]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agoFix typos in the Modules directory (GH-28761)
Christian Clauss [Thu, 7 Oct 2021 08:34:42 +0000 (10:34 +0200)] 
Fix typos in the Modules directory (GH-28761)

4 years agobpo-35970: Add help flag to base64 module (GH-28774)
Ammar Askar [Thu, 7 Oct 2021 01:38:43 +0000 (21:38 -0400)] 
bpo-35970: Add help flag to base64 module (GH-28774)

This continues off rkuska's work from https://github.com/python/cpython/pull/11789 seeing as the patch wasn't updated to add tests.

4 years agobpo-45385: Fix reference leak from descr_check (#28719)
Dong-hee Na [Thu, 7 Oct 2021 00:51:56 +0000 (09:51 +0900)] 
bpo-45385: Fix reference leak from descr_check (#28719)

4 years agoFix typos in the Objects directory (GH-28766)
Christian Clauss [Wed, 6 Oct 2021 23:57:10 +0000 (01:57 +0200)] 
Fix typos in the Objects directory (GH-28766)

4 years agobpo-29505: Add fuzzer for ast.literal_eval (GH-28777)
Ammar Askar [Wed, 6 Oct 2021 23:22:09 +0000 (19:22 -0400)] 
bpo-29505: Add fuzzer for ast.literal_eval (GH-28777)

This supercedes https://github.com/python/cpython/pull/3437 and fuzzes the method we recommend for unsafe inputs, `ast.literal_eval`. This should exercise the tokenizer and parser.

4 years agoFix typos in the Lib directory (GH-28775)
Christian Clauss [Wed, 6 Oct 2021 23:13:48 +0000 (01:13 +0200)] 
Fix typos in the Lib directory (GH-28775)

Fix typos in the Lib directory as identified by codespell.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agoFix typos in the Python directory (GH-28767)
Christian Clauss [Wed, 6 Oct 2021 22:55:27 +0000 (00:55 +0200)] 
Fix typos in the Python directory (GH-28767)

4 years agobpo-45375: Fix off by one error in buffer allocation (GH-28764)
Steve Dower [Wed, 6 Oct 2021 19:09:33 +0000 (20:09 +0100)] 
bpo-45375: Fix off by one error in buffer allocation (GH-28764)

4 years agoFix typos in the Include directory (GH-28745)
Christian Clauss [Wed, 6 Oct 2021 18:32:38 +0000 (20:32 +0200)] 
Fix typos in the Include directory (GH-28745)

4 years ago[doc] Mention __slots__ behavior in weakref.rst (GH-21061)
Jakub Stasiak [Wed, 6 Oct 2021 18:23:02 +0000 (20:23 +0200)] 
[doc] Mention __slots__ behavior in weakref.rst (GH-21061)

It took me longer than I expected to figure out why a random class
I dealt with didn't support weak references. I believe this addition
will make the __slots__/weakref interaction more discoverable to people
having troubles with this. (Before this patch __slots__ was not
mentioned in weakref documentation even once).

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agoFix typos in the Tools directory (GH-28769)
Christian Clauss [Wed, 6 Oct 2021 17:55:16 +0000 (19:55 +0200)] 
Fix typos in the Tools directory (GH-28769)

Like #28744 but for the Tools directory.

[skip issue] Opening a related issue is pending python/psf-infra-meta#130

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)
rtobar [Wed, 6 Oct 2021 17:49:44 +0000 (01:49 +0800)] 
bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)

Operating systems without support for TCP_NODELAY will raise an OSError
when trying to set the socket option, but the show can still go on.

4 years ago[Misc] [Mac] Fix typos found using codespell (GH-28756)
Christian Clauss [Wed, 6 Oct 2021 17:40:09 +0000 (19:40 +0200)] 
[Misc] [Mac] Fix typos found using codespell (GH-28756)

4 years agobpo-40321: Add missing test, slightly expand documentation (GH-28760)
Łukasz Langa [Wed, 6 Oct 2021 15:28:16 +0000 (17:28 +0200)] 
bpo-40321: Add missing test, slightly expand documentation (GH-28760)

4 years agoRemove test_nntplib from quicktest (GH-28754)
Inada Naoki [Wed, 6 Oct 2021 15:03:58 +0000 (00:03 +0900)] 
Remove test_nntplib from quicktest (GH-28754)

