diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 8f75abcddbdf37f..7db9e7a7d1b703b 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -429,7 +429,8 @@ For simple text calendars this module provides the following functions. .. function:: prcal(theyear, w=0, l=0, c=6, m=3) - Prints the calendar for an entire year as returned by :func:`calendar`. + Prints the calendar for an entire year as returned by + :func:`~calendar.calendar`. .. function:: calendar(theyear, w=2, l=1, c=6, m=3) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 23608cf76c8031d..b29615e3d91283a 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1385,9 +1385,9 @@ Instance methods: hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \ tzinfo=self.tzinfo, *, fold=0) - Return a new :class:`datetime` object with the same attributes, but with - specified parameters updated. Note that ``tzinfo=None`` can be specified to - create a naive datetime from an aware datetime with no conversion of date + Return a new :class:`~datetime.datetime` object with the same attributes, but + with specified parameters updated. Note that ``tzinfo=None`` can be specified + to create a naive datetime from an aware datetime with no conversion of date and time data. :class:`.datetime` objects are also supported by generic function diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 240a921e8de254d..43345959351c643 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -375,7 +375,7 @@ operation is being performed, so the intermediate analysis object isn't useful: source line information (if any) is taken directly from the disassembled code object. - The *adaptive* parameter works as it does in :func:`dis`. + The *adaptive* parameter works as it does in :func:`~dis.dis`. .. versionadded:: 3.4 diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst index 42539283c5ff2b9..9439d6afb545389 100644 --- a/Doc/library/fnmatch.rst +++ b/Doc/library/fnmatch.rst @@ -53,7 +53,8 @@ a :class:`!str` filename, and vice-versa. Finally, note that :deco:`functools.lru_cache` with a *maxsize* of 32768 is used to cache the (typed) compiled regex patterns in the following -functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`.filterfalse`. +functions: :func:`~fnmatch.fnmatch`, :func:`fnmatchcase`, :func:`.filter`, +:func:`.filterfalse`. .. function:: fnmatch(name, pat) diff --git a/Doc/library/getopt.rst b/Doc/library/getopt.rst index 9995f114d063e82..7d8a151534a4d17 100644 --- a/Doc/library/getopt.rst +++ b/Doc/library/getopt.rst @@ -80,10 +80,10 @@ exception: .. function:: gnu_getopt(args, shortopts, longopts=[]) - This function works like :func:`getopt`, except that GNU style scanning mode is - used by default. This means that option and non-option arguments may be - intermixed. The :func:`getopt` function stops processing options as soon as a - non-option argument is encountered. + This function works like :func:`~getopt.getopt`, except that GNU style + scanning mode is used by default. This means that option and non-option + arguments may be intermixed. The :func:`~getopt.getopt` function stops + processing options as soon as a non-option argument is encountered. If the first character of the option string is ``'+'``, or if the environment variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst index 37ffbe1be55a73e..6992e84985cf0a2 100644 --- a/Doc/library/getpass.rst +++ b/Doc/library/getpass.rst @@ -31,13 +31,14 @@ The :mod:`!getpass` module provides two functions: typed character is replaced by it. For example, ``echo_char='*'`` will display asterisks instead of the actual input. - If echo free input is unavailable getpass() falls back to printing - a warning message to *stream* and reading from ``sys.stdin`` and + If echo-free input is unavailable, :func:`~getpass.getpass` falls back to + printing a warning message to *stream* and reading from :data:`sys.stdin` and issuing a :exc:`GetPassWarning`. .. note:: - If you call getpass from within IDLE, the input may be done in the - terminal you launched IDLE from rather than the idle window itself. + If you call :func:`~getpass.getpass` from within IDLE, the input may be + done in the terminal you launched IDLE from rather than the idle window + itself. .. note:: On Unix systems, when *echo_char* is set, the terminal will be diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index e6b3565173fe1c4..3809c4224725fc5 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -92,8 +92,9 @@ class-based API instead. .. function:: dnpgettext(domain, context, singular, plural, n, /) Similar to the corresponding functions without the ``p`` in the prefix (that - is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`), - but the translation is restricted to the given message *context*. + is, :func:`~gettext.gettext`, :func:`dgettext`, :func:`ngettext`, + :func:`dngettext`), but the translation is restricted to the given message + *context*. .. versionadded:: 3.8 @@ -429,7 +430,8 @@ take the following steps: In order to prepare your code for I18N, you need to look at all the strings in your files. Any string that needs to be translated should be marked by wrapping -it in ``_('...')`` --- that is, a call to the function :func:`_ `. For example:: +it in ``_('...')`` --- that is, a call to the function +:func:`_ `. For example:: filename = 'mylog.txt' message = _('writing a log message') diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst index 49fb430e7ae709e..53c50d4654c1caa 100644 --- a/Doc/library/glob.rst +++ b/Doc/library/glob.rst @@ -102,7 +102,7 @@ The :mod:`!glob` module defines the following functions: .. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \ include_hidden=False) - Return an :term:`iterator` which yields the same values as :func:`glob` + Return an :term:`iterator` which yields the same values as :func:`~glob.glob` without actually storing them all simultaneously. .. audit-event:: glob.glob pathname,recursive glob.iglob @@ -181,7 +181,7 @@ Examples Consider a directory containing the following files: :file:`1.gif`, :file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub` -which contains only the file :file:`3.txt`. :func:`glob` will produce +which contains only the file :file:`3.txt`. :func:`~glob.glob` will produce the following results. Notice how any leading components of the path are preserved. :: diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index c2c4a0e269de991..c6a6ffd7516827b 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -707,7 +707,7 @@ Access to message catalogs .. function:: bind_textdomain_codeset(domain, codeset) The locale module exposes the C library's gettext interface on systems that -provide this interface. It consists of the functions :func:`gettext`, +provide this interface. It consists of the functions :func:`~locale.gettext`, :func:`dgettext`, :func:`dcgettext`, :func:`textdomain`, :func:`bindtextdomain`, and :func:`bind_textdomain_codeset`. These are similar to the same functions in the :mod:`gettext` module, but use the C library's binary format for message diff --git a/Doc/library/marshal.rst b/Doc/library/marshal.rst index ed182ea24e8f3ca..8e36f061905cb94 100644 --- a/Doc/library/marshal.rst +++ b/Doc/library/marshal.rst @@ -57,8 +57,8 @@ this module. The following types are supported: therein are themselves supported. Recursive containers are supported since :data:`version` 3. * The singletons :const:`None`, :const:`Ellipsis` and :exc:`StopIteration`. -* :class:`code` objects, if *allow_code* is true. See note above about - version dependence. +* :class:`code ` objects, if *allow_code* is true. See note + above about version dependence. .. versionchanged:: 3.4 diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index 5c1dc0ae0134406..f71ac08d7c372b7 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -358,7 +358,7 @@ ACCESS_* constants :const:`ACCESS_READ` provides read-only access, :const:`ACCESS_WRITE` provides write-through access, and :const:`ACCESS_COPY` provides copy-on-write access. :const:`ACCESS_DEFAULT` defers to the *prot* - argument of :class:`mmap`. + argument of :class:`~mmap.mmap`. .. _page-size-constants: @@ -370,7 +370,7 @@ Page size constants :const:`PAGESIZE` is the system memory page size in bytes. :const:`ALLOCATIONGRANULARITY` is the minimum alignment in bytes required - for the *offset* argument of :class:`mmap`. On Unix, + for the *offset* argument of :class:`~mmap.mmap`. On Unix, :const:`ALLOCATIONGRANULARITY` is equal to :const:`PAGESIZE`. .. _prot-constants: @@ -382,11 +382,11 @@ PROT_* constants PROT_WRITE PROT_EXEC - Memory protection flags accepted by the *prot* argument of :class:`mmap`. - :const:`PROT_READ` allows pages to be read, :const:`PROT_WRITE` allows pages - to be written, and :const:`PROT_EXEC` allows pages to be executed. Values - can be combined using the bitwise OR operator. Not every option is present - on every system. + Memory protection flags accepted by the *prot* argument of + :class:`~mmap.mmap`. :const:`PROT_READ` allows pages to be read, + :const:`PROT_WRITE` allows pages to be written, and :const:`PROT_EXEC` allows + pages to be executed. Values can be combined using the bitwise OR operator. + Not every option is present on every system. .. availability:: Unix. diff --git a/Doc/library/msvcrt.rst b/Doc/library/msvcrt.rst index 79069c136c28416..7c41fda58631c0e 100644 --- a/Doc/library/msvcrt.rst +++ b/Doc/library/msvcrt.rst @@ -11,7 +11,7 @@ These functions provide access to some useful capabilities on Windows platforms. Some higher-level modules use these functions to build the Windows implementations of their services. For example, the :mod:`getpass` module uses -this in the implementation of the :func:`getpass` function. +this in the implementation of the :func:`~getpass.getpass` function. Further documentation on these functions can be found in the Platform API documentation. diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 5d1de9fafa7f00d..dba2b069831eccd 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -2452,10 +2452,11 @@ with the :class:`Pool` class. the process which created the pool. .. warning:: - :class:`multiprocessing.pool` objects have internal resources that need to be - properly managed (like any other resource) by using the pool as a context manager - or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this - can lead to the process hanging on finalization. + :class:`~multiprocessing.pool.Pool` objects have internal resources that + need to be properly managed (like any other resource) by using the pool as + a context manager or by calling :meth:`close` and :meth:`terminate` + manually. Failure to do this can lead to the process hanging on + finalization. Note that it is **not correct** to rely on the garbage collector to destroy the pool as CPython does not assure that the finalizer of the pool will be called diff --git a/Doc/library/multiprocessing.shared_memory.rst b/Doc/library/multiprocessing.shared_memory.rst index e8f04a6ac7b95db..a330b114fcc59f8 100644 --- a/Doc/library/multiprocessing.shared_memory.rst +++ b/Doc/library/multiprocessing.shared_memory.rst @@ -215,14 +215,17 @@ same :class:`!numpy.ndarray` from two distinct Python shells: of all shared memory blocks managed by that process, call :meth:`~multiprocessing.managers.BaseManager.shutdown` on the instance. This triggers a :meth:`~multiprocessing.shared_memory.SharedMemory.unlink` call - on all of the :class:`SharedMemory` objects managed by that process and then - stops the process itself. By creating :class:`!SharedMemory` instances + on all of the :class:`~multiprocessing.shared_memory.SharedMemory` objects + managed by that process and then stops the process itself. + By creating :class:`!SharedMemory` instances through a :class:`!SharedMemoryManager`, we avoid the need to manually track and trigger the freeing of shared memory resources. - This class provides methods for creating and returning :class:`SharedMemory` - instances and for creating a list-like object (:class:`ShareableList`) - backed by shared memory. + This class provides methods for creating and returning + :class:`~multiprocessing.shared_memory.SharedMemory` instances and for + creating a list-like object + (:class:`~multiprocessing.shared_memory.ShareableList`) backed by shared + memory. Refer to :class:`~multiprocessing.managers.BaseManager` for a description of the inherited *address* and *authkey* optional input arguments and how @@ -231,12 +234,14 @@ same :class:`!numpy.ndarray` from two distinct Python shells: .. method:: SharedMemory(size) - Create and return a new :class:`SharedMemory` object with the + Create and return a new + :class:`~multiprocessing.shared_memory.SharedMemory` object with the specified *size* in bytes. .. method:: ShareableList(sequence) - Create and return a new :class:`ShareableList` object, initialized + Create and return a new + :class:`~multiprocessing.shared_memory.ShareableList` object, initialized by the values from the input *sequence*. diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst index 74c97e8c9a97598..68e622506ecfca7 100644 --- a/Doc/library/netrc.rst +++ b/Doc/library/netrc.rst @@ -40,7 +40,7 @@ the Unix :program:`ftp` program and other FTP clients. :file:`.netrc` file when *file* is not passed as argument. .. versionchanged:: 3.10 - :class:`netrc` try UTF-8 encoding before using locale specific + :class:`~netrc.netrc` try UTF-8 encoding before using locale specific encoding. The entry in the netrc file no longer needs to contain all tokens. The missing tokens' value default to an empty string. All the tokens and their values now diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index a3b8c2f3dc8292a..5a95f6e78d1eda7 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -2037,10 +2037,10 @@ Finally, the Option subclass:: TYPE_CHECKER = copy(Option.TYPE_CHECKER) TYPE_CHECKER["complex"] = check_complex -(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would end -up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:`!optparse`'s -Option class. This being Python, nothing stops you from doing that except good -manners and common sense.) +(If we didn't make a :func:`~copy.copy` of :attr:`Option.TYPE_CHECKER`, we would +end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of +:mod:`!optparse`'s Option class. This being Python, nothing stops you from +doing that except good manners and common sense.) That's it! Now you can write a script that uses the new option type just like any other :mod:`!optparse`\ -based script, except you have to instruct your diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 9327e5a23d621a4..ffad068589549b3 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -193,9 +193,9 @@ Functions for sequences to specify both *weights* and *cum_weights*. The *weights* or *cum_weights* can use any numeric type that interoperates - with the :class:`float` values returned by :func:`random` (that includes - integers, floats, and fractions but excludes decimals). Weights are assumed - to be non-negative and finite. A :exc:`ValueError` is raised if all + with the :class:`float` values returned by :func:`~random.random` (that + includes integers, floats, and fractions but excludes decimals). Weights are + assumed to be non-negative and finite. A :exc:`ValueError` is raised if all weights are zero. For a given seed, the :func:`choices` function with equal weighting diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst index 0653bf2f4189c20..6876045de1ba191 100644 --- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -398,16 +398,16 @@ Improved Compatibility with Shells .. versionadded:: 3.6 -The :class:`shlex` class provides compatibility with the parsing performed by -common Unix shells like ``bash``, ``dash``, and ``sh``. To take advantage of -this compatibility, specify the ``punctuation_chars`` argument in the -constructor. This defaults to ``False``, which preserves pre-3.6 behaviour. -However, if it is set to ``True``, then parsing of the characters ``();<>|&`` -is changed: any run of these characters is returned as a single token. While -this is short of a full parser for shells (which would be out of scope for the -standard library, given the multiplicity of shells out there), it does allow -you to perform processing of command lines more easily than you could -otherwise. To illustrate, you can see the difference in the following snippet: +The :class:`~shlex.shlex` class provides compatibility with the parsing +performed by common Unix shells like ``bash``, ``dash``, and ``sh``. To take +advantage of this compatibility, specify the ``punctuation_chars`` argument in +the constructor. This defaults to ``False``, which preserves pre-3.6 behaviour. +However, if it is set to ``True``, then parsing of the characters ``();<>|&`` is +changed: any run of these characters is returned as a single token. While this +is short of a full parser for shells (which would be out of scope for the +standard library, given the multiplicity of shells out there), it does allow you +to perform processing of command lines more easily than you could otherwise. To +illustrate, you can see the difference in the following snippet: .. doctest:: :options: +NORMALIZE_WHITESPACE diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index 8e543d9205ec6aa..c0526e244db27e1 100644 --- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -599,8 +599,8 @@ The :mod:`!signal` module defines the following functions: See the man page :manpage:`siginterrupt(3)` for further information. - Note that installing a signal handler with :func:`signal` will reset the - restart behaviour to interruptible by implicitly calling + Note that installing a signal handler with :func:`~signal.signal` will reset + the restart behaviour to interruptible by implicitly calling :c:func:`!siginterrupt` with a true *flag* value for the given signal. @@ -622,7 +622,7 @@ The :mod:`!signal` module defines the following functions: see the :ref:`description in the type hierarchy ` or see the attribute descriptions in the :mod:`inspect` module). - On Windows, :func:`signal` can only be called with :const:`SIGABRT`, + On Windows, :func:`~signal.signal` can only be called with :const:`SIGABRT`, :const:`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:`SIGTERM`, or :const:`SIGBREAK`. A :exc:`ValueError` will be raised in any other case. diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 62c448faa2d5702..23e317c96bbe943 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -521,8 +521,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only particular, ``sys.exit("some error message")`` is a quick way to exit a program when an error occurs. - Since :func:`exit` ultimately "only" raises an exception, it will only exit - the process when called from the main thread, and the exception is not + Since :func:`~sys.exit` ultimately "only" raises an exception, it will only + exit the process when called from the main thread, and the exception is not intercepted. Cleanup actions specified by finally clauses of :keyword:`try` statements are honored, and it is possible to intercept the exit attempt at an outer level. diff --git a/Doc/library/syslog.rst b/Doc/library/syslog.rst index b6bf01240951ebd..cf6823733d70027 100644 --- a/Doc/library/syslog.rst +++ b/Doc/library/syslog.rst @@ -29,29 +29,30 @@ The module defines the following functions: not encoded in *priority* using logical-or (``LOG_INFO | LOG_USER``), the value given in the :func:`openlog` call is used. - If :func:`openlog` has not been called prior to the call to :func:`syslog`, - :func:`openlog` will be called with no arguments. + If :func:`openlog` has not been called prior to the call to + :func:`~syslog.syslog`, :func:`openlog` will be called with no arguments. .. audit-event:: syslog.syslog priority,message syslog.syslog .. versionchanged:: 3.2 In previous versions, :func:`openlog` would not be called automatically if - it wasn't called prior to the call to :func:`syslog`, deferring to the syslog - implementation to call ``openlog()``. + it wasn't called prior to the call to :func:`~syslog.syslog`, deferring to + the syslog implementation to call ``openlog()``. .. versionchanged:: 3.12 This function is restricted in subinterpreters. (Only code that runs in multiple interpreters is affected and the restriction is not relevant for most users.) - :func:`openlog` must be called in the main interpreter before :func:`syslog` may be used - in a subinterpreter. Otherwise it will raise :exc:`RuntimeError`. + :func:`openlog` must be called in the main interpreter before + :func:`~syslog.syslog` may be used in a subinterpreter. Otherwise it will + raise :exc:`RuntimeError`. .. function:: openlog([ident[, logoption[, facility]]]) - Logging options of subsequent :func:`syslog` calls can be set by calling - :func:`openlog`. :func:`syslog` will call :func:`openlog` with no arguments - if the log is not currently open. + Logging options of subsequent :func:`~syslog.syslog` calls can be set by + calling :func:`openlog`. :func:`~syslog.syslog` will call :func:`openlog` + with no arguments if the log is not currently open. The optional *ident* keyword argument is a string which is prepended to every message, and defaults to ``sys.argv[0]`` with leading path components @@ -79,8 +80,8 @@ The module defines the following functions: Reset the syslog module values and call the system library ``closelog()``. This causes the module to behave as it does when initially imported. For - example, :func:`openlog` will be called on the first :func:`syslog` call (if - :func:`openlog` hasn't already been called), and *ident* and other + example, :func:`openlog` will be called on the first :func:`~syslog.syslog` + call (if :func:`openlog` hasn't already been called), and *ident* and other :func:`openlog` parameters are reset to defaults. .. audit-event:: syslog.closelog "" syslog.closelog @@ -96,11 +97,11 @@ The module defines the following functions: .. function:: setlogmask(maskpri) Set the priority mask to *maskpri* and return the previous mask value. Calls - to :func:`syslog` with a priority level not set in *maskpri* are ignored. - The default is to log all priorities. The function ``LOG_MASK(pri)`` - calculates the mask for the individual priority *pri*. The function - ``LOG_UPTO(pri)`` calculates the mask for all priorities up to and including - *pri*. + to :func:`~syslog.syslog` with a priority level not set in *maskpri* are + ignored. The default is to log all priorities. The function + ``LOG_MASK(pri)`` calculates the mask for the individual priority *pri*. The + function ``LOG_UPTO(pri)`` calculates the mask for all priorities up to and + including *pri*. .. audit-event:: syslog.setlogmask maskpri syslog.setlogmask diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst index 43ab19037d26273..f2d372440717517 100644 --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -1941,10 +1941,10 @@ Support for a port to IBM's OS/2 using the EMX runtime environment was merged into the main Python source tree. EMX is a POSIX emulation layer over the OS/2 system APIs. The Python port for EMX tries to support all the POSIX-like capability exposed by the EMX runtime, and mostly succeeds; :func:`!fork` and -:func:`fcntl` are restricted by the limitations of the underlying emulation -layer. The standard OS/2 port, which uses IBM's Visual Age compiler, also -gained support for case-sensitive import semantics as part of the integration of -the EMX port into CVS. (Contributed by Andrew MacIntyre.) +:func:`~fcntl.fcntl` are restricted by the limitations of the underlying +emulation layer. The standard OS/2 port, which uses IBM's Visual Age compiler, +also gained support for case-sensitive import semantics as part of the +integration of the EMX port into CVS. (Contributed by Andrew MacIntyre.) On MacOS, most toolbox modules have been weaklinked to improve backward compatibility. This means that modules will no longer fail to load if a single diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index 3c430a9edd9d4dc..60ea5b87f8ab612 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -2622,15 +2622,15 @@ changes, or look through the Subversion logs for all the details. intended for testing purposes that lets you temporarily modify the warning filters and then restore their original values (:issue:`3781`). -* The XML-RPC :class:`SimpleXMLRPCServer ` and :class:`DocXMLRPCServer ` - classes can now be prevented from immediately opening and binding to - their socket by passing ``False`` as the *bind_and_activate* - constructor parameter. This can be used to modify the instance's - :attr:`~socketserver.BaseServer.allow_reuse_address` attribute before calling the - :meth:`~socketserver.BaseServer.server_bind` and - :meth:`~socketserver.BaseServer.server_activate` methods to - open the socket and begin listening for connections. - (Contributed by Peter Parente; :issue:`1599845`.) +* The XML-RPC :class:`~xmlrpc.server.SimpleXMLRPCServer` and + :class:`~xmlrpc.server.DocXMLRPCServer` classes can now be prevented from + immediately opening and binding to their socket by passing ``False`` as the + *bind_and_activate* constructor parameter. This can be used to modify the + instance's :attr:`~socketserver.BaseServer.allow_reuse_address` attribute + before calling the :meth:`~socketserver.BaseServer.server_bind` and + :meth:`~socketserver.BaseServer.server_activate` methods to open the socket + and begin listening for connections. (Contributed by Peter Parente; + :issue:`1599845`.) :class:`~xmlrpc.server.SimpleXMLRPCServer` also has a :attr:`!_send_traceback_header` attribute; if true, the exception and formatted traceback are returned diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index f72b78e32148738..0af4670b0b120e7 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -2708,9 +2708,9 @@ require changes to your code: (Discovered by David Beazley and fixed by Victor Stinner; :issue:`10783`.) -* The :class:`xml.etree.ElementTree` class now raises an - :exc:`xml.etree.ElementTree.ParseError` when a parse fails. Previously it - raised an :exc:`xml.parsers.expat.ExpatError`. +* The :class:`xml.etree.ElementTree ` class + now raises an :exc:`xml.etree.ElementTree.ParseError` when a parse fails. + Previously it raised an :exc:`xml.parsers.expat.ExpatError`. * The new, longer :func:`str` value on floats may break doctests which rely on the old output format. diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index b6e48c3538310ae..2aa23f87b4507b5 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -440,7 +440,7 @@ Some smaller changes made to the core Python language are: references to local variables from the frame. (Contributed by Antoine Pitrou in :issue:`17934`.) -* :class:`memoryview` is now registered as a :class:`Sequence `, +* :class:`memoryview` is now registered as a :class:`~collections.abc.Sequence`, and supports the :func:`reversed` builtin. (Contributed by Nick Coghlan and Claudiu Popa in :issue:`18690` and :issue:`19078`.)