]> granicus.if.org Git - python/log
python
4 years agov3.8.0 v3.8.0
Łukasz Langa [Mon, 14 Oct 2019 13:34:47 +0000 (15:34 +0200)]
v3.8.0

4 years ago[3.8] bpo-37759: Polish What's New in Python 3.8. (GH-16769) (#16777)
Łukasz Langa [Mon, 14 Oct 2019 13:25:46 +0000 (15:25 +0200)]
[3.8] bpo-37759: Polish What's New in Python 3.8. (GH-16769) (#16777)

(cherry picked from commit 298439ce3fb01de6c3110cc4847e6afe3253ba7a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agoMake 3.8 README link to 3.8 doc pages, not master (GH-16776)
Ned Deily [Mon, 14 Oct 2019 13:14:21 +0000 (09:14 -0400)]
Make 3.8 README link to 3.8 doc pages, not master (GH-16776)

4 years agoUpdate build docs for macOS (GH-16771)
Miss Islington (bot) [Mon, 14 Oct 2019 12:35:28 +0000 (05:35 -0700)]
Update build docs for macOS (GH-16771)

(cherry picked from commit 19d6842c15c145f65178f806048ac1a8ae7d05f6)

Co-authored-by: Ned Deily <nad@python.org>
4 years agobpo-38469: Handle named expression scope with global/nonlocal keywords (GH-16755...
Miss Islington (bot) [Mon, 14 Oct 2019 11:40:15 +0000 (04:40 -0700)]
bpo-38469: Handle named expression scope with global/nonlocal keywords (GH-16755) (#16760)

The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions.
(cherry picked from commit fd5c414880b2e05720b9cf14ab0b0d7ae2b7d925)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years ago[3.8] Update macOS installer display files for 3.8.0 (GH-16766)
Ned Deily [Mon, 14 Oct 2019 08:36:34 +0000 (04:36 -0400)]
[3.8] Update macOS installer display files for 3.8.0 (GH-16766)

4 years agobpo-37759: Add examples for the new typing features (GH-16763) (GH-16764)
Miss Islington (bot) [Mon, 14 Oct 2019 06:45:45 +0000 (23:45 -0700)]
bpo-37759: Add examples for the new typing features (GH-16763) (GH-16764)

(cherry picked from commit a3291531ea51455cfa5989119db496267425323c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
4 years agobpo-38461 and bpo-38463: Minor fixes to Whatsnew 3.8 (GH-16761) (GH-16762)
Miss Islington (bot) [Mon, 14 Oct 2019 04:54:05 +0000 (21:54 -0700)]
bpo-38461 and bpo-38463: Minor fixes to Whatsnew 3.8 (GH-16761) (GH-16762)

* bpo-38461: ncurses misspelled as curses

* bpo-38463: Fix broken link
(cherry picked from commit 61a6db5e79921b89b9e2a154990f01f5f3150213)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
4 years agoFix minor typos in Whatsnew (GH-16759)
Raymond Hettinger [Mon, 14 Oct 2019 03:35:11 +0000 (20:35 -0700)]
Fix minor typos in Whatsnew (GH-16759)

4 years agobpo-38464: Document parameter for NormalDist.quantiles() (GH-16757) (GH-16758)
Miss Islington (bot) [Mon, 14 Oct 2019 03:04:29 +0000 (20:04 -0700)]
bpo-38464: Document parameter for NormalDist.quantiles() (GH-16757) (GH-16758)

(cherry picked from commit 8a6cbf8adb68aa2c43a48769af92e50d5ca1539d)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
4 years agoFix strict-aliasing rules errors on gcc 4.8.5. (GH-16714)
Miss Islington (bot) [Mon, 14 Oct 2019 02:14:27 +0000 (19:14 -0700)]
Fix strict-aliasing rules errors on gcc 4.8.5. (GH-16714)

(cherry picked from commit c39d1ddc012987e2159a997e27665d2d579c0ce0)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
4 years agoRebased version of what's new PR (GH-16745) (#16748)
Miss Islington (bot) [Sun, 13 Oct 2019 20:35:10 +0000 (13:35 -0700)]
Rebased version of what's new PR (GH-16745) (#16748)

* Use Unicode character for accent
* Various grammar fixes
* Sort library modules alphabetically; remove duplicated idlelib/IDLE section
(cherry picked from commit bb78f6cfa6f2b84fa4611d39c35baf1c7dce7f8d)

Co-authored-by: Andrew Kuchling <amk@amk.ca>
4 years agobpo-38467: Fix argument name of typing functions (GH-16753)
Miss Islington (bot) [Sun, 13 Oct 2019 18:38:45 +0000 (11:38 -0700)]
bpo-38467: Fix argument name of typing functions (GH-16753)

(cherry picked from commit fdfe2833ace93021278fe4c41c40e1d08d70abf9)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
4 years agobpo-28556: Remove another mention of metaclass of Generic in typing docs (GH-16743)
Miss Islington (bot) [Sun, 13 Oct 2019 17:00:19 +0000 (10:00 -0700)]
bpo-28556: Remove another mention of metaclass of Generic in typing docs (GH-16743)

Metaclass was removed in Python 3.7 (there is already a `versionchanged` item about this).

https://bugs.python.org/issue28556
(cherry picked from commit 8144095707f87bdee6f3e1bbb15283ea61381be6)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
4 years agoCorrect signature of __build_class__ (GH-16735)
Miss Islington (bot) [Sun, 13 Oct 2019 15:53:54 +0000 (08:53 -0700)]
Correct signature of __build_class__ (GH-16735)

(cherry picked from commit e3babbd03cd2bcb3c85deabae3bc6976aa95a3c3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years agobpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)
Miss Islington (bot) [Sun, 13 Oct 2019 12:04:05 +0000 (05:04 -0700)]
bpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)

(cherry picked from commit 793cb85437299a3da3d74fe65480d720af330cbb)

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
4 years agobpo-37731: Reorder includes in xmltok.c to avoid redefinition of _POSIX_C_SOURCE...
Miss Islington (bot) [Sat, 12 Oct 2019 19:32:48 +0000 (12:32 -0700)]
bpo-37731: Reorder includes in xmltok.c to avoid redefinition of _POSIX_C_SOURCE (GH-16733)

(cherry picked from commit 8177404d520e81f16324a900f093adf3856d33f8)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years agoAnnounce the change in the CancelledError inheritance (GH-16730)
Miss Islington (bot) [Sat, 12 Oct 2019 17:53:32 +0000 (10:53 -0700)]
Announce the change in the CancelledError inheritance (GH-16730)

This is a fairly noticeable change that requires adjustments in
existing asyncio code. It should therefore be announced.
(cherry picked from commit e634da27471a76f4abe685e86e6e302e0ed6b553)

Co-authored-by: Phil Jones <philip.graham.jones@googlemail.com>
4 years agobpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)
Miss Islington (bot) [Sat, 12 Oct 2019 17:03:24 +0000 (10:03 -0700)]
bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)

KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead.
(cherry picked from commit 65dcc8a8dc41d3453fd6b987073a5f1b30c5c0fd)

Co-authored-by: Andrei Troie <andreitroie90@gmail.com>
4 years ago[3.8] bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing...
Abhilash Raj [Sat, 12 Oct 2019 16:58:11 +0000 (09:58 -0700)]
[3.8] bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing of URLs" (GH-16724) (GH-16728)

This reverts commit 87bd2071c756188b6cd577889fb1682831142ceb.

The reason for revert is a regression caused by the change in 3.8.0rc1, see bpo-38449 for more details.

https://bugs.python.org/issue38449
(cherry picked from commit 19a3d873005e5730eeabdc394c961e93f2ec02f0)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
4 years agobpo-38341: Add SMTPNotSupportedError in the exports of smtplib (GH-16525)
Miss Islington (bot) [Sat, 12 Oct 2019 16:08:24 +0000 (09:08 -0700)]
bpo-38341: Add SMTPNotSupportedError in the exports of smtplib (GH-16525)

Add SMTPNotSupportedError in the exports of smtplib

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 3faf826e5879536d2272f1a51c58965a16827f81)