4 years agobpo-34804: [doc] Rephrase section on side effects in functional.rst for clarity ...
DonnaDia [Wed, 6 Oct 2021 14:51:55 +0000 (17:51 +0300)] 
bpo-34804: [doc] Rephrase section on side effects in functional.rst for clarity (GH-27989)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-40116: Add insertion order bit-vector to dict values to allow dicts to share...
Mark Shannon [Wed, 6 Oct 2021 12:19:53 +0000 (13:19 +0100)] 
bpo-40116: Add insertion order bit-vector to dict values to allow dicts to share keys more freely. (GH-28520)

4 years agoNormalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)
Mark Shannon [Wed, 6 Oct 2021 12:05:45 +0000 (13:05 +0100)] 
Normalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)

4 years agobpo-40321: Support HTTP response status code 308 in urllib.request (#19588)
Jochem Schulenklopper [Wed, 6 Oct 2021 02:02:58 +0000 (04:02 +0200)] 
bpo-40321: Support HTTP response status code 308 in urllib.request (#19588)

* Support HTTP response status code 308 in urllib.

HTTP response status code 308 is defined in https://tools.ietf.org/html/rfc7538 to be the permanent redirect variant of 307 (temporary redirect).

* Update documentation to include http_error_308()

* Add blurb for bpo-40321 fix

Co-authored-by: Roland Crosby <roland@rolandcrosby.com>
4 years ago[doc] Fix typos found using codespell (GH-28744)
Christian Clauss [Tue, 5 Oct 2021 21:48:44 +0000 (23:48 +0200)] 
[doc] Fix typos found using codespell (GH-28744)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0 (GH-28684)
Illia Volochii [Tue, 5 Oct 2021 21:30:38 +0000 (00:30 +0300)] 
bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0 (GH-28684)

4 years ago[Tools/peg_generator/pegen/parser.py] Fix typo: s/wether/whether/ (GH-28739)
Ikko Ashimine [Tue, 5 Oct 2021 21:06:19 +0000 (06:06 +0900)] 
[Tools/peg_generator/pegen/parser.py] Fix typo: s/wether/whether/ (GH-28739)

4 years agobpo-45020: Identify which frozen modules are actually aliases. (gh-28655)
Eric Snow [Tue, 5 Oct 2021 17:26:37 +0000 (11:26 -0600)] 
bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)

In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.)

Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen().

https://bugs.python.org/issue45020

4 years agoPost 3.11.0a1
Pablo Galindo [Tue, 5 Oct 2021 17:08:06 +0000 (18:08 +0100)] 
Post 3.11.0a1

4 years agoMerge tag 'v3.11.0a1'
Pablo Galindo [Tue, 5 Oct 2021 17:07:59 +0000 (18:07 +0100)] 
Merge tag 'v3.11.0a1'

Python 3.11.0a1

4 years ago[doc] Fix gethostbyname_ex description (GH-28700)
Andre Delfino [Tue, 5 Oct 2021 16:53:35 +0000 (13:53 -0300)] 
[doc] Fix gethostbyname_ex description (GH-28700)

It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.

4 years agoRearrage the finder tests. (gh-28740)
Eric Snow [Tue, 5 Oct 2021 16:37:14 +0000 (10:37 -0600)] 
Rearrage the finder tests. (gh-28740)

This makes the tests a bit cleaner and makes adding more tests a little simpler.

https://bugs.python.org/issue45324

4 years agobpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh...
Eric Snow [Tue, 5 Oct 2021 16:01:27 +0000 (10:01 -0600)] 
bpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh-28633)

Before this change we end up duplicating effort and throwing away data in FrozenImporter.find_spec().  Now we do the work once in find_spec() and the only thing we do in FrozenImporter.exec_module() is turn the raw frozen data into a code object and then exec it.

We've added _imp.find_frozen(), add an arg to _imp.get_frozen_object(), and updated FrozenImporter.  We've also moved some code around to reduce duplication, get a little more consistency in outcomes, and be more efficient.

Note that this change is mostly necessary if we want to set __file__ on frozen stdlib modules. (See https://bugs.python.org/issue21736.)

https://bugs.python.org/issue45324

4 years agobpo-44050: Extension modules can share state when they don't support sub-interpreters...
Hai Shi [Tue, 5 Oct 2021 13:19:32 +0000 (21:19 +0800)] 
bpo-44050: Extension modules can share state when they don't support sub-interpreters. (GH-27794)

Automerge-Triggered-By: GH:encukou
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>