]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-40898: Remove redundant if statements in tp_traverse (GH-20692)
Hai Shi [Sun, 7 Jun 2020 12:05:36 +0000 (20:05 +0800)] 
bpo-40898: Remove redundant if statements in tp_traverse (GH-20692)

5 years agoFix return type of test helper function heapctypewithbuffer_releasebuffer() (GH-20685)
Rémi Lapeyre [Sun, 7 Jun 2020 07:05:33 +0000 (09:05 +0200)] 
Fix return type of test helper function heapctypewithbuffer_releasebuffer() (GH-20685)

5 years agoUpdate comments to reflect the current API (GH-20682)
Raymond Hettinger [Sat, 6 Jun 2020 19:42:54 +0000 (12:42 -0700)] 
Update comments to reflect the current API (GH-20682)

5 years agobpo-40724: Support setting buffer slots from type specs (GH-20648)
scoder [Sat, 6 Jun 2020 19:35:10 +0000 (21:35 +0200)] 
bpo-40724: Support setting buffer slots from type specs (GH-20648)

This is not part of the limited API but makes the buffer slots available for type specs.

5 years agobpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
Batuhan Taskaya [Sat, 6 Jun 2020 12:44:16 +0000 (15:44 +0300)] 
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)

5 years ago[workflow] Use gcc problem matcher for Ubuntu action build (GH-18567)
Ammar Askar [Sat, 6 Jun 2020 11:21:46 +0000 (11:21 +0000)] 
[workflow] Use gcc problem matcher for Ubuntu action build (GH-18567)

5 years agoRefactor scripts in Tools/peg_generator/scripts (GH-20401)
Lysandros Nikolaou [Sat, 6 Jun 2020 04:21:40 +0000 (07:21 +0300)] 
Refactor scripts in Tools/peg_generator/scripts (GH-20401)

5 years agobpo-40880: Fix invalid read in newline_in_string in pegen.c (#20666)
Pablo Galindo [Fri, 5 Jun 2020 23:52:27 +0000 (00:52 +0100)] 
bpo-40880: Fix invalid read in newline_in_string in pegen.c (#20666)

* bpo-40880: Fix invalid read in newline_in_string in pegen.c

* Update Parser/pegen/pegen.c

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* Add NEWS entry

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
5 years agobpo-40883: Fix memory leak in fstring_compile_expr in parse_string.c (GH-20667)
Pablo Galindo [Fri, 5 Jun 2020 23:52:15 +0000 (00:52 +0100)] 
bpo-40883: Fix memory leak in fstring_compile_expr in parse_string.c (GH-20667)

5 years agobpo-40862: Raise TypeError when const is given to argparse.BooleanOptionalAction...
Rémi Lapeyre [Fri, 5 Jun 2020 22:00:42 +0000 (00:00 +0200)] 
bpo-40862: Raise TypeError when const is given to argparse.BooleanOptionalAction (GH-20623)

5 years agobpo-40867: Remove unused include from Module/_randommodule.c (GH-20635)
Erlend Egeberg Aasland [Fri, 5 Jun 2020 21:32:09 +0000 (23:32 +0200)] 
bpo-40867: Remove unused include from Module/_randommodule.c (GH-20635)

5 years agobpo-40876: Clarify error message in the csv module (GH-20653)
Ram Rachum [Fri, 5 Jun 2020 20:56:06 +0000 (23:56 +0300)] 
bpo-40876: Clarify error message in the csv module (GH-20653)

5 years agobpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)
Jason R. Coombs [Fri, 5 Jun 2020 20:34:16 +0000 (16:34 -0400)] 
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)

* Refresh importlib.metadata from importlib_metadata 1.6.1.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agoFix missing FloatOperation in EXTRA_FUNCTIONALITY path. (#20655)
Stefan Krah [Fri, 5 Jun 2020 20:01:18 +0000 (22:01 +0200)] 
Fix missing FloatOperation in EXTRA_FUNCTIONALITY path. (#20655)

5 years agobpo-19468: delete unnecessary instance check in importlib.reload() (GH-19424)
Furkan Önder [Fri, 5 Jun 2020 19:56:32 +0000 (22:56 +0300)] 
bpo-19468: delete unnecessary instance check in importlib.reload() (GH-19424)

Automerge-Triggered-By: @brettcannon
5 years agobpo-40874: Update to libmpdec-2.5.0 (GH-20652)
Stefan Krah [Fri, 5 Jun 2020 17:43:01 +0000 (19:43 +0200)] 
bpo-40874: Update to libmpdec-2.5.0 (GH-20652)

5 years agobpo-1635741: Port mmap module to multiphase initialization (GH-19459)
Dong-hee Na [Fri, 5 Jun 2020 15:01:02 +0000 (00:01 +0900)] 
bpo-1635741: Port mmap module to multiphase initialization (GH-19459)

5 years agobpo-40521: Make context free list per-interpreter (GH-20644)
Victor Stinner [Fri, 5 Jun 2020 00:56:37 +0000 (02:56 +0200)] 
bpo-40521: Make context free list per-interpreter (GH-20644)

Each interpreter now has its own context free list:

* Move context free list into PyInterpreterState.
* Add _Py_context_state structure.
* Add tstate parameter to _PyContext_ClearFreeList()
  and _PyContext_Fini().
* Pass tstate to clear_freelists().

5 years agobpo-40521: Make async gen free lists per-interpreter (GH-20643)
Victor Stinner [Fri, 5 Jun 2020 00:34:14 +0000 (02:34 +0200)] 
bpo-40521: Make async gen free lists per-interpreter (GH-20643)

Each interpreter now has its own asynchronous generator free lists:

* Move async gen free lists into PyInterpreterState.
* Move _PyAsyncGen_MAXFREELIST define to pycore_interp.h
* Add _Py_async_gen_state structure.
* Add tstate parameter to _PyAsyncGen_ClearFreeLists
  and _PyAsyncGen_Fini().

5 years agobpo-40521: Make list free list per-interpreter (GH-20642)
Victor Stinner [Fri, 5 Jun 2020 00:05:41 +0000 (02:05 +0200)] 
bpo-40521: Make list free list per-interpreter (GH-20642)

Each interpreter now has its own list free list:

* Move list numfree and free_list into PyInterpreterState.
* Add _Py_list_state structure.
* Add tstate parameter to _PyList_ClearFreeList()
  and _PyList_Fini().
* Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".
* _PyGC_Fini() clears gcstate->garbage list which can be stored in
  the list free list. Call _PyGC_Fini() before _PyList_Fini() to
  prevent leaking this list.

5 years agobpo-40807: Show warnings once from codeop._maybe_compile (#20486)
Cheryl Sabella [Thu, 4 Jun 2020 23:40:24 +0000 (19:40 -0400)] 
bpo-40807: Show warnings once from codeop._maybe_compile (#20486)

* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-40521: Make frame free list per-interpreter (GH-20638)
Victor Stinner [Thu, 4 Jun 2020 23:39:24 +0000 (01:39 +0200)] 
bpo-40521: Make frame free list per-interpreter (GH-20638)

Each interpreter now has its own frame free list:

* Move frame free list into PyInterpreterState.
* Add _Py_frame_state structure.
* Add tstate parameter to _PyFrame_ClearFreeList()
  and _PyFrame_Fini().
* Remove "#if PyFrame_MAXFREELIST > 0".
* Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".

5 years agobpo-40521: Make slice cache per-interpreter (GH-20637)
Victor Stinner [Thu, 4 Jun 2020 23:14:40 +0000 (01:14 +0200)] 
bpo-40521: Make slice cache per-interpreter (GH-20637)

Each interpreter now has its own slice cache:

* Move slice cache into PyInterpreterState.
* Add tstate parameter to _PySlice_Fini().

5 years agobpo-40521: Make float free list per-interpreter (GH-20636)
Victor Stinner [Thu, 4 Jun 2020 22:50:05 +0000 (00:50 +0200)] 
bpo-40521: Make float free list per-interpreter (GH-20636)

Each interpreter now has its own float free list:

* Move tuple numfree and free_list into PyInterpreterState.
* Add _Py_float_state structure.
* Add tstate parameter to _PyFloat_ClearFreeList()
  and _PyFloat_Fini().

5 years agobpo-40521: Make tuple free list per-interpreter (GH-20247)
Victor Stinner [Thu, 4 Jun 2020 21:38:36 +0000 (23:38 +0200)] 
bpo-40521: Make tuple free list per-interpreter (GH-20247)

Each interpreter now has its own tuple free lists:

* Move tuple numfree and free_list arrays into PyInterpreterState.
* Define PyTuple_MAXSAVESIZE and PyTuple_MAXFREELIST macros in
  pycore_interp.h.
* Add _Py_tuple_state structure. Pass it explicitly to tuple_alloc().
* Add tstate parameter to _PyTuple_ClearFreeList()
* Each interpreter now has its own empty tuple singleton.

5 years agobpo-39573: Porting to Python 3.10: Py_SET_SIZE() macro (GH-20610)
Victor Stinner [Thu, 4 Jun 2020 20:10:43 +0000 (22:10 +0200)] 
bpo-39573: Porting to Python 3.10: Py_SET_SIZE() macro (GH-20610)

In What's New in Python 3.10, propose Py_SET_SIZE(), Py_SET_REFCNT()
and Py_SET_TYPE() macros for backward compatibility with Python 3.9
and older.

5 years agobpo-40865: Remove unused insint() macro from hash modules (GH-20627)
Erlend Egeberg Aasland [Thu, 4 Jun 2020 20:08:42 +0000 (22:08 +0200)] 
bpo-40865: Remove unused insint() macro from hash modules (GH-20627)

Automerge-Triggered-By: @tiran
5 years agoFix spacing in docs for tarfile (GH-20629)
Harsha Laxman [Thu, 4 Jun 2020 19:58:10 +0000 (12:58 -0700)] 
Fix spacing in docs for tarfile (GH-20629)

Before
```
content.txt is 42 bytes in size and isa regular file.
folder is 420 bytes in size and isa directory.
magic is 4200 bytes in size and issomething else.
```

After:
```
content.txt is 42 bytes in size and is a regular file.
folder is 420 bytes in size and is a directory.
magic is 4200 bytes in size and is something else.
```

Automerge-Triggered-By: @orsenthil
5 years agobpo-40679: Fix _PyEval_EvalCode() crash if qualname is NULL (GH-20615)
Victor Stinner [Thu, 4 Jun 2020 13:19:02 +0000 (15:19 +0200)] 
bpo-40679: Fix _PyEval_EvalCode() crash if qualname is NULL (GH-20615)

If name is NULL, name is now set to co->co_name.
If qualname is NULL, qualname is now set to name.

qualname must not be NULL: it is used to build error messages.

Cleanup also the code: declare variables where they are initialized.
Rename "name" local variables to "varname" to avoid overriding "name"
parameter.

5 years agobpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)
Christian Heimes [Thu, 4 Jun 2020 12:48:17 +0000 (14:48 +0200)] 
bpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)

Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agoDon't raise an exception on normal return from generator. (GH-19473)
Mark Shannon [Thu, 4 Jun 2020 12:23:35 +0000 (13:23 +0100)] 
Don't raise an exception on normal return from generator. (GH-19473)

5 years agoFix MSVC warning in frameobject.c (GH-20590)
Ammar Askar [Thu, 4 Jun 2020 05:19:23 +0000 (05:19 +0000)] 
Fix MSVC warning in frameobject.c (GH-20590)

5 years agoRemove unused ReaderObject_Check macro (#20614)
Dong-hee Na [Wed, 3 Jun 2020 15:43:46 +0000 (00:43 +0900)] 
Remove unused ReaderObject_Check macro (#20614)

5 years agoUpdate error message in _zoneinfo.py to use f-string (GH-20577)
aboddie [Wed, 3 Jun 2020 14:18:19 +0000 (10:18 -0400)] 
Update error message in _zoneinfo.py to use f-string (GH-20577)

Inline with the rest of the file, updated error message to use f-string.

5 years agobpo-40471: Fix grammar typo in 'issubclass' docstring (GH-19847)
Alex Povel [Wed, 3 Jun 2020 13:19:45 +0000 (15:19 +0200)] 
bpo-40471: Fix grammar typo in 'issubclass' docstring (GH-19847)

Just a brief grammar fix.

See also <>.

5 years agobpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)
Jeremy Attali [Wed, 3 Jun 2020 12:42:33 +0000 (08:42 -0400)] 
bpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)

Would be nice to backport to python 3.7+. I don't think it's worth the hassle to backport this all the way down to 3.10. But I'll let the maintainers decide.

This is hard to test because the test setup already includes this [environment variable](https://github.com/python/cpython/blob/master/Lib/test/pythoninfo.py#L292)

Let me know if something doesn't match the PR guidelines. This is my first PR in the python source code.

5 years agobpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)
Victor Stinner [Wed, 3 Jun 2020 12:39:59 +0000 (14:39 +0200)] 
bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

5 years agobpo-32604: Fix reference leak in select module (GH-20600)
Victor Stinner [Wed, 3 Jun 2020 12:36:46 +0000 (14:36 +0200)] 
bpo-32604: Fix reference leak in select module (GH-20600)

Fix reference leak in PyInit_select() of the select module:
remove Py_INCREF(poll_Type).

5 years agoPyOS_AfterFork_Child() pass tstate to _PyEval_ReInitThreads() (GH-20598)
Victor Stinner [Tue, 2 Jun 2020 16:44:54 +0000 (18:44 +0200)] 
PyOS_AfterFork_Child() pass tstate to _PyEval_ReInitThreads() (GH-20598)

5 years agobpo-40232: _PyImport_ReInitLock() can now safely use its lock (GH-20597)
Victor Stinner [Tue, 2 Jun 2020 15:13:49 +0000 (17:13 +0200)] 
bpo-40232: _PyImport_ReInitLock() can now safely use its lock (GH-20597)

Since _PyImport_ReInitLock() now calls _PyThread_at_fork_reinit() on
the import lock, the lock is now in a known state: unlocked. It
became safe to acquire it after fork.

5 years agoPyOS_AfterFork_Child() uses PyStatus (GH-20596)
Victor Stinner [Tue, 2 Jun 2020 13:51:37 +0000 (15:51 +0200)] 
PyOS_AfterFork_Child() uses PyStatus (GH-20596)

PyOS_AfterFork_Child() helper functions now return a PyStatus:
PyOS_AfterFork_Child() is now responsible to handle errors.

* Move _PySignal_AfterFork() to the internal C API
* Add #ifdef HAVE_FORK on _PyGILState_Reinit(), _PySignal_AfterFork()
  and _PyInterpreterState_DeleteExceptMain().

5 years agobpo-39465: Cleanup _PyUnicode_FromId() code (GH-20595)
Victor Stinner [Tue, 2 Jun 2020 12:39:45 +0000 (14:39 +0200)] 
bpo-39465: Cleanup _PyUnicode_FromId() code (GH-20595)

Work on a local variable before filling _Py_Identifier members.

5 years agobpo-40839: PyDict_GetItem() requires the GIL (GH-20580)
Victor Stinner [Tue, 2 Jun 2020 12:03:25 +0000 (14:03 +0200)] 
bpo-40839: PyDict_GetItem() requires the GIL (GH-20580)

Calling PyDict_GetItem() without GIL held had been allowed for
historical reason. It is no longer allowed.

5 years agobpo-35078: Allow customization of CSS class name of a month in calendar module (gh...
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Tue, 2 Jun 2020 11:33:09 +0000 (17:03 +0530)] 
bpo-35078: Allow customization of CSS class name of a month in calendar module (gh-10137)

Refactor formatweekday(), formatmonthname() methods in LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to call the base class methods. This enables customizable CSS classes for LocaleHTMLCalendar and LocaleTextCalendar.

Patch by Srinivas Reddy Thatiparthy

5 years agobpo-40241: What's New in Python 3.9: opaque PyGC_Head (GH-20586)
Victor Stinner [Tue, 2 Jun 2020 10:02:58 +0000 (12:02 +0200)] 
bpo-40241: What's New in Python 3.9: opaque PyGC_Head (GH-20586)

5 years agobpo-40244: Remove XLC's support from the noreturn flag (GH-20588)
Batuhan Taskaya [Tue, 2 Jun 2020 08:19:52 +0000 (11:19 +0300)] 
bpo-40244: Remove XLC's support from the noreturn flag (GH-20588)

Automerge-Triggered-By: @pablogsal
5 years agoFix MSVC warnings in pythonrun.c (#GH-0587)
Ammar Askar [Tue, 2 Jun 2020 08:17:24 +0000 (08:17 +0000)] 
Fix MSVC warnings in pythonrun.c (#GH-0587)

5 years agobpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206)
Sanyam Khurana [Tue, 2 Jun 2020 01:17:45 +0000 (06:47 +0530)] 
bpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206)

5 years agoEnsure correct version of Sphinx is used for Windows builds (GH-20582)
Steve Dower [Mon, 1 Jun 2020 21:17:23 +0000 (22:17 +0100)] 
Ensure correct version of Sphinx is used for Windows builds (GH-20582)

5 years agobpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)
Victor Stinner [Mon, 1 Jun 2020 18:59:35 +0000 (20:59 +0200)] 
bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

5 years agobpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)
Skip Montanaro [Mon, 1 Jun 2020 18:35:56 +0000 (13:35 -0500)] 
bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)

5 years agobpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
Victor Stinner [Mon, 1 Jun 2020 18:34:15 +0000 (20:34 +0200)] 
bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)

PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.

5 years agobpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)
Huon Wilson [Mon, 1 Jun 2020 17:26:33 +0000 (03:26 +1000)] 
bpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)

5 years agobpo-39943: Fix MSVC warnings in sre extension (GH-20508)
Ammar Askar [Mon, 1 Jun 2020 17:21:43 +0000 (17:21 +0000)] 
bpo-39943: Fix MSVC warnings in sre extension (GH-20508)

5 years agobpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)
Hai Shi [Mon, 1 Jun 2020 16:54:18 +0000 (00:54 +0800)] 
bpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)

5 years agobpo-1635741: Port fcntl module to multiphase initialization (GH-20540)
Dong-hee Na [Mon, 1 Jun 2020 16:12:24 +0000 (01:12 +0900)] 
bpo-1635741: Port fcntl module to multiphase initialization (GH-20540)

5 years agobpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)
Zackery Spytz [Mon, 1 Jun 2020 15:43:56 +0000 (09:43 -0600)] 
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)

5 years agobpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Victor Stinner [Mon, 1 Jun 2020 14:02:40 +0000 (16:02 +0200)] 
bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)

Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.

5 years agoMake sure that keyword arguments are merged into the arguments dictionary when dict...
Mark Shannon [Mon, 1 Jun 2020 09:42:42 +0000 (10:42 +0100)] 
Make sure that keyword arguments are merged into the arguments dictionary when dict unpacking and keyword arguments are interleaved. (GH-20553)

