]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314)
Victor Stinner [Thu, 2 Apr 2020 22:40:25 +0000 (00:40 +0200)] 
bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314)

test_builtin.PtyTests now registers an handler for SIGHUP signal.
Closing the PTY file descriptor can emit a SIGHUP signal: just ignore
it.

run_child() now also closes the PTY file descriptor before waiting
for the process completition, otherwise the test hangs on AIX.

5 years agolib2to3: Support named assignment expressions (GH-12702)
Tim Hatch [Thu, 2 Apr 2020 22:34:54 +0000 (15:34 -0700)] 
lib2to3: Support named assignment expressions (GH-12702)

There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.

5 years agobpo-38972: Link to instructions to change PowerShell execution policy (GH-19131)
Derek Keeler [Thu, 2 Apr 2020 19:00:21 +0000 (12:00 -0700)] 
bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131)

5 years agobpo-1635741: Fix refleak in _locale init error handling (GH-19307)
Hai Shi [Thu, 2 Apr 2020 18:00:47 +0000 (02:00 +0800)] 
bpo-1635741: Fix refleak in _locale init error handling (GH-19307)

5 years agobpo-1635741: Port resource extension module to multiphase initialization (PEP 489...
Hai Shi [Thu, 2 Apr 2020 12:35:08 +0000 (20:35 +0800)] 
bpo-1635741: Port resource extension module to multiphase initialization (PEP 489) (GH-19252)

Fix also reference leaks on error.

5 years agobpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)
Kyle Stanley [Thu, 2 Apr 2020 02:46:44 +0000 (22:46 -0400)] 
bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)

Call explicitly self.loop.shutdown_default_executor().

5 years agobpo-40094: Fix which.py script exit code (GH-19286)
Victor Stinner [Thu, 2 Apr 2020 01:42:47 +0000 (03:42 +0200)] 
bpo-40094: Fix which.py script exit code (GH-19286)

It now uses os.waitstatus_to_exitcode() to convert os.system() exit
status into an exit code.

5 years agobpo-40094: CGIHTTPRequestHandler logs exit code (GH-19285)
Victor Stinner [Thu, 2 Apr 2020 01:42:05 +0000 (03:42 +0200)] 
bpo-40094: CGIHTTPRequestHandler logs exit code (GH-19285)

CGIHTTPRequestHandler of http.server now logs the CGI script exit
code, rather than the CGI script exit status of os.waitpid().

For example, if the script is killed by signal 11, it now logs:
"CGI script exit code -11."

5 years agobpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280)
Dong-hee Na [Thu, 2 Apr 2020 00:55:43 +0000 (09:55 +0900)] 
bpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280)

5 years agobpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288)
Victor Stinner [Thu, 2 Apr 2020 00:53:33 +0000 (02:53 +0200)] 
bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288)

5 years agobpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284)
Victor Stinner [Thu, 2 Apr 2020 00:52:20 +0000 (02:52 +0200)] 
bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284)

The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-40094: mailcap.test() uses waitstatus_to_exitcode() (GH-19287)
Victor Stinner [Thu, 2 Apr 2020 00:00:06 +0000 (02:00 +0200)] 
bpo-40094: mailcap.test() uses waitstatus_to_exitcode() (GH-19287)

mailcap.test() now uses os.waitstatus_to_exitcode() to convert
os.system() exit status into an exit code.

5 years agobpo-40141: Add line and column information to ast.keyword nodes (GH-19283)
Pablo Galindo [Wed, 1 Apr 2020 23:47:39 +0000 (00:47 +0100)] 
bpo-40141: Add line and column information to ast.keyword nodes (GH-19283)

5 years agobpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)
Victor Stinner [Wed, 1 Apr 2020 16:49:29 +0000 (18:49 +0200)] 
bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)

Add os.waitstatus_to_exitcode() function to convert a wait status to an
exitcode.

Suggest waitstatus_to_exitcode() usage in the documentation when
appropriate.

Use waitstatus_to_exitcode() in:

* multiprocessing, os, subprocess and _bootsubprocess modules;
* test.support.wait_process();
* setup.py: run_command();
* and many tests.

