]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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.

4 years agobpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377)
Nikita Sobolev [Tue, 21 Sep 2021 17:49:42 +0000 (20:49 +0300)] 
bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377)

4 years agobpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493)
Pablo Galindo Salgado [Tue, 21 Sep 2021 17:38:57 +0000 (18:38 +0100)] 
bpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493)

4 years agobpo-45246: Document that sorted() only uses "<" comparisons (GH-28494)
Raymond Hettinger [Tue, 21 Sep 2021 17:26:27 +0000 (12:26 -0500)] 
bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494)

4 years agobpo-45200: Ignore test_multiprocessing_* in ASAN build due to false positives (GH...
Pablo Galindo Salgado [Tue, 21 Sep 2021 16:28:13 +0000 (17:28 +0100)] 
bpo-45200: Ignore test_multiprocessing_* in ASAN build due to false positives (GH-28492)

4 years agobpo-44958: Fix ref. leak introduced in GH-27844 (GH-28490)
Erlend Egeberg Aasland [Tue, 21 Sep 2021 13:15:54 +0000 (15:15 +0200)] 
bpo-44958: Fix ref. leak introduced in GH-27844 (GH-28490)

Modify managed_connect() helper to support in-memory databases. Use it
for the regression tests added in GH-27844.

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-44958: Only reset `sqlite3` statements when needed (GH-27844)
Erlend Egeberg Aasland [Tue, 21 Sep 2021 11:20:34 +0000 (13:20 +0200)] 
bpo-44958: Only reset `sqlite3` statements when needed (GH-27844)

4 years agobpo-24076: Inline single digit unpacking in the integer fastpath of sum() (GH-28469)
scoder [Tue, 21 Sep 2021 09:01:18 +0000 (11:01 +0200)] 
bpo-24076: Inline single digit unpacking in the integer fastpath of sum() (GH-28469)

4 years agobpo-45021: Fix a hang in forked children (GH-28007)
nullptr [Mon, 20 Sep 2021 18:30:19 +0000 (20:30 +0200)] 
bpo-45021: Fix a hang in forked children (GH-28007)

_global_shutdown_lock should be reinitialized in forked children

4 years agobpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465)
Raymond Hettinger [Mon, 20 Sep 2021 18:22:55 +0000 (13:22 -0500)] 
bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465)

4 years agobpo-44848: Update Windows installer to use SQLite 3.36.0 (GH-27622)
Erlend Egeberg Aasland [Mon, 20 Sep 2021 15:58:13 +0000 (17:58 +0200)] 
bpo-44848: Update Windows installer to use SQLite 3.36.0 (GH-27622)

4 years agobpo-45229: Make pickle tests discoverable (GH-28467)
Serhiy Storchaka [Mon, 20 Sep 2021 15:21:33 +0000 (18:21 +0300)] 
bpo-45229: Make pickle tests discoverable (GH-28467)

4 years agobpo-1514420: Do not attempt to open files with names in <>s when formatting an except...
Irit Katriel [Mon, 20 Sep 2021 15:10:30 +0000 (16:10 +0100)] 
bpo-1514420: Do not attempt to open files with names in <>s when formatting an exception (GH-28143)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)
Rémi Lapeyre [Mon, 20 Sep 2021 15:09:05 +0000 (17:09 +0200)] 
bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)

Co-authored-by: Tal Einat <taleinat@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45055: Add retry when downloading externals on Windows (GH-28399)
Steve Dower [Mon, 20 Sep 2021 14:33:00 +0000 (15:33 +0100)] 
bpo-45055: Add retry when downloading externals on Windows (GH-28399)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)
Serhiy Storchaka [Mon, 20 Sep 2021 08:36:57 +0000 (11:36 +0300)] 
bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)

Alo use load_tests() for adding tests.

4 years agobpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)
Victor Stinner [Mon, 20 Sep 2021 08:30:02 +0000 (10:30 +0200)] 
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)

Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
not crash.

Cleanup also test_get_argc_argv().

4 years agoDocs: Clarify the before_and_after() example (GH-28458)
Raymond Hettinger [Mon, 20 Sep 2021 00:52:27 +0000 (19:52 -0500)] 
Docs: Clarify the before_and_after() example (GH-28458)

