You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c311c8e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Doc/library/pydoc.rst
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,11 @@ will start a HTTP server on port 1234, allowing you to browse the
68
68
documentation at ``http://localhost:1234/`` in your preferred web browser.
69
69
Specifying ``0`` as the port number will select an arbitrary unused port.
70
70
71
+
.. warning::
72
+
73
+
The :mod:`!pydoc` HTTP server is intended for local use during
74
+
development and is not suitable for production use.
75
+
71
76
:program:`python -m pydoc -n <hostname>` will start the server listening at the given
72
77
hostname. By default the hostname is 'localhost' but if you want the server to
73
78
be reached from other machines, you may want to change the host name that the
Creates and returns a new :class:`xmlparser` object. *encoding*, if specified,
67
-
must be a string naming the encoding used by the XML data. Expat doesn't
68
-
support as many encodings as Python does, and its repertoire of encodings can't
69
-
be extended; it supports UTF-8, UTF-16, ISO-8859-1 (Latin1), and ASCII. If
70
-
*encoding* [1]_ is given it will override the implicit or explicit encoding of the
71
-
document.
66
+
Creates and returns a new :class:`xmlparser` object.
67
+
*encoding* [1]_, if specified, must be a string naming the encoding
68
+
used by the XML data.
69
+
If it is given it will override the implicit or explicit encoding
70
+
of the document.
71
+
72
+
.. impl-detail::
73
+
74
+
Expat natively understands and processes UTF-8, UTF-16, UTF-16BE,
75
+
UTF-16LE, ISO-8859-1, and US-ASCII.
76
+
For other encodings (including aliases like Latin1 and ASCII) it
77
+
falls back to Python.
78
+
It supports most of 8-bit encodings and many multi-byte encodings
79
+
like Shift_JIS, although only BMP characters (``U+0000-U+FFFF``)
80
+
are supported with non-native encodings (this restriction is also
81
+
applied to aliases like UTF8).
82
+
These restrictions only apply if *encoding* is not given.
83
+
84
+
.. versionchanged:: next
85
+
Added support for multi-byte encodings.
72
86
73
87
.. _xmlparser-non-root:
74
88
@@ -113,7 +127,6 @@ The :mod:`!xml.parsers.expat` module contains two functions:
113
127
XML document. Call ``ParserCreate`` for each document to provide unique
114
128
parser instances.
115
129
116
-
117
130
.. seealso::
118
131
119
132
`The Expat XML Parser <http://www.libexpat.org/>`_
@@ -1083,9 +1096,11 @@ The ``errors`` module has the following attributes:
1083
1096
1084
1097
.. rubric:: Footnotes
1085
1098
1086
-
.. [1] The encoding string included in XML output should conform to the
1087
-
appropriate standards. For example, "UTF-8" is valid, but "UTF8" is
1088
-
not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
1099
+
.. [1] The encoding string included in XML output should conform to
1100
+
the appropriate standards. For example, "UTF-8" is valid, but
1101
+
"UTF8" is not valid in an XML document's declaration, even though
1102
+
Python accepts it as an encoding name.
1103
+
See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
1089
1104
and https://www.iana.org/assignments/character-sets/character-sets.xhtml.
0 commit comments