5 years agobpo-38527: fix configure script for Solaris (GH-16845)
Arnon Yaari [Wed, 1 Apr 2020 15:19:09 +0000 (18:19 +0300)] 
bpo-38527: fix configure script for Solaris (GH-16845)

On Solaris, the regular "grep" command may be an old version that fails to search a binary file. We need to use the correct command (ggrep, in our case), which is found by the configure script earlier.

Automerge-Triggered-By: @pablogsal
5 years agobpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)
Paulo Henrique Silva [Wed, 1 Apr 2020 15:06:21 +0000 (12:06 -0300)] 
bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)

Changes on 7dd549eb0893 made _functools compatible with
PEP-489 and we could have multiple modules instances loaded.

But, right now there is no way to make `kwd_mark` global into
a per module instance variable. kwd_mark is used on lru_cache_new
which does not have a reference to a PyModule*, necessary to use
PyModule_GetState.

PEP-573 will solve this problem and will allow us to move the global
state to per-module data and properly clear the state when unloading
a module instance.

This change temporarily disable cleaning of kwd_mark to avoid NULL
pointer dereference if we clear kwd_mark and other module instances
still alive use it.

5 years agobpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for ...
Barney Gale [Wed, 1 Apr 2020 14:10:51 +0000 (15:10 +0100)] 
bpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for "closing" a path by using it as a context manager (GH-18846)

Support for using a path as a context manager remains, and is now a no-op.

5 years agobpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)
Zackery Spytz [Wed, 1 Apr 2020 13:58:55 +0000 (07:58 -0600)] 
bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)

* bpo-33262: Deprecate passing None for `s` to shlex.split()

This reads the string to split from standard input.

* Update What's New.

* Fix shlex.rst

5 years agobpo-40094: Enhance os.WIFEXITED documentation (GH-19244)
Victor Stinner [Wed, 1 Apr 2020 13:48:05 +0000 (15:48 +0200)] 
bpo-40094: Enhance os.WIFEXITED documentation (GH-19244)

5 years agobpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265)
Serhiy Storchaka [Wed, 1 Apr 2020 12:41:49 +0000 (15:41 +0300)] 
bpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265)

Make it a static function, and pass known attributes
(kind, data, length) instead of the PyUnicode object.

5 years agobpo-40121: Fix exception type in test (GH-19267)
Steve Dower [Wed, 1 Apr 2020 08:38:26 +0000 (09:38 +0100)] 
bpo-40121: Fix exception type in test (GH-19267)

5 years agoHandle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)
Pablo Galindo [Wed, 1 Apr 2020 00:48:37 +0000 (01:48 +0100)] 
Handle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)

Running `test_socket` or anything that depends on it (like python -m
test.pythoninfo) crashes if IOCTL_VM_SOCKETS_GET_LOCAL_CID does not
exist in the socket module.

Automerge-Triggered-By: @pablogsal
5 years agobpo-40094: Add missing import to wait_process() (GH-19268)
Victor Stinner [Wed, 1 Apr 2020 00:26:19 +0000 (02:26 +0200)] 
bpo-40094: Add missing import to wait_process() (GH-19268)

5 years agobpo-40094: Add run_command() to setup.py (GH-19266)
Victor Stinner [Tue, 31 Mar 2020 23:10:07 +0000 (01:10 +0200)] 
bpo-40094: Add run_command() to setup.py (GH-19266)

5 years agobpo-31160: Fix race condition in test_os.PtyTests (GH-19263)
Victor Stinner [Tue, 31 Mar 2020 22:27:18 +0000 (00:27 +0200)] 
bpo-31160: Fix race condition in test_os.PtyTests (GH-19263)

bpo-31160, bpo-40094: Wait until the process completes before closing
the PTY to prevent sending SIGHUP to the child process.

5 years agobpo-40094: Add _bootsubprocess._waitstatus_to_exitcode (GH-19264)
Victor Stinner [Tue, 31 Mar 2020 21:45:13 +0000 (23:45 +0200)] 
bpo-40094: Add _bootsubprocess._waitstatus_to_exitcode (GH-19264)

* Add _waitstatus_to_exitcode() helper function to _bootsubprocess.
* Enhance check_output() error message if the command fails.

_bootsubprocess no longer handles WIFSTOPPED() case: it now raises a
ValueError.

