summaryrefslogtreecommitdiffstats
path: root/Doc/library/socket.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-12-16 13:46:36 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-12-16 13:46:36 (GMT)
commit6ec29e299b663662a1610a740c4c7f8066fc63a6 (patch)
tree7bf65e75b7d28f95f679bd164e7db38173585a9e /Doc/library/socket.rst
parentab0e9f7089c04df546af6cacbc8751247cf4020a (diff)
downloadcpython-6ec29e299b663662a1610a740c4c7f8066fc63a6.zip
cpython-6ec29e299b663662a1610a740c4c7f8066fc63a6.tar.gz
cpython-6ec29e299b663662a1610a740c4c7f8066fc63a6.tar.bz2
Issue #8373: The filesystem path of AF_UNIX sockets now uses the filesystem
encoding and the surrogateescape error handler, rather than UTF-8. Patch by David Watson.
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r--Doc/library/socket.rst18
1 files changed, 16 insertions, 2 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index f507958..77f5bb8 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -40,9 +40,23 @@ Socket families
Depending on the system and the build options, various socket families
are supported by this module.
-Socket addresses are represented as follows:
+The address format required by a particular socket object is automatically
+selected based on the address family specified when the socket object was
+created. Socket addresses are represented as follows:
+
+- The address of an :const:`AF_UNIX` socket bound to a file system node
+ is represented as a string, using the file system encoding and the
+ ``'surrogateescape'`` error handler (see :pep:`383`). An address in
+ Linux's abstract namespace is returned as a :class:`bytes` object with
+ an initial null byte; note that sockets in this namespace can
+ communicate with normal file system sockets, so programs intended to
+ run on Linux may need to deal with both types of address. A string or
+ :class:`bytes` object can be used for either type of address when
+ passing it as an argument.
-- A single string is used for the :const:`AF_UNIX` address family.
+ .. versionchanged:: 3.3
+ Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8
+ encoding.
- A pair ``(host, port)`` is used for the :const:`AF_INET` address family,
where *host* is a string representing either a hostname in Internet domain