Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f06576dc
Commit
f06576dc
authored
Feb 28, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recommend inspecting the errno attribute of socket.error objects,
and improve wording.
parent
061cfb52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
Doc/library/socket.rst
Doc/library/socket.rst
+26
-21
No files found.
Doc/library/socket.rst
View file @
f06576dc
...
@@ -117,39 +117,44 @@ The module :mod:`socket` exports the following constants and functions:
...
@@ -117,39 +117,44 @@ The module :mod:`socket` exports the following constants and functions:
.. index:: module: errno
.. index:: module: errno
This exception is raised for socket-related errors. The accompanying value is
A subclass of :exc:`IOError`, this exception is raised for socket-related
either a string telling what went wrong or a pair ``(errno, string)``
errors. It is recommended that you inspect its ``errno`` attribute to
representing an error returned by a system call, similar to the value
discriminate between different kinds of errors.
accompanying :exc:`os.error`. See the module :mod:`errno`, which contains names
for the error codes defined by the underlying operating system.
.. seealso::
The :mod:`errno` module contains symbolic names for the error codes
defined by the underlying operating system.
.. exception:: herror
This exception is raised for address-related errors, i.e. for functions that use
.. exception:: herror
*h_errno* in the C API, including :func:`gethostbyname_ex` and
:func:`gethostbyaddr`.
The accompanying value is a pair ``(h_errno, string)`` representing an error
A subclass of :exc:`socket.error`, this exception is raised for
returned by a library call. *string* represents the description of *h_errno*, as
address-related errors, i.e. for functions that use *h_errno* in the POSIX
returned by the :c:func:`hstrerror` C function.
C API, including :func:`gethostbyname_ex` and :func:`gethostbyaddr`.
The accompanying value is a pair ``(h_errno, string)`` representing an
error returned by a library call. *h_errno* is a numeric value, while
*string* represents the description of *h_errno*, as returned by the
:c:func:`hstrerror` C function.
.. exception:: gaierror
.. exception:: gaierror
This exception is raised for address-related errors, for :func:`getaddrinfo` and
A subclass of :exc:`socket.error`, this exception is raised for
:func:`getnameinfo`. The accompanying value is a pair ``(error, string)``
address-related errors by :func:`getaddrinfo` and :func:`getnameinfo`.
representing an error returned by a library call. *string* represents the
The accompanying value is a pair ``(error, string)`` representing an error
description of *error*, as returned by the :c:func:`gai_strerror` C function. The
returned by a library call. *string* represents the description of
*error* value will match one of the :const:`EAI_\*` constants defined in this
*error*, as returned by the :c:func:`gai_strerror` C function. The
module.
numeric *error* value will match one of the :const:`EAI_\*` constants
defined in this module.
.. exception:: timeout
.. exception:: timeout
This exception is raised when a timeout occurs on a socket which has had
A subclass of :exc:`socket.error`, this exception is raised when a timeout
timeouts enabled via a prior call to :meth:`~socket.settimeout`. The
occurs on a socket which has had timeouts enabled via a prior call to
accompanying value is a string whose value is currently always "timed out".
:meth:`~socket.settimeout` (or implicitly through
:func:`~socket.setdefaulttimeout`). The accompanying value is a string
whose value is currently always "timed out".
.. data:: AF_UNIX
.. data:: AF_UNIX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment