]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agoPython 3.11.0a1 v3.11.0a1
Pablo Galindo [Tue, 5 Oct 2021 12:42:52 +0000 (13:42 +0100)] 
Python 3.11.0a1

4 years agobpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths...
Steve Dower [Tue, 5 Oct 2021 12:37:43 +0000 (13:37 +0100)] 
bpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths (GH-28735)

4 years agobpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712)
Jeremy Kloth [Tue, 5 Oct 2021 12:17:13 +0000 (06:17 -0600)] 
bpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712)

4 years agobpo-45163: Restrict added libnetwork check to builds on Haiku. (GH-28729)
Ned Deily [Tue, 5 Oct 2021 10:02:57 +0000 (06:02 -0400)] 
bpo-45163: Restrict added libnetwork check to builds on Haiku. (GH-28729)

For example, without the guard the check could cause macOS
installer builds to fail to install on older supported macOS
releases where libnetwork is not available and is not needed
on any release.

4 years agobpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. (GH...
Mark Shannon [Tue, 5 Oct 2021 10:01:11 +0000 (11:01 +0100)] 
bpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. (GH-28723)

4 years agobpo-45371: Fix distutils' rpath support for clang (GH-28732)
Christian Heimes [Tue, 5 Oct 2021 09:43:46 +0000 (12:43 +0300)] 
bpo-45371: Fix distutils' rpath support for clang (GH-28732)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agoFix compiler warning in ceval.c regarding signed comparison (GH-28716)
Pablo Galindo Salgado [Mon, 4 Oct 2021 11:13:46 +0000 (12:13 +0100)] 
Fix compiler warning in ceval.c regarding signed comparison (GH-28716)

4 years agobpo-45355: More use of sizeof(_Py_CODEUNIT) (GH-28720)
Serhiy Storchaka [Mon, 4 Oct 2021 11:11:26 +0000 (14:11 +0300)] 
bpo-45355: More use of sizeof(_Py_CODEUNIT) (GH-28720)

4 years agobpo-28206: Document signals Handlers, Sigmasks and Signals enums (GH-28628)
Bibo-Joshi [Mon, 4 Oct 2021 11:09:40 +0000 (13:09 +0200)] 
bpo-28206: Document signals Handlers, Sigmasks and Signals enums (GH-28628)

Co-authored-by: desbma <desbma@users.noreply.github.com>
4 years agobpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)
John Belmonte [Mon, 4 Oct 2021 06:49:55 +0000 (15:49 +0900)] 
bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)

* bpo-44594: fix (Async)ExitStack handling of __context__

Make enter_context(foo()) / enter_async_context(foo()) equivalent to
`[async] with foo()` regarding __context__ when an exception is raised.

Previously exceptions would be caught and re-raised with the wrong
context when explicitly overriding __context__ with None.

4 years agobpo-45350: Rerun autoreconf with the pkg-config macros (GH-28708)
Pablo Galindo Salgado [Sun, 3 Oct 2021 23:46:52 +0000 (00:46 +0100)] 
bpo-45350: Rerun autoreconf with the pkg-config macros (GH-28708)

4 years agobpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code...
Serhiy Storchaka [Sun, 3 Oct 2021 18:22:42 +0000 (21:22 +0300)] 
bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit (GH-28711)

4 years agoRemove news entry without bpo issue number. (GH-28703)
Julien Palard [Sun, 3 Oct 2021 14:21:31 +0000 (16:21 +0200)] 
Remove news entry without bpo issue number. (GH-28703)

I'm just removing an erroneous NEWS entry I previously merged.

Automerge-Triggered-By: GH:JulienPalard
4 years agoRemove trailing spaces. (GH-28706)
Serhiy Storchaka [Sun, 3 Oct 2021 13:58:14 +0000 (16:58 +0300)] 
Remove trailing spaces. (GH-28706)

4 years agoFix spelling error in comment (GH-28696)
Raymond Hettinger [Sat, 2 Oct 2021 18:52:05 +0000 (13:52 -0500)] 
Fix spelling error in comment (GH-28696)

4 years agobpo-45346: Keep docs consistent regarding true and false values (GH-28697)
Raymond Hettinger [Sat, 2 Oct 2021 18:48:08 +0000 (13:48 -0500)] 
bpo-45346: Keep docs consistent regarding true and false values (GH-28697)

