]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102839: remove AC for math.log (GH-102863) 102894/head
Sergey B Kirpichev [Tue, 21 Mar 2023 23:48:19 +0000 (02:48 +0300)] 
gh-102839: remove AC for math.log (GH-102863)

2 years agoAdd link to `sys.exit` function documentation (#102805)
David Poirier [Tue, 21 Mar 2023 21:58:31 +0000 (08:58 +1100)] 
Add link to `sys.exit` function documentation (#102805)

* Add link to `sys.exit` function documentation

* Update Doc/library/os.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Update Doc/library/os.rst

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
---------

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-102406: replace exception chaining by PEP-678 notes in codecs (#102407)
Irit Katriel [Tue, 21 Mar 2023 21:36:31 +0000 (21:36 +0000)] 
gh-102406: replace exception chaining by PEP-678 notes in codecs (#102407)

2 years agogh-94673: Isolate the _io module to Each Interpreter (gh-102663)
Eric Snow [Tue, 21 Mar 2023 20:01:38 +0000 (14:01 -0600)] 
gh-94673: Isolate the _io module to Each Interpreter (gh-102663)

Aside from sys and builtins, _io is the only core builtin module that hasn't been ported to multi-phase init.  We may do so later (e.g. gh-101948), but in the meantime we must at least take care of the module's static types properly.  (This came up while working on gh-101660.)

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

2 years agogh-102860: improve performance of compiler's instr_sequence_to_cfg (#102861)
Irit Katriel [Tue, 21 Mar 2023 19:13:49 +0000 (19:13 +0000)] 
gh-102860: improve performance of compiler's instr_sequence_to_cfg (#102861)

2 years agogh-98608: Fix Failure-handling in new_interpreter() (gh-102658)
Eric Snow [Tue, 21 Mar 2023 18:47:55 +0000 (12:47 -0600)] 
gh-98608: Fix Failure-handling in new_interpreter() (gh-102658)

The error-handling code in new_interpreter() has been broken for a while.  We hadn't noticed because those code mostly doesn't fail.  (I noticed while working on gh-101660.)  The problem is that we try to clear/delete the newly-created thread/interpreter using itself, which just failed.  The solution is to switch back to the calling thread state first.

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

2 years agoTweak polynomial itertool recipes (GH-102880)
Raymond Hettinger [Tue, 21 Mar 2023 18:21:57 +0000 (13:21 -0500)] 
Tweak polynomial itertool recipes (GH-102880)

2 years agogh-102304: Move the Total Refcount to PyInterpreterState (gh-102545)
Eric Snow [Tue, 21 Mar 2023 17:46:09 +0000 (11:46 -0600)] 
gh-102304: Move the Total Refcount to PyInterpreterState (gh-102545)

Moving it valuable with a per-interpreter GIL.  However, it is also useful without one, since it allows us to identify refleaks within a single interpreter or where references are escaping an interpreter.  This becomes more important as we move the obmalloc state to PyInterpreterState.

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

2 years agogh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)
wim glenn [Tue, 21 Mar 2023 17:06:18 +0000 (12:06 -0500)] 
gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)

remove superfluous parens from itertools.batched recipe

2 years agogh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig() as Fatal ...
Eric Snow [Tue, 21 Mar 2023 16:49:12 +0000 (10:49 -0600)] 
gh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig() as Fatal (gh-102657)

Prior to this change, errors in _Py_NewInterpreterFromConfig() were always fatal.  Instead, callers should be able to handle such errors and keep going.  That's what this change supports.  (This was an oversight in the original implementation of _Py_NewInterpreterFromConfig().)  Note that the existing [fatal] behavior of the public Py_NewInterpreter() is preserved.

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

2 years agogh-102595: Document `PyObject_Format` c-api function (GH-102596)
Nikita Sobolev [Tue, 21 Mar 2023 16:46:24 +0000 (19:46 +0300)] 
gh-102595: Document `PyObject_Format` c-api function (GH-102596)

Def: https://github.com/python/cpython/blame/5ffdaf748d98da6065158534720f1996a45a0072/Include/abstract.h#L389

2 years agogh-102828: emit deprecation warning for onerror arg to shutil.rmtree (#102850)
Irit Katriel [Tue, 21 Mar 2023 11:08:46 +0000 (11:08 +0000)] 
gh-102828: emit deprecation warning for onerror arg to shutil.rmtree (#102850)

2 years agogh-102799: Let pydoc use the exception instead of sys.exc_info (#102830)
Irit Katriel [Tue, 21 Mar 2023 11:07:03 +0000 (11:07 +0000)] 
gh-102799: Let pydoc use the exception instead of sys.exc_info (#102830)

2 years agogh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover PyErr_Display...
Irit Katriel [Tue, 21 Mar 2023 09:36:18 +0000 (09:36 +0000)] 
gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover PyErr_Display as well (GH-102849)

2 years agogh-102598: Remove obsolete optimization from `FORMAT_VALUE` opcode (#102599)
Nikita Sobolev [Tue, 21 Mar 2023 07:47:15 +0000 (10:47 +0300)] 
gh-102598: Remove obsolete optimization from `FORMAT_VALUE` opcode (#102599)

2 years agoThe pow() variant further improves accuracy (GH-102866)
Raymond Hettinger [Tue, 21 Mar 2023 05:02:14 +0000 (00:02 -0500)] 
The pow() variant further improves accuracy (GH-102866)

2 years agoRemove itermediate list. Expand docstring. (GH-102862)
Raymond Hettinger [Tue, 21 Mar 2023 01:40:04 +0000 (20:40 -0500)] 
Remove itermediate list. Expand docstring. (GH-102862)

2 years agogh-102809: Remove `Misc/gdbinit` (#102854)
Nikita Sobolev [Mon, 20 Mar 2023 23:30:46 +0000 (02:30 +0300)] 
gh-102809: Remove `Misc/gdbinit` (#102854)

Looks like the consensus is that we don't need this file anymore.
Old version can be always found here: https://github.com/python/cpython/blob/094cf392f49d3c16fe798863717f6c8e0f3734bb/Misc/gdbinit

2 years agoAdd itertool recipe for polynomial evaluation. (GH-102852)
Raymond Hettinger [Mon, 20 Mar 2023 22:14:29 +0000 (17:14 -0500)] 
Add itertool recipe for polynomial evaluation. (GH-102852)

2 years agogh-102304: Fix Non-Debug Builds (gh-102846)
Eric Snow [Mon, 20 Mar 2023 17:28:13 +0000 (11:28 -0600)] 
gh-102304: Fix Non-Debug Builds (gh-102846)

Some debug-only code slipped in with gh-102543.

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

2 years agogh-102304: Add a What's New Entry About _Py_RefTotal (gh-102845)
Eric Snow [Mon, 20 Mar 2023 16:35:49 +0000 (10:35 -0600)] 
gh-102304: Add a What's New Entry About _Py_RefTotal (gh-102845)

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

2 years agogh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)
Eric Snow [Mon, 20 Mar 2023 16:03:04 +0000 (10:03 -0600)] 
gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)

The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState.

Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead.

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

2 years agogh-102255: Use GetVersionEx instead of GetVersionExW to match argument type (GH-102583)
Max Bachmann [Mon, 20 Mar 2023 15:47:17 +0000 (16:47 +0100)] 
gh-102255: Use GetVersionEx instead of GetVersionExW to match argument type (GH-102583)

Since we pass a structure of type `OSVERSIONINFOEX`, we need to call
`GetVersionEx` instead of `GetVersionExW`.

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)