5 years agobpo-39943: Clean up marshal.c. (GH-19236)
Serhiy Storchaka [Tue, 31 Mar 2020 20:23:21 +0000 (23:23 +0300)] 
bpo-39943: Clean up marshal.c. (GH-19236)

* Add consts.
* Remove redundant casts and checks.
* Use concrete C API macros.
* Avoid raising and silencing OverflowError for ints.

5 years agobpo-40094: Enhance threading tests (GH-19260)
Victor Stinner [Tue, 31 Mar 2020 19:49:44 +0000 (21:49 +0200)] 
bpo-40094: Enhance threading tests (GH-19260)

* Rewrite test_thread.test_forkinthread() to use
  support.wait_process() and wait for the child process in the main
  thread, not in the spawned thread.
* test_threading now uses support.wait_process() and checks the child
  process exit code to detect crashes.

5 years agobpo-40094: Enhance fork and wait tests (GH-19259)
Victor Stinner [Tue, 31 Mar 2020 19:46:40 +0000 (21:46 +0200)] 
bpo-40094: Enhance fork and wait tests (GH-19259)

* test_fork1: remove duplicated wait_impl() method: reuse
  fork_wait.py implementation instead.
* Use exit code different than 0 to ensure that we executed the
  expected code path.

5 years agobpo-40094: Add test.support.wait_process() (GH-19254)
Victor Stinner [Tue, 31 Mar 2020 18:08:12 +0000 (20:08 +0200)] 
bpo-40094: Add test.support.wait_process() (GH-19254)

Moreover, the following tests now check the child process exit code:

* test_os.PtyTests
* test_mailbox.test_lock_conflict()
* test_tempfile.test_process_awareness()
* test_uuid.testIssue8621()
* multiprocessing resource tracker tests

5 years agoDocument most common signals (GH-19245)
Victor Stinner [Tue, 31 Mar 2020 17:13:10 +0000 (19:13 +0200)] 
Document most common signals (GH-19245)

Document individual signals (only the most common signals):
description, default action, availability.

5 years agocloses bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)
Benjamin Peterson [Tue, 31 Mar 2020 15:49:56 +0000 (10:49 -0500)] 
closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)

5 years agobpo-40003: test.bisect_cmd copies Python options (GH-19246)
Victor Stinner [Tue, 31 Mar 2020 15:25:56 +0000 (17:25 +0200)] 
bpo-40003: test.bisect_cmd copies Python options (GH-19246)

test.bisect_cmd now copies Python command line options like -O or -W.
Moreover, emit a warning if test.bisect_cmd is used with
-w/--verbose2 option.

5 years agobpo-32591: _PyErr_WarnUnawaitedCoroutine() sets source (GH-19247)
Victor Stinner [Tue, 31 Mar 2020 15:25:12 +0000 (17:25 +0200)] 
bpo-32591: _PyErr_WarnUnawaitedCoroutine() sets source (GH-19247)

The _PyErr_WarnUnawaitedCoroutine() fallback now also sets the
coroutine object as the source of the warning, as done by the Python
implementation warnings._warn_unawaited_coroutine().

Moreover, don't truncate the coroutine name: Python supports
arbitrary string length to format the message.

5 years agobpo-1635741: Port math module to multiphase initialization (GH-19243)
Dong-hee Na [Tue, 31 Mar 2020 14:33:22 +0000 (23:33 +0900)] 
bpo-1635741: Port math module to multiphase initialization (GH-19243)

5 years agobpo-1635741: Port _uuid module to multiphase initialization (GH-19242)
Dong-hee Na [Tue, 31 Mar 2020 12:43:47 +0000 (21:43 +0900)] 
bpo-1635741: Port _uuid module to multiphase initialization (GH-19242)

5 years agobpo-40121: Fixes audit event raised on creating a new socket (GH-19238)
Steve Dower [Tue, 31 Mar 2020 11:38:53 +0000 (12:38 +0100)] 
bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)

5 years agobpo-40108: Improve the error message in runpy when importing a module that includes...
Pablo Galindo [Tue, 31 Mar 2020 11:23:55 +0000 (12:23 +0100)] 
bpo-40108: Improve the error message in runpy when importing a module that includes the extension (GH-19239)