4 years agobpo-45329: Fix freed memory access in pyexpat.c (GH-28649)
TAGAMI Yukihiro [Sat, 2 Oct 2021 09:57:13 +0000 (18:57 +0900)] 
bpo-45329: Fix freed memory access in pyexpat.c (GH-28649)

4 years agoMakefile: Fix missing slashes (GH-28659)
native-api [Sat, 2 Oct 2021 09:38:59 +0000 (12:38 +0300)] 
Makefile: Fix missing slashes (GH-28659)

4 years agobpo-45341: Replace 'Packaging' with 'Package' in "Python P... Index" (#28687)
Terry Jan Reedy [Sat, 2 Oct 2021 06:04:55 +0000 (02:04 -0400)] 
bpo-45341: Replace 'Packaging' with 'Package' in "Python P... Index" (#28687)

pypi.org "  The Python Package Index (PyPI) ...

4 years agobpo-44687: Ensure BufferedReader objects with unread buffers can peek even when the...
AngstyDuck [Fri, 1 Oct 2021 20:11:08 +0000 (04:11 +0800)] 
bpo-44687: Ensure BufferedReader objects with unread buffers can peek even when the underlying file is closed (GH-28457)

4 years agoFix a couple of compiler warnings. (GH-28677)
Mark Shannon [Fri, 1 Oct 2021 14:44:19 +0000 (15:44 +0100)] 
Fix a couple of compiler warnings. (GH-28677)

4 years agobpo-45332: Fix broken Decimal test and benchmark (GH-28680)
Dong-hee Na [Fri, 1 Oct 2021 13:49:46 +0000 (13:49 +0000)] 
bpo-45332: Fix broken Decimal test and benchmark (GH-28680)

4 years agohashlib: Fix old message about unicode objects. (GH-28653)
Julien Palard [Fri, 1 Oct 2021 12:38:49 +0000 (14:38 +0200)] 
hashlib: Fix old message about unicode objects. (GH-28653)

4 years agosqlite3: Modernize documentation around unicode and bytes. (GH-28652)
Julien Palard [Fri, 1 Oct 2021 12:37:56 +0000 (14:37 +0200)] 
sqlite3: Modernize documentation around unicode and bytes. (GH-28652)

4 years agobpo-41710: Add private _PyDeadline_Get() function (GH-28674)
Victor Stinner [Fri, 1 Oct 2021 11:29:25 +0000 (13:29 +0200)] 
bpo-41710: Add private _PyDeadline_Get() function (GH-28674)

Add a private C API for deadlines: add _PyDeadline_Init() and
_PyDeadline_Get() functions.

* Add _PyTime_Add() and _PyTime_Mul() functions which compute t1+t2
  and t1*t2 and clamp the result on overflow.
* _PyTime_MulDiv() now uses _PyTime_Add() and _PyTime_Mul().

4 years agobpo-41710: gc_collect_main() uses _PyTime_GetPerfCounter() (GH-28676)
Victor Stinner [Fri, 1 Oct 2021 11:29:00 +0000 (13:29 +0200)] 
bpo-41710: gc_collect_main() uses _PyTime_GetPerfCounter() (GH-28676)

If the DEBUG_STATS debug flag is set, gc_collect_main() now uses
_PyTime_GetPerfCounter() instead of _PyTime_GetMonotonicClock() to
measure the elapsed time.

On Windows, _PyTime_GetMonotonicClock() only has a resolution of 15.6
ms, whereas _PyTime_GetPerfCounter() is closer to a resolution of 100
ns.

4 years agobpo-41710: Fix PY_TIMEOUT_MAX on Windows (GH-28673)
Victor Stinner [Fri, 1 Oct 2021 11:03:03 +0000 (13:03 +0200)] 
bpo-41710: Fix PY_TIMEOUT_MAX on Windows (GH-28673)

WaitForSingleObject() accepts timeout in milliseconds in the range
[0; 0xFFFFFFFE] (DWORD type). INFINITE value (0xFFFFFFFF) means no
timeout. 0xFFFFFFFE milliseconds is around 49.7 days.

PY_TIMEOUT_MAX is (0xFFFFFFFE * 1000) milliseconds on Windows, around
49.7 days.

Partially revert commit 37b8294d6295ca12553fd7c98778be71d24f4b24.

4 years agobpo-45125: Improves pickling docs and tests for `shared_memory` (GH-28294)
Nikita Sobolev [Fri, 1 Oct 2021 10:45:59 +0000 (13:45 +0300)] 
bpo-45125: Improves pickling docs and tests for `shared_memory` (GH-28294)

4 years agoRevert "Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650...
Serhiy Storchaka [Fri, 1 Oct 2021 07:57:58 +0000 (10:57 +0300)] 
Revert "Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)" (GH-28667)

This reverts commit b07fddd527efe67174ce6b0fdbe8dac390b16e4e.

4 years agobpo-45310: Fix parrallel shared memory tests (GH-28661)
Serhiy Storchaka [Fri, 1 Oct 2021 07:56:32 +0000 (10:56 +0300)] 
bpo-45310: Fix parrallel shared memory tests (GH-28661)

Add a PID to names of POSIX shared memory objects to allow
running multiprocessing tests (test_multiprocessing_fork,
test_multiprocessing_spawn, etc) in parallel.

4 years agobpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28662)
Victor Stinner [Fri, 1 Oct 2021 07:55:28 +0000 (09:55 +0200)] 
bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28662)

