]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102654: Insert #line directives in generated_cases.c.h (#102669)
Guido van Rossum [Wed, 15 Mar 2023 15:37:36 +0000 (08:37 -0700)] 
gh-102654: Insert #line directives in generated_cases.c.h (#102669)

This behavior is optional, because in some extreme cases it
may just make debugging harder. The tool defaults it to off,
but it is on in Makefile.pre.in.

Also note that this makes diffs to generated_cases.c.h noisier,
since whenever you insert or delete a line in bytecodes.c,
all subsequent #line directives will change.

2 years agogh-101100: Documenting --prefix and --exec-prefix. (GH-102695)
Julien Palard [Wed, 15 Mar 2023 15:10:03 +0000 (16:10 +0100)] 
gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-102281: Fix potential nullptr dereference + use of uninitialized memory (gh-102282)
Max Bachmann [Wed, 15 Mar 2023 12:58:43 +0000 (13:58 +0100)] 
gh-102281: Fix potential nullptr dereference + use of uninitialized memory (gh-102282)

2 years agogh-102615: Use `list` instead of `tuple` in `repr` of paramspec (#102637)
Nikita Sobolev [Wed, 15 Mar 2023 09:33:41 +0000 (12:33 +0300)] 
gh-102615: Use `list` instead of `tuple` in `repr` of paramspec (#102637)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoRemove misformatted exclamation marks in docs (#102694)
Tom Levy [Wed, 15 Mar 2023 07:06:32 +0000 (20:06 +1300)] 
Remove misformatted exclamation marks in docs (#102694)

Remove the exclamation mark from :program:`!foo` in .rst files because
it inadvertently shows up in the rendered HTML.

(Sphinx's cross-referencing roles use a '!' prefix to suppress
hyperlinking[1], but :program: is not a cross-referencing role so the
'!' is displayed verbatim.)

The exclamation marks in venv.rst were introduced in #98350. See
comments [2] and [3] for additional discussion.

[1]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#cross-referencing-syntax
[2]: https://github.com/python/cpython/pull/98350#issuecomment-1285965759
[3]: https://github.com/python/cpython/pull/98350#issuecomment-1286394047

Reported-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2 years agogh-101377: improving test_locale_calendar_formatweekday of calendar (#101378)
Andre Hora [Wed, 15 Mar 2023 02:36:31 +0000 (23:36 -0300)] 
gh-101377: improving test_locale_calendar_formatweekday of calendar (#101378)

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-102560 Add docstrings to asyncio.TaskGroup (#102565)
JosephSBoyle [Wed, 15 Mar 2023 00:33:19 +0000 (00:33 +0000)] 
gh-102560 Add docstrings to asyncio.TaskGroup (#102565)

2 years agogh-102519: Avoid failing tests due to inaccessible volumes (GH-102706)
Steve Dower [Wed, 15 Mar 2023 00:07:30 +0000 (00:07 +0000)] 
gh-102519: Avoid failing tests due to inaccessible volumes (GH-102706)

2 years agogh-102703: Fix typo in modules tutorial documentation (GH-102707)
Robert Prater (B. Eng) [Wed, 15 Mar 2023 00:03:43 +0000 (20:03 -0400)] 
gh-102703: Fix typo in modules tutorial documentation (GH-102707)

**Before**
This prevents directories with a common name, such as ``string``, unintentionally hiding ...
**After**
This prevents directories with a common name, such as ``string``, from unintentionally hiding ...

2 years agogh-101578: mention in what's new in 3.12 that exceptions are now normalized before...
Irit Katriel [Tue, 14 Mar 2023 22:38:15 +0000 (22:38 +0000)] 
gh-101578: mention in what's new in 3.12 that exceptions are now normalized before stored (#102702)

2 years agoRename redundant enum tests so that they run (#102535)
JosephSBoyle [Tue, 14 Mar 2023 22:16:45 +0000 (22:16 +0000)] 
Rename redundant enum tests so that they run (#102535)

2 years agogh-102674: Remove _specialization_stats from Lib/opcode.py (#102685)
Dong-hee Na [Tue, 14 Mar 2023 20:20:14 +0000 (05:20 +0900)] 
gh-102674: Remove _specialization_stats from Lib/opcode.py (#102685)

It's not use except in a test, so move it there instead.

2 years agogh-102660: Handle m_copy Specially for the sys and builtins Modules (gh-102661)
Eric Snow [Tue, 14 Mar 2023 20:01:35 +0000 (14:01 -0600)] 
gh-102660: Handle m_copy Specially for the sys and builtins Modules (gh-102661)

It doesn't make sense to use multi-phase init for these modules. Using a per-interpreter "m_copy" (instead of PyModuleDef.m_base.m_copy) makes this work okay. (This came up while working on gh-101660.)

Note that we might instead end up disallowing re-load for sys/builtins since they are so special.

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

2 years agogh-102354: change python3 to python in docs examples (#102696)
Paul Watson [Tue, 14 Mar 2023 18:40:12 +0000 (13:40 -0500)] 
gh-102354: change python3 to python in docs examples (#102696)

2 years agogh-81057: Add a CI Check for New Unsupported C Global Variables (gh-102506)
Eric Snow [Tue, 14 Mar 2023 16:05:54 +0000 (10:05 -0600)] 
gh-81057: Add a CI Check for New Unsupported C Global Variables (gh-102506)

This will keep us from adding new unsupported (i.e. non-const) C global variables, which would break interpreter isolation.

FYI, historically it is very uncommon for new global variables to get added. Furthermore, it is rare for new code to break the c-analyzer. So the check should almost always pass unnoticed.

Note that I've removed test_check_c_globals. A test wasn't a great fit conceptually and was super slow on debug builds. A CI check is a better fit.

This also resolves gh-100237.

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

2 years agoGH-94851: check unicode consistency of static strings in debug mode (#102684)
Kumar Aditya [Tue, 14 Mar 2023 09:51:38 +0000 (15:21 +0530)] 
GH-94851: check unicode consistency of static strings in debug mode (#102684)

2 years agogh-100315: clarification to `__slots__` docs. (#102621)
T [Tue, 14 Mar 2023 09:23:52 +0000 (17:23 +0800)] 
gh-100315: clarification to `__slots__` docs. (#102621)

refer to tp_itemsize in discussion on "variable-length" built-in types

2 years agoGH-100227: cleanup initialization of global interned dict (#102682)
Kumar Aditya [Tue, 14 Mar 2023 08:52:21 +0000 (14:22 +0530)] 
GH-100227: cleanup initialization of global interned dict (#102682)

2 years agodoc: Remove a duplicate 'versionchanged' in library/asyncio-task (gh-102677)
Joongi Kim [Tue, 14 Mar 2023 02:07:59 +0000 (11:07 +0900)] 
doc: Remove a duplicate 'versionchanged' in library/asyncio-task (gh-102677)

2 years agogh-102013: Add PyUnstable_GC_VisitObjects (#102014)
Jacob Bower [Tue, 14 Mar 2023 01:35:54 +0000 (20:35 -0500)] 
gh-102013: Add PyUnstable_GC_VisitObjects (#102014)

2 years agoGH-102670: Use sumprod() to simplify, speed up, and improve accuracy of statistics...
Raymond Hettinger [Tue, 14 Mar 2023 01:06:43 +0000 (20:06 -0500)] 
GH-102670: Use sumprod() to simplify, speed up, and improve accuracy of statistics functions (GH-102649)

2 years agogh-102627: Replace address pointing toward malicious web page (#102630)
Blind4Basics [Mon, 13 Mar 2023 22:35:37 +0000 (23:35 +0100)] 
gh-102627: Replace address pointing toward malicious web page (#102630)

* Replace known bad address pointing toward a malicious web page.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-98831: Use DECREF_INPUTS() more (#102409)
Guido van Rossum [Mon, 13 Mar 2023 22:08:45 +0000 (15:08 -0700)] 
gh-98831: Use DECREF_INPUTS() more (#102409)

2 years agogh-101659: Avoid Allocation for Shared Exceptions in the _xxsubinterpreters Module...
Eric Snow [Mon, 13 Mar 2023 22:01:44 +0000 (16:01 -0600)] 
gh-101659: Avoid Allocation for Shared Exceptions in the _xxsubinterpreters Module (gh-102659)

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

2 years agogh-101524: Fix the ChannelID tp_name (gh-102655)
Eric Snow [Mon, 13 Mar 2023 21:50:16 +0000 (15:50 -0600)] 
gh-101524: Fix the ChannelID tp_name (gh-102655)

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

2 years agogh-102069: Fix `__weakref__` descriptor generation for custom dataclasses (#102075)
Nikita Sobolev [Mon, 13 Mar 2023 21:42:05 +0000 (00:42 +0300)] 
gh-102069: Fix `__weakref__` descriptor generation for custom dataclasses (#102075)

2 years agogh-98169 dataclasses.astuple support DefaultDict (#98170)
T [Mon, 13 Mar 2023 20:46:35 +0000 (04:46 +0800)] 
gh-98169 dataclasses.astuple support DefaultDict (#98170)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2 years agogh-102650: Remove duplicate include directives from multiple source files (#102651)
chgnrdv [Mon, 13 Mar 2023 19:25:17 +0000 (22:25 +0300)] 
gh-102650: Remove duplicate include directives from multiple source files (#102651)

Remove duplicate include directives from multiple source files

2 years agoGH-100987: Don't cache references to the names and consts array in `_PyEval_EvalFrame...
Mark Shannon [Mon, 13 Mar 2023 18:35:37 +0000 (18:35 +0000)] 
GH-100987: Don't cache references to the names and consts array in `_PyEval_EvalFrameDefault`. (#102640)

* Rename local variables, names and consts, from the interpeter loop. Will allow non-code objects in frames for better introspection of C builtins and extensions.

* Remove unused dummy variables.

2 years agogh-87092: refactor assemble() to a number of separate functions, which do not need...
Irit Katriel [Mon, 13 Mar 2023 15:59:20 +0000 (15:59 +0000)] 
gh-87092: refactor assemble() to a number of separate functions, which do not need the compiler struct (#102562)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102631)
Irit Katriel [Mon, 13 Mar 2023 15:56:24 +0000 (15:56 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102631)

2 years agoFix broken link to MSDN (#102355)
谭九鼎 [Mon, 13 Mar 2023 13:15:52 +0000 (21:15 +0800)] 
Fix broken link to MSDN (#102355)

2 years agoGH-102300: Reuse objects with refcount == 1 in float specialized binary ops. (GH...
Mark Shannon [Mon, 13 Mar 2023 10:34:54 +0000 (10:34 +0000)] 
GH-102300: Reuse objects with refcount == 1 in float specialized binary ops. (GH-102301)

2 years agogh-101100: Fix Sphinx warnings in `turtle` module (#102340)
Hugo van Kemenade [Mon, 13 Mar 2023 09:24:52 +0000 (11:24 +0200)] 
gh-101100: Fix Sphinx warnings in `turtle` module (#102340)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoGH-101673: Fix pdb bug where local variable changes are lost after longlist (#101674)
gaogaotiantian [Sun, 12 Mar 2023 23:09:55 +0000 (16:09 -0700)] 
GH-101673: Fix pdb bug where local variable changes are lost after longlist (#101674)

2 years agoFix duplicated words in the docs (GH-102629)
Виталий Дмитриев [Sun, 12 Mar 2023 18:03:59 +0000 (21:03 +0300)] 
Fix duplicated words in the docs (GH-102629)

With grep utility found some duplicated words

Automerge-Triggered-By: GH:AlexWaygood
2 years agoOptimize fmean() weighted average (#102626)
Raymond Hettinger [Sun, 12 Mar 2023 17:48:25 +0000 (12:48 -0500)] 
Optimize fmean() weighted average  (#102626)

2 years agoFixes duplicated word (#102623)
Guido van Rossum [Sun, 12 Mar 2023 16:58:02 +0000 (09:58 -0700)] 
Fixes duplicated word (#102623)

In line 1627, the end of the sentence reads "only that that it may be." but it should read "only that it may be" (or alternatively "only that that may be").

Co-authored-by: Hugo Gabriel Eyherabide <hugogabriel.eyherabide@gmail.com>
2 years agogh-101821: Test coverage for `ast.main` function (#101822)
Nikita Sobolev [Sat, 11 Mar 2023 19:10:52 +0000 (22:10 +0300)] 
gh-101821: Test coverage for `ast.main` function (#101822)

2 years agogh-79940: skip `TestGetAsyncGenState` on wasm as it requires working sockets (GH...
Thomas Krennwallner [Sat, 11 Mar 2023 18:36:49 +0000 (13:36 -0500)] 
gh-79940: skip `TestGetAsyncGenState` on wasm as it requires working sockets (GH-102605)

Skip `TestGetAsyncGenState` and restoring of the default event loop policy in `test_inspect` if platform lacks working socket support.

Fixes #11590

Automerge-Triggered-By: GH:kumaraditya303
2 years agogh-79940: add introspection API for asynchronous generators to `inspect` module ...
Thomas Krennwallner [Sat, 11 Mar 2023 13:19:40 +0000 (08:19 -0500)] 
gh-79940: add introspection API for asynchronous generators to `inspect` module (#11590)

2 years agogh-102213: Optimize the performance of `__getattr__` (GH-102248)
wangxiang-hz [Sat, 11 Mar 2023 11:11:37 +0000 (19:11 +0800)] 
gh-102213: Optimize the performance of `__getattr__`  (GH-102248)

When __getattr__ is defined, python with try to find an attribute using _PyObject_GenericGetAttrWithDict
find nothing is reasonable so we don't need an exception, it will hurt performance.

2 years agogh-102433: Add tests for how classes with properties interact with `isinstance()...
Alex Waygood [Sat, 11 Mar 2023 01:20:20 +0000 (01:20 +0000)] 
gh-102433: Add tests for how classes with properties interact with `isinstance()` checks on `typing.runtime_checkable` protocols (#102449)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2 years agoGH-90997: Shrink the LOAD_GLOBAL caches (#102569)
Brandt Bucher [Sat, 11 Mar 2023 01:01:16 +0000 (17:01 -0800)] 
GH-90997: Shrink the LOAD_GLOBAL caches (#102569)

2 years agogh-88071: Update docstrings of dataclass' astuple and asdict (#101806)
Ilya V. Schurov [Sat, 11 Mar 2023 00:27:41 +0000 (01:27 +0100)] 
gh-88071: Update docstrings of dataclass' astuple and asdict (#101806)

Update dataclasses.astuple and dataclasses.asdict docstrings to reflect that they deep copy objects in the field values.

2 years agogh-102103: add `module` argument to `dataclasses.make_dataclass` (#102104)
Nikita Sobolev [Sat, 11 Mar 2023 00:26:46 +0000 (03:26 +0300)] 
gh-102103: add `module` argument to `dataclasses.make_dataclass` (#102104)

2 years agogh-102578: Optimise setting and deleting mutable attributes on non-dataclass subclass...
Xuehai Pan [Sat, 11 Mar 2023 00:21:22 +0000 (08:21 +0800)] 
gh-102578: Optimise setting and deleting mutable attributes on non-dataclass subclasses of frozen dataclasses (gh-102573)

2 years agoGH-80486: Fix handling of NTFS alternate data streams in pathlib (GH-102454)
Barney Gale [Fri, 10 Mar 2023 17:29:04 +0000 (17:29 +0000)] 
GH-80486: Fix handling of NTFS alternate data streams in pathlib (GH-102454)

Co-authored-by: Maor Kleinberger <kmaork@gmail.com>
2 years agogh-102519: Add doc updates for os.listdrives, listvolumes and listmounts (GH-102585)
Steve Dower [Fri, 10 Mar 2023 15:41:32 +0000 (15:41 +0000)] 
gh-102519: Add doc updates for os.listdrives, listvolumes and listmounts (GH-102585)

2 years agoGH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)
Paul Ganssle [Fri, 10 Mar 2023 15:29:37 +0000 (10:29 -0500)] 
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)

It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.

2 years agogh-86509: Add link to Lib/_threading_local.py in threading docs (#101824)
Owain Davies [Fri, 10 Mar 2023 12:22:02 +0000 (19:22 +0700)] 
gh-86509: Add link to Lib/_threading_local.py in threading docs (#101824)

2 years agogh-102519: Add os.listdrives, os.listvolumes and os.listmounts on Windows (GH-102544)
Steve Dower [Fri, 10 Mar 2023 12:21:37 +0000 (12:21 +0000)] 
gh-102519: Add os.listdrives, os.listvolumes and os.listmounts on Windows (GH-102544)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in `_ctypes...
Irit Katriel [Fri, 10 Mar 2023 09:02:32 +0000 (09:02 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in `_ctypes` (#102477)

2 years agogh-102378: don't bother stripping `/` from __text_signature__ (#102379)
David Hewitt [Thu, 9 Mar 2023 23:06:20 +0000 (23:06 +0000)] 
gh-102378: don't bother stripping `/` from __text_signature__ (#102379)

2 years agogh-102255: Improve build support for Windows API partitions (GH-102256)
Max Bachmann [Thu, 9 Mar 2023 21:09:12 +0000 (22:09 +0100)] 
gh-102255: Improve build support for Windows API partitions (GH-102256)

Add `MS_WINDOWS_DESKTOP`, `MS_WINDOWS_APPS`, `MS_WINDOWS_SYSTEM` and `MS_WINDOWS_GAMES` preprocessor definitions to allow switching off functionality missing from particular API partitions ("partitions" are used in Windows to identify overlapping subsets of APIs).
CPython only officially supports `MS_WINDOWS_DESKTOP` and `MS_WINDOWS_SYSTEM` (APPS is included by normal desktop builds, but APPS without DESKTOP is not covered). Other configurations are a convenience for people building their own runtimes.
`MS_WINDOWS_GAMES` is for the Xbox subset of the Windows API, which is also available on client OS, but is restricted compared to `MS_WINDOWS_DESKTOP`. These restrictions may change over time, as they relate to the build headers rather than the OS support, and so we assume that Xbox builds will use the latest available version of the GDK.

2 years agogh-81057: Vendor a Subset of distutils for the c-analyzer Tool (gh-102505)
Eric Snow [Thu, 9 Mar 2023 16:50:33 +0000 (09:50 -0700)] 
gh-81057: Vendor a Subset of distutils for the c-analyzer Tool (gh-102505)

distutils was removed in November. However, the c-analyzer relies on it. To solve that here, we vendor the parts the tool needs so it can be run against 3.12+. (Also see gh-92584.)

Note that we may end up removing this code later in favor of a solution in common with the peg_generator tool (which also relies on distutils).  At the least, the copy here makes sure the c-analyzer tool works on 3.12+ in the meantime.

2 years agogh-100227: Isolate the Import State to Each Interpreter (gh-101941)
Eric Snow [Thu, 9 Mar 2023 16:46:21 +0000 (09:46 -0700)] 
gh-100227: Isolate the Import State to Each Interpreter (gh-101941)

Specific changes:

* move the import lock to PyInterpreterState
* move the "find_and_load" diagnostic state to PyInterpreterState

Note that the import lock exists to keep multiple imports of the same module in the same interpreter (but in different threads) from stomping on each other.  Independently, we use a distinct global lock to protect globally shared import state, especially related to loaded extension modules.  For now we can rely on the GIL as that lock but with a per-interpreter GIL we'll need a new global lock.

The remaining state in _PyRuntimeState.imports will (probably) continue being global.

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

2 years agogh-100227: Move dict_state.global_version to PyInterpreterState (gh-102338)
Eric Snow [Thu, 9 Mar 2023 15:16:30 +0000 (08:16 -0700)] 
gh-100227: Move dict_state.global_version to PyInterpreterState (gh-102338)

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

2 years agoGH-84783: Document GH-101264 (Make the slice object hashable) in What's New. (#102548)
T. Wouters [Thu, 9 Mar 2023 02:39:33 +0000 (18:39 -0800)] 
GH-84783: Document GH-101264 (Make the slice object hashable) in What's New. (#102548)

2 years agogh-100227: Move next_keys_version to PyInterpreterState (gh-102335)
Eric Snow [Thu, 9 Mar 2023 01:04:16 +0000 (18:04 -0700)] 
gh-100227: Move next_keys_version to PyInterpreterState (gh-102335)

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

2 years agogh-100227: Move func_state.next_version to PyInterpreterState (gh-102334)
Eric Snow [Wed, 8 Mar 2023 22:56:36 +0000 (15:56 -0700)] 
gh-100227: Move func_state.next_version to PyInterpreterState (gh-102334)

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

2 years agogh-102304: Consolidate Direct Usage of _Py_RefTotal (gh-102514)
Eric Snow [Wed, 8 Mar 2023 19:03:50 +0000 (12:03 -0700)] 
gh-102304: Consolidate Direct Usage of _Py_RefTotal (gh-102514)

This simplifies further changes to _Py_RefTotal (e.g. make it atomic or move it to PyInterpreterState).

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

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Objects...
Irit Katriel [Wed, 8 Mar 2023 17:03:18 +0000 (17:03 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Objects/) (#102218)

2 years agogh-102507 Remove invisible pagebreak characters (#102531)
JosephSBoyle [Wed, 8 Mar 2023 13:58:14 +0000 (13:58 +0000)] 
gh-102507 Remove invisible pagebreak characters (#102531)

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2 years agogh-102515: Remove unused imports in the `Lib/` directory (#102516)
Alex Waygood [Wed, 8 Mar 2023 11:45:38 +0000 (11:45 +0000)] 
gh-102515: Remove unused imports in the `Lib/` directory (#102516)

2 years agoRemove or update bitbucket links (GH-101963)
sblondon [Wed, 8 Mar 2023 10:24:39 +0000 (11:24 +0100)] 
Remove or update bitbucket links (GH-101963)

Since Mercurial removal from bitbucket.org, some links are broken.
They are replaced by github.com or webarchive.org links if available. Otherwise, they are removed.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-101100: Fix sphinx warnings in `zipapp` and `zipfile` modules (#102526)
Nikita Sobolev [Wed, 8 Mar 2023 08:19:05 +0000 (11:19 +0300)] 
gh-101100: Fix sphinx warnings in `zipapp` and `zipfile` modules (#102526)

2 years agoGH-102397: Fix segfault from race condition in signal handling (#102399)
Kumar Aditya [Wed, 8 Mar 2023 07:59:39 +0000 (13:29 +0530)] 
GH-102397: Fix segfault from race condition in signal handling (#102399)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agoFix style in argparse.rst (#101733)
Marcin Wieczorek [Wed, 8 Mar 2023 07:25:28 +0000 (08:25 +0100)] 
Fix style in argparse.rst (#101733)

2 years agoMerge in the release of Python 3.12.0a6.
Thomas Wouters [Wed, 8 Mar 2023 04:05:16 +0000 (05:05 +0100)] 
Merge in the release of Python 3.12.0a6.

2 years agoPost 3.12.0a6
Thomas Wouters [Wed, 8 Mar 2023 04:04:38 +0000 (05:04 +0100)] 
Post 3.12.0a6

2 years agofix typo in async generator code field name `ag_code` (#102448)
Kumar Aditya [Wed, 8 Mar 2023 03:39:50 +0000 (09:09 +0530)] 
fix typo in async generator code field name `ag_code` (#102448)

2 years agogh-102381: don't call watcher callback with dead object (#102382)
Carl Meyer [Wed, 8 Mar 2023 00:10:58 +0000 (17:10 -0700)] 
gh-102381: don't call watcher callback with dead object (#102382)

Co-authored-by: T. Wouters <thomas@python.org>
2 years agoPython 3.12.0a6 v3.12.0a6
Thomas Wouters [Tue, 7 Mar 2023 21:41:50 +0000 (22:41 +0100)] 
Python 3.12.0a6

2 years agogh-102493: fix normalization in PyErr_SetObject (#102502)
Irit Katriel [Tue, 7 Mar 2023 21:27:46 +0000 (21:27 +0000)] 
gh-102493: fix normalization in PyErr_SetObject (#102502)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-87092: compiler's CFG construction moved to after codegen stage (#102320)
Irit Katriel [Tue, 7 Mar 2023 18:16:32 +0000 (18:16 +0000)] 
gh-87092: compiler's CFG construction moved to after codegen stage (#102320)

2 years agogh-95913: Consolidate build requirements changes in 3.11 WhatsNew (GH-98781)
C.A.M. Gerlach [Tue, 7 Mar 2023 14:38:31 +0000 (08:38 -0600)] 
gh-95913: Consolidate build requirements changes in 3.11 WhatsNew (GH-98781)

Apply suggestion to combine build requirements changes in 3.11 WhatsNew

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 years agoRemove redundant `_ensure_future` in favor of `ensure_future` in `asyncio` (#102398)
Kumar Aditya [Tue, 7 Mar 2023 03:14:55 +0000 (08:44 +0530)] 
Remove redundant `_ensure_future` in favor of `ensure_future` in `asyncio` (#102398)

2 years agogh-95913: Edit Faster CPython section in 3.11 WhatsNew (GH-98429)
C.A.M. Gerlach [Tue, 7 Mar 2023 02:45:52 +0000 (20:45 -0600)] 
gh-95913: Edit Faster CPython section in 3.11 WhatsNew (GH-98429)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-90110: Fix the c-analyzer Tool (#102483)
Eric Snow [Tue, 7 Mar 2023 02:40:09 +0000 (19:40 -0700)] 
gh-90110: Fix the c-analyzer Tool (#102483)

Some incompatible changes had gone in, and the "ignore" lists weren't properly undated. This change fixes that. It's necessary prior to enabling test_check_c_globals, which I hope to do soon.

Note that this does include moving last_resort_memory_error to PyInterpreterState.

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

2 years agogh-101759: Update macOS installer SQLite 3.40.1 checksum (gh-102485)
Ned Deily [Tue, 7 Mar 2023 01:02:24 +0000 (20:02 -0500)] 
gh-101759: Update macOS installer SQLite 3.40.1 checksum (gh-102485)

2 years agoRemove unused import of `warnings` from `unittest.loader` (#102479)
JosephSBoyle [Mon, 6 Mar 2023 22:02:19 +0000 (22:02 +0000)] 
Remove unused import of `warnings` from `unittest.loader` (#102479)

2 years agoAdd gettext support to tools/extensions/c_annotations.py (#101989)
Rémi Lapeyre [Mon, 6 Mar 2023 21:20:52 +0000 (22:20 +0100)] 
Add gettext support to tools/extensions/c_annotations.py (#101989)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in sub...
Irit Katriel [Mon, 6 Mar 2023 17:49:31 +0000 (17:49 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in sub interpreters module (#102472)

2 years agogh-95672: Fix versionadded indentation of get_pagesize in test.rst (gh-102455)
Hyunkyun Moon [Mon, 6 Mar 2023 13:56:19 +0000 (22:56 +0900)] 
gh-95672: Fix versionadded indentation of get_pagesize in test.rst (gh-102455)

2 years agogh-102416: Do not memoize incorrectly loop rules in the parser (#102467)
Pablo Galindo Salgado [Mon, 6 Mar 2023 13:41:53 +0000 (14:41 +0100)] 
gh-102416: Do not memoize incorrectly loop rules in the parser (#102467)

2 years agoGH-101362: Optimise PurePath(PurePath(...)) (GH-101667)
Barney Gale [Sun, 5 Mar 2023 23:50:21 +0000 (23:50 +0000)] 
GH-101362: Optimise PurePath(PurePath(...)) (GH-101667)

The previous `_parse_args()` method pulled the `_parts` out of any supplied `PurePath` objects; these were subsequently joined in `_from_parts()` using `os.path.join()`. This is actually a slower form of joining than calling `fspath()` on the path object, because it doesn't take advantage of the fact that the contents of `_parts` is normalized!

This reduces the time taken to run `PurePath("foo", "bar")` by ~20%, and the time taken to run `PurePath(p, "cheese")`, where `p = PurePath("/foo", "bar", "baz")`, by ~40%.

Automerge-Triggered-By: GH:AlexWaygood
2 years agoGH-101362: Check pathlib.Path flavour compatibility at import time (GH-101664)
Barney Gale [Sun, 5 Mar 2023 22:46:45 +0000 (22:46 +0000)] 
GH-101362: Check pathlib.Path flavour compatibility at import time (GH-101664)

This saves a comparison in `pathlib.Path.__new__()` and reduces the time taken to run `Path()` by ~5%.

Automerge-Triggered-By: GH:AlexWaygood
2 years agoGH-101362: Call join() only when >1 argument supplied to pathlib.PurePath() (#101665)
Barney Gale [Sun, 5 Mar 2023 22:00:56 +0000 (22:00 +0000)] 
GH-101362: Call join() only when >1 argument supplied to pathlib.PurePath() (#101665)

GH-101362: Call join() only when >1 argument supplied to pathlib.PurePath

This reduces the time taken to run `PurePath("foo")` by ~15%

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)