]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
21 months agogh-104522: Fix OSError raised when run a subprocess (#114195)
Serhiy Storchaka [Thu, 18 Jan 2024 00:52:42 +0000 (02:52 +0200)] 
gh-104522: Fix OSError raised when run a subprocess (#114195)

Only set filename to cwd if it was caused by failed chdir(cwd).

_fork_exec() now returns "noexec:chdir" for failed chdir(cwd).

Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
21 months agogh-114149: [Enum] revert #114160 and add more tuple-subclass tests (GH-114215)
Ethan Furman [Thu, 18 Jan 2024 00:31:00 +0000 (16:31 -0800)] 
gh-114149: [Enum] revert #114160 and add more tuple-subclass tests (GH-114215)

This reverts commit 05e142b1543eb9662d6cc33722e7e16250c9219f.

21 months agogh-112984: Fix test_ctypes.test_loading.test_load_dll_with_flags when directory name...
Steve Dower [Thu, 18 Jan 2024 00:26:31 +0000 (00:26 +0000)] 
gh-112984: Fix test_ctypes.test_loading.test_load_dll_with_flags when directory name includes a dot (GH-114217)

21 months agogh-112984 Update Windows build and installer for free-threaded builds (GH-113129)
Steve Dower [Wed, 17 Jan 2024 21:52:23 +0000 (21:52 +0000)] 
gh-112984 Update Windows build and installer for free-threaded builds (GH-113129)

21 months agogh-38807: Fix race condition in Lib/trace.py (GH-110143)
buermarc [Wed, 17 Jan 2024 20:02:14 +0000 (21:02 +0100)] 
gh-38807: Fix race condition in Lib/trace.py (GH-110143)

Instead of checking if a directory does not exist and thereafter
creating it, directly call os.makedirs() with the exist_ok=True.

21 months agoFix typo in tkinter.ttk.rst (GH-106157)
Christophe Nanteuil [Wed, 17 Jan 2024 18:23:25 +0000 (19:23 +0100)] 
Fix typo in tkinter.ttk.rst (GH-106157)

21 months agogh-105102: Fix nested unions in structures when the system byteorder is the opposite...
Sheidan [Wed, 17 Jan 2024 18:20:39 +0000 (19:20 +0100)] 
gh-105102: Fix nested unions in structures when the system byteorder is the opposite (GH-105106)

21 months agogh-114149: [Enum] fix tuple subclass handling when using custom __new__ (GH-114160)
Ethan Furman [Wed, 17 Jan 2024 17:47:11 +0000 (09:47 -0800)] 
gh-114149: [Enum] fix tuple subclass handling when using custom __new__ (GH-114160)

21 months agogh-114070: fix token reference warnings in expressions.rst (#114169)
Sergey B Kirpichev [Wed, 17 Jan 2024 16:39:50 +0000 (19:39 +0300)] 
gh-114070: fix token reference warnings in expressions.rst (#114169)

21 months agogh-114178: Fix generate_sbom.py for out-of-tree builds (#114179)
Erlend E. Aasland [Wed, 17 Jan 2024 16:25:39 +0000 (17:25 +0100)] 
gh-114178: Fix generate_sbom.py for out-of-tree builds (#114179)

21 months agoMerge branch 'main' of https://github.com/python/cpython
Thomas Wouters [Wed, 17 Jan 2024 15:19:08 +0000 (16:19 +0100)] 
Merge branch 'main' of https://github.com/python/cpython

21 months agoPost 3.13.0a3
Thomas Wouters [Wed, 17 Jan 2024 15:17:42 +0000 (16:17 +0100)] 
Post 3.13.0a3

21 months agogh-112343: pdb: Use tokenize to replace convenience variables (#112380)
Tian Gao [Wed, 17 Jan 2024 14:50:31 +0000 (06:50 -0800)] 
gh-112343: pdb: Use tokenize to replace convenience variables (#112380)

21 months agogh-111301: Advertise importlib methods removal in What's new in Python 3.12 (GH-111630)
Karolina Surma [Wed, 17 Jan 2024 14:25:42 +0000 (15:25 +0100)] 
gh-111301: Advertise importlib methods removal in What's new in Python 3.12 (GH-111630)

21 months agogh-104282: Fix null pointer dereference in `lzma._decode_filter_properties` (GH-104283)
Radislav Chugunov [Wed, 17 Jan 2024 13:15:44 +0000 (16:15 +0300)] 
gh-104282: Fix null pointer dereference in `lzma._decode_filter_properties` (GH-104283)

21 months agoPython 3.13.0a3 v3.13.0a3
Thomas Wouters [Wed, 17 Jan 2024 12:09:05 +0000 (13:09 +0100)] 
Python 3.13.0a3

21 months agogh-86179: Skip test case that fails on POSIX with unversioned binary (GH-114136)
Steve Dower [Wed, 17 Jan 2024 11:33:59 +0000 (11:33 +0000)] 
gh-86179: Skip test case that fails on POSIX with unversioned binary (GH-114136)

21 months agogh-72284: Revise lists in IDLE doc (#114174)
Terry Jan Reedy [Wed, 17 Jan 2024 07:52:32 +0000 (02:52 -0500)] 
gh-72284: Revise lists in IDLE doc  (#114174)

Tkinter is a fact, not necessarily a feature.

Reorganize editor key bindings in a logical order
and remove those that do not work, at least on Windows.

Improve shell bindings list.

21 months agogh-81479: For Help => IDLE Doc, stop double-spacing some lists. (#114168)
Terry Jan Reedy [Wed, 17 Jan 2024 05:24:59 +0000 (00:24 -0500)] 
gh-81479: For Help => IDLE Doc, stop double-spacing some lists. (#114168)

This matches Firefox format.  Edge double-spaces non-simple
list but I think it looks worse.

21 months agogh-112043: Align concurrent.futures.Executor.map docs with implementation (#114153)
Erlend E. Aasland [Wed, 17 Jan 2024 01:31:16 +0000 (02:31 +0100)] 
gh-112043: Align concurrent.futures.Executor.map docs with implementation (#114153)

The first parameter is named 'fn', not 'func'.

21 months agogh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404)
Steffen Zeile [Wed, 17 Jan 2024 01:17:34 +0000 (02:17 +0100)] 
gh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404)

* Simplify __post_init__ example usage. It applies to all base classes, not just dataclasses.

21 months agogh-106293: Fix typos in Objects/object_layout.md (#106294)
Mano Sriram [Tue, 16 Jan 2024 23:11:15 +0000 (04:41 +0530)] 
gh-106293: Fix typos in Objects/object_layout.md (#106294)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
21 months agoGH-110109: pathlib docs: bring `from_uri()` and `as_uri()` together. (#110312)
Barney Gale [Tue, 16 Jan 2024 22:51:57 +0000 (22:51 +0000)] 
GH-110109: pathlib docs: bring `from_uri()` and `as_uri()` together. (#110312)

This is a very soft deprecation of `PurePath.as_uri()`. We instead document
it as a `Path` method, and add a couple of sentences mentioning that it's
also available in `PurePath`.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
21 months agoFix typo in c_annotations.py comment (#108773)
Kuan-Wei Chiu [Tue, 16 Jan 2024 22:36:01 +0000 (06:36 +0800)] 
Fix typo in c_annotations.py comment (#108773)

"compatability" => "compatibility"

21 months agogh-94220: Align fnmatch docs with the implementation and amend markup (#114152)
Erlend E. Aasland [Tue, 16 Jan 2024 22:35:09 +0000 (23:35 +0100)] 
gh-94220: Align fnmatch docs with the implementation and amend markup (#114152)

- Align the argument spec for fnmatch functions with the actual
  implementation.
- Update Sphinx markup to recent recommandations.
- Add link to 'iterable' glossary entry.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
21 months agoGH-78988: Document `pathlib.Path.glob()` exception propagation. (#114036)
Barney Gale [Tue, 16 Jan 2024 22:28:54 +0000 (22:28 +0000)] 
GH-78988: Document `pathlib.Path.glob()` exception propagation. (#114036)

We propagate the `OSError` from the `is_dir()` call on the top-level
directory, and suppress all others.

21 months agogh-113655: Increase default stack size for PGO builds to avoid C stack exhaustion...
Steve Dower [Tue, 16 Jan 2024 22:02:20 +0000 (22:02 +0000)] 
gh-113655: Increase default stack size for PGO builds to avoid C stack exhaustion (GH-114148)

21 months agogh-112529: Track if debug allocator is used as underlying allocator (#113747)
Sam Gross [Tue, 16 Jan 2024 21:42:15 +0000 (16:42 -0500)] 
gh-112529: Track if debug allocator is used as underlying allocator (#113747)

* gh-112529: Track if debug allocator is used as underlying allocator

The GC implementation for free-threaded builds will need to accurately
detect if the debug allocator is used because it affects the offset of
the Python object from the beginning of the memory allocation. The
current implementation of `_PyMem_DebugEnabled` only considers if the
debug allocator is the outer-most allocator; it doesn't handle the case
of "hooks" like tracemalloc being used on top of the debug allocator.

This change enables more accurate detection of the debug allocator by
tracking when debug hooks are enabled.

* Simplify _PyMem_DebugEnabled

21 months agoUpdate copyright years to 2024. (GH-113608)
solya0x [Tue, 16 Jan 2024 20:54:05 +0000 (23:54 +0300)] 
Update copyright years to 2024. (GH-113608)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agoGH-114013: fix setting `HOSTRUNNER` for `Tools/wasm/wasi.py` (GH-114097)
Brett Cannon [Tue, 16 Jan 2024 19:36:41 +0000 (11:36 -0800)] 
GH-114013: fix setting `HOSTRUNNER` for `Tools/wasm/wasi.py` (GH-114097)

Also fix tests found failing under a pydebug build of WASI thanks to `make test` working due to this change.

21 months agoClean up backslash avoiding code in ast, fix typo (#113605)
Shantanu [Tue, 16 Jan 2024 19:24:25 +0000 (11:24 -0800)] 
Clean up backslash avoiding code in ast, fix typo (#113605)

As of #108553, the `_avoid_backslashes` code path is dead

`scape_newlines` was introduced in #110271. Happy to drop the typo fix
if we don't want it

21 months agogh-113659: Skip hidden .pth files (GH-113660)
Serhiy Storchaka [Tue, 16 Jan 2024 18:23:05 +0000 (20:23 +0200)] 
gh-113659: Skip hidden .pth files (GH-113660)

Skip .pth files with names starting with a dot or hidden file attribute.

21 months agoFix 'expresion' typo in IDLE doc (#114130)
Terry Jan Reedy [Tue, 16 Jan 2024 17:12:59 +0000 (12:12 -0500)] 
Fix 'expresion' typo in IDLE doc (#114130)

The substantive change is on line 577/593. Rest is header/footer stuff ignored when displaying.

21 months agoDocs: Improve multiprocessing.SharedMemory reference (#114093)
Erlend E. Aasland [Tue, 16 Jan 2024 16:43:13 +0000 (17:43 +0100)] 
Docs: Improve multiprocessing.SharedMemory reference (#114093)

Align the multiprocessing shared memory docs with Diatáxis's
recommendations for references.

- use a parameter list for the SharedMemory.__init__() argument spec
- use the imperative mode
- use versionadded, not versionchanged, for added parameters
- reflow touched lines according to SemBr

21 months agogh-114096: Restore privileges in _winapi.CreateJunction after creating the junction...
Steve Dower [Tue, 16 Jan 2024 16:40:02 +0000 (16:40 +0000)] 
gh-114096: Restore privileges in _winapi.CreateJunction after creating the junction (GH-114089)

This avoids impact on later parts of the application which may be able to do things they otherwise shouldn't.

21 months agogh-114069: Revise Tutorial Methods paragraph (#114127)
Terry Jan Reedy [Tue, 16 Jan 2024 16:33:05 +0000 (11:33 -0500)] 
gh-114069: Revise Tutorial Methods paragraph (#114127)

Remove excess words in the first and third sentences.

21 months agoFix an incorrect comment in iobase_is_closed (GH-102952)
Jonathon Reinhart [Tue, 16 Jan 2024 16:27:17 +0000 (11:27 -0500)] 
Fix an incorrect comment in iobase_is_closed (GH-102952)

This comment appears to have been mistakenly copied from what is now
called iobase_check_closed() in commit 4d9aec022063.

Also unite the iobase_check_closed() code with the relevant comment.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
21 months agogh-114107: test.pythoninfo logs Windows Developer Mode (#114121)
Victor Stinner [Tue, 16 Jan 2024 16:23:46 +0000 (17:23 +0100)] 
gh-114107: test.pythoninfo logs Windows Developer Mode (#114121)

Also, don't skip the whole collect_windows() if ctypes is missing.

Log also ctypes.windll.shell32.IsUserAnAdmin().

21 months agogh-111968: Use per-thread freelists for PyContext in free-threading (gh-114122)
Donghee Na [Tue, 16 Jan 2024 16:14:56 +0000 (01:14 +0900)] 
gh-111968: Use per-thread freelists for PyContext in free-threading (gh-114122)

21 months agogh-113626: Add allow_code parameter in marshal functions (GH-113648)
Serhiy Storchaka [Tue, 16 Jan 2024 16:05:15 +0000 (18:05 +0200)] 
gh-113626: Add allow_code parameter in marshal functions (GH-113648)

Passing allow_code=False prevents serialization and de-serialization of
code objects which is incompatible between Python versions.

21 months agogh-102468: Document `PyCFunction_New*` and `PyCMethod_New` (GH-112557)
AN Long [Tue, 16 Jan 2024 15:17:03 +0000 (23:17 +0800)] 
gh-102468: Document `PyCFunction_New*` and `PyCMethod_New` (GH-112557)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
21 months agogh-114107: Fix importlib.resources symlink test if symlinks aren't supported (#114108)
Petr Viktorin [Tue, 16 Jan 2024 15:10:03 +0000 (16:10 +0100)] 
gh-114107: Fix importlib.resources symlink test if symlinks aren't supported (#114108)

gh-114107: Fix symlink test if symlinks aren't supported

21 months agogh-113858: GH Actions: Limit max ccache size for the asan build (GH-114113)
Petr Viktorin [Tue, 16 Jan 2024 13:21:16 +0000 (14:21 +0100)] 
gh-113858: GH Actions: Limit max ccache size for the asan build (GH-114113)

21 months agoDocs: Align multiprocessing.shared_memory docs with Sphinx recommendations (#114103)
Erlend E. Aasland [Tue, 16 Jan 2024 12:35:35 +0000 (13:35 +0100)] 
Docs: Align multiprocessing.shared_memory docs with Sphinx recommendations (#114103)

- add :class: and :mod: markups where needed
- fix incorrect escaping of a star in ShareableList arg spec
- mark up parameters with stars: *val*
- mark up list of built-in types using list markup
- remove unneeded parentheses from :meth: markups

21 months agogh-114077: Fix OverflowError in socket.sendfile() when pass count >2GiB (GH-114079)
Serhiy Storchaka [Tue, 16 Jan 2024 11:31:34 +0000 (13:31 +0200)] 
gh-114077: Fix OverflowError in socket.sendfile() when pass count >2GiB (GH-114079)

21 months agogh-113238: add Anchor to importlib.resources (#113801)
Mike Zimin [Tue, 16 Jan 2024 10:55:59 +0000 (13:55 +0300)] 
gh-113238: add Anchor to importlib.resources (#113801)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
21 months agogh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH...
Jérome Perrin [Tue, 16 Jan 2024 09:49:24 +0000 (18:49 +0900)] 
gh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH-113359)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
21 months agoGH-113655: Lower the C recursion limit on various platforms (GH-113944)
Mark Shannon [Tue, 16 Jan 2024 09:32:01 +0000 (09:32 +0000)] 
GH-113655: Lower the C recursion limit on various platforms (GH-113944)

21 months agogh-114101: Correct PyErr_Format arguments in _testcapi module (#114102)
AN Long [Tue, 16 Jan 2024 08:32:39 +0000 (16:32 +0800)] 
gh-114101: Correct PyErr_Format arguments in _testcapi module (#114102)

- use PyErr_SetString() iso. PyErr_Format() in parse_tuple_and_keywords()
- fix misspelled format specifier in CHECK_SIGNNESS() macro

21 months agogh-78502: Add a trackfd parameter to mmap.mmap() (GH-25425)
Zackery Spytz [Tue, 16 Jan 2024 07:51:46 +0000 (23:51 -0800)] 
gh-78502: Add a trackfd parameter to mmap.mmap() (GH-25425)

If *trackfd* is False, the file descriptor specified by *fileno*
will not be duplicated.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
21 months agogh-112087: Update list impl to be thread-safe with manual CS (gh-113863)
Donghee Na [Tue, 16 Jan 2024 00:11:14 +0000 (09:11 +0900)] 
gh-112087: Update list impl to be thread-safe with manual CS (gh-113863)

21 months agogh-91539: Small performance improvement of urrlib.request.getproxies_environment...
Raphaël Marinier [Mon, 15 Jan 2024 23:45:01 +0000 (00:45 +0100)] 
gh-91539: Small performance improvement of urrlib.request.getproxies_environment() (#108771)

 Small performance improvement of getproxies_environment() when there are many environment variables. In a benchmark with 5k environment variables not related to proxies, and 5 specifying proxies, we get a 10% walltime improvement.

21 months agogh-114070: correct the specification of ``digit`` in the float() docs (#114080)
Sergey B Kirpichev [Mon, 15 Jan 2024 22:19:59 +0000 (01:19 +0300)] 
gh-114070: correct the specification of ``digit`` in the float() docs (#114080)

21 months agogh-99437: runpy: decode path-like objects before setting globals
Kamil Turek [Mon, 15 Jan 2024 16:58:50 +0000 (17:58 +0100)] 
gh-99437: runpy: decode path-like objects before setting globals

21 months agogh-111968: Use per-thread slice_cache in free-threading (gh-113972)
Donghee Na [Mon, 15 Jan 2024 15:38:57 +0000 (00:38 +0900)] 
gh-111968: Use per-thread slice_cache in free-threading (gh-113972)

21 months agogh-112532: Fix memory block count for free-threaded build (gh-113995)
Sam Gross [Mon, 15 Jan 2024 15:37:36 +0000 (10:37 -0500)] 
gh-112532: Fix memory block count for free-threaded build (gh-113995)

This fixes `_PyInterpreterState_GetAllocatedBlocks()` and
`_Py_GetGlobalAllocatedBlocks()` in the free-threaded builds. The
gh-113263 change that introduced multiple mimalloc heaps per-thread
broke the logic for counting the number of allocated blocks. For subtle
reasons, this led to reported reference count leaks in the refleaks
buildbots.

21 months agogh-109598: make PyComplex_RealAsDouble/ImagAsDouble use __complex__ (GH-109647)
Sergey B Kirpichev [Mon, 15 Jan 2024 15:04:17 +0000 (18:04 +0300)] 
gh-109598: make PyComplex_RealAsDouble/ImagAsDouble use __complex__ (GH-109647)

`PyComplex_RealAsDouble()`/`PyComplex_ImagAsDouble` now try to convert
an object to a `complex` instance using its `__complex__()` method
before falling back to the ``__float__()`` method.

PyComplex_ImagAsDouble() also will not silently return 0.0 for
non-complex types anymore.  Instead we try to call PyFloat_AsDouble()
and return 0.0 only if this call is successful.

21 months agoGH-112354: `_GUARD_IS_TRUE_POP` side-exits to target the next instruction, not themse...
Mark Shannon [Mon, 15 Jan 2024 11:41:06 +0000 (11:41 +0000)] 
GH-112354: `_GUARD_IS_TRUE_POP` side-exits to target the next instruction, not themselves. (GH-114078)

21 months agogh-113666: Adding missing UF_ and SF_ flags to module 'stat' (#113667)
Ronald Oussoren [Mon, 15 Jan 2024 11:22:43 +0000 (12:22 +0100)] 
gh-113666: Adding missing UF_ and SF_ flags to module 'stat' (#113667)

Add some constants to module 'stat' that are used on macOS.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
21 months agogh-114075: Capture `test_compileall` stdout output (#114076)
Kirill Podoprigora [Mon, 15 Jan 2024 10:21:34 +0000 (13:21 +0300)] 
gh-114075: Capture `test_compileall` stdout output  (#114076)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
21 months agogh-109862: Fix test_create_subprocess_with_pidfd when it was run separately (GH-113991)
Serhiy Storchaka [Mon, 15 Jan 2024 07:26:49 +0000 (09:26 +0200)] 
gh-109862: Fix test_create_subprocess_with_pidfd when it was run separately (GH-113991)

21 months agogh-113317: Move FormatCounterFormatter into libclinic (#114066)
Erlend E. Aasland [Sun, 14 Jan 2024 23:09:26 +0000 (00:09 +0100)] 
gh-113317: Move FormatCounterFormatter into libclinic (#114066)

21 months agoReplace `pathlib._abc.PathModuleBase.splitroot()` with `splitdrive()` (#114065)
Barney Gale [Sun, 14 Jan 2024 23:06:04 +0000 (23:06 +0000)] 
Replace `pathlib._abc.PathModuleBase.splitroot()` with `splitdrive()` (#114065)

This allows users of the `pathlib-abc` PyPI package to use `posixpath` or
`ntpath` as a path module in versions of Python lacking
`os.path.splitroot()` (3.11 and before).

21 months agoAdd `pathlib._abc.PathModuleBase` (#113893)
Barney Gale [Sun, 14 Jan 2024 21:49:53 +0000 (21:49 +0000)] 
Add `pathlib._abc.PathModuleBase` (#113893)

Path modules provide a subset of the `os.path` API, specifically those
functions needed to provide `PurePathBase` functionality. Each
`PurePathBase` subclass references its path module via a `pathmod` class
attribute.

This commit adds a new `PathModuleBase` class, which provides abstract
methods that unconditionally raise `UnsupportedOperation`. An instance of
this class is assigned to `PurePathBase.pathmod`, replacing `posixpath`.
As a result, `PurePathBase` is no longer POSIX-y by default, and
all its methods raise `UnsupportedOperation` courtesy of `pathmod`.

Users who subclass `PurePathBase` or `PathBase` should choose the path
syntax by setting `pathmod` to `posixpath`, `ntpath`, `os.path`, or their
own subclass of `PathModuleBase`, as circumstances demand.

21 months agogh-101100: Fix Sphinx warnings in `howto/urllib2.rst` and `library/http.client.rst...
Hugo van Kemenade [Sun, 14 Jan 2024 20:38:53 +0000 (22:38 +0200)] 
gh-101100: Fix Sphinx warnings in `howto/urllib2.rst` and `library/http.client.rst` (#114060)

21 months agogh-113317: Move global utility functions into libclinic (#113986)
Erlend E. Aasland [Sun, 14 Jan 2024 18:26:09 +0000 (19:26 +0100)] 
gh-113317: Move global utility functions into libclinic (#113986)

Establish Tools/clinic/libclinic/utils.py and move the following
functions over there:

- compute_checksum()
- create_regex()
- write_file()

21 months agogh-111803: Support loading more deeply nested lists in binary plist format (GH-114024)
Serhiy Storchaka [Sat, 13 Jan 2024 13:26:55 +0000 (15:26 +0200)] 
gh-111803: Support loading more deeply nested lists in binary plist format (GH-114024)

It no longer uses the C stack. The depth of nesting is only limited by
Python recursion limit setting.

21 months agogh-114014: Update `fractions.Fraction()`'s rational parsing regex (#114015)
Crowthebird [Sat, 13 Jan 2024 12:02:39 +0000 (20:02 +0800)] 
gh-114014: Update `fractions.Fraction()`'s rational parsing regex (#114015)

Fix a bug in the regex used for parsing a string input to the `fractions.Fraction` constructor. That bug led to an inconsistent exception message being given for some inputs.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
21 months agogh-101225: Increase the socket backlog when creating a multiprocessing.connection...
Ronald Oussoren [Sat, 13 Jan 2024 09:48:33 +0000 (10:48 +0100)] 
gh-101225: Increase the socket backlog when creating a multiprocessing.connection.Listener (#113567)

Increase the backlog for multiprocessing.connection.Listener` objects created
 by `multiprocessing.manager` and `multiprocessing.resource_sharer` to
 significantly reduce the risk of getting a connection refused error when creating
 a `multiprocessing.connection.Connection` to them.

21 months agoAdd module docstring for `pathlib._abc`. (#113691)
Barney Gale [Sat, 13 Jan 2024 08:47:00 +0000 (08:47 +0000)] 
Add module docstring for `pathlib._abc`. (#113691)

21 months agopathlib ABCs: add `_raw_path` property (#113976)
Barney Gale [Sat, 13 Jan 2024 08:03:21 +0000 (08:03 +0000)] 
pathlib ABCs: add `_raw_path` property (#113976)

It's wrong for the `PurePathBase` methods to rely so much on `__str__()`.
Instead, they should treat the raw path(s) as opaque objects and leave the
details to `pathmod`.

This commit adds a `PurePathBase._raw_path` property and uses it through
many of the other ABC methods. These methods are all redefined in
`PurePath` and `Path`, so this has no effect on the public classes.

21 months agoGH-44626, GH-105476: Fix `ntpath.isabs()` handling of part-absolute paths (#113829)
Barney Gale [Sat, 13 Jan 2024 07:36:05 +0000 (07:36 +0000)] 
GH-44626, GH-105476: Fix `ntpath.isabs()` handling of part-absolute paths (#113829)

On Windows, `os.path.isabs()` now returns `False` when given a path that
starts with exactly one (back)slash. This is more compatible with other
functions in `os.path`, and with Microsoft's own documentation.

Also adjust `pathlib.PureWindowsPath.is_absolute()` to call
`ntpath.isabs()`, which corrects its handling of partial UNC/device paths
like `//foo`.

Co-authored-by: Jon Foster <jon@jon-foster.co.uk>
21 months agoGH-111798: skip `test_super_deep()` from `test_call` under pydebug builds on WASI...
Brett Cannon [Sat, 13 Jan 2024 00:29:16 +0000 (16:29 -0800)] 
GH-111798: skip `test_super_deep()` from `test_call` under pydebug builds on WASI (GH-114010)

21 months agogh-89159: Document missing TarInfo members (#91564)
Stanley [Fri, 12 Jan 2024 23:19:57 +0000 (15:19 -0800)] 
gh-89159: Document missing TarInfo members (#91564)

21 months agoGH-111801: set a lower recursion limit for `test_infintely_many_bases()` in `test_isi...
Brett Cannon [Fri, 12 Jan 2024 23:19:21 +0000 (15:19 -0800)] 
GH-111801: set a lower recursion limit for `test_infintely_many_bases()` in `test_isinstance` (#113997)

21 months agodatamodel: Fix a typo in ``object.__init_subclass__`` (#111599)
InSync [Fri, 12 Jan 2024 22:59:24 +0000 (05:59 +0700)] 
datamodel: Fix a typo in ``object.__init_subclass__`` (#111599)

21 months agoLink to the glossary for "magic methods" in ``MagicMock`` (#111292)
Pierre Equoy [Fri, 12 Jan 2024 22:54:36 +0000 (06:54 +0800)] 
Link to the glossary for "magic methods" in ``MagicMock`` (#111292)

The MagicMock documentation mentions magic methods several times without
actually pointing to the term in the glossary. This can be helpful for
people to fully understand what those magic methods are.

21 months agoTutorial: Clarify 'nonzero exit status' in the appendix (#112039)
Andrew Zipperer [Fri, 12 Jan 2024 22:42:51 +0000 (14:42 -0800)] 
Tutorial: Clarify 'nonzero exit status' in the appendix (#112039)

21 months agoFix a grammatical error in `pycore_pymem.h` (#112993)
Joseph Pearson [Fri, 12 Jan 2024 22:25:52 +0000 (17:25 -0500)] 
Fix a grammatical error in `pycore_pymem.h` (#112993)

21 months agogh-101100: Fix Sphinx Lint warnings in `Misc/` (#113946)
Hugo van Kemenade [Fri, 12 Jan 2024 22:25:04 +0000 (00:25 +0200)] 
gh-101100: Fix Sphinx Lint warnings in `Misc/` (#113946)

Fix Sphinx Lint warnings in Misc/

21 months agogh-95649: Document that asyncio contains uvloop code (#107536)
Alois Klink [Fri, 12 Jan 2024 22:21:13 +0000 (22:21 +0000)] 
gh-95649: Document that asyncio contains uvloop code (#107536)

Some of the asyncio SSL changes in GH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: https://github.com/python/cpython/pull/31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0

21 months agoGH-111802: set a low recursion limit for `test_bad_getattr()` in `test.pickletester...
Brett Cannon [Fri, 12 Jan 2024 22:14:09 +0000 (14:14 -0800)] 
GH-111802: set a low recursion limit for `test_bad_getattr()` in `test.pickletester` (GH-113996)

21 months agogh-113971: Make `zipfile.ZipInfo._compresslevel` public as `.compress_level` (#113969)
Gregory P. Smith [Fri, 12 Jan 2024 20:15:05 +0000 (12:15 -0800)] 
gh-113971: Make `zipfile.ZipInfo._compresslevel` public as `.compress_level` (#113969)

Make zipfile.ZipInfo.compress_level public.

A property is used to retain the behavior of the ._compresslevel.

People constructing zipfile.ZipInfo instances to pass into existing APIs to control per-file compression levels already treat this as public, there was never a reason for it not to be.

I used the more modern name compress_level instead of compresslevel as the keyword argument on other ZipFile APIs is called to be consistent with compress_type and a general long term preference of not runningwordstogether without a separator in names.

21 months agogh-113710: Add types to the interpreter DSL (#113711)
Ken Jin [Fri, 12 Jan 2024 17:30:27 +0000 (01:30 +0800)] 
gh-113710: Add types to the interpreter DSL (#113711)

Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
21 months agogh-113868: Add a number of MAP_* flags from macOS to module mmap (#113869)
Ronald Oussoren [Fri, 12 Jan 2024 15:56:18 +0000 (16:56 +0100)] 
gh-113868: Add a number of MAP_* flags from macOS to module mmap (#113869)

The new flags were extracted from the macOS 14.2 SDK.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
21 months agogh-107901: duplicate blocks with no lineno that have an eval break and multiple prede...
Irit Katriel [Fri, 12 Jan 2024 15:38:09 +0000 (15:38 +0000)] 
gh-107901: duplicate blocks with no lineno that have an eval break and multiple predecessors (#113950)

21 months agogh-113980: Fix resource warnings in test_asyncgen (GH-113984)
Serhiy Storchaka [Fri, 12 Jan 2024 15:30:26 +0000 (17:30 +0200)] 
gh-113980: Fix resource warnings in test_asyncgen (GH-113984)

21 months agogh-111877: Fixes stat() handling for inaccessible files on Windows (GH-113716)
Steve Dower [Fri, 12 Jan 2024 15:27:56 +0000 (15:27 +0000)] 
gh-111877: Fixes stat() handling for inaccessible files on Windows (GH-113716)

21 months agoDocs: Amend codeobject.co_lines docs; end number is exclusive (#113970)
Ned Batchelder [Fri, 12 Jan 2024 15:04:14 +0000 (10:04 -0500)] 
Docs: Amend codeobject.co_lines docs; end number is exclusive (#113970)

The end number should be exclusive, not inclusive.

21 months agoGH-113860: Get rid of `_PyUOpExecutorObject` (GH-113954)
Brandt Bucher [Fri, 12 Jan 2024 11:58:23 +0000 (03:58 -0800)] 
GH-113860: Get rid of `_PyUOpExecutorObject` (GH-113954)

21 months agogh-113027: Fix timezone check in test_variable_tzname in test_email (GH-113835)
Pablo Galindo Salgado [Fri, 12 Jan 2024 10:46:17 +0000 (10:46 +0000)] 
gh-113027: Fix timezone check in test_variable_tzname in test_email (GH-113835)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
21 months agogh-108364: In sqlite3, disable foreign keys before dumping SQL schema (#113957)
Mariusz Felisiak [Fri, 12 Jan 2024 09:50:37 +0000 (10:50 +0100)] 
gh-108364: In sqlite3, disable foreign keys before dumping SQL schema (#113957)

sqlite3.Connection.iterdump now ensures that foreign key support is
disabled before dumping the database schema, if there is any foreign key
violation.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
21 months agogh-113858: Cut down ccache size (GH-113945)
Petr Viktorin [Fri, 12 Jan 2024 09:48:25 +0000 (10:48 +0100)] 
gh-113858: Cut down ccache size (GH-113945)

Cut down ccache size

- Only save the ccache in the main reusable builds, not on builds that
  don't use special build options:
  - Generated files check
  - OpenSSL tests
  - Hypothesis tests
- Halve the max cache size, to 200M

21 months agogh-113937 Fix failures in type cache tests due to re-running (GH-113953)
Peter Lazorchak [Fri, 12 Jan 2024 05:18:19 +0000 (21:18 -0800)] 
gh-113937 Fix failures in type cache tests due to re-running (GH-113953)

21 months agogh-113903: Fix an IDLE configdialog test (#113973)
Terry Jan Reedy [Fri, 12 Jan 2024 03:10:00 +0000 (22:10 -0500)] 
gh-113903: Fix an IDLE configdialog test (#113973)

test_configdialog.HighPageTest.test_highlight_target_text_mouse fails
if a line of the Highlight tab text sample is not visible. If so, bbox()
in click_char() returns None and the unpacking iteration fails.

This occurred on a Devuan Linux system. Fix by moving the
'see character' call inside click_char, just before the bbox call.

Also, reduce the click_char calls to just one per tag name and
replace the other nested function with a dict comprehension.

21 months agogh-111968: Explicit handling for finalized freelist (gh-113929)
Donghee Na [Fri, 12 Jan 2024 00:31:28 +0000 (09:31 +0900)] 
gh-111968: Explicit handling for finalized freelist (gh-113929)

21 months agoImprove kde graph with better caption and number formatting (gh-113967)
Raymond Hettinger [Fri, 12 Jan 2024 00:25:18 +0000 (18:25 -0600)] 
Improve kde graph with better caption and number formatting (gh-113967)

21 months agoGH-107678: Improve Unicode handling clarity in ``library/re.rst`` (#107679)
Adam Turner [Thu, 11 Jan 2024 23:56:10 +0000 (23:56 +0000)] 
GH-107678: Improve Unicode handling clarity in ``library/re.rst`` (#107679)

21 months agogh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)
Zackery Spytz [Thu, 11 Jan 2024 22:39:47 +0000 (14:39 -0800)] 
gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
21 months agoUpdate KDE recipe to match the standard use of the h parameter (gh-#113958)
Raymond Hettinger [Thu, 11 Jan 2024 22:21:21 +0000 (16:21 -0600)] 
Update KDE recipe to match the standard use of the h parameter (gh-#113958)