5 years agofix comma location in various places (GH-19233)
Mathieu Dupuy [Mon, 30 Mar 2020 21:28:25 +0000 (23:28 +0200)] 
fix comma location in various places (GH-19233)

5 years agobpo-40020: Fix realloc leak on failure in growable_comment_array_add (GH-19083)
Alexander Riccio [Mon, 30 Mar 2020 21:15:59 +0000 (17:15 -0400)] 
bpo-40020: Fix realloc leak on failure in growable_comment_array_add (GH-19083)

Fix a leak and subsequent crash in parsetok.c caused by realloc misuse on a rare codepath.

Realloc returns a null pointer on failure, and then growable_comment_array_deallocate crashes later when it dereferences it.

5 years agobpo-39943: Remove unnecessary casts in import.c that remove constness (GH-19209)
Andy Lester [Mon, 30 Mar 2020 20:19:14 +0000 (15:19 -0500)] 
bpo-39943: Remove unnecessary casts in import.c that remove constness (GH-19209)

5 years agoFix bug in test_collections.py (#19221)
Curtis Bucher [Mon, 30 Mar 2020 16:50:57 +0000 (09:50 -0700)] 
Fix bug in test_collections.py (#19221)

Test in TestChainMap() line 257 did not properly check union behavior.

5 years agobpo-8901: Windows registry path is now ignored with the -E option (GH-18169)
Zackery Spytz [Mon, 30 Mar 2020 16:04:45 +0000 (10:04 -0600)] 
bpo-8901: Windows registry path is now ignored with the -E option (GH-18169)

5 years agobpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202)
Dong-hee Na [Mon, 30 Mar 2020 14:35:38 +0000 (23:35 +0900)] 
bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202)

Replace statically allocated types with heap allocated types:
use PyType_FromSpec().

Add a module state to store the _abc_data_type.
Add traverse, clear and free functions to the module.

5 years agobpo-37207: Use vectorcall for list() (GH-18928)
Petr Viktorin [Mon, 30 Mar 2020 12:16:16 +0000 (14:16 +0200)] 
bpo-37207: Use vectorcall for list() (GH-18928)

