]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

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