5 years agobpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Christian Heimes [Mon, 1 Jun 2020 06:58:14 +0000 (08:58 +0200)] 
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)

Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
5 years agobpo-17005: Move topological sort functionality to its own module (GH-20558)
Pablo Galindo [Sun, 31 May 2020 23:41:14 +0000 (00:41 +0100)] 
bpo-17005: Move topological sort functionality to its own module (GH-20558)

The topological sort functionality that was introduced initially in the
functools module has been moved to a new graphlib module to
better accommodate the new tools and keep the original scope of the
functools module.

5 years agoFix typo in "What's new in Python 3.9" (GH-20559)
Lysandros Nikolaou [Sun, 31 May 2020 23:28:46 +0000 (02:28 +0300)] 
Fix typo in "What's new in Python 3.9" (GH-20559)

Automerge-Triggered-By: @pablogsal
5 years agobpo-40759: Deprecate the symbol module (GH-20364)
Batuhan Taskaya [Sun, 31 May 2020 22:01:50 +0000 (01:01 +0300)] 
bpo-40759: Deprecate the symbol module (GH-20364)

Automerge-Triggered-By: @pablogsal
5 years agobpo-40755: Add rich comparisons to Counter (GH-20548)
Raymond Hettinger [Sun, 31 May 2020 21:57:42 +0000 (14:57 -0700)] 
bpo-40755: Add rich comparisons to Counter (GH-20548)