Co-authored-by: nde <denayer.norman@gmail.com>
4 years agoFix typo in the "Porting to Python 3.8" section. (GH-16435)
Miss Islington (bot) [Fri, 11 Oct 2019 21:09:44 +0000 (14:09 -0700)]
Fix typo in the "Porting to Python 3.8" section. (GH-16435)

(cherry picked from commit dd6117c6d7859fee57751593cd56f0862131de8b)

Co-authored-by: bariod <35639254+bariod@users.noreply.github.com>
4 years agoUpdate badges in README.rst (GH-16709)
Zachary Ware [Fri, 11 Oct 2019 16:30:03 +0000 (11:30 -0500)]
Update badges in README.rst (GH-16709)

We no longer use AppVeyor on 3.x, and others were still pointed at master.

4 years agobpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
Miss Islington (bot) [Fri, 11 Oct 2019 13:56:49 +0000 (06:56 -0700)]
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)

 pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
(cherry picked from commit 2b7dc40b2af6578181808ba73c1533fc114e55df)

Co-authored-by: Ruediger Pluem <r.pluem@gmx.de>
4 years ago[3.8] Typo fix: "throuhgh" should be "through". (GH-16713)
Benjamin Peterson [Fri, 11 Oct 2019 04:02:38 +0000 (21:02 -0700)]
[3.8] Typo fix: "throuhgh" should be "through". (GH-16713)

(cherry picked from commit a8e0d3141e271b3c0fbb7399a911f0c3aa567e30)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
4 years agodocs: Add asyncio source code links (GH-16640)
Miss Islington (bot) [Thu, 10 Oct 2019 23:25:28 +0000 (16:25 -0700)]
docs: Add asyncio source code links (GH-16640)

(cherry picked from commit f900064ac4b35226caad7502abc8a7e64f1c0e9d)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
4 years agoRe-enable the OverflowError test for test_truediv on test_complex (GH-16591)
Miss Islington (bot) [Thu, 10 Oct 2019 17:11:07 +0000 (10:11 -0700)]
Re-enable the OverflowError test for test_truediv on test_complex (GH-16591)

(cherry picked from commit 1dbe5373851acb85ba91f0be7b83c69563acd68d)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
4 years agobpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)
Miss Islington (bot) [Thu, 10 Oct 2019 13:50:32 +0000 (06:50 -0700)]
bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)

Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT,
stat.S_ISDOOR, stat.S_ISPORT, and stat.S_ISWHT values to
the Python implementation of the stat module.
(cherry picked from commit 7bb14316b8ceddb813f31040a299af94a57ab339)

Co-authored-by: Ronan Lamy <ronan.lamy@gmail.com>
4 years agobpo-32996: Documentation fix-up. (GH-16646)
Miss Islington (bot) [Thu, 10 Oct 2019 11:19:03 +0000 (04:19 -0700)]
bpo-32996: Documentation fix-up. (GH-16646)