On Unix, if the sem_clockwait() function is available in the C
library (glibc 2.30 and newer), the threading.Lock.acquire() method
now uses the monotonic clock (time.CLOCK_MONOTONIC) for the timeout,
rather than using the system clock (time.CLOCK_REALTIME), to not be
affected by system clock changes.

configure now checks if the sem_clockwait() function is available.

4 years agoInstall the __phello__ package too. (#28665)
Eric Snow [Fri, 1 Oct 2021 02:23:32 +0000 (20:23 -0600)] 
Install the __phello__ package too. (#28665)

I broke some buildbots by not adding __phello__ to the list of installed packages.

https://bugs.python.org/issue45020

4 years agobpo-45020: Add more test cases for frozen modules. (gh-28664)
Eric Snow [Fri, 1 Oct 2021 00:38:52 +0000 (18:38 -0600)] 
bpo-45020: Add more test cases for frozen modules. (gh-28664)

I've added a number of test-only modules. Some of those cases are covered by the recently frozen stdlib modules (and some will be once we add encodings back in). However, I figured we'd play it safe by having a set of modules guaranteed to be there during tests.

https://bugs.python.org/issue45020

4 years agobpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)
Serhiy Storchaka [Thu, 30 Sep 2021 16:20:39 +0000 (19:20 +0300)] 
bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)

* Work correctly if an additional fresh module imports other
  additional fresh module which imports a blocked module.
* Raises ImportError if the specified module cannot be imported
  while all additional fresh modules are successfully imported.
* Support blocking packages.
* Always restore the import state of fresh and blocked modules
  and their submodules.
* Fix test_decimal and test_xml_etree which depended on an undesired
  side effect of import_fresh_module().

4 years agoRevert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)
Pablo Galindo Salgado [Thu, 30 Sep 2021 13:46:26 +0000 (14:46 +0100)] 
Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)

This reverts commit d441437ee71ae174c008c23308b749b91020ba77.

4 years agobpo-41710: Document _PyTime_t API in pytime.h (GH-28647)
Victor Stinner [Thu, 30 Sep 2021 09:23:03 +0000 (11:23 +0200)] 
bpo-41710: Document _PyTime_t API in pytime.h (GH-28647)

4 years agobpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643)
Victor Stinner [Thu, 30 Sep 2021 08:16:51 +0000 (10:16 +0200)] 
bpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643)

PyThread_acquire_lock_timed() now clamps the timeout into the
[_PyTime_MIN; _PyTime_MAX] range (_PyTime_t type) if it is too large,
rather than calling Py_FatalError() which aborts the process.

PyThread_acquire_lock_timed() no longer uses
MICROSECONDS_TO_TIMESPEC() to compute sem_timedwait() argument, but
_PyTime_GetSystemClock() and _PyTime_AsTimespec_truncate().