5 years agoFix asyncio.to_thread() documented return type (GH-20547)
Kyle Stanley [Sun, 31 May 2020 07:07:04 +0000 (03:07 -0400)] 
Fix asyncio.to_thread() documented return type (GH-20547)

When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine.

This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.

5 years agobpo-40829: Add a what's new entry about deprecation of shuffle's random parameter...
Batuhan Taskaya [Sat, 30 May 2020 22:15:06 +0000 (01:15 +0300)] 
bpo-40829: Add a what's new entry about deprecation of shuffle's random parameter (GH-20541)

5 years agobpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)
Zackery Spytz [Sat, 30 May 2020 08:22:02 +0000 (02:22 -0600)] 
bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)

tup should be decrefed in the unlikely event of a PyList_New()
failure.

5 years agobpo-40798: Generate a different message for already removed elements (GH-20483)
Florian Dahlitz [Sat, 30 May 2020 07:47:32 +0000 (09:47 +0200)] 
bpo-40798: Generate a different message for already removed elements (GH-20483)

5 years agocloses bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Samuel Gaist [Sat, 30 May 2020 01:57:03 +0000 (03:57 +0200)] 
closes bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)

Reference to PySide has been removed has it is for Qt 4, which has reached end of life.

5 years agobpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Terry Jan Reedy [Fri, 29 May 2020 22:54:14 +0000 (18:54 -0400)] 
bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)