4 years agobpo-45041: Simplify `sqlite3.Cursor.executescript()` (GH-28020)
Erlend Egeberg Aasland [Sun, 19 Sep 2021 22:52:36 +0000 (00:52 +0200)] 
bpo-45041: Simplify `sqlite3.Cursor.executescript()` (GH-28020)

4 years agobpo-45040: Simplify sqlite3 transaction control functions (GH-28019)
Erlend Egeberg Aasland [Sun, 19 Sep 2021 22:51:36 +0000 (00:51 +0200)] 
bpo-45040: Simplify sqlite3 transaction control functions (GH-28019)

4 years agobpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)
Nikita Sobolev [Sun, 19 Sep 2021 22:50:04 +0000 (01:50 +0300)] 
bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)

4 years agobpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH...
Pablo Galindo Salgado [Sun, 19 Sep 2021 22:44:51 +0000 (23:44 +0100)] 
bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459)

4 years agoClean up initialization __class_getitem__ with Py_GenericAlias. (GH-28450)
Serhiy Storchaka [Sun, 19 Sep 2021 15:05:30 +0000 (18:05 +0300)] 
Clean up initialization __class_getitem__ with Py_GenericAlias. (GH-28450)

The cast to PyCFunction is redundant. Overuse of redundant casts
can hide actual bugs.

4 years agobpo-45229: Fix setUpModule in test_ssl (GH-28454)
Serhiy Storchaka [Sun, 19 Sep 2021 13:18:16 +0000 (16:18 +0300)] 
bpo-45229: Fix setUpModule in test_ssl (GH-28454)

4 years agobpo-45229: Remove test_main in many tests (GH-28405)
Serhiy Storchaka [Sun, 19 Sep 2021 12:27:33 +0000 (15:27 +0300)] 
bpo-45229: Remove test_main in many tests (GH-28405)

Instead of explicitly enumerate test classes for run_unittest()
use the unittest ability to discover tests. This also makes these
tests discoverable and runnable with unittest.

load_tests() can be used for dynamic generating tests and adding
doctests. setUpModule(), tearDownModule() and addModuleCleanup()
can be used for running code before and after all module tests.

4 years agobpo-30856: Update TestResult early, without buffering in _Outcome (GH-28180)
Serhiy Storchaka [Sun, 19 Sep 2021 12:24:38 +0000 (15:24 +0300)] 
bpo-30856: Update TestResult early, without buffering in _Outcome (GH-28180)

TestResult methods addFailure(), addError(), addSkip() and
addSubTest() are now called immediately after raising an exception
in test or finishing a subtest.  Previously they were called only
after finishing the test clean up.

4 years agobpo-36674: Honour the skipping decorators in TestCase.debug() (GH-28446)
Serhiy Storchaka [Sat, 18 Sep 2021 12:34:22 +0000 (15:34 +0300)] 
bpo-36674: Honour the skipping decorators in TestCase.debug() (GH-28446)

unittest.TestCase.debug() raises now a SkipTest if the class or
the test method are decorated with the skipping decorator.

Previously it only raised a SkipTest if the test method was decorated
with other decorator in addition to the skipping decorator, or
if SkipTest was explicitly raised in the test or setup methods.

4 years agobpo-45198: __set_name__ documentation not clear about its usage with non-descriptor...
Raymond Hettinger [Sat, 18 Sep 2021 06:49:43 +0000 (01:49 -0500)] 
bpo-45198: __set_name__ documentation not clear about its usage with non-descriptor classes (GH-28439)

4 years agobpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420)
Adam Schwalm [Sat, 18 Sep 2021 04:20:31 +0000 (23:20 -0500)] 
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420)

4 years agoFix minor typo in Doc/c-api/type.rst (GH-28432)
Konstantin Popov [Sat, 18 Sep 2021 01:45:33 +0000 (04:45 +0300)] 
Fix minor typo in Doc/c-api/type.rst (GH-28432)

retreived-> retrieved

4 years agobpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec...
Brett Cannon [Fri, 17 Sep 2021 23:48:17 +0000 (16:48 -0700)] 
bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435)

This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).