]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450) 102822/head
Alan Williams [Mon, 20 Mar 2023 00:20:20 +0000 (19:20 -0500)] 
gh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450)

2 years agogh-102828: fix test failure (add missing skip instructions) (#102835)
Irit Katriel [Mon, 20 Mar 2023 00:03:55 +0000 (00:03 +0000)] 
gh-102828: fix test failure (add missing skip instructions) (#102835)

2 years agogh-102491: Remove IronPython version check in sys_version (#102492)
Pieter Eendebak [Sun, 19 Mar 2023 22:52:47 +0000 (23:52 +0100)] 
gh-102491: Remove IronPython version check in sys_version (#102492)

2 years agogh-102810: Add docstrings to the public-facing methods of `asyncio.Timeout` (#102811)
JosephSBoyle [Sun, 19 Mar 2023 20:06:09 +0000 (20:06 +0000)] 
gh-102810: Add docstrings to the public-facing methods of `asyncio.Timeout` (#102811)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102828: add onexc arg to shutil.rmtree. Deprecate onerror. (#102829)
Irit Katriel [Sun, 19 Mar 2023 18:33:51 +0000 (18:33 +0000)] 
gh-102828: add onexc arg to shutil.rmtree. Deprecate onerror. (#102829)

2 years agogh-102778: revert changes to idlelib (#102825)
Irit Katriel [Sun, 19 Mar 2023 16:19:59 +0000 (16:19 +0000)] 
gh-102778: revert changes to idlelib (#102825)

2 years agogh-102755: fix refleak (#102826)
Irit Katriel [Sun, 19 Mar 2023 15:18:24 +0000 (15:18 +0000)] 
gh-102755: fix refleak (#102826)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102816)
Irit Katriel [Sun, 19 Mar 2023 15:17:59 +0000 (15:17 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102816)

2 years agoAdd more comments to hypot() (GH-102817)
Raymond Hettinger [Sat, 18 Mar 2023 17:21:48 +0000 (12:21 -0500)] 
Add more comments to hypot() (GH-102817)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102769)
Irit Katriel [Sat, 18 Mar 2023 13:44:47 +0000 (13:44 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102769)

2 years agogh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceba...
Irit Katriel [Sat, 18 Mar 2023 11:47:11 +0000 (11:47 +0000)] 
gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback (#102779)

2 years agogh-101975: Fixed a potential SegFault on garbage collection (GH-102803)
gaogaotiantian [Sat, 18 Mar 2023 10:59:21 +0000 (03:59 -0700)] 
gh-101975: Fixed a potential SegFault on garbage collection (GH-102803)

2 years agogh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)
Irit Katriel [Sat, 18 Mar 2023 07:19:38 +0000 (07:19 +0000)] 
gh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)

2 years agoSimplify and improve accuracy for subnormals in hypot() (GH-102785)
Raymond Hettinger [Fri, 17 Mar 2023 19:06:52 +0000 (14:06 -0500)] 
Simplify and improve accuracy for subnormals in hypot() (GH-102785)

2 years agogh-102781: fix cwd dependence in cases generator (#102782)
Carl Meyer [Fri, 17 Mar 2023 17:01:10 +0000 (11:01 -0600)] 
gh-102781: fix cwd dependence in cases generator (#102782)

2 years agogh-102701: Fix overflow in dictobject.c (GH-102750)
Inada Naoki [Fri, 17 Mar 2023 13:39:09 +0000 (22:39 +0900)] 
gh-102701: Fix overflow in dictobject.c (GH-102750)

2 years agoGH-78530: add support for generators in `asyncio.wait` (#102761)
Kumar Aditya [Fri, 17 Mar 2023 01:28:43 +0000 (06:58 +0530)] 
GH-78530: add support for generators in `asyncio.wait` (#102761)

2 years agoIncrease stack reserve size for Windows debug builds to avoid test crashes (GH-102764)
Steve Dower [Fri, 17 Mar 2023 01:07:07 +0000 (01:07 +0000)] 
Increase stack reserve size for Windows debug builds to avoid test crashes (GH-102764)

2 years agogh-102755: Add PyErr_DisplayException(exc) (#102756)
Irit Katriel [Thu, 16 Mar 2023 22:18:04 +0000 (22:18 +0000)] 
gh-102755: Add PyErr_DisplayException(exc) (#102756)

2 years agoFix outdated note about 'int' rounding or truncating (#102736)
Mark Dickinson [Thu, 16 Mar 2023 20:34:42 +0000 (20:34 +0000)] 
Fix outdated note about 'int' rounding or truncating (#102736)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102760)
Irit Katriel [Thu, 16 Mar 2023 19:03:52 +0000 (19:03 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102760)

2 years agogh-99726: Improves correctness of stat results for Windows, and uses faster API when...
Steve Dower [Thu, 16 Mar 2023 17:27:21 +0000 (17:27 +0000)] 
gh-99726: Improves correctness of stat results for Windows, and uses faster API when available (GH-102149)

This deprecates `st_ctime` fields on Windows, with the intent to change them to contain the correct value in 3.14. For now, they should keep returning the creation time as they always have.

2 years agogh-102192: remove redundant exception fields from ssl module socket (#102466)
Irit Katriel [Thu, 16 Mar 2023 16:41:10 +0000 (16:41 +0000)] 
gh-102192: remove redundant exception fields from ssl module socket (#102466)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102743)
Irit Katriel [Thu, 16 Mar 2023 16:21:49 +0000 (16:21 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102743)

2 years agogh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)
Eric Snow [Thu, 16 Mar 2023 15:26:42 +0000 (09:26 -0600)] 
gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)

The tool now allows user-added #LINE preprocessor directives.

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

2 years agoGH-102748: remove legacy support for generator based coroutines from `asyncio.iscorou...
Kumar Aditya [Thu, 16 Mar 2023 14:58:10 +0000 (20:28 +0530)] 
GH-102748: remove legacy support for generator based coroutines from `asyncio.iscoroutine` (#102749)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102721: Improve coverage of `_collections_abc._CallableGenericAlias` (#102722)
Nikita Sobolev [Thu, 16 Mar 2023 14:47:30 +0000 (17:47 +0300)] 
gh-102721: Improve coverage of `_collections_abc._CallableGenericAlias` (#102722)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-102653: Make recipe docstring show the correct distribution (#102742)
Raymond Hettinger [Thu, 16 Mar 2023 14:32:18 +0000 (09:32 -0500)] 
GH-102653: Make recipe docstring show the correct distribution (#102742)

2 years agoAdd comments to `{typing,_collections_abc}._type_repr` about each other (#102752)
Nikita Sobolev [Thu, 16 Mar 2023 13:05:38 +0000 (16:05 +0300)] 
Add comments to `{typing,_collections_abc}._type_repr` about each other (#102752)

Remove `if` condition in `_collections_abc._type_repr` that's no longer needed, bringing it in sync with `typing._type_repr`.

2 years agogh-102594: PyErr_SetObject adds note to exception raised on normalization error ...
Irit Katriel [Thu, 16 Mar 2023 10:16:01 +0000 (10:16 +0000)] 
gh-102594: PyErr_SetObject adds note to exception raised on normalization error (#102675)

2 years agogh-94440: Fix issue of ProcessPoolExecutor shutdown hanging (#94468)
yonatanp [Thu, 16 Mar 2023 04:44:52 +0000 (00:44 -0400)] 
gh-94440: Fix issue of ProcessPoolExecutor shutdown hanging (#94468)

Fix an issue of concurrent.futures ProcessPoolExecutor shutdown hanging.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-100112: avoid using iterable coroutines in asyncio internally (#100128)
Kumar Aditya [Thu, 16 Mar 2023 03:50:43 +0000 (09:20 +0530)] 
GH-100112:  avoid using iterable coroutines in asyncio internally (#100128)

2 years agogh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)
Jamoo721 [Thu, 16 Mar 2023 02:52:11 +0000 (13:52 +1100)] 
gh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)

2 years agogh-102660: Fix Refleaks in import.c (#102744)
Eric Snow [Thu, 16 Mar 2023 00:43:54 +0000 (18:43 -0600)] 
gh-102660: Fix Refleaks in import.c (#102744)

gh-102661 introduced some leaks. This fixes them.

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

2 years agogh-102738: remove from cases generator the code related to register instructions...
Irit Katriel [Wed, 15 Mar 2023 21:25:31 +0000 (21:25 +0000)] 
gh-102738: remove from cases generator the code related to register instructions (#102739)

2 years agoSimplify and speed-up math.hypot() and math.dist() (GH-102734)
Raymond Hettinger [Wed, 15 Mar 2023 20:15:23 +0000 (15:15 -0500)] 
Simplify and speed-up math.hypot() and math.dist() (GH-102734)

2 years agoFix typo in code comment (#102726)
Martin Breuss [Wed, 15 Mar 2023 19:18:18 +0000 (20:18 +0100)] 
Fix typo in code comment (#102726)

2 years agoExclude `ceval.c` from the C-analyzer tool (#102735)
Alex Waygood [Wed, 15 Mar 2023 18:19:07 +0000 (18:19 +0000)] 
Exclude `ceval.c` from the C-analyzer tool (#102735)

The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main)

See, for example:
- https://github.com/python/cpython/pull/94468
- https://github.com/python/cpython/pull/94468
- https://github.com/python/cpython/pull/102731

This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in https://github.com/python/cpython/commit/70185de1abfe428049a5c43d58fcb656b46db96c. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!

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