Fix _thread.TIMEOUT_MAX value on Windows: the maximum timeout is
0x7FFFFFFF milliseconds (around 24.9 days), not 0xFFFFFFFF
milliseconds (around 49.7 days).

Set PY_TIMEOUT_MAX to 0x7FFFFFFF milliseconds, rather than 0xFFFFFFFF
milliseconds.

Fix PY_TIMEOUT_MAX overflow test: replace (us >= PY_TIMEOUT_MAX) with
(us > PY_TIMEOUT_MAX).

4 years agoFix EncodingWarning in freeze_modules. (GH-28591)
Inada Naoki [Thu, 30 Sep 2021 03:36:16 +0000 (12:36 +0900)] 
Fix EncodingWarning in freeze_modules. (GH-28591)

4 years agobpo-41710: Fix building pytime.c on Windows (GH-28644)
Victor Stinner [Thu, 30 Sep 2021 01:50:29 +0000 (03:50 +0200)] 
bpo-41710: Fix building pytime.c on Windows (GH-28644)

4 years agobpo-41710: Add pytime_add() and pytime_mul() (GH-28642)
Victor Stinner [Thu, 30 Sep 2021 01:07:11 +0000 (03:07 +0200)] 
bpo-41710: Add pytime_add() and pytime_mul() (GH-28642)

Add pytime_add() and pytime_mul() functions to pytime.c to compute
t+t2 and t*k with clamping to [_PyTime_MIN; _PyTime_MAX].

Fix pytime.h: _PyTime_FromTimeval() is not implemented on Windows.

4 years agobpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)
Victor Stinner [Thu, 30 Sep 2021 00:11:41 +0000 (02:11 +0200)] 
bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)

Add the _PyTime_AsTimespec_clamp() function: similar to
_PyTime_AsTimespec(), but clamp to _PyTime_t min/max and don't raise
an exception.

PyThread_acquire_lock_timed() now uses _PyTime_AsTimespec_clamp() to
remove the Py_UNREACHABLE() code path.

* Add _PyTime_AsTime_t() function.
* Add PY_TIME_T_MIN and PY_TIME_T_MAX constants.
* Replace _PyTime_AsTimeval_noraise() with _PyTime_AsTimeval_clamp().
* Add pytime_divide_round_up() function.
* Fix integer overflow in pytime_divide().
* Add pytime_divmod() function.

4 years agobpo-43753: _operator.is_() uses Py_Is() (GH-28641)
Victor Stinner [Wed, 29 Sep 2021 23:28:10 +0000 (01:28 +0200)] 
bpo-43753: _operator.is_() uses Py_Is() (GH-28641)

4 years agobpo-45229: Make datetime tests discoverable (GH-28615)
Serhiy Storchaka [Wed, 29 Sep 2021 20:27:57 +0000 (23:27 +0300)] 
bpo-45229: Make datetime tests discoverable (GH-28615)

4 years agobpo-45020: Do not freeze <pkg>/__init__.py twice. (gh-28635)
Eric Snow [Wed, 29 Sep 2021 18:55:35 +0000 (12:55 -0600)] 
bpo-45020: Do not freeze <pkg>/__init__.py twice. (gh-28635)

Currently we're freezing the __init__.py twice, duplicating the built data unnecessarily With this change we do it once. There is no change in runtime behavior.

https://bugs.python.org/issue45020

4 years ago[typo] s/libexpact/libexpat/ in setup.py (GH-28624)
Łukasz Langa [Wed, 29 Sep 2021 14:29:35 +0000 (16:29 +0200)] 
[typo] s/libexpact/libexpat/ in setup.py (GH-28624)

4 years ago[typo] Fix threading.Barrier comment that used confusing punctuation (GH-28623)
Łukasz Langa [Wed, 29 Sep 2021 14:11:26 +0000 (16:11 +0200)] 
[typo] Fix threading.Barrier comment that used confusing punctuation (GH-28623)

Removed extra comma in comment that indicates state of a `Barrier` as it was confusing and breaking the flow while reading.

Co-authored-by: Priyank <5903604+cpriyank@users.noreply.github.com>
4 years agobpo-44394: Ensure libexpat is linked against libm (GH-28617)
Pablo Galindo Salgado [Wed, 29 Sep 2021 13:18:33 +0000 (14:18 +0100)] 
bpo-44394: Ensure libexpat is linked against libm (GH-28617)