Leave selection when right click within.  This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d.  I did not realize that this completely disabled the context menu entries, and  I should have merged a minimal fix immediately.  An automated test should follow.

5 years agobpo-29882: Add an efficient popcount method for integers (#771)
Niklas Fiekas [Fri, 29 May 2020 16:28:02 +0000 (18:28 +0200)] 
bpo-29882: Add an efficient popcount method for integers (#771)

* bpo-29882: Add an efficient popcount method for integers

* Update 'sign bit' and versionadded in docs

* Add entry to whatsnew document

* Doc: use positive example, mention population count

* Minor cleanups of the core code

* Move popcount_digit closer to where it's used

* Use z instead of self after conversion

* Add 'absolute value' and 'population count' to docstring

* Fix clinic error about missing summary line

* Ensure popcount_digit is portable with 64-bit ints

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
5 years agoFurther de-linting of zoneinfo module (#20499)
Paul Ganssle [Fri, 29 May 2020 13:34:30 +0000 (09:34 -0400)] 
Further de-linting of zoneinfo module (#20499)

* Remove unused imports in zoneinfo

* Remove unused variables in zoneinfo

* Remove else after raise

5 years agobpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435)
Mark Dickinson [Fri, 29 May 2020 13:23:57 +0000 (14:23 +0100)] 
bpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435)

* Fix failure of _Py_dg_dtoa to remove trailing zeros

* Add regression test and news entry

* Add explanation about why it's safe to strip trailing zeros

* Make code safer, clean up comments, add change note at top of file

* Nitpick: avoid implicit int-to-float conversion in tests

5 years agoIndicate that abs() method accept argument that implement __abs__(), just like call...
Windson yang [Fri, 29 May 2020 11:35:34 +0000 (19:35 +0800)] 
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)

5 years agobpo-39040: Fix parsing of email mime headers with whitespace between encoded-words...
Abhilash Raj [Fri, 29 May 2020 00:04:59 +0000 (17:04 -0700)] 
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)

* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string.

