]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102444: Fix minor bugs in `test_typing` highlighted by pyflakes (#102445)
Alex Waygood [Sun, 5 Mar 2023 21:37:29 +0000 (21:37 +0000)] 
gh-102444: Fix minor bugs in `test_typing` highlighted by pyflakes (#102445)

2 years agoGH-102341: Improve the test function for pow (#102342)
Partha P. Mukherjee [Sun, 5 Mar 2023 17:31:26 +0000 (12:31 -0500)] 
GH-102341: Improve the test function for pow (#102342)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agoFix unused classes in a typing test (GH-102437)
JosephSBoyle [Sun, 5 Mar 2023 15:07:44 +0000 (15:07 +0000)] 
Fix unused classes in a typing test (GH-102437)

As part of investigation issue https://github.com/python/cpython/issues/102433, I discovered what I believe to be an error where two classes `CI` and `DI` are not being used. The assertions beneath them act on `C` and `D`, duplicating existing assertions in this test.

Automerge-Triggered-By: GH:AlexWaygood
2 years agogh-101979: argparse: fix a bug where parentheses in metavar argument of add_argument...
Yeojin Kim [Sun, 5 Mar 2023 14:54:33 +0000 (23:54 +0900)] 
gh-101979: argparse: fix a bug where parentheses in metavar argument of add_argument() were dropped (#102318)

2 years agogh-102356: Add thrashcan macros to filter object dealloc (#102426)
Marta Gómez Macías [Sun, 5 Mar 2023 11:00:41 +0000 (12:00 +0100)] 
gh-102356: Add thrashcan macros to filter object dealloc (#102426)

Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters.

2 years agoMove around example in to_bytes() to avoid confusion (#101595)
Sergey B Kirpichev [Sun, 5 Mar 2023 09:31:56 +0000 (12:31 +0300)] 
Move around example in to_bytes() to avoid confusion (#101595)

Moves an example to be closer to the sentence that refers to it.

2 years agoGH-97546: fix flaky asyncio `test_wait_for_race_condition` test (#102421)
Kumar Aditya [Sun, 5 Mar 2023 06:45:22 +0000 (12:15 +0530)] 
GH-97546: fix flaky asyncio `test_wait_for_race_condition` test (#102421)

2 years agogh-96821: Add config option `--with-strict-overflow` (#96823)
Matthias Görgens [Sat, 4 Mar 2023 21:39:52 +0000 (05:39 +0800)] 
gh-96821: Add config option `--with-strict-overflow` (#96823)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <hauntsaninja@gmail.com>
2 years agogh-101992: update pstlib module documentation (#102133)
Dustin Rodrigues [Sat, 4 Mar 2023 21:35:25 +0000 (16:35 -0500)] 
gh-101992: update pstlib module documentation (#102133)

2 years agogh-63301: Set exit code when tabnanny CLI exits on error (#7699)
Jaysinh Shukla [Sat, 4 Mar 2023 21:32:13 +0000 (03:02 +0530)] 
gh-63301: Set exit code when tabnanny CLI exits on error (#7699)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-101863: Fix wrong comments in EUC-KR codec (gh-102417)
Byeongmin Choi [Sat, 4 Mar 2023 16:01:54 +0000 (01:01 +0900)] 
gh-101863: Fix wrong comments in EUC-KR codec (gh-102417)

2 years agogh-102302 Micro-optimize `inspect.Parameter.__hash__` (#102303)
Gouvernathor [Sat, 4 Mar 2023 15:08:57 +0000 (16:08 +0100)] 
gh-102302 Micro-optimize `inspect.Parameter.__hash__` (#102303)

2 years agogh-102179: Fix `os.dup2` error reporting for negative fds (#102180)
Alexey Izbyshev [Sat, 4 Mar 2023 14:24:08 +0000 (17:24 +0300)] 
gh-102179: Fix `os.dup2` error reporting for negative fds (#102180)

2 years agogh-101892: Fix `SystemError` when a callable iterator call exhausts the iterator...
Raj [Sat, 4 Mar 2023 14:21:29 +0000 (19:51 +0530)] 
gh-101892: Fix `SystemError` when a callable iterator call exhausts the iterator (#101896)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agoRemove unused internal macros (#102415)
Mark Dickinson [Sat, 4 Mar 2023 12:20:14 +0000 (12:20 +0000)] 
Remove unused internal macros (#102415)

Since #101826 was merged, the internal macro `_Py_InIntegralTypeRange` is unused, as are its supporting macros `_Py_IntegralTypeMax` and `_Py_IntegralTypeMin`. This PR removes them.

Note that `_Py_InIntegralTypeRange` doesn't actually work as advertised - it's not a safe way to avoid undefined behaviour in an integer to double conversion.

2 years agogh-102021 : Allow multiple input files for interpreter loop generator (#102022)
Jacob Bower [Sat, 4 Mar 2023 04:59:21 +0000 (20:59 -0800)] 
gh-102021 : Allow multiple input files for interpreter loop generator (#102022)

The input files no longer use `-i`.

2 years agoAdd import of `unittest.mock.Mock` in documentation (#102346)
Wagner Alberto [Fri, 3 Mar 2023 17:25:31 +0000 (14:25 -0300)] 
Add import of `unittest.mock.Mock` in documentation (#102346)

2 years agogh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (#102390)
Nikita Sobolev [Fri, 3 Mar 2023 17:16:50 +0000 (20:16 +0300)] 
gh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (#102390)

2 years agogh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840)
Owain Davies [Fri, 3 Mar 2023 10:51:32 +0000 (17:51 +0700)] 
gh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840)

2 years agogh-102324: Improve tests of `typing.override` (#102325)
Nikita Sobolev [Fri, 3 Mar 2023 03:59:05 +0000 (06:59 +0300)] 
gh-102324: Improve tests of `typing.override` (#102325)

Fixes #101564

2 years agogh-102371: move _Py_Mangle from compile.c to symtable.c (#102372)
Irit Katriel [Thu, 2 Mar 2023 18:38:22 +0000 (18:38 +0000)] 
gh-102371: move _Py_Mangle from compile.c to symtable.c (#102372)

2 years agoFix typos in documentation and comments (GH-102374)
Michael K [Thu, 2 Mar 2023 15:26:49 +0000 (16:26 +0100)] 
Fix typos in documentation and comments (GH-102374)

Found some duplicate `to`s in the documentation and some code comments and fixed them.

[Misc/NEWS.d/3.12.0a1.rst](https://github.com/python/cpython/blob/ed55c69ebd74178115cd8b080f7f8e7588cd5fda/Misc/NEWS.d/3.12.0a1.rst) also contains two duplicate `to`s, but I wasn't sure if it's ok to touch that file.  Looks auto generated.  I'm happy to amend the PR if requested. :)

Automerge-Triggered-By: GH:AlexWaygood
2 years agogh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)
Dong-hee Na [Thu, 2 Mar 2023 11:32:05 +0000 (20:32 +0900)] 
gh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)

2 years agogh-95672: Update memory_watchdog to use test.support.get_pagesize (gh-102365)
Hyunkyun Moon [Thu, 2 Mar 2023 11:10:08 +0000 (20:10 +0900)] 
gh-95672: Update memory_watchdog to use test.support.get_pagesize (gh-102365)

2 years agogh-102088 Optimize iter_index itertools recipe (GH-102360)
Stefan Pochmann [Thu, 2 Mar 2023 03:16:23 +0000 (04:16 +0100)] 
gh-102088 Optimize iter_index itertools recipe (GH-102360)

2 years agogh-95672 skip fcntl when pipesize is smaller than pagesize (gh-102163)
Hyunkyun Moon [Wed, 1 Mar 2023 14:56:19 +0000 (23:56 +0900)] 
gh-95672 skip fcntl when pipesize is smaller than pagesize (gh-102163)

2 years agogh-102344: Reimplement winreg QueryValue / SetValue using QueryValueEx / SetValueEx...
Max Bachmann [Wed, 1 Mar 2023 14:50:38 +0000 (15:50 +0100)] 
gh-102344: Reimplement winreg QueryValue / SetValue using QueryValueEx / SetValueEx (GH-102345)

The newer APIs are more widely available than the old ones, and are called in a way to preserve functionality.

2 years agogh-102336: Ensure CancelIoEx result is not ignored (GH-102347)
Max Bachmann [Wed, 1 Mar 2023 12:01:39 +0000 (13:01 +0100)] 
gh-102336: Ensure CancelIoEx result is not ignored (GH-102347)

fix ignored return value

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in tkinter...
Irit Katriel [Wed, 1 Mar 2023 09:49:23 +0000 (09:49 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in tkinter module (#102319)

2 years agoDoc: Fix minor error in ePub (GH-100614)
Inada Naoki [Wed, 1 Mar 2023 00:48:15 +0000 (09:48 +0900)] 
Doc: Fix minor error in ePub (GH-100614)

Fix issue reported https://mail.python.org/archives/list/docs@python.org/message/KE7OIAO53P4XRC4ZOWPDHA63ZQJCHEC3/

2 years agogh-102336: Remove code specifically for handling Windows 7 (GH-102337)
Max Bachmann [Wed, 1 Mar 2023 00:31:21 +0000 (01:31 +0100)] 
gh-102336: Remove code specifically for handling Windows 7 (GH-102337)

2 years agogh-99108: Add missing md5/sha1 defines to Modules/Setup (#102308)
Anthony Sottile [Tue, 28 Feb 2023 21:34:06 +0000 (16:34 -0500)] 
gh-99108: Add missing md5/sha1 defines to Modules/Setup (#102308)

2 years agogh-100227: Move _str_replace_inf to PyInterpreterState (gh-102333)
Eric Snow [Tue, 28 Feb 2023 21:16:39 +0000 (14:16 -0700)] 
gh-100227: Move _str_replace_inf to PyInterpreterState (gh-102333)

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

2 years agogh-100227: Move the dtoa State to PyInterpreterState (gh-102331)
Eric Snow [Tue, 28 Feb 2023 20:14:40 +0000 (13:14 -0700)] 
gh-100227: Move the dtoa State to PyInterpreterState (gh-102331)

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

2 years agoGH-102305: Expand some macros in generated_cases.c.h (#102309)
Guido van Rossum [Tue, 28 Feb 2023 16:49:35 +0000 (08:49 -0800)] 
GH-102305: Expand some macros in generated_cases.c.h (#102309)

* Emit straight stack_pointer[-i] instead of PEEK(i), POKE(i, ...)
* Expand JUMPBY() and NEXTOPARG(), and fix a perf bug

2 years agoMigrate to new PSF mailgun account (#102284)
Ee Durbin [Tue, 28 Feb 2023 13:23:39 +0000 (08:23 -0500)] 
Migrate to new PSF mailgun account (#102284)

Our legacy mailgun account is associated with a parent rackspace account that I am trying to decomission.

The necessary secret has been added to the GitHub Actions Secrets already, so this is ready to go on approval.

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Python...
Irit Katriel [Tue, 28 Feb 2023 11:50:52 +0000 (11:50 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Python/) (#102193)

2 years agoGH-90744: Fix erroneous doc links in the sys module (#101319)
Furkan Onder [Tue, 28 Feb 2023 11:43:00 +0000 (11:43 +0000)] 
GH-90744: Fix erroneous doc links in the sys module (#101319)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-87092: Make jump target label equal to the offset of the target in the instruction...
Irit Katriel [Tue, 28 Feb 2023 11:29:32 +0000 (11:29 +0000)] 
gh-87092: Make jump target label equal to the offset of the target in the instructions sequence (#102093)

2 years agogh-101101: Unstable C API tier (PEP 689) (GH-101102)
Petr Viktorin [Tue, 28 Feb 2023 08:31:01 +0000 (09:31 +0100)] 
gh-101101: Unstable C API tier (PEP 689) (GH-101102)

2 years agoIDLE: Simplify DynOptionsMenu __init__code (#101371)
JosephSBoyle [Tue, 28 Feb 2023 06:11:52 +0000 (06:11 +0000)] 
IDLE: Simplify DynOptionsMenu __init__code (#101371)

Refactor DynOptionMenu's initializer to not copy  kwargs dict and use subscripting;
improve its htest.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-101561: Add typing.override decorator (#101564)
Steven Troxler [Mon, 27 Feb 2023 21:16:11 +0000 (13:16 -0800)] 
gh-101561: Add typing.override decorator (#101564)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-101825: Clarify that as_integer_ratio() output is always normalized (#101843)
Sergey B Kirpichev [Mon, 27 Feb 2023 19:11:28 +0000 (22:11 +0300)] 
gh-101825: Clarify that as_integer_ratio() output is always normalized (#101843)

Make docstrings for `as_integer_ratio` consistent across types, and document that
the returned pair is always normalized (coprime integers, with positive denominator).

---------

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2 years agogh-101773: Optimize creation of Fractions in private methods (#101780)
Sergey B Kirpichev [Mon, 27 Feb 2023 18:53:22 +0000 (21:53 +0300)] 
gh-101773: Optimize creation of Fractions in private methods (#101780)

This PR adds a private `Fraction._from_coprime_ints` classmethod for internal creations of `Fraction` objects, replacing the use of `_normalize=False` in the existing constructor. This speeds up creation of `Fraction` objects arising from calculations. The `_normalize` argument to the `Fraction` constructor has been removed.

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2 years agogh-102251: Updates to test_imp Toward Fixing Some Refleaks (gh-102254)
Eric Snow [Mon, 27 Feb 2023 16:21:18 +0000 (09:21 -0700)] 
gh-102251: Updates to test_imp Toward Fixing Some Refleaks (gh-102254)

This is related to fixing the refleaks introduced by commit 096d009.  I haven't been able to find the leak yet, but these changes are a consequence of that effort.  This includes some cleanup, some tweaks to the existing tests, and a bunch of new test cases.  The only change here that might have impact outside the tests in question is in imp.py, where I update imp.load_dynamic() to use spec_from_file_location() instead of creating a ModuleSpec directly.

Also note that I've updated the tests to only skip if we're checking for refleaks (regrtest's --huntrleaks), whereas in gh-101969 I had skipped the tests entirely.  The tests will be useful for some upcoming work and I'd rather the refleaks not hold that up.  (It isn't clear how quickly we'll be able to fix the leaking code, though it will certainly be done in the short term.)

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

2 years agogh-102296 Document that inspect.Parameter kinds support ordering (GH-102297)
Gouvernathor [Mon, 27 Feb 2023 15:13:18 +0000 (16:13 +0100)] 
gh-102296 Document that inspect.Parameter kinds support ordering (GH-102297)

Automerge-Triggered-By: GH:AlexWaygood
2 years agogh-102250: Fix double-decref in COMPARE_AND_BRANCH error case (GH-102287)
Dennis Sweeney [Mon, 27 Feb 2023 10:46:40 +0000 (05:46 -0500)] 
gh-102250: Fix double-decref in COMPARE_AND_BRANCH error case (GH-102287)

2 years agogh-101100: Fix sphinx warnings in `types` module (#102274)
Nikita Sobolev [Mon, 27 Feb 2023 07:26:21 +0000 (10:26 +0300)] 
gh-101100: Fix sphinx warnings in `types` module (#102274)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-91038: Change default argument value to `False` instead of `0` (#31621)
Rotzbua [Mon, 27 Feb 2023 02:10:34 +0000 (03:10 +0100)] 
gh-91038: Change default argument value to `False` instead of `0` (#31621)

The argument is used as a switch and corresponds to a boolean logic. Therefore it is more intuitive to use the corresponding constant `False` as default value instead of the integer `0`.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-101765: unicodeobject: use Py_XDECREF correctly (#102283)
Jelle Zijlstra [Sun, 26 Feb 2023 22:45:37 +0000 (14:45 -0800)] 
gh-101765: unicodeobject: use Py_XDECREF correctly (#102283)

2 years ago[doc] Improve grammar/fix missing word (GH-102060)
VMan [Sun, 26 Feb 2023 13:15:27 +0000 (13:15 +0000)] 
[doc] Improve grammar/fix missing word (GH-102060)

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)