PR GH-4906 changed the typing.Generic class hierarchy, leaving an
outdated comment in the library reference. User-defined Generic ABCs now
must get a abc.ABCMeta metaclass from something other than typing.Generic
inheritance.
(cherry picked from commit d47f0dd2e85ce032aebfedbde18cdb2e728fa79f)

Co-authored-by: M. Eric Irrgang <mei2n@virginia.edu>
4 years agobpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
Miss Islington (bot) [Thu, 10 Oct 2019 08:00:19 +0000 (01:00 -0700)]
bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)

(cherry picked from commit a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
4 years agobpo-38409: Fix grammar in str.strip() docstring (GH-16682) (GH-16684)
Miss Islington (bot) [Wed, 9 Oct 2019 21:55:39 +0000 (14:55 -0700)]
bpo-38409: Fix grammar in str.strip() docstring (GH-16682) (GH-16684)

(cherry picked from commit 09895c27cd8ff60563a794016e8c099bc897cc74)

4 years ago[3.8] bpo-38379: don't claim objects are collected when they aren't (GH-16658)...
Pablo Galindo [Wed, 9 Oct 2019 21:25:06 +0000 (22:25 +0100)]
[3.8] bpo-38379:  don't claim objects are collected when they aren't  (GH-16658) (GH-16683)

* [bpo-38379](https://bugs.python.org/issue38379):  when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth.
(cherry picked from commit ecbf35f9335b0420cb8adfda6f299d6747a16515)

Co-authored-by: Tim Peters <tim.peters@gmail.com>
https://bugs.python.org/issue38379

Automerge-Triggered-By: @pablogsal
4 years agobpo-37531: regrtest ignores output on timeout (GH-16659)
Miss Islington (bot) [Wed, 9 Oct 2019 14:02:15 +0000 (07:02 -0700)]
bpo-37531: regrtest ignores output on timeout (GH-16659)

bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call
`popen.communicate() again: it can hang until all child processes
using stdout and stderr pipes completes. Kill the worker process and
ignores its output.

Reenable test_regrtest.test_multiprocessing_timeout().

bpo-37531: Change also the faulthandler timeout of the main process
from 1 minute to 5 minutes, for Python slowest buildbots.
(cherry picked from commit 0ec618af98ac250a91ee9c91f8569e6df6772758)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 years agobpo-38368: Added fix for ctypes crash when handling arrays in structs/unions. (GH...
Vinay Sajip [Wed, 9 Oct 2019 05:47:57 +0000 (06:47 +0100)]
bpo-38368: Added fix for ctypes crash when handling arrays in structs/unions. (GH-16589) (GH-16671)

(cherry picked from commit e8bedbddadaa86be6bd86dc32dbdbd53933a4988)

4 years agoTypo fix: "empy" should be "empty". (GH-16666)
Miss Islington (bot) [Wed, 9 Oct 2019 02:42:22 +0000 (19:42 -0700)]
Typo fix: "empy" should be "empty". (GH-16666)

(cherry picked from commit 01171ebd966b0cd6352057799ad876dd1e07942e)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
4 years ago[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)
Pablo Galindo [Tue, 8 Oct 2019 20:38:11 +0000 (21:38 +0100)]
[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)

The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a9e3c22af37c748ea5a417f6fb66601e21)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years agobpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
Miss Islington (bot) [Tue, 8 Oct 2019 14:14:57 +0000 (07:14 -0700)]
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)

(cherry picked from commit 8252c52e57283515ace5d4251584255dc5c60eb5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
Miss Islington (bot) [Tue, 8 Oct 2019 14:12:38 +0000 (07:12 -0700)]
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)

(cherry picked from commit 13abda41003daf599587991d8291f0dacf6e9519)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
Miss Islington (bot) [Tue, 8 Oct 2019 13:49:12 +0000 (06:49 -0700)]
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)

Valgrind emits "Conditional jump or move depends on uninitialised
value(s)" false alarms on GCC builtin strcmp() function. The GCC code
is correct.

Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936
(cherry picked from commit 03ab6b4fc6f59a4452756e7a3a46310ce30ec4b2)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 years agobpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH...
Miss Islington (bot) [Tue, 8 Oct 2019 11:51:16 +0000 (04:51 -0700)]
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH-16583)

It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
(cherry picked from commit b690a2759e62d9ee0b6ea1b20e8f7e4b2cdbf8bb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agoFix typo in _warnings.warn_explicit() docstring (GH-16625)
Miss Islington (bot) [Tue, 8 Oct 2019 09:16:06 +0000 (02:16 -0700)]
Fix typo in _warnings.warn_explicit() docstring (GH-16625)

(cherry picked from commit 5dfbb4d50333e7a91fc0cd8c03a2f2f2cf56dbd9)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
4 years agobpo-38344: Fix syntax in activate.bat (GH-16533)
Miss Islington (bot) [Mon, 7 Oct 2019 21:26:57 +0000 (14:26 -0700)]
bpo-38344: Fix syntax in activate.bat (GH-16533)

(cherry picked from commit e310af9e2941c2fbb7370e003276cc37eb230f16)

Co-authored-by: James Abel <j@abel.co>
4 years agobpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442)
Miss Islington (bot) [Mon, 7 Oct 2019 21:07:46 +0000 (14:07 -0700)]
bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d660befe643ed42eb2707a557cea97256c)

Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
4 years agobpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623)
Victor Stinner [Mon, 7 Oct 2019 19:12:05 +0000 (21:12 +0200)]
bpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623)

Always define _PyUnicode_CheckConsistency() in the CPython C API.

4 years agobpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
Miss Islington (bot) [Mon, 7 Oct 2019 16:38:00 +0000 (09:38 -0700)]
bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)

(cherry picked from commit 321def805abc5b7c92c7e90ca90cb2434fdab855)

Co-authored-by: Ben Harper <btharper1221@gmail.com>
4 years agobpo-38391: Fixing a typo for Py_DECREF (GH-16616)
Miss Islington (bot) [Mon, 7 Oct 2019 12:05:09 +0000 (05:05 -0700)]
bpo-38391: Fixing a typo for Py_DECREF (GH-16616)

(cherry picked from commit 038503e08ac5b10601b95d5adc2c2cab7be10163)

Co-authored-by: Krishna Oza <krishoza15sep@gmail.com>
4 years agobpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
Miss Islington (bot) [Mon, 7 Oct 2019 02:15:44 +0000 (19:15 -0700)]
bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)

The `required` argument to `argparse.add_subparsers` was added in GH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917e0290972f65711f75510078f799cf0b59)

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
4 years agobpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray....
Miss Islington (bot) [Sun, 6 Oct 2019 12:37:20 +0000 (05:37 -0700)]
bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603)

(cherry picked from commit 24ddd9c2d6ab61cbce7e68d6de36d4df9bd2c3fb)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
4 years agobpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)
Miss Islington (bot) [Fri, 4 Oct 2019 10:28:54 +0000 (03:28 -0700)]
bpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)

On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.

On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.

Converting strings from Tcl to Python and back now never fails
(except MemoryError).
(cherry picked from commit 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-38235: Correct some arguments names in logging documentation (GH-16571) (GH-16576)
Miss Islington (bot) [Fri, 4 Oct 2019 08:14:01 +0000 (01:14 -0700)]
bpo-38235: Correct some arguments names in logging documentation (GH-16571) (GH-16576)

(cherry picked from commit 3142c667b50254daaa28f22c79bdda177136bd03)

Co-authored-by: Ashley Whetter <AWhetter@users.noreply.github.com>
4 years agobpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)
Miss Islington (bot) [Thu, 3 Oct 2019 21:26:57 +0000 (14:26 -0700)]
bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)

(cherry picked from commit b23a8423a923077e4f83d3f328bb7542b4c940ed)

Co-authored-by: idomic <michael.ido@gmail.com>
4 years agobpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16561)
Miss Islington (bot) [Thu, 3 Oct 2019 15:51:12 +0000 (08:51 -0700)]
bpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16561)

(cherry picked from commit 353fb1ecbfd58752dabae115c4964095e1e35e5f)

Co-authored-by: Steve Dower <steve.dower@python.org>
4 years agobpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)
Miss Islington (bot) [Thu, 3 Oct 2019 15:49:56 +0000 (08:49 -0700)]
bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)

(cherry picked from commit a0e3d27e4e3cb5b67e325df080fb18b70c2910cf)

Co-authored-by: Steve Dower <steve.dower@python.org>
4 years ago[3.8] bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550) ...
Victor Stinner [Thu, 3 Oct 2019 15:26:25 +0000 (17:26 +0200)]
[3.8] bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550) (GH-16560)

* bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550)

WindowsLoadTracker.read_output() now uses a short buffer for
incomplete line.

(cherry picked from commit 3e04cd268ee9a57f95dc78d8974b21a6fac3f666)

* bpo-36670: Enhance regrtest WindowsLoadTracker (GH-16553)

The last line is now passed to the parser even if it does not end
with a newline, but only if it's a valid value.

(cherry picked from commit c65119d5bfded03f80a9805889391b66fa7bf551)

* bpo-36670: Enhance regrtest (GH-16556)

* Add log() method: add timestamp and load average prefixes
  to main messages.
* WindowsLoadTracker:

  * LOAD_FACTOR_1 is now computed using SAMPLING_INTERVAL
  * Initialize the load to the arithmetic mean of the first 5 values
    of the Processor Queue Length value (so over 5 seconds), rather
    than 0.0.
  * Handle BrokenPipeError and when typeperf exit.

* format_duration(1.5) now returns '1.5 sec', rather than
  '1 sec 500 ms'

(cherry picked from commit 098e25672f1c3578855d5ded4f5147795c9ed956)

4 years agobpo-38338, test.pythoninfo: add more ssl infos (GH-16539)
Miss Islington (bot) [Wed, 2 Oct 2019 16:52:50 +0000 (09:52 -0700)]
bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)

test.pythoninfo now logs environment variables used by OpenSSL and
Python ssl modules, and logs attributes of 3 SSL contexts
(SSLContext, default HTTPS context, stdlib context).
(cherry picked from commit b3e7045f8314e7b62cd95861d207fe2f97e47198)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 years agobpo-36670: regrtest bug fixes (GH-16537)
Miss Islington (bot) [Wed, 2 Oct 2019 11:54:18 +0000 (04:54 -0700)]
bpo-36670: regrtest bug fixes (GH-16537)

* Fix TestWorkerProcess.__repr__(): start_time is only valid
  if _popen is not None.
* Fix _kill(): don't set _killed to True if _popen is None.
* _run_process(): only set _killed to False after calling
  run_test_in_subprocess().
(cherry picked from commit 2ea71a07d0a720707094ee55f78fd232c40724bc)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 years agobpo-38343: Fixes version handling for nuget packages (GH-16527)
Miss Islington (bot) [Wed, 2 Oct 2019 00:00:49 +0000 (17:00 -0700)]
bpo-38343: Fixes version handling for nuget packages (GH-16527)

(cherry picked from commit b9a8b8296cd7be22f8b5bf92af686a788c47c7bf)

Co-authored-by: Steve Dower <steve.dower@python.org>
4 years agoCorrect typos in the codecs module documentation (GH-15135)
Miss Islington (bot) [Tue, 1 Oct 2019 21:02:29 +0000 (14:02 -0700)]
Correct typos in the codecs module documentation (GH-15135)

(cherry picked from commit 891e9e3b44c99d643dc309a4e63082451271b136)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
4 years agoPost v3.8.0rc1
Łukasz Langa [Tue, 1 Oct 2019 20:49:40 +0000 (22:49 +0200)]
Post v3.8.0rc1

4 years agov3.8.0rc1 v3.8.0rc1
Łukasz Langa [Tue, 1 Oct 2019 12:58:26 +0000 (14:58 +0200)]
v3.8.0rc1

4 years ago[3.8] bpo-3832: Fix compiler warnings (GH-16518)
Victor Stinner [Tue, 1 Oct 2019 11:52:00 +0000 (13:52 +0200)]
[3.8] bpo-3832: Fix compiler warnings (GH-16518)

* bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493)

bpo-38248, bpo-38321: Fix warning:

    modules\_asynciomodule.c(2667):
    warning C4102: 'set_exception': unreferenced label

The related goto has been removed by
commit edad4d89e357c92f70c0324b937845d652b20afd.

(cherry picked from commit efe74b6369a8d08f27c69703fcc1686966e51068)

* bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)

bpo-22273, bpo-38321: Fix following warning:

    modules\_ctypes\stgdict.c(704):
    warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data

(cherry picked from commit c9a413ede47171a224c72dd34122005170caaad4)

4 years agobpo-36670: Multiple regrtest bugfixes (GH-16511)
Miss Islington (bot) [Tue, 1 Oct 2019 10:47:52 +0000 (03:47 -0700)]
bpo-36670: Multiple regrtest bugfixes (GH-16511)

* Windows: Fix counter name in WindowsLoadTracker. Counter names are
  localized: use the registry to get the counter name. Original
  change written by Lorenz Mende.
* Regrtest.main() now ensures that the Windows load tracker is also
  killed if an exception is raised
* TestWorkerProcess now ensures that worker processes are no longer
  running before exiting: kill also worker processes when an
  exception is raised.
* Enhance regrtest messages and warnings: include test name,
  duration, add a worker identifier, etc.
* Rename MultiprocessRunner to TestWorkerProcess
* Use print_warning() to display warnings.

Co-Authored-By: Lorenz Mende <Lorenz.mende@gmail.com>
(cherry picked from commit 982bfa4da07b2e5749a0f4e68f99e972bcc3a549)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
4 years agobpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)
Miss Islington (bot) [Tue, 1 Oct 2019 10:26:04 +0000 (03:26 -0700)]
bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)

PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
(cherry picked from commit 8462a4936b3a551dc546a6adea04a70b0a07ca67)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
4 years agobpo-38319: Fix shutil._fastcopy_sendfile(): set sendfile() max block size (GH-16491...
Miss Islington (bot) [Tue, 1 Oct 2019 07:55:02 +0000 (00:55 -0700)]
bpo-38319: Fix shutil._fastcopy_sendfile(): set sendfile() max block size (GH-16491) (#16506)

(cherry picked from commit 94e165096fd65e8237e60de570fb609604ab94c9)

Co-authored-by: Giampaolo Rodola <g.rodola@gmail.com>
4 years agoRestore tp_clear for function object. (#16502)
Neil Schemenauer [Tue, 1 Oct 2019 07:49:36 +0000 (00:49 -0700)]
Restore tp_clear for function object. (#16502)

This is a revert of the revert (GH-15826).  Having a tp_clear for
functions should be safe (and helpful) now that bpo-38006 has been
fixed.

4 years agoFix and improve `asyncio.run()` docs (GH-16403) (GH-16504)
Miss Islington (bot) [Tue, 1 Oct 2019 01:46:43 +0000 (18:46 -0700)]
Fix and improve `asyncio.run()` docs (GH-16403) (GH-16504)

(cherry picked from commit e407013089259e4c0b271703e1975bbcd578a2d5)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
4 years agobpo-38304: Remove PyConfig.struct_size (GH-16500)
Victor Stinner [Mon, 30 Sep 2019 22:46:42 +0000 (00:46 +0200)]
bpo-38304: Remove PyConfig.struct_size (GH-16500)

For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.

We may revisit this in the future if we further explore the idea of offering a stable embedding API.

4 years agoClear weakrefs in garbage found by the GC (GH-16495) (#16499)
Miss Islington (bot) [Mon, 30 Sep 2019 17:27:46 +0000 (10:27 -0700)]
Clear weakrefs in garbage found by the GC (GH-16495) (#16499)

Fix a bug due to the interaction of weakrefs and the cyclic garbage
collector. We must clear any weakrefs in garbage in order to prevent
their callbacks from executing and causing a crash.
(cherry picked from commit bcda460baf25062ab68622b3f043f52b9db4d21d)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
4 years agobpo-38322: Fix gotlandmark() of PC/getpathp.c (GH-16490)
Victor Stinner [Mon, 30 Sep 2019 12:49:42 +0000 (14:49 +0200)]
bpo-38322: Fix gotlandmark() of PC/getpathp.c (GH-16490)

Write the filename into a temporary buffer instead of reusing prefix.
The problem is that join() modifies prefix inplace. If prefix is not
normalized, join() can make prefix shorter and so gotlandmark()
does modify prefix instead of returning it unmodified.

4 years agobpo-38304: Fix PyConfig usage in python_uwp.cpp (GH-16488)
Victor Stinner [Mon, 30 Sep 2019 10:53:17 +0000 (12:53 +0200)]
bpo-38304: Fix PyConfig usage in python_uwp.cpp (GH-16488)

* Set PyPreConfig.struct_size and PyConfig.struct_size as required by
  the API.
* PyPreConfig_InitPythonConfig() can now fail: check PyStatus result.

4 years ago[3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)
Christian Heimes [Mon, 30 Sep 2019 07:10:38 +0000 (09:10 +0200)]
[3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)

test_hmac and test_hashlib test built-in hashing implementations and
OpenSSL-based hashing implementations. Add more checks to skip OpenSSL
implementations when a strict crypto policy is active.

Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the
EVP context. The EVP_DigestInit() function clears alls flags and breaks
usedforsecurity flag again.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38270.
(cherry picked from commit 90558158093c0ad893102158fd3c2dd9f864e82e)

Co-authored-by: Christian Heimes <christian@python.org>
4 years agobpo-37408: Precise that Tarfile "format" argument only concerns writing. (GH-14389...
Miss Islington (bot) [Mon, 30 Sep 2019 07:06:28 +0000 (00:06 -0700)]
bpo-37408: Precise that Tarfile "format" argument only concerns writing. (GH-14389) (#16465)

(cherry picked from commit c5a7e0ce194c0eafe82eb3e431881012398e7d46)

Co-authored-by: Pascal Chambon <pythoniks@gmail.com>
4 years agobpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (GH-7468...
Miss Islington (bot) [Mon, 30 Sep 2019 06:19:02 +0000 (23:19 -0700)]
bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (GH-7468) (#16486)

(cherry picked from commit fc4a044a3c54ce21e9ed150f7d769fb479d34c49)

Co-authored-by: Yury Selivanov <yury@magic.io>
4 years agobpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) (#16485)
Yury Selivanov [Mon, 30 Sep 2019 05:30:17 +0000 (22:30 -0700)]
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) (#16485)

See https://bugs.python.org/issue38242 for more details

4 years ago[3.8] bpo-38163: Child mocks detect their type as sync or async (GH-16471) (GH-16484)
Lisa Roach [Mon, 30 Sep 2019 05:22:44 +0000 (22:22 -0700)]
[3.8] bpo-38163: Child mocks detect their type as sync or async (GH-16471) (GH-16484)

4 years agobpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443) (GH-16481)
Miss Islington (bot) [Mon, 30 Sep 2019 04:23:33 +0000 (21:23 -0700)]
bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443) (GH-16481)

4 years agobpo-38108: Makes mock objects inherit from Base (GH-16060) (GH-16470)
Miss Islington (bot) [Mon, 30 Sep 2019 04:02:46 +0000 (21:02 -0700)]
bpo-38108: Makes mock objects inherit from Base (GH-16060) (GH-16470)

4 years agobpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
Miss Islington (bot) [Sun, 29 Sep 2019 23:58:57 +0000 (16:58 -0700)]
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)

Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.

* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
  with "_Py".
* test_embed: add test_init_warnoptions().
(cherry picked from commit fb4ae152a9930f0e00cae8b2807f534058cf341a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
4 years agobpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe (GH...
Miss Islington (bot) [Sun, 29 Sep 2019 12:20:15 +0000 (05:20 -0700)]
bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe (GH-16472)

(cherry picked from commit 58498bc7178608b1ab031994ca09c43889ce3e76)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
4 years agobpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) (GH-16464)
Gregory P. Smith [Sat, 28 Sep 2019 15:22:00 +0000 (08:22 -0700)]
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) (GH-16464)

Document that lnotab can contain invalid bytecode offsets (because of
terrible reasons that are difficult to fix). Make dis.findlinestarts()
ignore invalid offsets in lnotab. All other uses of lnotab in CPython
(various reimplementations of addr2line or line2addr in Python, C and gdb)
already ignore this, because they take an address to look for, instead.

Add tests for the result of dis.findlinestarts() on wacky constructs in
test_peepholer.py, because it's the easiest place to add them.

(cherry picked from commit c8165036f374cd2ee64d4314eeb2514f7acb5026)

4 years agobpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding...
Miss Islington (bot) [Sat, 28 Sep 2019 14:23:34 +0000 (07:23 -0700)]
bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448)

* bpo-38216: Allow bypassing input validation

* bpo-36274: Also allow the URL encoding to be overridden.

* bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL.

* Call with skip_host to avoid tripping on the host checking in the URL.

* Remove obsolete comment.

* Make _prepare_path_encoding its own attr.

This makes overriding just that simpler.

Also, don't use the := operator to make backporting easier.

* Add a news entry.

* _prepare_path_encoding -> _encode_prepared_path()

* Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path.
(cherry picked from commit 7774d7831e8809795c64ce27f7df52674581d298)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
4 years agobpo-38304: Add PyConfig.struct_size (GH-16451) (GH-16453)
Victor Stinner [Sat, 28 Sep 2019 02:50:43 +0000 (04:50 +0200)]
bpo-38304: Add PyConfig.struct_size (GH-16451) (GH-16453)

Add a new struct_size field to PyPreConfig and PyConfig structures to
allow to modify these structures in the future without breaking the
backward compatibility.

* Replace private _config_version field with public struct_size field
  in PyPreConfig and PyConfig.
* Public PyPreConfig_InitIsolatedConfig() and
  PyPreConfig_InitPythonConfig()
  return type becomes PyStatus, instead of void.
* Internal _PyConfig_InitCompatConfig(),
  _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(),
  _PyPreConfig_InitFromPreConfig() return type becomes PyStatus,
  instead of void.
* Remove _Py_CONFIG_VERSION
* Update the Initialization Configuration documentation.

(cherry picked from commit 441b10cf2855955c86565f8d59e72c2efc0f0a57)

4 years agobpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) (...
Miss Islington (bot) [Sat, 28 Sep 2019 02:20:31 +0000 (19:20 -0700)]
bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) (#16449)

(cherry picked from commit 52d1b86bde2b772a76919c76991c326384954bf1)

Co-authored-by: Jesús Cea <jcea@jcea.es>
4 years ago[3.8] bpo-38136: Updates await_count and call_count to be different things (GH-16192...
Lisa Roach [Fri, 27 Sep 2019 22:44:34 +0000 (15:44 -0700)]
[3.8] bpo-38136: Updates await_count and call_count to be different things (GH-16192) (GH-16431)

4 years agobpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
Miss Islington (bot) [Fri, 27 Sep 2019 20:19:41 +0000 (13:19 -0700)]
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)

Escape the server title of xmlrpc.server.DocXMLRPCServer
when rendering the document page as HTML.
(cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
4 years agobpo-38206: Clarify tp_dealloc requirements for heap allocated types. (GH-16248)
Miss Islington (bot) [Fri, 27 Sep 2019 11:18:24 +0000 (04:18 -0700)]
bpo-38206: Clarify tp_dealloc requirements for heap allocated types. (GH-16248)

As mentioned in the bpo ticket, this mistake came up on two reviews:
- https://github.com/python/cpython/pull/16127GH-pullrequestreview-288312751
- https://github.com/python/cpython/pull/16071GH-pullrequestreview-287819525

Would be nice to have it documented in a more permanent place than 3.8's whatsnew entry.

https://bugs.python.org/issue38206

Automerge-Triggered-By: @encukou
(cherry picked from commit 5faff977adbe089e1f91a5916ccb2160a22dd292)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
4 years agocleanup ababstractproperty in typing.py (GH-16432)
Miss Islington (bot) [Fri, 27 Sep 2019 08:13:38 +0000 (01:13 -0700)]
cleanup ababstractproperty in typing.py (GH-16432)

(cherry picked from commit 6ce03ec627680ce0829a5b3067fab7faed21b533)

Co-authored-by: HongWeipeng <961365124@qq.com>
4 years ago[3.8] bpo-38275: Skip ssl tests for disabled versions (GH-16386) (GH-16425)
Christian Heimes [Thu, 26 Sep 2019 20:53:09 +0000 (22:53 +0200)]
[3.8] bpo-38275: Skip ssl tests for disabled versions (GH-16386) (GH-16425)

test_ssl now handles disabled TLS/SSL versions better. OpenSSL's crypto
policy and run-time settings are recognized and tests for disabled versions
are skipped.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38275
(cherry picked from commit df6ac7e2b82d921a6e9ff5571b40c6dbcf635581)

4 years agobpo-38239: Fix test_gdb for Link Time Optimization (LTO) (GH-16422)
Miss Islington (bot) [Thu, 26 Sep 2019 15:13:39 +0000 (08:13 -0700)]
bpo-38239: Fix test_gdb for Link Time Optimization (LTO) (GH-16422)

(cherry picked from commit 64b4a3a2deabcd4103fac2759a311fe94159b4d1)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
4 years ago[3.8] bpo-38234: Backport init path config changes from master (GH-16423)
Victor Stinner [Thu, 26 Sep 2019 14:17:34 +0000 (16:17 +0200)]
[3.8] bpo-38234: Backport init path config changes from master (GH-16423)

* bpo-38234: Py_SetPath() uses the program full path (GH-16357)

Py_SetPath() now sets sys.executable to the program full path
(Py_GetProgramFullPath()), rather than to the program name
(Py_GetProgramName()).

Fix also memory leaks in pathconfig_set_from_config().

(cherry picked from commit 1ce152a42eaa917d7763bce93f1e1ca72530d7ca)

* bpo-38234: Add tests for Python init path config (GH-16358)

(cherry picked from commit bb6bf7d342b4503a6227fd209fac934905b6a1aa)

* bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366)

Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed
to test pyvenv.cfg and pybuilddir.txt configuration files.

Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8
encoding, not ASCII.

(cherry picked from commit 52ad33abbfb6637d74932617c7013bae0ccf6e32)

* bpo-38234: Cleanup getpath.c (GH-16367)

* search_for_prefix() directly calls reduce() if found is greater
  than 0.
* Add calculate_pybuilddir() subfunction.
* search_for_prefix(): add path string buffer for readability.
* Fix some error handling code paths: release resources on error.
* calculate_read_pyenv(): rename tmpbuffer to filename.
* test.pythoninfo now also logs windows.dll_path

(cherry picked from commit 221fd84703c545408bbb4a6e0b58459651331f5c)

* bpo-38234: Fix test_embed pathconfig tests (GH-16390)

bpo-38234: On macOS and FreeBSD, the temporary directory can be
symbolic link. For example, /tmp can be a symbolic link to /var/tmp.
Call realpath() to resolve all symbolic links.

(cherry picked from commit 00508a7407d7d300b487532e2271534b20e378a7)

* bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)

* Add test_embed.test_init_setpath_config(): test Py_SetPath()
  with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
  Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import  and base_executable
  fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
  calculated base_executable: _PyConfig_InitPathConfig() copies
  executable to base_executable.
* Complete path config documentation.

(cherry picked from commit 8bf39b606ef7b02c0279a80789f3c4824b0da5e9)

* bpo-38234: Complete init config documentation (GH-16404)

(cherry picked from commit 88feaecd46a8f427e30ef7ad8cfcddfe392a2402)

* bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406)

Explicitly preinitializes with a Python preconfiguration to avoid
Py_SetPath() implicit preinitialization with a compat
preconfiguration.

Fix also test_init_setpath() and test_init_setpythonhome() on macOS:
use self.test_exe as the executable (and base_executable), rather
than shutil.which('python3').

(cherry picked from commit 49d99f01e6e51acec5ca57a02e857f0796bc418b)

* bpo-38234: Py_Initialize() sets global path configuration (GH-16421)

* Py_InitializeFromConfig() now writes PyConfig path configuration to
  the global path configuration (_Py_path_config).
* Add test_embed.test_get_pathconfig().
* Fix typo in _PyWideStringList_Join().

(cherry picked from commit 12f2f177fc483723406d7917194e7f655a20631b)

4 years agobpo-38130: Fix error in explaining when an exception is re-raised (GH-16016) (GH...
Miss Islington (bot) [Thu, 26 Sep 2019 09:16:38 +0000 (02:16 -0700)]
bpo-38130: Fix error in explaining when an exception is re-raised (GH-16016) (GH-16415)

Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>
(cherry picked from commit 1ad7be2f16cc9955f271f57a5089602bb41eee85)

Co-authored-by: Mohammad Dehghan <md.unicorn@gmail.com>
4 years agoDoc: Use the `with` statement in the first example of the ftplib doc. (GH-16271)...
Miss Islington (bot) [Thu, 26 Sep 2019 07:12:39 +0000 (00:12 -0700)]
Doc: Use the `with` statement in the first example of the ftplib doc. (GH-16271) (GH-16412)

(cherry picked from commit 5d326abf2cb4891b78d9319a81bffb3974b5b745)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
4 years ago[3.8] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16409)
Benjamin Peterson [Thu, 26 Sep 2019 04:57:14 +0000 (21:57 -0700)]
[3.8] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16409)

Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes.
(cherry picked from commit 52b940803860e37bcc3f6096b2d24e7c20a0e807)

4 years ago[3.8] bpo-22273: Changed conditions for ctypes array-in-struct handling. (GH-16381...
Vinay Sajip [Wed, 25 Sep 2019 21:41:02 +0000 (22:41 +0100)]
[3.8] bpo-22273: Changed conditions for ctypes array-in-struct handling. (GH-16381) (GH-16401)

(cherry picked from commit c64af8fad3c4f5751af624647fbb0ce023f525dc)

4 years agobpo-38271: encrypt private key test files with AES256 (GH-16385)
Miss Islington (bot) [Wed, 25 Sep 2019 16:13:54 +0000 (09:13 -0700)]
bpo-38271: encrypt private key test files with AES256 (GH-16385)

The private keys for test_ssl were encrypted with 3DES in traditional
PKCSGH-5 format. 3DES and the digest algorithm of PKCSGH-5 are blocked by
some strict crypto policies. Use PKCSGH-8 format with AES256 encryption
instead.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38271

Automerge-Triggered-By: @tiran
(cherry picked from commit bfd0c963d88f3df69489ee250655e2b8f3d235bd)

Co-authored-by: Christian Heimes <christian@python.org>
4 years agobpo-38005: Remove support of string argument in InterpreterID(). (GH-16227)
Miss Islington (bot) [Wed, 25 Sep 2019 15:56:05 +0000 (08:56 -0700)]
bpo-38005: Remove support of string argument in InterpreterID(). (GH-16227)

Make negative interpreter id to raise ValueError instead of RuntimeError.
(cherry picked from commit 543a3951a1c96bae0ea839eacec71d3b1a563a10)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years ago[3.8] bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382) (GH-16393)
Miss Islington (bot) [Wed, 25 Sep 2019 15:50:31 +0000 (08:50 -0700)]
[3.8] bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382) (GH-16393)

Make it easier to run and test Python on systems with restrict crypto policies:

* add requires_hashdigest to test.support to check if a hash digest algorithm is available and working
* avoid MD5 in test_hmac
* replace MD5 with SHA256 in test_tarfile
* mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5

https://bugs.python.org/issue38270
(cherry picked from commit c64a1a61e6fc542cada40eb069a239317e1af36e)

Co-authored-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38270

Automerge-Triggered-By: @tiran
4 years agobpo-38255: super() can search attributes as well as methods (GH-16368) (GH-16391)
Miss Islington (bot) [Wed, 25 Sep 2019 15:24:12 +0000 (08:24 -0700)]
bpo-38255: super() can search attributes as well as methods (GH-16368) (GH-16391)

Improvement suggested by Géry Ogam.
(cherry picked from commit 15ccc4fac09b866d61b069c6c136aabfe4bac09c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
4 years agobpo-36210: correct logic in setup.py for optional extensions for AIX (GH-12202) ...
Michael Felt [Wed, 25 Sep 2019 14:14:09 +0000 (15:14 +0100)]
bpo-36210: correct logic in setup.py for optional extensions for AIX (GH-12202) (GH-16376)

4 years agobpo-37064: Skip test_tools.test_pathfix if installed (GH-15705) (GH-16389)
Victor Stinner [Wed, 25 Sep 2019 14:12:32 +0000 (16:12 +0200)]
bpo-37064: Skip test_tools.test_pathfix if installed (GH-15705) (GH-16389)

If Python is installed, skip test_tools.test_pathfix test because
Tools/scripts/pathfix.py script is not installed.

(cherry picked from commit 3f43ceff186da09978d0aff257bb18b8ac7611f7)