4 years agoFix doctest doc examples for syntax errors (GH-28486)
andrei kulakov [Wed, 29 Sep 2021 11:44:43 +0000 (07:44 -0400)] 
Fix doctest doc examples for syntax errors (GH-28486)

* fix doctest doc examples for syntax errors

* updated examples to use TypeErrors

* fixed first sentence

* unneeded comma

4 years agobpo-45291: Explicitly set --libdir=lib when configure OpenSSL (GH-28566)
zhanpon [Wed, 29 Sep 2021 10:54:59 +0000 (19:54 +0900)] 
bpo-45291: Explicitly set --libdir=lib when configure OpenSSL (GH-28566)

4 years agobpo-24391: Better reprs for threading objects. (GH-20534)
Serhiy Storchaka [Wed, 29 Sep 2021 10:07:58 +0000 (13:07 +0300)] 
bpo-24391: Better reprs for threading objects. (GH-20534)

Add reprs for Semaphore, BoundedSemaphore, Event, and Barrier.

4 years agobpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766)
Jack DeVries [Wed, 29 Sep 2021 09:25:48 +0000 (05:25 -0400)] 
bpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766)

* during tarfile parsing, a zlib error indicates invalid data
* tarfile.open now raises a descriptive exception from the zlib error
* this makes it clear to the user that they may be trying to open a
  corrupted tar file

4 years ago[docs] Use full names for time units (GH-28611)
Serhiy Storchaka [Wed, 29 Sep 2021 09:09:56 +0000 (12:09 +0300)] 
[docs] Use full names for time units (GH-28611)

Use "second", "millisecond", "microsecond", "nanosecond" instead of
"sec", "ms", "msec", "us", "ns", etc.

4 years agobpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540)
Nikita Sobolev [Tue, 28 Sep 2021 21:18:00 +0000 (00:18 +0300)] 
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540)

4 years ago[docs] Improve the markup of powers (GH-28598)
Serhiy Storchaka [Tue, 28 Sep 2021 20:40:57 +0000 (23:40 +0300)] 
[docs] Improve the markup of powers (GH-28598)

4 years agobpo-45211: Remember the stdlib dir during startup. (gh-28586)
Eric Snow [Tue, 28 Sep 2021 18:18:28 +0000 (12:18 -0600)] 
bpo-45211: Remember the stdlib dir during startup. (gh-28586)

During runtime startup we figure out the stdlib dir but currently throw that information away. This change preserves it and exposes it via PyConfig.stdlib_dir, _Py_GetStdlibDir(), and sys._stdlib_dir.

https://bugs.python.org/issue45211

4 years agobpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)
Pablo Galindo Salgado [Tue, 28 Sep 2021 12:32:43 +0000 (13:32 +0100)] 
bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)

4 years agobpo-45296: Fix exit/quit message on Windows (GH-28577)
Terry Jan Reedy [Tue, 28 Sep 2021 12:05:56 +0000 (08:05 -0400)] 
bpo-45296: Fix exit/quit message on Windows (GH-28577)

IDLE recognizes Ctrl-D, as on other systems, instead of Ctrl-Z.

4 years agoOptimized code format (GH-28599)
Rajendra arora [Tue, 28 Sep 2021 11:51:39 +0000 (17:21 +0530)] 
Optimized code format (GH-28599)

Automerge-Triggered-By: GH:pablogsal
4 years ago[doc] fix minor typo for argparse (GH-28451)
Louis Sautier [Tue, 28 Sep 2021 11:00:51 +0000 (13:00 +0200)] 
[doc] fix minor typo for argparse (GH-28451)

"A JSONDecodeError" instead of "An JSONDecodeError".

4 years agoFixed typo in "decclarations" (GH-28578)
Rajendra arora [Tue, 28 Sep 2021 10:56:41 +0000 (16:26 +0530)] 
Fixed typo in "decclarations" (GH-28578)

4 years agoFix typo in whatsnew: "ns" is 10^-9 secs and "us" is 10^-6 secs. (GH-28565)
Jörn Heissler [Tue, 28 Sep 2021 10:25:15 +0000 (12:25 +0200)] 
Fix typo in whatsnew: "ns" is 10^-9 secs and "us" is 10^-6 secs. (GH-28565)