Speed up calls to list() by using the PEP 590 vectorcall
calling convention. Patch by Mark Shannon.

Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
5 years agobpo-39073: validate Address parts to disallow CRLF (#19007)
Ashwin Ramaswami [Mon, 30 Mar 2020 00:38:41 +0000 (20:38 -0400)] 
bpo-39073: validate Address parts to disallow CRLF (#19007)

 Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.

5 years agobpo-40096: Support __attribute__((__noreturn__)) on xlc (GH-19204)
Batuhan Taşkaya [Sun, 29 Mar 2020 15:52:32 +0000 (18:52 +0300)] 
bpo-40096: Support __attribute__((__noreturn__)) on xlc (GH-19204)

5 years agobpo-40024: Update _elementtree to use PyModule_AddType() (GH-19205)
Dong-hee Na [Sun, 29 Mar 2020 14:12:11 +0000 (23:12 +0900)] 
bpo-40024: Update _elementtree to use PyModule_AddType() (GH-19205)

5 years agobpo-38002: Use False/True for IDLE pyshell bools (GH-19203)
Terry Jan Reedy [Sat, 28 Mar 2020 16:51:21 +0000 (12:51 -0400)] 
bpo-38002: Use False/True for IDLE pyshell bools (GH-19203)

Change 0/1 assignments to 'executing', 'canceled', 'reading', 'endoffile'.
These are not used outside of pyshell. Other bools already use False/True.
Add comment about int needed for Windows call.
Remove self.more, unused in idlelib and code.InteractiveInterpreter.
The latter uses 'more' as a local.

5 years agobpo-40086: Update/fix test_etree test case in test_typing (GH-19189)
Furkan Önder [Sat, 28 Mar 2020 12:32:36 +0000 (15:32 +0300)] 
bpo-40086: Update/fix test_etree test case in test_typing (GH-19189)

5 years agobpo-36543: What's new: Document how to replace xml.etree.cElementTree (GH-19188)
Miro Hrončok [Fri, 27 Mar 2020 19:59:02 +0000 (20:59 +0100)] 
bpo-36543: What's new: Document how to replace xml.etree.cElementTree (GH-19188)

5 years agobpo-39812: Remove daemon threads in concurrent.futures (GH-19149)
Kyle Stanley [Fri, 27 Mar 2020 19:31:22 +0000 (15:31 -0400)] 
bpo-39812: Remove daemon threads in concurrent.futures (GH-19149)

Remove daemon threads from :mod:`concurrent.futures` by adding
an internal `threading._register_atexit()`, which calls registered functions
prior to joining all non-daemon threads. This allows for compatibility
with subinterpreters, which don't support daemon threads.

5 years agobpo-40045: Make "dunder" method documentation easier to locate (#19153)
Javad Mokhtari [Fri, 27 Mar 2020 19:02:51 +0000 (23:32 +0430)] 
bpo-40045: Make "dunder" method documentation easier to locate (#19153)

* issue 40045

* Update lexical_analysis.rst

Make "dunder" method documentation easier(GH-19153)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
5 years agobpo-40089: Fix threading._after_fork() (GH-19191)
Victor Stinner [Fri, 27 Mar 2020 16:50:42 +0000 (17:50 +0100)] 
bpo-40089: Fix threading._after_fork() (GH-19191)

If fork was not called by a thread spawned by threading.Thread,
threading._after_fork() now creates a _MainThread instance for
_main_thread, instead of a _DummyThread instance.

5 years agobpo-38237: Use divmod for positional arguments whatsnew example (GH-19171)
Ammar Askar [Fri, 27 Mar 2020 16:37:43 +0000 (09:37 -0700)] 
bpo-38237: Use divmod for positional arguments whatsnew example (GH-19171)

5 years agobpo-38644: Use _PySys_Audit(): pass tstate explicitly (GH-19183)
Victor Stinner [Fri, 27 Mar 2020 14:11:45 +0000 (15:11 +0100)] 
bpo-38644: Use _PySys_Audit(): pass tstate explicitly (GH-19183)

Add the dependency to tstate more explicit.

5 years agobpo-40077: Convert _json module to use PyType_FromSpec() (GH-19177)
Dong-hee Na [Fri, 27 Mar 2020 10:59:59 +0000 (19:59 +0900)] 
bpo-40077: Convert _json module to use PyType_FromSpec() (GH-19177)

Replace statically allocated types with heap allocated types:
use PyType_FromSpec().

Add a module state to store the Scanner and Encoder types.
Add traverse, clear and free functions to the module.

5 years agobpo-38644: Make tstate more explicit inside pystate.c (GH-19182)
Victor Stinner [Thu, 26 Mar 2020 21:46:14 +0000 (22:46 +0100)] 
bpo-38644: Make tstate more explicit inside pystate.c (GH-19182)

Fix PyInterpreterState_New(): Don't call PyErr_SetString() when there
is no current Python thread state (if tstate is NULL).

5 years agobpo-38644: Pass tstate explicitly in signalmodule.c (GH-19184)
Victor Stinner [Thu, 26 Mar 2020 21:28:11 +0000 (22:28 +0100)] 
bpo-38644: Pass tstate explicitly in signalmodule.c (GH-19184)

PyOS_InterruptOccurred() now checks _Py_ThreadCanHandleSignals()
before checking if SIGINT is tripped.

5 years agobpo-38644: Add _PySys_Audit() which takes tstate (GH-19180)
Victor Stinner [Thu, 26 Mar 2020 17:57:32 +0000 (18:57 +0100)] 
bpo-38644: Add _PySys_Audit() which takes tstate (GH-19180)

Add _PySys_Audit() function to the internal C API: similar to
PySys_Audit(), but requires a mandatory tstate parameter.

Cleanup sys_audit_tstate() code: remove code path for NULL tstate,
since the function exits at entry if tstate is NULL. Remove also code
path for NULL tstate->interp: should_audit() now ensures that it is
not NULL (even if tstate->interp cannot be NULL in practice).

PySys_AddAuditHook() now checks if tstate is not NULL to decide if
tstate can be used or not, and tstate is set to NULL if the runtime
is not initialized yet.

Use _PySys_Audit() in sysmodule.c.

5 years agobpo-1812: Fix newline conversion when doctest.testfile loads from a package whose...
Peter Donis [Thu, 26 Mar 2020 15:53:16 +0000 (11:53 -0400)] 
bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385)

This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method.

5 years agobpo-39879: Update datamodel docs to include dict ordering (GH-19006)
Lahfa Samy [Thu, 26 Mar 2020 14:54:04 +0000 (15:54 +0100)] 
bpo-39879: Update datamodel docs to include dict ordering (GH-19006)

Co-authored-by: furkanonder <furkantahaonder@gmail.com>
5 years agobpo-40069: Clear out .lst files on make clean (GH-19169)
Batuhan Taşkaya [Thu, 26 Mar 2020 13:10:04 +0000 (16:10 +0300)] 
bpo-40069: Clear out .lst files on make clean (GH-19169)

Files created on AIX by xlc (C compiler).

5 years agobpo-40071: Fix refleak in _functools module (GH19172)
Paulo Henrique Silva [Thu, 26 Mar 2020 12:47:45 +0000 (09:47 -0300)] 
bpo-40071: Fix refleak in _functools module (GH19172)

5 years agobpo-38410: Properly handle PySys_Audit() failures (GH-16657)
Zackery Spytz [Thu, 26 Mar 2020 12:11:13 +0000 (06:11 -0600)] 
bpo-38410: Properly handle PySys_Audit() failures (GH-16657)

5 years agobpo-39943: Properly const the pointers in dictkeys_get_index (GH-19170)
Andy Lester [Thu, 26 Mar 2020 04:13:01 +0000 (23:13 -0500)] 
bpo-39943: Properly const the pointers in dictkeys_get_index (GH-19170)

5 years agobpo-40067: Improve error messages for multiple star expressions in assignments (GH...
Furkan Önder [Thu, 26 Mar 2020 01:54:31 +0000 (04:54 +0300)] 
bpo-40067: Improve error messages for multiple star expressions in assignments (GH-19168)

Co-Authored-By: Batuhan Taşkaya <isidentical@gmail.com>
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-39947: Add PyThreadState_GetID() function (GH-19163)
Victor Stinner [Wed, 25 Mar 2020 20:23:53 +0000 (21:23 +0100)] 
bpo-39947: Add PyThreadState_GetID() function (GH-19163)

Add PyThreadState_GetID() function: get the unique identifier of a
Python thread state.

5 years agobpo-39947: Add _PyThreadState_GetDict() function (GH-19160)
Victor Stinner [Wed, 25 Mar 2020 20:22:55 +0000 (21:22 +0100)] 
bpo-39947: Add _PyThreadState_GetDict() function (GH-19160)

5 years agobpo-19698: Document when importlib.machinery.FrozenImporter gained spec-related metho...
Brett Cannon [Wed, 25 Mar 2020 18:57:47 +0000 (11:57 -0700)] 
bpo-19698: Document when importlib.machinery.FrozenImporter gained spec-related methods (GH-19158)

5 years agobpo-39947: Use PyThreadState_GetFrame() (GH-19159)
Victor Stinner [Wed, 25 Mar 2020 18:52:02 +0000 (19:52 +0100)] 
bpo-39947: Use PyThreadState_GetFrame() (GH-19159)

_tracemalloc.c and _xxsubinterpretersmodule.c use
PyThreadState_GetFrame() and PyThreadState_GetInterpreter() to no
longer depend on the PyThreadState structure.

5 years agobpo-40016: re docstring: Clarify relationship of inline and argument flags (#19078)
Ram Rachum [Wed, 25 Mar 2020 18:44:47 +0000 (20:44 +0200)] 
bpo-40016: re docstring: Clarify relationship of inline and argument flags (#19078)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)
Victor Stinner [Wed, 25 Mar 2020 18:27:36 +0000 (19:27 +0100)] 
bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)

5 years agobpo-40050: Rephrase NEWS entry (GH-19148)
Victor Stinner [Wed, 25 Mar 2020 17:31:55 +0000 (18:31 +0100)] 
bpo-40050: Rephrase NEWS entry (GH-19148)

5 years agoUse calloc-based functions, not malloc. (GH-19152)
Andy Lester [Wed, 25 Mar 2020 04:26:44 +0000 (23:26 -0500)] 
Use calloc-based functions, not malloc. (GH-19152)

5 years agobpo-1635741: Port _functools module to multiphase initialization (PEP 489) (GH-19151)
Paulo Henrique Silva [Wed, 25 Mar 2020 02:19:58 +0000 (23:19 -0300)] 
bpo-1635741: Port _functools module to multiphase initialization (PEP 489) (GH-19151)

5 years agobpo-1635741: Port operator module to multiphase initialization (PEP 489) (GH-19150)
Paulo Henrique Silva [Wed, 25 Mar 2020 02:18:47 +0000 (23:18 -0300)] 
bpo-1635741: Port operator module to multiphase initialization (PEP 489) (GH-19150)

5 years agobpo-36144: Add union operators to WeakValueDictionary584 (#19127)
Curtis Bucher [Wed, 25 Mar 2020 01:51:29 +0000 (18:51 -0700)] 
bpo-36144: Add union operators to WeakValueDictionary584 (#19127)

5 years agobpo-40024: Update C extension modules to use PyModule_AddType() (GH-19119)
Dong-hee Na [Tue, 24 Mar 2020 22:08:51 +0000 (07:08 +0900)] 
bpo-40024: Update C extension modules to use PyModule_AddType() (GH-19119)

Update _asyncio, _bz2, _csv, _curses, _datetime,
_io, _operator, _pickle, _queue, blake2,
multibytecodec and overlapped C extension modules
to use PyModule_AddType().

5 years agobpo-40029 mark test_importlib.test_zip as requiring zlib (#19105)
Roman Yurchak [Tue, 24 Mar 2020 19:02:53 +0000 (20:02 +0100)] 
bpo-40029 mark test_importlib.test_zip as requiring zlib (#19105)

* bpo-40029 mark test_importlib.test_zip as requiring zlib

* Decorate TestZip / TestEgg classes as requiring zlib

5 years agobpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489...
Victor Stinner [Tue, 24 Mar 2020 17:31:19 +0000 (18:31 +0100)] 
bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19140)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
5 years agobpo-40014: Fix os.getgrouplist() (GH-19126)
Victor Stinner [Tue, 24 Mar 2020 17:22:10 +0000 (18:22 +0100)] 
bpo-40014: Fix os.getgrouplist() (GH-19126)

Fix os.getgrouplist(): if getgrouplist() function fails because the
group list is too small, retry with a larger group list.

On failure, the glibc implementation of getgrouplist() sets ngroups
to the total number of groups. For other implementations, double the
group list size.

5 years agobpo-40013: Clarify documentation of restval in csv.DictReader (GH-19099)
Juhana Jauhiainen [Tue, 24 Mar 2020 17:11:42 +0000 (19:11 +0200)] 
bpo-40013: Clarify documentation of restval in csv.DictReader (GH-19099)

5 years agobpo-40050: Fix importlib._bootstrap_external (GH-19135)
Victor Stinner [Tue, 24 Mar 2020 17:03:34 +0000 (18:03 +0100)] 
bpo-40050: Fix importlib._bootstrap_external (GH-19135)

Remove two unused imports: _thread and _weakref. Avoid creating a new
winreg builtin module if it's already available in sys.modules.

The winreg module is now stored as "winreg" rather than "_winreg".

5 years agoClarify a guarantee of the logging module. (GH-19132)
Gregory P. Smith [Tue, 24 Mar 2020 16:48:32 +0000 (09:48 -0700)] 
Clarify a guarantee of the logging module. (GH-19132)

When no additional arguments are passed to logging.debug() and related
methods, no % operation is performed on the passed in message.

5 years agobpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120)
Victor Stinner [Tue, 24 Mar 2020 15:32:26 +0000 (16:32 +0100)] 
bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120)

PyThreadState.frame is a borrowed reference, not a strong reference:
PyThreadState_Clear() must not call Py_CLEAR(tstate->frame).

Remove test_threading.test_warnings_at_exit(): we cannot warranty
that the Python thread state of daemon threads is cleared in a
reliable way during Python shutdown.

5 years agobpo-39689: Do not use native packing for format "?" with standard size (GH-18969)
Stefan Krah [Tue, 24 Mar 2020 13:01:13 +0000 (14:01 +0100)] 
bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)

5 years agocloses bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096)
Russell Owen [Tue, 24 Mar 2020 03:41:40 +0000 (20:41 -0700)] 
closes bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agoUpdated documentation for FOR_ITER (GH-19113)
laike9m [Tue, 24 Mar 2020 01:03:06 +0000 (18:03 -0700)] 
Updated documentation for FOR_ITER (GH-19113)

Added a comma to make the sentence less confusing.

5 years agoRevert "bpo-1635741: Port _weakref extension module to multiphase initialization...
Victor Stinner [Mon, 23 Mar 2020 23:48:03 +0000 (00:48 +0100)] 
Revert "bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19084)" (#19128)

bpo-1635741, bpo-40050: This reverts
commit 8334f30a74abcf7e469b901afc307887aa85a888.

5 years agoPost 3.9.0a5
Łukasz Langa [Mon, 23 Mar 2020 22:00:48 +0000 (23:00 +0100)] 
Post 3.9.0a5

5 years agoMerge tag 'v3.9.0a5'
Łukasz Langa [Mon, 23 Mar 2020 22:00:18 +0000 (23:00 +0100)] 
Merge tag 'v3.9.0a5'

Python 3.9.0a5

5 years agobpo-36144: Add union operators to WeakKeyDictionary (#19106)
Curtis Bucher [Mon, 23 Mar 2020 20:49:46 +0000 (13:49 -0700)] 
bpo-36144: Add union operators to WeakKeyDictionary (#19106)

5 years agobpo-40036: Deleting duplicates in itertoolsmodule.c (GH-18958)
AlphaHot [Mon, 23 Mar 2020 20:14:39 +0000 (01:14 +0500)] 
bpo-40036: Deleting duplicates in itertoolsmodule.c (GH-18958)

5 years agobpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)
Curtis Bucher [Mon, 23 Mar 2020 19:02:05 +0000 (12:02 -0700)] 
bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)

* Update ChainMap to include | and |=

Created __ior__, __or__ and __ror__ methods in ChainMap class.

* Update ACKS

* Update docs

* Update test_collections.py to include test_issue584().

Added testing for | and |= operators for ChainMap objects.

* Update test_union_operators

Renamed test_union operators, fixed errors and style problems raised by brandtbucher.

* Update test_union_operators in TestChainMap

Added testing for union operator between ChainMap and iterable of key-value pairs.

* Update test_union operators in test_collections.py

Gave more descriptive variable names and eliminated unnecessary tmp variable.

* Update test_union_operators in test_collections.py

Added cm3

* Check .maps rather than Chainmap equality.

* Add news entry

* Update Lib/test/test_collections.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
* Removed whitespace

* Added Guido's changes

* Fixed Docs

* Removed whitespace

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
5 years agobpo-40014: Fix os.getgrouplist() on macOS (GH-19118)
Victor Stinner [Mon, 23 Mar 2020 19:00:57 +0000 (20:00 +0100)] 
bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)

On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.

5 years agobpo-1635741: Port time module to multiphase initialization (PEP 489) (GH-19107)
Paulo Henrique Silva [Mon, 23 Mar 2020 18:58:23 +0000 (15:58 -0300)] 
bpo-1635741: Port time module to multiphase initialization (PEP 489) (GH-19107)

5 years agoPython 3.9.0a5 v3.9.0a5
Łukasz Langa [Mon, 23 Mar 2020 16:19:13 +0000 (17:19 +0100)] 
Python 3.9.0a5

5 years agobpo-39830: Add zipfile.Path to __all__ (GH-19115)
Zackery Spytz [Mon, 23 Mar 2020 13:29:36 +0000 (07:29 -0600)] 
bpo-39830: Add zipfile.Path to __all__ (GH-19115)

5 years agobpo-39999: Improve compatibility of the ast module. (GH-19056)
Serhiy Storchaka [Sun, 22 Mar 2020 18:33:34 +0000 (20:33 +0200)] 
bpo-39999: Improve compatibility of the ast module. (GH-19056)

* Re-add removed classes Suite, slice, Param, AugLoad and AugStore.
* Add docstrings for dummy classes.
* Add docstrings for attribute aliases.
* Set __module__ to "ast" instead of "_ast".