bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7620) (GH… · python/cpython@144493d (original) (raw)
`@@ -2367,6 +2367,18 @@ Port-Specific Changes: Mac OS X
`
2367
2367
` installation and a user-installed copy of the same version.
`
2368
2368
`` (Changed by Ronald Oussoren; :issue:4865
.)
``
2369
2369
``
``
2370
`+
.. versionchanged:: 2.7.13
`
``
2371
+
``
2372
`+
As of 2.7.13, this change was removed.
`
``
2373
``/Library/Python/2.7/site-packages``, the site-packages directory
``
2374
`+
used by the Apple-supplied system Python 2.7 is no longer appended to
`
``
2375
``sys.path`` for user-installed Pythons such as from the python.org
``
2376
`+
installers. As of macOS 10.12, Apple changed how the system
`
``
2377
`+
site-packages directory is configured, which could cause installation
`
``
2378
`+
of pip components, like setuptools, to fail. Packages installed for
`
``
2379
`+
the system Python will no longer be shared with user-installed
`
``
2380
`` +
Pythons. (:issue:28440
)
``
``
2381
+
2370
2382
`Port-Specific Changes: FreeBSD
`
2371
2383
`-----------------------------------
`
2372
2384
``
``` @@ -2558,6 +2570,21 @@ exemption allowing new -3
warnings to be added in any Python 2.7
`2558`
`2570`
`maintenance release.
`
`2559`
`2571`
``
`2560`
`2572`
``
``
`2573`
`+
Two new environment variables for debug mode
`
``
`2574`
`+
--------------------------------------------
`
``
`2575`
`+`
``
`2576`
``` +
In debug mode, the ``[xxx refs]`` statistic is not written by default, the
``
2577
`` +
:envvar:PYTHONSHOWREFCOUNT
environment variable now must also be set.
``
``
2578
`` +
(Contributed by Victor Stinner; :issue:31733
.)
``
``
2579
+
``
2580
When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are no
``
2581
`` +
longer dumped by default anymore: the :envvar:PYTHONSHOWALLOCCOUNT
environment
``
``
2582
`+
variable must now also be set. Moreover, allocation counts are now dumped into
`
``
2583
`` +
stderr, rather than stdout. (Contributed by Victor Stinner; :issue:31692
.)
``
``
2584
+
``
2585
`+
.. versionadded:: 2.7.15
`
``
2586
+
``
2587
+
2561
2588
`PEP 434: IDLE Enhancement Exception for All Branches
`
2562
2589
`----------------------------------------------------
`
2563
2590
``
`@@ -2602,10 +2629,162 @@ with the first of those changes appearing in the Python 2.7.7 release.
`
2602
2629
`` certificate store, the :class:~ssl.SSLContext
class, and other
``
2603
2630
`` features. (Contributed by Alex Gaynor and David Reid; :issue:21308
.)
``
2604
2631
``
``
2632
`+
Refer to the "Version added: 2.7.9" notes in the module documentation for
`
``
2633
`+
specific details.
`
``
2634
+
2605
2635
``` * :func:os.urandom
was changed to cache a file descriptor to /dev/urandom
`2606`
`2636`
``` instead of reopening ``/dev/urandom`` on every call. (Contributed by Alex
2607
2637
`` Gaynor; :issue:21305
.)
``
2608
2638
``
``
2639
`` +
- :data:
hashlib.algorithms_guaranteed
and
``
``
2640
`` +
:data:hashlib.algorithms_available
were backported from Python 3 to make
``
``
2641
`+
it easier for Python 2 applications to select the strongest available hash
`
``
2642
`` +
algorithm. (Contributed by Alex Gaynor in :issue:21307
)
``
``
2643
+
``
2644
+
``
2645
`+
PEP 477: Backport ensurepip (PEP 453) to Python 2.7
`
``
2646
`+
`
``
2647
+
``
2648
`` +
:pep:477
approves the inclusion of the :pep:453
ensurepip module and the
``
``
2649
`+
improved documentation that was enabled by it in the Python 2.7 maintenance
`
``
2650
`+
releases, appearing first in the Python 2.7.9 release.
`
``
2651
+
``
2652
+
``
2653
`+
Bootstrapping pip By Default
`
``
2654
`+
`
``
`2655`
`+`
``
`2656`
`` +
The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard
``
``
`2657`
`+
cross-platform mechanism to bootstrap the pip installer into Python
`
``
`2658`
``` +
installations. The version of ``pip`` included with Python 2.7.9 is ``pip``
```
``
`2659`
`+
1.5.6, and future 2.7.x maintenance releases will update the bundled version to
`
``
`2660`
``` +
the latest version of ``pip`` that is available at the time of creating the
```
``
`2661`
`+
release candidate.
`
``
`2662`
`+`
``
`2663`
``` +
By default, the commands ``pip``, ``pipX`` and ``pipX.Y`` will be installed on
```
``
`2664`
`+
all platforms (where X.Y stands for the version of the Python installation),
`
``
`2665`
``` +
along with the ``pip`` Python package and its dependencies.
```
``
`2666`
`+`
``
`2667`
`` +
For CPython :ref:`source builds on POSIX systems <building-python-on-unix>`,
``
``
`2668`
``` +
the ``make install`` and ``make altinstall`` commands do not bootstrap ``pip``
```
``
`2669`
`+
by default. This behaviour can be controlled through configure options, and
`
``
`2670`
`+
overridden through Makefile options.
`
``
`2671`
`+`
``
`2672`
`+
On Windows and Mac OS X, the CPython installers now default to installing
`
``
`2673`
``` +
``pip`` along with CPython itself (users may opt out of installing it
```
``
`2674`
`+
during the installation process). Window users will need to opt in to the
`
``
`2675`
``` +
automatic ``PATH`` modifications to have ``pip`` available from the command
```
``
`2676`
`+
line by default, otherwise it can still be accessed through the Python
`
``
`2677`
``` +
launcher for Windows as ``py -m pip``.
```
``
`2678`
`+`
``
`2679`
`` +
As `discussed in the PEP`__, platform packagers may choose not to install
``
``
`2680`
`+
these commands by default, as long as, when invoked, they provide clear and
`
``
`2681`
`+
simple directions on how to install them on that platform (usually using
`
``
`2682`
`+
the system package manager).
`
``
`2683`
`+`
``
`2684`
`+
__ https://www.python.org/dev/peps/pep-0477/#disabling-ensurepip-by-downstream-distributors
`
``
`2685`
`+`
``
`2686`
`+`
``
`2687`
`+
Documentation Changes
`
``
`2688`
`+
`
``
2689
+
``
2690
`` +
As part of this change, the :ref:installing-index
and
``
``
2691
`` +
:ref:distributing-index
sections of the documentation have been
``
``
2692
`+
completely redesigned as short getting started and FAQ documents. Most
`
``
2693
`+
packaging documentation has now been moved out to the Python Packaging
`
``
2694
`` +
Authority maintained `Python Packaging User Guide
``
``
2695
`` +
http://packaging.python.org`__ and the documentation of the individual
``
``
2696
`+
projects.
`
``
2697
+
``
2698
`+
However, as this migration is currently still incomplete, the legacy
`
``
2699
`` +
versions of those guides remaining available as :ref:install-index
``
``
2700
`` +
and :ref:distutils-index
.
``
``
2701
+
``
2702
`+
.. seealso::
`
``
2703
+
``
2704
`` +
:pep:453
-- Explicit bootstrapping of pip in Python installations
``
``
2705
`+
PEP written by Donald Stufft and Nick Coghlan, implemented by
`
``
2706
`+
Donald Stufft, Nick Coghlan, Martin von Löwis and Ned Deily.
`
``
2707
+
``
2708
`+
PEP 476: Enabling certificate verification by default for stdlib http clients
`
``
2709
`+
`
``
2710
+
``
2711
`` +
:pep:476
updated :mod:httplib
and modules which use it, such as
``
``
2712
`` +
:mod:urllib2
and :mod:xmlrpclib
, to now verify that the server
``
``
2713
`+
presents a certificate which is signed by a Certificate Authority in the
`
``
2714
`+
platform trust store and whose hostname matches the hostname being requested
`
``
2715
`+
by default, significantly improving security for many applications. This
`
``
2716
`+
change was made in the Python 2.7.9 release.
`
``
2717
+
``
2718
`+
For applications which require the old previous behavior, they can pass an
`
``
2719
`+
alternate context::
`
``
2720
+
``
2721
`+
import urllib2
`
``
2722
`+
import ssl
`
``
2723
+
``
2724
`+
This disables all verification
`
``
2725
`+
context = ssl._create_unverified_context()
`
``
2726
+
``
2727
`+
This allows using a specific certificate for the host, which doesn't need
`
``
2728
`+
to be in the trust store
`
``
2729
`+
context = ssl.create_default_context(cafile="/path/to/file.crt")
`
``
2730
+
``
2731
`+
urllib2.urlopen("https://invalid-cert", context=context)
`
``
2732
+
``
2733
+
``
2734
`+
PEP 493: HTTPS verification migration tools for Python 2.7
`
``
2735
`+
`
``
2736
+
``
2737
`` +
:pep:493
provides additional migration tools to support a more incremental
``
``
2738
`+
infrastructure upgrade process for environments containing applications and
`
``
2739
`+
services relying on the historically permissive processing of server
`
``
2740
`+
certificates when establishing client HTTPS connections. These additions were
`
``
2741
`+
made in the Python 2.7.12 release.
`
``
2742
+
``
2743
`+
These tools are intended for use in cases where affected applications and
`
``
2744
`+
services can't be modified to explicitly pass a more permissive SSL context
`
``
2745
`+
when establishing the connection.
`
``
2746
+
``
2747
`+
For applications and services which can't be modified at all, the new
`
``
2748
``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an
``
2749
`+
entire Python process back to the default permissive behaviour of Python 2.7.8
`
``
2750
`+
and earlier.
`
``
2751
+
``
2752
`+
For cases where the connection establishment code can't be modified, but the
`
``
2753
`` +
overall application can be, the new :func:ssl._https_verify_certificates
``
``
2754
`+
function can be used to adjust the default behaviour at runtime.
`
``
2755
+
``
2756
+
``
2757
New ``make regen-all`` build target
``
2758
`+
`
``
2759
+
``
2760
`+
To simplify cross-compilation, and to ensure that CPython can reliably be
`
``
2761
`+
compiled without requiring an existing version of Python to already be
`
``
2762
`+
available, the autotools-based build system no longer attempts to implicitly
`
``
2763
`+
recompile generated files based on file modification times.
`
``
2764
+
``
2765
Instead, a new ``make regen-all`` command has been added to force regeneration
``
2766
`+
of these files when desired (e.g. after an initial version of Python has
`
``
2767
`+
already been built based on the pregenerated versions).
`
``
2768
+
``
2769
`+
More selective regeneration targets are also defined - see
`
``
2770
`` +
:source:Makefile.pre.in
for details.
``
``
2771
+
``
2772
`` +
(Contributed by Victor Stinner in :issue:23404
.)
``
``
2773
+
``
2774
`+
.. versionadded:: 2.7.14
`
``
2775
+
``
2776
+
``
2777
Removal of ``make touch`` build target
``
2778
`+
`
``
2779
+
``
2780
The ``make touch`` build target previously used to request implicit regeneration
``
2781
`+
of generated files by updating their modification times has been removed.
`
``
2782
+
``
2783
It has been replaced by the new ``make regen-all`` target.
``
2784
+
``
2785
`` +
(Contributed by Victor Stinner in :issue:23404
.)
``
``
2786
+
``
2787
`+
.. versionchanged:: 2.7.14
`
2609
2788
``
2610
2789
`.. ======================================================================
`
2611
2790
``