4 years agobpo-1596321: Fix threading._shutdown() for the main thread (GH-28549)
Victor Stinner [Mon, 27 Sep 2021 21:09:00 +0000 (23:09 +0200)] 
bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549)

Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.

4 years agobpo-45249: Ensure the traceback module prints correctly syntax errors with ranges...
Pablo Galindo Salgado [Mon, 27 Sep 2021 20:59:06 +0000 (21:59 +0100)] 
bpo-45249: Ensure the traceback module prints correctly syntax errors with ranges (GH-28575)

4 years agoSelect correct tool platform when building on Windows ARM64 natively (GH-28491)
Niyas Sait [Mon, 27 Sep 2021 19:52:54 +0000 (20:52 +0100)] 
Select correct tool platform when building on Windows ARM64 natively (GH-28491)

4 years agoDo not check isabs() on Windows. (gh-28584)
Eric Snow [Mon, 27 Sep 2021 16:52:19 +0000 (10:52 -0600)] 
Do not check isabs() on Windows. (gh-28584)

I missed this in gh-28550.

https://bugs.python.org/issue45211

4 years agobpo-45211: Move helpers from getpath.c to internal API. (gh-28550)
Eric Snow [Mon, 27 Sep 2021 16:00:32 +0000 (10:00 -0600)] 
bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)

This accomplishes 2 things:

* consolidates some common code between getpath.c and getpathp.c
* makes the helpers available to code in other files

FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx().

Note that this change is mostly moving code around. No behavior is meant to change.

https://bugs.python.org/issue45211

4 years agobpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expressio...
Pablo Galindo Salgado [Mon, 27 Sep 2021 13:37:43 +0000 (14:37 +0100)] 
bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576)

4 years agobpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)
Victor Stinner [Mon, 27 Sep 2021 12:20:31 +0000 (14:20 +0200)] 
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)

Fix a race condition in the Thread.join() method of the threading
module. If the function is interrupted by a signal and the signal
handler raises an exception, make sure that the thread remains in a
consistent state to prevent a deadlock.

4 years agobpo-44958: Revert GH-27844 (GH-28574)
Erlend Egeberg Aasland [Sun, 26 Sep 2021 21:24:19 +0000 (23:24 +0200)] 
bpo-44958: Revert GH-27844 (GH-28574)

This reverts commit 050d1035957379d70e8601e6f5636637716a264b, but keeps
the tests.

4 years agobpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559)
Nikita Sobolev [Sun, 26 Sep 2021 16:32:18 +0000 (19:32 +0300)] 
bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
4 years agobpo-21302: Add nanosleep() implementation for time.sleep() in Unix (GH-28545)
Victor Stinner [Sat, 25 Sep 2021 12:36:26 +0000 (14:36 +0200)] 
bpo-21302: Add nanosleep() implementation for time.sleep() in Unix (GH-28545)

Co-authored-by: Livius <egyszeregy@freemail.hu>
4 years agobpo-43914: Whats New 310: add new SyntaxError attributes (GH-28558)
Terry Jan Reedy [Sat, 25 Sep 2021 09:04:13 +0000 (05:04 -0400)] 
bpo-43914: Whats New 310: add new SyntaxError attributes (GH-28558)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279)
Nikita Sobolev [Sat, 25 Sep 2021 08:56:22 +0000 (11:56 +0300)] 
bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-45277: Fix typo in codecs doc (GH-28555)
Terry Jan Reedy [Sat, 25 Sep 2021 01:56:09 +0000 (21:56 -0400)] 
bpo-45277: Fix typo in codecs doc (GH-28555)

encoding => encode

4 years agobpo-41299: Mark private thread_nt.h functions as static (GH-28553)
Victor Stinner [Fri, 24 Sep 2021 23:14:09 +0000 (01:14 +0200)] 
bpo-41299: Mark private thread_nt.h functions as static (GH-28553)

Mark the following thread_nt.h functions as static:

* AllocNonRecursiveMutex()
* FreeNonRecursiveMutex()
* EnterNonRecursiveMutex()
* LeaveNonRecursiveMutex()