It is fairly common to find malformed mime headers (especially content-disposition
headers) where the parameter values, instead of being encoded to RFC
standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and
then enclosing the whole thing in quotes.  The processing of these malformed
headers was incorrectly leaving the spaces between encoded words in the decoded
text (whitespace between adjacent encoded words is supposed to be stripped on
decoding).  This changeset fixes the encoded word processing inside quoted strings
(bare-quoted-string) to do correct RFC 2047 decoding by stripping that
whitespace.

5 years agobpo-40784: Fix sqlite3 deterministic test (GH-20448)
Erlend Egeberg Aasland [Thu, 28 May 2020 23:27:31 +0000 (01:27 +0200)] 
bpo-40784: Fix sqlite3 deterministic test (GH-20448)

5 years agobpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)
Fantix King [Thu, 28 May 2020 21:56:42 +0000 (16:56 -0500)] 
bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)

5 years agoNote the output ordering of combinatoric functions (GH-19732)
Ruaridh Williamson [Thu, 28 May 2020 19:56:43 +0000 (20:56 +0100)] 
Note the output ordering of combinatoric functions (GH-19732)

5 years agobpo-40474: Updated coverage.yml to better report coverage stats (#19851)
lrjball [Thu, 28 May 2020 18:51:44 +0000 (19:51 +0100)] 
bpo-40474: Updated coverage.yml to better report coverage stats (#19851)

Currently modules which are imported early are misreported in coverage. A fix is documented in the devguide, but the fix wasn't being used in CI.

5 years agobpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492)
Ramil Nugmanov [Thu, 28 May 2020 16:46:22 +0000 (19:46 +0300)] 
bpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492)

5 years agobpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
Michał Górny [Thu, 28 May 2020 16:33:04 +0000 (18:33 +0200)] 
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)

Try to make the meaning of platlibdir clear.  The previous wording could
be misinterpreted to suggest that it will be used to find all shared
libraries on the system, and not just Python extensions.  Furthermore,
it was unclear whether it affects third-party (site-packages) extensions
or not.  The new wording tries to make its dual purpose clear,
and provide the additional example of extensions in site-packages.

5 years agobpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
Victor Stinner [Thu, 28 May 2020 16:26:01 +0000 (18:26 +0200)] 
bpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)

Update What's New in Python 3.9.

PyThreadState_DeleteCurrent was not removed, but excluded from the limited C API.

5 years agobpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time (GH-20493)
Petr Viktorin [Thu, 28 May 2020 16:14:46 +0000 (18:14 +0200)] 
bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time (GH-20493)

Recent changes to _datetimemodule broke compilation on mingw; see the comments in this change for details.

FWIW, @corona10: this issue is why `PyType_FromModuleAndSpec` & friends take the `bases` argument at run time.

5 years agobpo-40755: Add missing multiset operations to Counter() (GH-20339)
Raymond Hettinger [Thu, 28 May 2020 15:35:46 +0000 (08:35 -0700)] 
bpo-40755: Add missing multiset operations to Counter() (GH-20339)

5 years agobpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)
Victor Stinner [Thu, 28 May 2020 15:23:39 +0000 (17:23 +0200)] 
bpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)

On macOS, socket.getaddrinfo() no longer uses an internal lock to
prevent race conditions when calling getaddrinfo(). getaddrinfo is
thread-safe is macOS 10.5, whereas Python 3.9 requires macOS 10.6 or
newer.

The lock was also used on FreeBSD older than 5.3, OpenBSD older than
201311 and NetBSD older than 4.

5 years agobpo-40275: Fix test.support.threading_helper (GH-20488)
Victor Stinner [Thu, 28 May 2020 14:37:37 +0000 (16:37 +0200)] 
bpo-40275: Fix test.support.threading_helper (GH-20488)

* Add missing sys import
* Get verbose and gc_collect() from test.support
* Remove unused starttime variable.

Issues spotted by pyflakes.

5 years ago bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)
Hai Shi [Thu, 28 May 2020 14:24:39 +0000 (22:24 +0800)] 
 bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)

