From 1b5731e2761a9a1b7394b3a81ed267f94fde42ca Mon Sep 17 00:00:00 2001 From: Ned Deily Date: Mon, 11 Jun 2018 04:33:26 -0400 Subject: [PATCH] bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7622) --- Doc/whatsnew/2.7.rst | 187 ++++++++++++++++++++++++++++++++++++++++++- Doc/whatsnew/3.5.rst | 36 +++++++++ Doc/whatsnew/3.6.rst | 29 ++++--- 3 files changed, 233 insertions(+), 19 deletions(-) diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst index 0f9529a1b4..fd59c1611f 100644 --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -1545,7 +1545,7 @@ changes, or look through the Subversion logs for all the details. *ciphers* argument that's a string listing the encryption algorithms to be allowed; the format of the string is described `in the OpenSSL documentation - `__. + `__. (Added by Antoine Pitrou; :issue:`8322`.) Another change makes the extension load all of OpenSSL's ciphers and @@ -1809,7 +1809,7 @@ wish to read the Tcl/Tk manual page describing the Ttk theme engine, available at https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some screenshots of the Python/Ttk code in use are at -http://code.google.com/p/python-ttk/wiki/Screenshots. +https://code.google.com/archive/p/python-ttk/wikis/Screenshots.wiki. The :mod:`ttk` module was written by Guilherme Polo and added in :issue:`2983`. An alternate version called ``Tile.py``, written by @@ -1832,8 +1832,8 @@ https://pypi.org/project/unittest2. When used from the command line, the module can automatically discover tests. It's not as fancy as `py.test `__ or -`nose `__, but provides a simple way -to run tests kept within a set of package directories. For example, +`nose `__, but provides a +simple way to run tests kept within a set of package directories. For example, the following command will search the :file:`test/` subdirectory for any importable test files named ``test*.py``:: @@ -2367,6 +2367,18 @@ Port-Specific Changes: Mac OS X installation and a user-installed copy of the same version. (Changed by Ronald Oussoren; :issue:`4865`.) + .. versionchanged:: 2.7.13 + + As of 2.7.13, this change was removed. + ``/Library/Python/2.7/site-packages``, the site-packages directory + used by the Apple-supplied system Python 2.7 is no longer appended to + ``sys.path`` for user-installed Pythons such as from the python.org + installers. As of macOS 10.12, Apple changed how the system + site-packages directory is configured, which could cause installation + of pip components, like setuptools, to fail. Packages installed for + the system Python will no longer be shared with user-installed + Pythons. (:issue:`28440`) + Port-Specific Changes: FreeBSD ----------------------------------- @@ -2558,6 +2570,21 @@ exemption allowing new ``-3`` warnings to be added in any Python 2.7 maintenance release. +Two new environment variables for debug mode +-------------------------------------------- + +In debug mode, the ``[xxx refs]`` statistic is not written by default, the +:envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set. +(Contributed by Victor Stinner; :issue:`31733`.) + +When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are no +longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` environment +variable must now also be set. Moreover, allocation counts are now dumped into +stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.) + +.. versionadded:: 2.7.15 + + PEP 434: IDLE Enhancement Exception for All Branches ---------------------------------------------------- @@ -2602,10 +2629,162 @@ with the first of those changes appearing in the Python 2.7.7 release. certificate store, the :class:`~ssl.SSLContext` class, and other features. (Contributed by Alex Gaynor and David Reid; :issue:`21308`.) + Refer to the "Version added: 2.7.9" notes in the module documentation for + specific details. + * :func:`os.urandom` was changed to cache a file descriptor to ``/dev/urandom`` instead of reopening ``/dev/urandom`` on every call. (Contributed by Alex Gaynor; :issue:`21305`.) +* :data:`hashlib.algorithms_guaranteed` and + :data:`hashlib.algorithms_available` were backported from Python 3 to make + it easier for Python 2 applications to select the strongest available hash + algorithm. (Contributed by Alex Gaynor in :issue:`21307`) + + +PEP 477: Backport ensurepip (PEP 453) to Python 2.7 +--------------------------------------------------- + +:pep:`477` approves the inclusion of the :pep:`453` ensurepip module and the +improved documentation that was enabled by it in the Python 2.7 maintenance +releases, appearing first in the Python 2.7.9 release. + + +Bootstrapping pip By Default +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard +cross-platform mechanism to bootstrap the pip installer into Python +installations. The version of ``pip`` included with Python 2.7.9 is ``pip`` +1.5.6, and future 2.7.x maintenance releases will update the bundled version to +the latest version of ``pip`` that is available at the time of creating the +release candidate. + +By default, the commands ``pip``, ``pipX`` and ``pipX.Y`` will be installed on +all platforms (where X.Y stands for the version of the Python installation), +along with the ``pip`` Python package and its dependencies. + +For CPython :ref:`source builds on POSIX systems `, +the ``make install`` and ``make altinstall`` commands do not bootstrap ``pip`` +by default. This behaviour can be controlled through configure options, and +overridden through Makefile options. + +On Windows and Mac OS X, the CPython installers now default to installing +``pip`` along with CPython itself (users may opt out of installing it +during the installation process). Window users will need to opt in to the +automatic ``PATH`` modifications to have ``pip`` available from the command +line by default, otherwise it can still be accessed through the Python +launcher for Windows as ``py -m pip``. + +As `discussed in the PEP`__, platform packagers may choose not to install +these commands by default, as long as, when invoked, they provide clear and +simple directions on how to install them on that platform (usually using +the system package manager). + +__ https://www.python.org/dev/peps/pep-0477/#disabling-ensurepip-by-downstream-distributors + + +Documentation Changes +~~~~~~~~~~~~~~~~~~~~~ + +As part of this change, the :ref:`installing-index` and +:ref:`distributing-index` sections of the documentation have been +completely redesigned as short getting started and FAQ documents. Most +packaging documentation has now been moved out to the Python Packaging +Authority maintained `Python Packaging User Guide +`__ and the documentation of the individual +projects. + +However, as this migration is currently still incomplete, the legacy +versions of those guides remaining available as :ref:`install-index` +and :ref:`distutils-index`. + +.. seealso:: + + :pep:`453` -- Explicit bootstrapping of pip in Python installations + PEP written by Donald Stufft and Nick Coghlan, implemented by + Donald Stufft, Nick Coghlan, Martin von Löwis and Ned Deily. + +PEP 476: Enabling certificate verification by default for stdlib http clients +----------------------------------------------------------------------------- + +:pep:`476` updated :mod:`httplib` and modules which use it, such as +:mod:`urllib2` and :mod:`xmlrpclib`, to now verify that the server +presents a certificate which is signed by a Certificate Authority in the +platform trust store and whose hostname matches the hostname being requested +by default, significantly improving security for many applications. This +change was made in the Python 2.7.9 release. + +For applications which require the old previous behavior, they can pass an +alternate context:: + + import urllib2 + import ssl + + # This disables all verification + context = ssl._create_unverified_context() + + # This allows using a specific certificate for the host, which doesn't need + # to be in the trust store + context = ssl.create_default_context(cafile="/path/to/file.crt") + + urllib2.urlopen("https://invalid-cert", context=context) + + +PEP 493: HTTPS verification migration tools for Python 2.7 +---------------------------------------------------------- + +:pep:`493` provides additional migration tools to support a more incremental +infrastructure upgrade process for environments containing applications and +services relying on the historically permissive processing of server +certificates when establishing client HTTPS connections. These additions were +made in the Python 2.7.12 release. + +These tools are intended for use in cases where affected applications and +services can't be modified to explicitly pass a more permissive SSL context +when establishing the connection. + +For applications and services which can't be modified at all, the new +``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an +entire Python process back to the default permissive behaviour of Python 2.7.8 +and earlier. + +For cases where the connection establishment code can't be modified, but the +overall application can be, the new :func:`ssl._https_verify_certificates` +function can be used to adjust the default behaviour at runtime. + + +New ``make regen-all`` build target +----------------------------------- + +To simplify cross-compilation, and to ensure that CPython can reliably be +compiled without requiring an existing version of Python to already be +available, the autotools-based build system no longer attempts to implicitly +recompile generated files based on file modification times. + +Instead, a new ``make regen-all`` command has been added to force regeneration +of these files when desired (e.g. after an initial version of Python has +already been built based on the pregenerated versions). + +More selective regeneration targets are also defined - see +:source:`Makefile.pre.in` for details. + +(Contributed by Victor Stinner in :issue:`23404`.) + +.. versionadded:: 2.7.14 + + +Removal of ``make touch`` build target +-------------------------------------- + +The ``make touch`` build target previously used to request implicit regeneration +of generated files by updating their modification times has been removed. + +It has been replaced by the new ``make regen-all`` target. + +(Contributed by Victor Stinner in :issue:`23404`.) + +.. versionchanged:: 2.7.14 .. ====================================================================== diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 3e3329a84c..96f86e6c61 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -2536,3 +2536,39 @@ Changes in the C API :c:member:`tp_as_async` slot. Refer to :ref:`coro-objects` for new types, structures and functions. + +Notable changes in Python 3.5.4 +=============================== + +New ``make regen-all`` build target +----------------------------------- + +To simplify cross-compilation, and to ensure that CPython can reliably be +compiled without requiring an existing version of Python to already be +available, the autotools-based build system no longer attempts to implicitly +recompile generated files based on file modification times. + +Instead, a new ``make regen-all`` command has been added to force regeneration +of these files when desired (e.g. after an initial version of Python has +already been built based on the pregenerated versions). + +More selective regeneration targets are also defined - see +:source:`Makefile.pre.in` for details. + +(Contributed by Victor Stinner in :issue:`23404`.) + +.. versionadded:: 3.5.4 + + +Removal of ``make touch`` build target +-------------------------------------- + +The ``make touch`` build target previously used to request implicit regeneration +of generated files by updating their modification times has been removed. + +It has been replaced by the new ``make regen-all`` target. + +(Contributed by Victor Stinner in :issue:`23404`.) + +.. versionchanged:: 3.5.4 + diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 42191e0964..8ffe7ef4c0 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -237,8 +237,8 @@ and the ``__annotations__`` attribute. and Guido van Rossum. Implemented by Ivan Levkivskyi. Tools that use or will use the new syntax: - `mypy `_, - `pytype `_, PyCharm, etc. + `mypy `_, + `pytype `_, PyCharm, etc. .. _whatsnew36-pep515: @@ -907,7 +907,7 @@ return value. cmath ----- -The new :const:`cmath.tau` (τ) constant has been added. +The new :const:`cmath.tau` (*τ*) constant has been added. (Contributed by Lisa Roach in :issue:`12345`, see :pep:`628` for details.) New constants: :const:`cmath.inf` and :const:`cmath.nan` to @@ -1016,11 +1016,6 @@ attribute defaults to ``['gztar']``. Although not anticipated, any code relying on the presence of ``default_format`` may need to be adapted. See :issue:`27819` for more details. -The ``upload`` command now longer tries to change CR end-of-line characters -to CRLF. This fixes a corruption issue with sdists that ended with a byte -equivalent to CR. -(Contributed by Bo Bayles in :issue:`32304`.) - email ----- @@ -1240,7 +1235,7 @@ be reopened. math ---- -The tau (τ) constant has been added to the :mod:`math` and :mod:`cmath` +The tau (*τ*) constant has been added to the :mod:`math` and :mod:`cmath` modules. (Contributed by Lisa Roach in :issue:`12345`, see :pep:`628` for details.) @@ -1609,7 +1604,7 @@ mark class variables. As introduced in :pep:`526`, a variable annotation wrapped in ClassVar indicates that a given attribute is intended to be used as a class variable and should not be set on instances of that class. (Contributed by Ivan Levkivskyi in `Github #280 -`_.) +`_.) A new :const:`~typing.TYPE_CHECKING` constant that is assumed to be ``True`` by the static type chekers, but is ``False`` at runtime. @@ -1894,11 +1889,6 @@ Build and C API Changes * The :c:func:`PyUnicode_FSConverter` and :c:func:`PyUnicode_FSDecoder` functions will now accept :term:`path-like objects `. -* The ``PyExc_RecursionErrorInst`` singleton that was part of the public API - has been removed as its members being never cleared may cause a segfault - during finalization of the interpreter. Contributed by Xavier de Gaye in - :issue:`22898` and :issue:`30697`. - Other Improvements ================== @@ -2393,6 +2383,15 @@ It has been replaced by the new ``make regen-all`` target. .. versionchanged:: 3.6.2 +Notable changes in Python 3.6.4 +=============================== + +The ``PyExc_RecursionErrorInst`` singleton that was part of the public API +has been removed as its members being never cleared may cause a segfault +during finalization of the interpreter. +(Contributed by Xavier de Gaye in :issue:`22898` and :issue:`30697`.) + + Notable changes in Python 3.6.5 =============================== -- 2.40.0