4 years agobpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)
Victor Stinner [Fri, 24 Sep 2021 22:40:18 +0000 (00:40 +0200)] 
bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)

Remove Py_FatalError() call: the code works even if now is negative.

4 years agobpo-41299: QueryPerformanceFrequency() cannot fail (GH-28552)
Victor Stinner [Fri, 24 Sep 2021 22:31:56 +0000 (00:31 +0200)] 
bpo-41299: QueryPerformanceFrequency() cannot fail (GH-28552)

py_win_perf_counter_frequency() no longer checks for
QueryPerformanceFrequency() failure. According to the
QueryPerformanceFrequency() documentation, the function can no longer
fails since Windows XP.

4 years agobpo-45020: Fix some corner cases for frozen module generation. (gh-28538)
Eric Snow [Fri, 24 Sep 2021 20:35:47 +0000 (14:35 -0600)] 
bpo-45020: Fix some corner cases for frozen module generation. (gh-28538)

This also includes some cleanup in preparation for a PR to make the "make all" output less noisy.

https://bugs.python.org/issue45020

4 years agobpo-44019: Add missing comma to operator.call doc (GH-28551)
Terry Jan Reedy [Fri, 24 Sep 2021 17:40:44 +0000 (13:40 -0400)] 
bpo-44019: Add missing comma to operator.call doc (GH-28551)

4 years agobpo-44019: Implement operator.call(). (GH-27888)
Antony Lee [Fri, 24 Sep 2021 15:22:49 +0000 (17:22 +0200)] 
bpo-44019: Implement operator.call(). (GH-27888)

Having `operator.call(obj, arg)` mean `type(obj).__call__(obj, arg)` is
consistent with the other dunder operators.  The semantics with `*args,
**kwargs` then follow naturally from the single-arg semantics.

4 years agobpo-20524: adds better error message for `.format()` (GH-28310)
Nikita Sobolev [Fri, 24 Sep 2021 15:18:04 +0000 (18:18 +0300)] 
bpo-20524: adds better error message for `.format()` (GH-28310)

It now lists the bad format_spec and the type of the object.

4 years agobpo-30951: Correct co_names docstring in inspect module (GH-2743)
Alex Vig [Fri, 24 Sep 2021 10:05:34 +0000 (06:05 -0400)] 
bpo-30951: Correct co_names docstring in inspect module (GH-2743)

4 years agobpo-38623: Add note about site module (site-packages) (GH-16974)
Peter Bittner [Thu, 23 Sep 2021 21:39:58 +0000 (23:39 +0200)] 
bpo-38623: Add note about site module (site-packages) (GH-16974)

4 years agobpo-39359: [zipfile] add missing "pwd: expected bytes, got str" exception (GH-18031)
Daniel Hillier [Thu, 23 Sep 2021 21:37:53 +0000 (07:37 +1000)] 
bpo-39359: [zipfile] add missing "pwd: expected bytes, got str" exception (GH-18031)

4 years agobpo-38415: Allow using @asynccontextmanager-made ctx managers as decorators (GH-16667)
Jason Fried [Thu, 23 Sep 2021 21:36:03 +0000 (14:36 -0700)] 
bpo-38415: Allow using @asynccontextmanager-made ctx managers as decorators (GH-16667)

4 years ago[docs] Update documentation for `multiprocessing.get_start_method` (GH-18170)
Sam Sneddon [Thu, 23 Sep 2021 21:03:13 +0000 (22:03 +0100)] 
[docs] Update documentation for `multiprocessing.get_start_method` (GH-18170)

4 years agoFix legacy logging module URL (GH-28528)
Sean Leavey [Thu, 23 Sep 2021 14:47:10 +0000 (16:47 +0200)] 
Fix legacy logging module URL (GH-28528)

The URL listed in the `logging` docs for the original `logging` module leads to a 404. I managed to find the new location for the page and updated the URL.

Automerge-Triggered-By: GH:vsajip
4 years agobpo-43760: Document PyThreadState.use_tracing removal (GH-28527)
Victor Stinner [Thu, 23 Sep 2021 14:38:31 +0000 (16:38 +0200)] 
bpo-43760: Document PyThreadState.use_tracing removal (GH-28527)

