]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102259: Fix re doc issue regarding right square brackets (#102264)
Skip Montanaro [Sun, 26 Feb 2023 02:22:16 +0000 (20:22 -0600)] 
gh-102259: Fix re doc issue regarding right square brackets (#102264)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-101765: Fix refcount issues in list and unicode pickling (#102265)
Jelle Zijlstra [Sun, 26 Feb 2023 00:01:58 +0000 (16:01 -0800)] 
gh-101765: Fix refcount issues in list and unicode pickling (#102265)

Followup from #101769.

2 years agogh-101100: Fix sphinx warnings in `typing` module docs (#102260)
Nikita Sobolev [Sat, 25 Feb 2023 21:48:00 +0000 (00:48 +0300)] 
gh-101100: Fix sphinx warnings in `typing` module docs (#102260)

2 years agogh-102252: Improve coverage of test_bool.py (#102253)
Eclips4 [Sat, 25 Feb 2023 20:50:24 +0000 (23:50 +0300)] 
gh-102252: Improve coverage of test_bool.py (#102253)

Add tests for conversion from bool to complex.

2 years agogh-102209: Sync with zipp 3.15 moving complexity tests into dedicated module (#102232)
Jason R. Coombs [Sat, 25 Feb 2023 16:15:48 +0000 (11:15 -0500)] 
gh-102209: Sync with zipp 3.15 moving complexity tests into dedicated module (#102232)

Sync with jaraco/zipp@757a4e1a.

2 years agoasyncio docs: Fix dangling hyphen (#102227)
Jelle Zijlstra [Sat, 25 Feb 2023 13:21:32 +0000 (05:21 -0800)] 
asyncio docs: Fix dangling hyphen (#102227)

Currently this gets rendered with a dangling hyphen.

2 years agogh-101997: Update bundled pip version to 23.0.1 (#101998)
Pradyun Gedam [Sat, 25 Feb 2023 12:00:12 +0000 (12:00 +0000)] 
gh-101997: Update bundled pip version to 23.0.1 (#101998)

2 years agogh-101100: Fix Sphinx warnings in `decimal` module (#102125)
Hugo van Kemenade [Sat, 25 Feb 2023 09:42:45 +0000 (11:42 +0200)] 
gh-101100: Fix Sphinx warnings in `decimal` module (#102125)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoGH-102126: fix deadlock at shutdown when clearing thread states (#102222)
Kumar Aditya [Sat, 25 Feb 2023 06:51:36 +0000 (12:21 +0530)] 
GH-102126: fix deadlock at shutdown when clearing thread states (#102222)

2 years agogh-95675: fix uid and gid at test_add_dir_getmember (gh-102207)
SKO [Sat, 25 Feb 2023 02:26:40 +0000 (11:26 +0900)] 
gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207)

Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
2 years agogh-101765: Fix SystemError / segmentation fault in iter `__reduce__` when internal...
Ionite [Fri, 24 Feb 2023 23:02:04 +0000 (18:02 -0500)] 
gh-101765: Fix SystemError / segmentation fault in iter `__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (#101769)

2 years agogh-102209: Disable the timeout in test_implied_dirs_performance. (#102225)
Jason R. Coombs [Fri, 24 Feb 2023 22:58:10 +0000 (17:58 -0500)] 
gh-102209: Disable the timeout in test_implied_dirs_performance. (#102225)

Disable the timeout in test_implied_dirs_performance. Workaround for #102209 until I can work out a more robust test for linearity.

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Modules...
Irit Katriel [Fri, 24 Feb 2023 21:43:03 +0000 (21:43 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Modules/) (#102196)

2 years agogh-101476: Use _PyType_GetModuleState where applicable (#102188)
Erlend E. Aasland [Fri, 24 Feb 2023 20:16:29 +0000 (21:16 +0100)] 
gh-101476: Use _PyType_GetModuleState where applicable (#102188)

2 years agogh-102105 Fix wording in filterfalse/quantify/filter (GH-102189)
Stefan Pochmann [Fri, 24 Feb 2023 16:13:05 +0000 (17:13 +0100)] 
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189)

2 years agoRemove references to old Windows source files from internal documentation (GH-102216)
Max Bachmann [Fri, 24 Feb 2023 14:53:50 +0000 (15:53 +0100)] 
Remove references to old Windows source files from internal documentation (GH-102216)

2 years agogh-102141: replace use of getpid on Windows with GetCurrentProcessId (GH-102142)
Max Bachmann [Fri, 24 Feb 2023 12:38:21 +0000 (13:38 +0100)] 
gh-102141: replace use of getpid on Windows with GetCurrentProcessId (GH-102142)

2 years agogh-81652: Add MAP_ALIGNED_SUPER FreeBSD and MAP_CONCEAL OpenBSD constants (gh-102191)
Yeojin Kim [Fri, 24 Feb 2023 10:26:51 +0000 (19:26 +0900)] 
gh-81652: Add MAP_ALIGNED_SUPER FreeBSD and MAP_CONCEAL OpenBSD constants (gh-102191)

2 years agogh-102158: Add tests for `softkwlist` (#102159)
Eclips4 [Fri, 24 Feb 2023 02:28:24 +0000 (05:28 +0300)] 
gh-102158: Add tests for `softkwlist` (#102159)

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agoFix deadlock on shutdown if test_current_{exception,frames} fails (#102019)
Jacob Bower [Thu, 23 Feb 2023 22:57:06 +0000 (14:57 -0800)] 
Fix deadlock on shutdown if test_current_{exception,frames} fails (#102019)

* Don't deadlock on shutdown if test_current_{exception,frames} fails

These tests spawn a thread that waits on a threading.Event. If the test fails any of its assertions, the Event won't be signaled and the thread will wait indefinitely, causing a deadlock when threading._shutdown() tries to join all outstanding threads.

Co-authored-by: Brett Simmers <bsimmers@meta.com>
* Add a news entry

* Fix whitespace

---------

Co-authored-by: Brett Simmers <bsimmers@meta.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-101476: Add _PyType_GetModuleState (GH-101477)
Erlend E. Aasland [Thu, 23 Feb 2023 21:42:15 +0000 (22:42 +0100)] 
gh-101476: Add _PyType_GetModuleState (GH-101477)

For fast module state access from heap type methods.

2 years agogh-99108: Followup fix for Modules/Setup (GH-102183)
Jonathan Protzenko [Thu, 23 Feb 2023 17:23:57 +0000 (09:23 -0800)] 
gh-99108: Followup fix for Modules/Setup (GH-102183)

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-93649: Split exception tests from _testcapimodule.c (GH-102173)
Erlend E. Aasland [Thu, 23 Feb 2023 15:03:13 +0000 (16:03 +0100)] 
gh-93649: Split exception tests from _testcapimodule.c (GH-102173)

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-101981: Consolidate macOS configure steps in CI (GH-102131)
Erlend E. Aasland [Thu, 23 Feb 2023 15:02:23 +0000 (16:02 +0100)] 
gh-101981: Consolidate macOS configure steps in CI (GH-102131)

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-102151: Correctly fetch CONFIG_ARGS in Tools/freeze/test/freeze.py (#102152)
Erlend E. Aasland [Thu, 23 Feb 2023 14:09:51 +0000 (15:09 +0100)] 
gh-102151: Correctly fetch CONFIG_ARGS in Tools/freeze/test/freeze.py (#102152)

2 years agobpo-23224: Fix segfaults and multiple leaks in the lzma and bz2 modules (GH-7822)
Zackery Spytz [Thu, 23 Feb 2023 14:00:58 +0000 (06:00 -0800)] 
bpo-23224: Fix segfaults and multiple leaks in the lzma and bz2 modules (GH-7822)

lzma.LZMADecompressor and bz2.BZ2Decompressor objects caused
segfaults when their `__init__()` methods were not called.

lzma.LZMADecompressor, lzma.LZMACompressor, bz2.BZ2Compressor,
and bz2.BZ2Decompressor objects would leak locks and internal buffers
when their `__init__()` methods were called multiple times.

https://bugs.python.org/issue23224

2 years agoFix typo in `Py_GetPythonHome` signature (#102168)
Tanner Firl [Thu, 23 Feb 2023 13:28:33 +0000 (07:28 -0600)] 
Fix typo in `Py_GetPythonHome` signature (#102168)

2 years agogh-101578: Fixup NEWS and add What's New entry for new exception APIs (#102157)
Erlend E. Aasland [Thu, 23 Feb 2023 12:19:21 +0000 (13:19 +0100)] 
gh-101578: Fixup NEWS and add What's New entry for new exception APIs (#102157)

2 years agoGH-100719: Remove redundant `gi_code` field from generator object. (GH-100749)
Mark Shannon [Thu, 23 Feb 2023 10:19:01 +0000 (10:19 +0000)] 
GH-100719: Remove redundant `gi_code` field from generator object. (GH-100749)

2 years agoRevert "bpo-46978: Correct docstrings for in-place builtin operators #31802) (#102146)
Irit Katriel [Thu, 23 Feb 2023 10:17:44 +0000 (10:17 +0000)] 
Revert "bpo-46978: Correct docstrings for in-place builtin operators #31802) (#102146)

Revert "bpo-46978: Correct docstrings for in-place builtin operators (#31802)"

This reverts commit 128379b8cdb88a6d3d7fed24df082c9a654b3fb8.

2 years agogh-87634: remove locking from functools.cached_property (GH-101890)
Carl Meyer [Thu, 23 Feb 2023 01:49:22 +0000 (18:49 -0700)] 
gh-87634: remove locking from functools.cached_property (GH-101890)

Remove the undocumented locking capabilities of functools.cached_property.

2 years agoFix syntax error in struct doc example (#102160)
Terry Jan Reedy [Wed, 22 Feb 2023 23:55:03 +0000 (18:55 -0500)] 
Fix syntax error in struct doc example (#102160)

Missing closing ) reported on Discuss by Chukwudi Nwachukwu.

2 years agogh-99108: Import MD5 and SHA1 from HACL* (#102089)
Jonathan Protzenko [Wed, 22 Feb 2023 21:18:43 +0000 (13:18 -0800)] 
gh-99108: Import MD5 and SHA1 from HACL* (#102089)

Replaces our fallback non-OpenSSL MD5 and SHA1 implementations with those from HACL* as we've already done with SHA2.

2 years agoGH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (#102143)
Owain Davies [Wed, 22 Feb 2023 20:21:38 +0000 (03:21 +0700)] 
GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (#102143)

2 years agoFew coverage nitpicks for the cmath module (#102067)
Sergey B Kirpichev [Wed, 22 Feb 2023 19:10:01 +0000 (22:10 +0300)] 
Few coverage nitpicks for the cmath module (#102067)

- partial tests for cosh/sinh overflows (L535 and L771).  I doubt
  both ||-ed conditions could be tested.
- removed inaccessible case in sqrt (L832): ax=ay=0 is handled
  above (L823) because fabs() is exact.  Also added test (checked
  with mpmath and gmpy2) for second condition on that line.
- some trivial tests for isclose (cover all conditions on L1217-1218)
- add comment for uncovered L1018

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2 years agoGH-100982: Restrict `FOR_ITER_RANGE` to a single instruction to allow instrumentation...
Mark Shannon [Wed, 22 Feb 2023 11:11:57 +0000 (11:11 +0000)] 
GH-100982: Restrict `FOR_ITER_RANGE` to a single instruction to allow instrumentation. (GH-101985)

2 years agogh-102135: Update turtle docs to rename wikipedia demo to rosette (#102137)
somebody [Wed, 22 Feb 2023 10:11:30 +0000 (14:11 +0400)] 
gh-102135: Update turtle docs to rename wikipedia demo to rosette (#102137)

2 years agogh-99942: python.pc on android/cygwin should link to libpython per configure.ac ...
Eli Schwartz [Wed, 22 Feb 2023 01:21:24 +0000 (20:21 -0500)] 
gh-99942: python.pc on android/cygwin should link to libpython per configure.ac (GH-100356)

In commit 254b309c801f82509597e3d7d4be56885ef94c11 a previous change to avoid linking to libpython was partially reverted for Android (and later Cygwin as well), to add back the link flags. This was applied to distutils and to python-config.sh, but not to python.pc.

Add it back to python.pc as well.

Automerge-Triggered-By: GH:gpshead
2 years agogh-95672 fix typo SkitTest to SkipTest (gh-102119)
Hyunkyun Moon [Tue, 21 Feb 2023 17:39:00 +0000 (02:39 +0900)] 
gh-95672 fix typo SkitTest to SkipTest (gh-102119)

Co-authored-by: HyunKyun Moon <hyunkyun.moon@linecorp.com>
2 years agogh-101936: Update the default value of fp from io.StringIO to io.BytesIO (gh-102100)
Vo Hoang Long [Tue, 21 Feb 2023 15:14:41 +0000 (22:14 +0700)] 
gh-101936: Update the default value of fp from io.StringIO to io.BytesIO (gh-102100)

Co-authored-by: Long Vo <long.vo@linecorp.com>
2 years agogh-102008: simplify test_except_star by using sys.exception() instead of sys.exc_info...
Irit Katriel [Tue, 21 Feb 2023 15:11:31 +0000 (15:11 +0000)] 
gh-102008: simplify test_except_star by using sys.exception() instead of sys.exc_info() (#102009)

2 years agogh-101903: Remove obsolete undefs for previously removed macros Py_EnterRecursiveCall...
Owain Davies [Tue, 21 Feb 2023 11:58:47 +0000 (18:58 +0700)] 
gh-101903: Remove obsolete undefs for previously removed macros Py_EnterRecursiveCall and Py_LeaveRecursiveCall (#101923)

2 years agogh-100556: Improve clarity of `or` docs (#100589)
ram vikram singh [Tue, 21 Feb 2023 10:34:56 +0000 (16:04 +0530)] 
gh-100556: Improve clarity of `or` docs (#100589)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-101777: Make `PriorityQueue` docs slightly clearer (#102026)
Owain Davies [Tue, 21 Feb 2023 10:24:33 +0000 (17:24 +0700)] 
gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)

Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.

2 years agogh-101965: Fix usage of Py_EnterRecursiveCall return value in _bisectmodule.c (GH...
Owain Davies [Tue, 21 Feb 2023 10:03:50 +0000 (17:03 +0700)] 
gh-101965: Fix usage of Py_EnterRecursiveCall return value in _bisectmodule.c (GH-101966)

Closes #101965

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-101578: Amend exception docs (#102057)
Erlend E. Aasland [Tue, 21 Feb 2023 08:15:49 +0000 (09:15 +0100)] 
gh-101578: Amend exception docs (#102057)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-101961 fileinput.hookcompressed should not set the encoding value for the binary...
Gihwan Kim [Tue, 21 Feb 2023 03:10:29 +0000 (12:10 +0900)] 
gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068)

2 years agogh-102056: Fix a few bugs in error handling of exception printing code (#102078)
Irit Katriel [Mon, 20 Feb 2023 22:16:09 +0000 (22:16 +0000)] 
gh-102056: Fix a few bugs in error handling of exception printing code (#102078)

2 years agogh-102011: use sys.exception() instead of sys.exc_info() in docs where possible ...
Irit Katriel [Mon, 20 Feb 2023 21:54:19 +0000 (21:54 +0000)] 
gh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (#102012)

2 years agogh-101566: Sync with zipp 3.14. (GH-102018)
Jason R. Coombs [Mon, 20 Feb 2023 21:01:58 +0000 (16:01 -0500)] 
gh-101566: Sync with zipp 3.14. (GH-102018)

2 years agoGH-99818: improve the documentation for zipfile.Path and Traversable (GH-101589)
Filipe Laíns [Mon, 20 Feb 2023 19:21:10 +0000 (19:21 +0000)] 
GH-99818: improve the documentation for zipfile.Path and Traversable (GH-101589)

Automerge-Triggered-By: GH:FFY00
2 years agogh-88233: zipfile: handle extras after a zip64 extra (GH-96161)
Tim Hatch [Mon, 20 Feb 2023 17:07:03 +0000 (09:07 -0800)] 
gh-88233: zipfile: handle extras after a zip64 extra (GH-96161)

Previously, any data _after_ the zip64 extra would be removed.

With many new tests.

Fixes #88233

Automerge-Triggered-By: GH:jaraco
2 years agogh-101981: Apply HOMEBREW related environment variables (gh-102074)
Dong-hee Na [Mon, 20 Feb 2023 15:20:18 +0000 (00:20 +0900)] 
gh-101981: Apply HOMEBREW related environment variables (gh-102074)

2 years agogh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (GH-101912)
Steve Dower [Mon, 20 Feb 2023 14:56:48 +0000 (14:56 +0000)] 
gh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (GH-101912)

* gh-101907: Removes use of non-standard C++ extension from Include/cpython/code.h

* Make cases_generator correct on Windows

2 years agogh-101819: Adapt _io types to heap types, batch 1 (GH-101949)
Erlend E. Aasland [Mon, 20 Feb 2023 13:46:20 +0000 (14:46 +0100)] 
gh-101819: Adapt _io types to heap types, batch 1 (GH-101949)

Adapt StringIO, TextIOWrapper, FileIO, Buffered*, and BytesIO types.

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-101981: Build macOS as recommended by the devguide (GH-102070)
Erlend E. Aasland [Mon, 20 Feb 2023 13:07:25 +0000 (14:07 +0100)] 
gh-101981: Build macOS as recommended by the devguide (GH-102070)

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-97786: Fix compiler warnings in pytime.c (#101826)
Mark Dickinson [Mon, 20 Feb 2023 01:16:11 +0000 (01:16 +0000)] 
gh-97786: Fix compiler warnings in pytime.c (#101826)

Fixes compiler warnings in pytime.c.

2 years agogh-101578: Amend PyErr_{Set,Get}RaisedException docs (#101962)
Erlend E. Aasland [Sun, 19 Feb 2023 20:22:29 +0000 (21:22 +0100)] 
gh-101578: Amend PyErr_{Set,Get}RaisedException docs (#101962)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoMisc improvements to the float tutorial (GH-102052)
Raymond Hettinger [Sun, 19 Feb 2023 19:21:37 +0000 (13:21 -0600)] 
Misc improvements to the float tutorial (GH-102052)

2 years agogh-85417: Clarify behaviour on branch cuts in cmath module (#102046)
Mark Dickinson [Sun, 19 Feb 2023 19:15:44 +0000 (19:15 +0000)] 
gh-85417: Clarify behaviour on branch cuts in cmath module (#102046)

This PR updates the cmath module documentation to reflect the reality that Python is almost always (and as far as I can tell, that "almost" can be omitted) running on a machine whose C double supports signed zeros.

* Removes misleading references to functions being continuous from above / below / the left / the right at branch cuts
* Expands the note on branch cuts at the top of the module documentation to explain the double-sided sign-of-zero-based behaviour

2 years agogh-100425: Update tutorial docs related to sum() accuracy (FH-101854)
neuralstring [Sun, 19 Feb 2023 16:39:03 +0000 (16:39 +0000)] 
gh-100425: Update tutorial docs related to sum() accuracy (FH-101854)

2 years agoAdd missing 'is' to `cmath.log()` docstring (#102049)
Owain Davies [Sun, 19 Feb 2023 15:00:59 +0000 (22:00 +0700)] 
Add missing 'is' to `cmath.log()` docstring (#102049)

Fix missing 'is' in cmath.log() docstring

2 years agogh-100210: Correct the comment link for unescaping HTML (#100212)
Jean-Christophe Amiel [Sun, 19 Feb 2023 10:18:12 +0000 (11:18 +0100)] 
gh-100210: Correct the comment link for unescaping HTML (#100212)

gh-100210: correct the comment link for unescaping HTML

2 years agogh-97930: Also include subdirectory in makefile. (#102030)
Jason R. Coombs [Sun, 19 Feb 2023 02:32:50 +0000 (21:32 -0500)] 
gh-97930: Also include subdirectory in makefile. (#102030)

2 years agogh-99735: Use required=True in argparse subparsers example (#100927)
Patricio Paez [Sun, 19 Feb 2023 01:06:03 +0000 (19:06 -0600)] 
gh-99735: Use required=True in argparse subparsers example (#100927)

2 years agoFix incorrectly documented attribute in csv docs (#101250)
Reza Rastak [Sun, 19 Feb 2023 00:55:43 +0000 (19:55 -0500)] 
Fix incorrectly documented attribute in csv docs (#101250)

2 years agoGH-84783: Make the slice object hashable (GH-101264)
Furkan Onder [Sun, 19 Feb 2023 00:22:02 +0000 (00:22 +0000)] 
GH-84783: Make the slice object hashable (GH-101264)

2 years agogh-97930: Apply changes from importlib_resources 5.12. (GH-102010)
Jason R. Coombs [Sat, 18 Feb 2023 21:29:22 +0000 (16:29 -0500)] 
gh-97930: Apply changes from importlib_resources 5.12. (GH-102010)

2 years agobpo-46978: Correct docstrings for in-place builtin operators (#31802)
Nicko van Someren [Sat, 18 Feb 2023 18:44:41 +0000 (11:44 -0700)] 
bpo-46978: Correct docstrings for in-place builtin operators (#31802)

2 years agogh-101536: [docs] Improve attributes of `urllib.error.HTTPError` (#101612)
Nikita Sobolev [Sat, 18 Feb 2023 15:46:33 +0000 (18:46 +0300)] 
gh-101536: [docs] Improve attributes of `urllib.error.HTTPError` (#101612)

* gh-101536: [docs] Improve attributes of `urllib.error.HTTPError`

* Address review

2 years agogh-101967: add a missing error check (#101968)
Eclips4 [Sat, 18 Feb 2023 00:52:23 +0000 (03:52 +0300)] 
gh-101967: add a missing error check (#101968)

2 years agogh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746)
Owain Davies [Fri, 17 Feb 2023 21:36:47 +0000 (04:36 +0700)] 
gh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746)

2 years agogh-100226: Clarify StreamReader.read behavior (#101807)
Jan Gosmann [Fri, 17 Feb 2023 21:01:26 +0000 (22:01 +0100)] 
gh-100226: Clarify StreamReader.read behavior (#101807)

2 years agogh-101992: update plistlib examples to be runnable (#101994)
Dustin Rodrigues [Fri, 17 Feb 2023 19:30:29 +0000 (14:30 -0500)] 
gh-101992: update plistlib examples to be runnable (#101994)

* gh-101992: update plistlib examples to be runnable

* Update Doc/library/plistlib.rst

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-101766: Fix refleak for _BlockingOnManager resources from test suite level (gh...
Dong-hee Na [Fri, 17 Feb 2023 15:18:47 +0000 (00:18 +0900)] 
gh-101766: Fix refleak for _BlockingOnManager resources from test suite level (gh-101988)

2 years agogh-100809: Fix handling of drive-relative paths in pathlib.Path.absolute() (GH-100812)
Barney Gale [Fri, 17 Feb 2023 14:08:14 +0000 (14:08 +0000)] 
gh-100809: Fix handling of drive-relative paths in pathlib.Path.absolute() (GH-100812)

Resolving the drive independently uses the OS API, which ensures it starts from the current directory on that drive.

2 years agogh-101360: Fix anchor matching in pathlib.PureWindowsPath.match() (GH-101363)
Barney Gale [Fri, 17 Feb 2023 14:05:38 +0000 (14:05 +0000)] 
gh-101360: Fix anchor matching in pathlib.PureWindowsPath.match() (GH-101363)

Use `fnmatch` to match path and pattern anchors, just as we do for other
path parts. This allows patterns such as `'*:/Users/*'` to be matched.

2 years agogh-101766: Fix refleak for _BlockingOnManager resources (gh-101942)
Dong-hee Na [Fri, 17 Feb 2023 10:14:07 +0000 (19:14 +0900)] 
gh-101766: Fix refleak for _BlockingOnManager resources (gh-101942)

2 years agoDocs: fix typos in PyFunction_WatchCallback docs and in 3.12 NEWS (GH-101980)
Yeojin Kim [Fri, 17 Feb 2023 08:47:02 +0000 (17:47 +0900)] 
Docs: fix typos in PyFunction_WatchCallback docs and in 3.12 NEWS (GH-101980)

- possitibility => possibility
- disaallowed => disallowed

2 years agogh-101973: Fix parameter reference for PyModule_FromDefAndSpec (#101976)
Oleg Iarygin [Fri, 17 Feb 2023 08:43:07 +0000 (12:43 +0400)] 
gh-101973: Fix parameter reference for PyModule_FromDefAndSpec (#101976)

2 years agogh-101758: Fix Refleak-Related Failures in test_singlephase_variants (gh-101969)
Eric Snow [Fri, 17 Feb 2023 00:21:22 +0000 (17:21 -0700)] 
gh-101758: Fix Refleak-Related Failures in test_singlephase_variants (gh-101969)

gh-101891 is causing failures under `$> ./python -m test test_imp -R 3:3`.  Furthermore, with that fixed, "test_singlephase_variants" is leaking references.  This change addresses the first part, but skips the leaking tests until we can follow up with a fix.

https://github.com/python/cpython/issues/101758

2 years agogh-101758: Add _PyState_AddModule() Back for the Stable ABI (gh-101956)
Eric Snow [Thu, 16 Feb 2023 21:05:31 +0000 (14:05 -0700)] 
gh-101758: Add _PyState_AddModule() Back for the Stable ABI (gh-101956)

We're adding the function back, only for the stable ABI symbol and not as any form of API. I had removed it yesterday.

This undocumented "private" function was added with the implementation for PEP 3121 (3.0, 2007) for internal use and later moved out of the limited API (3.6, 2016) and then into the internal API (3.9, 2019). I removed it completely yesterday, including from the stable ABI manifest (where it was added because the symbol happened to be exported). It's unlikely that anyone is using _PyState_AddModule(), especially any stable ABI extensions built against 3.2-3.5, but we're playing it safe.

https://github.com/python/cpython/issues/101758

2 years agoGH-96764: rewrite `asyncio.wait_for` to use `asyncio.timeout` (#98518)
Kumar Aditya [Thu, 16 Feb 2023 18:48:21 +0000 (00:18 +0530)] 
GH-96764: rewrite `asyncio.wait_for` to use `asyncio.timeout` (#98518)

Changes `asyncio.wait_for` to use `asyncio.timeout` as its underlying implementation.

2 years agogh-99942: correct the pkg-config/python-config flags for cygwin/android
Eli Schwartz [Thu, 16 Feb 2023 17:57:59 +0000 (12:57 -0500)] 
gh-99942: correct the pkg-config/python-config flags for cygwin/android

2 years agogh-101952: Fix possible segfault in `BUILD_SET` opcode (#101958)
Eclips4 [Thu, 16 Feb 2023 17:46:43 +0000 (20:46 +0300)] 
gh-101952: Fix possible segfault in `BUILD_SET` opcode (#101958)

2 years agogh-93573: Replace wrong example domains in configparser doc (GH-93574)
sblondon [Thu, 16 Feb 2023 15:13:21 +0000 (16:13 +0100)] 
gh-93573: Replace wrong example domains in configparser doc (GH-93574)

* Replace bitbucket.org domain by forge.example
* Update example to python.org
* Use explicitly invalid domain

topsecret.server.com domain is not controled by PSF. It's replaced by invalid topsecret.server.example domain. It follows RFC 2606, which advise .example as TLD for documentation.

2 years agogh-101881: Support (non-)blocking read/write functions on Windows pipes (GH-101882)
Rayyan Ansari [Thu, 16 Feb 2023 14:52:24 +0000 (14:52 +0000)] 
gh-101881: Support (non-)blocking read/write functions on Windows pipes (GH-101882)

* fileutils: handle non-blocking pipe IO on Windows

Handle erroring operations on non-blocking pipes by reading the _doserrno code.
Limit writes on non-blocking pipes that are too large.

* Support blocking functions on Windows

Use the GetNamedPipeHandleState and SetNamedPipeHandleState Win32 API functions to add support for os.get_blocking and os.set_blocking.

2 years agogh-101951: use textwrap.dedent in compiler tests to make them more readable (GH-101950)
Irit Katriel [Thu, 16 Feb 2023 12:31:59 +0000 (12:31 +0000)] 
gh-101951: use textwrap.dedent in compiler tests to make them more readable (GH-101950)

Fixes #101951.

Automerge-Triggered-By: GH:iritkatriel
2 years agogh-101928: fix crash in compiler on multi-line lambda in function call (#101933)
penguin_wwy [Thu, 16 Feb 2023 11:31:41 +0000 (19:31 +0800)] 
gh-101928: fix crash in compiler on multi-line lambda in function call (#101933)

2 years agogh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)
Gregory P. Smith [Thu, 16 Feb 2023 06:08:20 +0000 (22:08 -0800)] 
gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)

This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance.

This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice.

Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names.

Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.

2 years agogh-98627: Add an Optional Check for Extension Module Subinterpreter Compatibility...
Eric Snow [Thu, 16 Feb 2023 01:16:00 +0000 (18:16 -0700)] 
gh-98627: Add an Optional Check for Extension Module Subinterpreter Compatibility (gh-99040)

Enforcing (optionally) the restriction set by PEP 489 makes sense. Furthermore, this sets the stage for a potential restriction related to a per-interpreter GIL.

This change includes the following:

* add tests for extension module subinterpreter compatibility
* add _PyInterpreterConfig.check_multi_interp_extensions
* add Py_RTFLAGS_MULTI_INTERP_EXTENSIONS
* add _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
* fail iff the module does not implement multi-phase init and the current interpreter is configured to check

https://github.com/python/cpython/issues/98627

2 years agogh-101758: Fix the wasm Buildbots (gh-101943)
Eric Snow [Thu, 16 Feb 2023 00:54:05 +0000 (17:54 -0700)] 
gh-101758: Fix the wasm Buildbots (gh-101943)

They were broken by gh-101920.

https://github.com/python/cpython/issues/101758

2 years agogh-101758: Add a Test For Single-Phase Init Modules in Multiple Interpreters (gh...
Eric Snow [Wed, 15 Feb 2023 23:05:07 +0000 (16:05 -0700)] 
gh-101758: Add a Test For Single-Phase Init Modules in Multiple Interpreters (gh-101920)

The test verifies the behavior of single-phase init modules when loaded in multiple interpreters.

https://github.com/python/cpython/issues/101758

2 years agogh-101758: Clean Up Uses of Import State (gh-101919)
Eric Snow [Wed, 15 Feb 2023 22:32:31 +0000 (15:32 -0700)] 
gh-101758: Clean Up Uses of Import State (gh-101919)

This change is almost entirely moving code around and hiding import state behind internal API.  We introduce no changes to behavior, nor to non-internal API.  (Since there was already going to be a lot of churn, I took this as an opportunity to re-organize import.c into topically-grouped sections of code.)  The motivation is to simplify a number of upcoming changes.

Specific changes:

* move existing import-related code to import.c, wherever possible
* add internal API for interacting with import state (both global and per-interpreter)
* use only API outside of import.c (to limit churn there when changing the location, etc.)
* consolidate the import-related state of PyInterpreterState into a single struct field (this changes layout slightly)
* add macros for import state in import.c (to simplify changing the location)
* group code in import.c into sections
*remove _PyState_AddModule()

https://github.com/python/cpython/issues/101758

2 years agogh-99138: Isolate _zoneinfo (#99218)
Erlend E. Aasland [Wed, 15 Feb 2023 21:58:48 +0000 (22:58 +0100)] 
gh-99138: Isolate _zoneinfo (#99218)

* Convert zone info type to heap type and add it to module state
* Add global variables to module state

2 years agogh-101819: Remove _PyWindowsConsoleIO_Type from the Windows DLL (GH-101904)
Erlend E. Aasland [Wed, 15 Feb 2023 13:07:59 +0000 (14:07 +0100)] 
gh-101819: Remove _PyWindowsConsoleIO_Type from the Windows DLL (GH-101904)

Automerge-Triggered-By: GH:erlend-aasland
2 years agoGH-87849: Fix refleak in SEND instruction. (GH-101908)
Mark Shannon [Wed, 15 Feb 2023 12:21:40 +0000 (12:21 +0000)] 
GH-87849: Fix refleak in SEND instruction. (GH-101908)

Fix refleak in SEND instruction.

2 years agogh-101819: Remove _testcapi dependencies on specific _io symbols (#101918)
Erlend E. Aasland [Wed, 15 Feb 2023 10:18:27 +0000 (11:18 +0100)] 
gh-101819: Remove _testcapi dependencies on specific _io symbols (#101918)

2 years agogh-101693: In sqlite3, deprecate using named placeholders with parameters supplied...
Erlend E. Aasland [Wed, 15 Feb 2023 05:27:16 +0000 (06:27 +0100)] 
gh-101693: In sqlite3, deprecate using named placeholders with parameters supplied as a sequence (#101698)

2 years agogh-99108: Build the hashlib HACL* code as a static library. (#101917)
Gregory P. Smith [Tue, 14 Feb 2023 23:57:01 +0000 (15:57 -0800)] 
gh-99108: Build the hashlib HACL* code as a static library. (#101917)

This builds HACL* as a library in one place.

A followup to #101707 which broke some WASM builds. This fixes 2/4 of them, but the enscripten toolchain in the others don't deduplicate linker arguments and error out. A follow-on PR will address those.