Replace test.support.TESTFN_ENCODING with sys.getfilesystemencoding().

5 years agobpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)
Victor Stinner [Thu, 28 May 2020 14:08:50 +0000 (16:08 +0200)] 
bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)

Skip new "racing" socket tests which fail randomly until someone fix
them, to ease analysis of buildbot failures (skip tests which are
known to be broken/unstable).

5 years agoRevert "Upgrade bundled versions of pip & setuptools (#16782)" (GH-20484)
Victor Stinner [Thu, 28 May 2020 13:57:49 +0000 (15:57 +0200)] 
Revert "Upgrade bundled versions of pip & setuptools (#16782)" (GH-20484)

This reverts commit feb0846c3a28b05b4cfbc6ab34c764957f3eff55.

5 years agobpo-40792: Make the result of PyNumber_Index() always having exact type int. (GH...
Serhiy Storchaka [Thu, 28 May 2020 07:33:45 +0000 (10:33 +0300)] 
bpo-40792: Make the result of PyNumber_Index() always having exact type int. (GH-20443)

Previously, the result could have been an instance of a subclass of int.

Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.

Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().

5 years agoImprove IO tutorial's "Old string formatting" section (GH-16251)
Adorilson Bezerra [Thu, 28 May 2020 01:34:01 +0000 (22:34 -0300)] 
Improve IO tutorial's "Old string formatting" section (GH-16251)

* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years ago bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473)
Elazar Gershuni [Thu, 28 May 2020 00:41:24 +0000 (03:41 +0300)] 
 bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473)

5 years agobpo-40275: test.support imports subprocess lazily (GH-20471)
Victor Stinner [Wed, 27 May 2020 23:56:29 +0000 (01:56 +0200)] 
bpo-40275: test.support imports subprocess lazily (GH-20471)

test.support module now imports the platform and subprocess modules
lazily to reduce the number of modules imported by
"import test.support".

With this change, the threading module is no longer imported
indirectly by "import test.support".

Use sys.version rather than platform.machine() to detect the Windows
ARM32 buildbot.

5 years agobpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)
Victor Stinner [Wed, 27 May 2020 22:44:23 +0000 (00:44 +0200)] 
bpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)

check_impl_detail() of test.support now uses sys.implementation.name,
instead of platform.python_implementation().lower(). This change
prepares test.support to import the platform module lazily.

5 years agobpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
Victor Stinner [Wed, 27 May 2020 22:38:12 +0000 (00:38 +0200)] 
bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)

If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().

5 years agobpo-40275: Adding threading_helper submodule in test.support (GH-20263)
Hai Shi [Wed, 27 May 2020 22:10:27 +0000 (06:10 +0800)] 
bpo-40275: Adding threading_helper submodule in test.support (GH-20263)

5 years agoRevert "bpo-32604: PEP 554 for use in test suite (GH-19985)" (#20465)
Pablo Galindo [Wed, 27 May 2020 21:33:13 +0000 (22:33 +0100)] 
Revert "bpo-32604: PEP 554 for use in test suite (GH-19985)" (#20465)

This reverts commit 9d17cbf33df7cfb67ca0f37f6463ba5c18676641.

5 years agobpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336)
YoSTEALTH [Wed, 27 May 2020 21:32:22 +0000 (15:32 -0600)] 
bpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336)

5 years agoFix compiler warnings in _zoneinfo.c (GH-20342)
Pablo Galindo [Wed, 27 May 2020 20:48:12 +0000 (21:48 +0100)] 
Fix compiler warnings in _zoneinfo.c (GH-20342)

```
D:\a\cpython\cpython\Modules\_zoneinfo.c(903,52): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(904,44): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(1772,31): warning C4244: '=': conversion from 'ssize_t' to 'uint8_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
```

5 years agobpo-40614: Respect feature version for f-string debug expressions (GH-20196)
Shantanu [Wed, 27 May 2020 20:30:38 +0000 (13:30 -0700)] 
bpo-40614: Respect feature version for f-string debug expressions (GH-20196)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>