4 years agobpo-41137: Reorganize What's New in Python 3.11 (GH-28518)
Victor Stinner [Thu, 23 Sep 2021 09:37:39 +0000 (11:37 +0200)] 
bpo-41137: Reorganize What's New in Python 3.11 (GH-28518)

* Merge the two Removed sections.
* Move "Build Changes" at the end, before "C API Changes".
* Move the pdb change in Porting to Python 3.11.
* Move C API new features in their section.

4 years agobpo-39549: reprlib.Repr uses a “fillvalue” attribute (GH-18343)
Alexander Böhn [Wed, 22 Sep 2021 20:45:58 +0000 (16:45 -0400)] 
bpo-39549: reprlib.Repr uses a “fillvalue” attribute (GH-18343)

4 years agobpo-41203: Replace Mac OS X and OS X with macOS (GH-28515)
Serhiy Storchaka [Wed, 22 Sep 2021 17:33:36 +0000 (20:33 +0300)] 
bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515)

Replace old names when they refer to actual versions of macOS.
Keep historical names in references to older versions.

Co-authored-by: Patrick Reader <_@pxeger.com>
4 years agobpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449)
Serhiy Storchaka [Wed, 22 Sep 2021 15:43:23 +0000 (18:43 +0300)] 
bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449)

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.

4 years agobpo-21302: time.sleep() uses waitable timer on Windows (GH-28483)
Victor Stinner [Wed, 22 Sep 2021 14:09:30 +0000 (16:09 +0200)] 
bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483)

On Windows, time.sleep() now uses a waitable timer which has a
resolution of 100 ns (10^-7 sec). Previously, it had a solution of 1
ms (10^-3 sec).

* On Windows, time.sleep() now calls PyErr_CheckSignals() before
  resetting the SIGINT event.
* Add _PyTime_As100Nanoseconds() function.
* Complete and update time.sleep() documentation.

Co-authored-by: Livius <egyszeregy@freemail.hu>
4 years agobpo-45061: Revert unicode_is_singleton() change (GH-28516)
Victor Stinner [Wed, 22 Sep 2021 10:16:53 +0000 (12:16 +0200)] 
bpo-45061: Revert unicode_is_singleton() change (GH-28516)

Don't use a loop over 256 items, only checks for a single singleton.

4 years ago[codemod] Fix non-matching bracket pairs (GH-28473)
Mohamad Mansour [Tue, 21 Sep 2021 23:09:00 +0000 (02:09 +0300)] 
[codemod] Fix non-matching bracket pairs (GH-28473)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years ago[tests] Add missing assert against expected tracebacks in test_exceptions.py (GH...
andrei kulakov [Tue, 21 Sep 2021 22:06:13 +0000 (18:06 -0400)] 
[tests] Add missing assert against expected tracebacks in test_exceptions.py (GH-28484)

4 years agobpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil...
andrei kulakov [Tue, 21 Sep 2021 21:53:07 +0000 (17:53 -0400)] 
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421)

This was a regression from fixing BPO-43219.

4 years agobpo-45061: Detect refcount bug on empty string singleton (GH-28504)
Victor Stinner [Tue, 21 Sep 2021 21:43:09 +0000 (23:43 +0200)] 
bpo-45061: Detect refcount bug on empty string singleton (GH-28504)

Detect refcount bugs in C extensions when the empty Unicode string
singleton is destroyed by mistake.

* Move forward declarations to the top of unicodeobject.c.
* Simplifiy unicode_is_singleton().

4 years agobpo-45216: Remove extraneous method docs from `difflib` (GH-28445)
Nikita Sobolev [Tue, 21 Sep 2021 21:31:12 +0000 (00:31 +0300)] 
bpo-45216: Remove extraneous method docs from `difflib` (GH-28445)

4 years agobpo-45061: Detect refcount bug on empty tuple singleton (GH-28503)
Victor Stinner [Tue, 21 Sep 2021 21:04:34 +0000 (23:04 +0200)] 
bpo-45061: Detect refcount bug on empty tuple singleton (GH-28503)

Detect refcount bugs in C extensions when the empty tuple singleton
is destroyed by mistake.

Add the _Py_FatalRefcountErrorFunc() function.