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

21 months agogh-111968: Use per-thread freelists for tuple in free-threading (gh-113921)
Donghee Na [Thu, 11 Jan 2024 18:46:28 +0000 (03:46 +0900)] 
gh-111968: Use per-thread freelists for tuple in free-threading (gh-113921)

21 months agogh-113845: Fix a compiler warning in Python/suggestions.c (GH-113949)
Serhiy Storchaka [Thu, 11 Jan 2024 18:31:24 +0000 (20:31 +0200)] 
gh-113845: Fix a compiler warning in Python/suggestions.c (GH-113949)

21 months agoGH-113853: Guarantee forward progress in executors (GH-113854)
Mark Shannon [Thu, 11 Jan 2024 18:20:42 +0000 (18:20 +0000)] 
GH-113853: Guarantee forward progress in executors (GH-113854)

21 months agogh-107901: jump leaving an exception handler doesn't need an eval break check (#113943)
Irit Katriel [Thu, 11 Jan 2024 14:27:41 +0000 (14:27 +0000)] 
gh-107901: jump leaving an exception handler doesn't need an eval break check (#113943)

21 months agogh-91960: Remove Cirrus CI configuration (#113938)
Victor Stinner [Thu, 11 Jan 2024 13:33:24 +0000 (14:33 +0100)] 
gh-91960: Remove Cirrus CI configuration (#113938)

Remove .cirrus.yml which was already disabled by being renamed to
.cirrus-DISABLED.yml. In total, Cirrus CI only run for less than one
month.

21 months agogh-113932: assert ``SyntaxWarning`` in test_compile.TestSpecifics.test_… (#113933)
Kirill Podoprigora [Thu, 11 Jan 2024 11:25:07 +0000 (14:25 +0300)] 
gh-113932: assert ``SyntaxWarning`` in test_compile.TestSpecifics.test_… (#113933)

21 months agogh-112419: Document removal of sys.meta_path's 'find_module' fallback (#112421)
AN Long [Thu, 11 Jan 2024 09:43:35 +0000 (17:43 +0800)] 
gh-112419: Document removal of sys.meta_path's 'find_module' fallback (#112421)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
21 months agogh-112640: Add `kwdefaults` parameter to `types.FunctionType.__new__` (#112641)
Nikita Sobolev [Thu, 11 Jan 2024 08:42:30 +0000 (11:42 +0300)] 
gh-112640: Add `kwdefaults` parameter to `types.FunctionType.__new__` (#112641)

21 months agogh-89811: Check for valid tp_version_tag in specializer (GH-113558)
Peter Lazorchak [Thu, 11 Jan 2024 05:33:05 +0000 (21:33 -0800)] 
gh-89811: Check for valid tp_version_tag in specializer (GH-113558)

21 months agogh-111968: Unify naming scheme for freelist (gh-113919)
Donghee Na [Wed, 10 Jan 2024 23:51:51 +0000 (08:51 +0900)] 
gh-111968: Unify naming scheme for freelist (gh-113919)

21 months agogh-113896: Fix test_builtin.BuiltinTest.test___ne__() (#113897)
Kirill Podoprigora [Wed, 10 Jan 2024 23:39:48 +0000 (02:39 +0300)] 
gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (#113897)

Fix DeprecationWarning in test___ne__().

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
21 months agogh-87868: Skip `test_one_environment_variable` in `test_subprocess` when the platform...
AN Long [Wed, 10 Jan 2024 23:17:05 +0000 (07:17 +0800)] 
gh-87868: Skip `test_one_environment_variable` in `test_subprocess` when the platform or build cannot do that (#113867)

* improve the assert for test_one_environment_variable
* skip some test in test_subprocess when python is configured with shared
* also skip the test if AddressSanitizer is enabled

---------

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
21 months agogh-77046: os.pipe() sets _O_NOINHERIT flag on fds (#113817)
Victor Stinner [Wed, 10 Jan 2024 22:02:17 +0000 (23:02 +0100)] 
gh-77046: os.pipe() sets _O_NOINHERIT flag on fds (#113817)

On Windows, set _O_NOINHERIT flag on file descriptors
created by os.pipe() and io.WindowsConsoleIO.

Add test_pipe_spawnl() to test_os.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
21 months agogh-112302: Point core developers to SBOM devguide on errors (#113490)
Seth Michael Larson [Wed, 10 Jan 2024 19:21:04 +0000 (13:21 -0600)] 
gh-112302: Point core developers to SBOM devguide on errors (#113490)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agogh-113753: Clear finalized bit when putting PyAsyncGenASend back into free list ...
Sam Gross [Wed, 10 Jan 2024 18:18:38 +0000 (13:18 -0500)] 
gh-113753: Clear finalized bit when putting PyAsyncGenASend back into free list (#113754)

21 months agogh-113625: Align object addresses in the Descriptor HowTo Guide (#113894)
Raymond Hettinger [Wed, 10 Jan 2024 16:23:40 +0000 (10:23 -0600)] 
gh-113625: Align object addresses in the Descriptor HowTo Guide (#113894)

21 months agoAdd @requires_zlib() decorator for gh-109858 tests (GH-113918)
Serhiy Storchaka [Wed, 10 Jan 2024 15:56:40 +0000 (17:56 +0200)] 
Add @requires_zlib() decorator for gh-109858 tests (GH-113918)

21 months agogh-111968: Use per-thread freelists for float in free-threading (gh-113886)
Donghee Na [Wed, 10 Jan 2024 15:47:13 +0000 (00:47 +0900)] 
gh-111968: Use per-thread freelists for float in free-threading (gh-113886)

21 months agoGH-113860: All executors are now defined in terms of micro ops. Convert counter execu...
Mark Shannon [Wed, 10 Jan 2024 15:44:34 +0000 (15:44 +0000)] 
GH-113860: All executors are now defined in terms of micro ops. Convert counter executor to use uops. (GH-113864)

21 months agogh-111139: Optimize math.gcd(int, int) (#113887)
Victor Stinner [Wed, 10 Jan 2024 15:38:56 +0000 (16:38 +0100)] 
gh-111139: Optimize math.gcd(int, int) (#113887)

Add a fast-path for the common case.

Benchmark:

    python -m pyperf timeit \
        -s 'import math; gcd=math.gcd; x=2*3; y=3*5' \
        'gcd(x,y)'

Result: 1.07x faster (-3.4 ns)

    Mean +- std dev: 52.6 ns +- 4.0 ns -> 49.2 ns +- 0.4 ns: 1.07x faster

21 months agogh-109858: Protect zipfile from "quoted-overlap" zipbomb (GH-110016)
Serhiy Storchaka [Wed, 10 Jan 2024 13:55:36 +0000 (15:55 +0200)] 
gh-109858: Protect zipfile from "quoted-overlap" zipbomb (GH-110016)

Raise BadZipFile when try to read an entry that overlaps with other entry or
central directory.

21 months agogh-111789: Use PyDict_GetItemRef() in Modules/_zoneinfo.c (GH-112078)
Serhiy Storchaka [Wed, 10 Jan 2024 13:35:10 +0000 (15:35 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_zoneinfo.c (GH-112078)

21 months agogh-66515: Fix locking of an MH mailbox without ".mh_sequences" file (GH-113482)
Serhiy Storchaka [Wed, 10 Jan 2024 13:31:55 +0000 (15:31 +0200)] 
gh-66515: Fix locking of an MH mailbox without ".mh_sequences" file (GH-113482)

Guarantee that it either open an existing ".mh_sequences" file or create
a new ".mh_sequences" file, but do not replace existing ".mh_sequences"
file.

21 months agogh-89850: Add default C implementations of persistent_id() and persistent_load()...
Serhiy Storchaka [Wed, 10 Jan 2024 13:30:37 +0000 (15:30 +0200)] 
gh-89850: Add default C implementations of persistent_id() and persistent_load() (GH-113579)

Previously the C implementation of pickle.Pickler and pickle.Unpickler
classes did not have such methods and they could only be used if
they were overloaded in subclasses or set as instance attributes.

Fixed calling super().persistent_id() and super().persistent_load() in
subclasses of the C implementation of pickle.Pickler and pickle.Unpickler
classes. It no longer causes an infinite recursion.

21 months agogh-58032: Do not use argparse.FileType in module CLIs and scripts (GH-113649)
Serhiy Storchaka [Wed, 10 Jan 2024 13:07:19 +0000 (15:07 +0200)] 
gh-58032: Do not use argparse.FileType in module CLIs and scripts (GH-113649)

Open and close files manually. It prevents from leaking files,
preliminary creation of output files, and accidental closing of stdin
and stdout.

21 months agogh-113664: Improve style of Big O notation (GH-113695)
Serhiy Storchaka [Wed, 10 Jan 2024 13:01:18 +0000 (15:01 +0200)] 
gh-113664: Improve style of Big O notation (GH-113695)

Use cursive to make it looking like mathematic formulas.

21 months agogh-113594: Fix UnicodeEncodeError in TokenList.fold() (GH-113730)
Serhiy Storchaka [Wed, 10 Jan 2024 12:54:36 +0000 (14:54 +0200)] 
gh-113594: Fix UnicodeEncodeError in TokenList.fold() (GH-113730)

It occurred when try to re-encode an unknown-8bit part combined with non-unknown-8bit part.

21 months agogh-70835: Clarify error message for CSV file opened with wrong newline (GH-113786)
Serhiy Storchaka [Wed, 10 Jan 2024 12:52:29 +0000 (14:52 +0200)] 
gh-70835: Clarify error message for CSV file opened with wrong newline (GH-113786)

Based on patch by SilentGhost.

21 months agogh-96037: Always insert TimeoutError when exit an expired asyncio.timeout() block...
Serhiy Storchaka [Wed, 10 Jan 2024 10:50:31 +0000 (12:50 +0200)] 
gh-96037: Always insert TimeoutError when exit an expired asyncio.timeout() block (GH-113819)

If other exception was raised during exiting an expired
asyncio.timeout() block, insert TimeoutError in the exception context
just above the CancelledError.

21 months agogh-113879: Fix ResourceWarning in test_asyncio.test_server (GH-113881)
Serhiy Storchaka [Wed, 10 Jan 2024 10:38:36 +0000 (12:38 +0200)] 
gh-113879: Fix ResourceWarning in test_asyncio.test_server (GH-113881)

21 months agogh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows (GH-113900)
Serhiy Storchaka [Wed, 10 Jan 2024 10:36:03 +0000 (12:36 +0200)] 
gh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows (GH-113900)

winfo_id() converts the result of "winfo id" command to integer, but
"winfo pathname" command requires an argument to be a hexadecimal number
on Win64.

21 months agoGH-113858: GitHub Actions config: Only save ccache on pushes (GH-113859)
Petr Viktorin [Wed, 10 Jan 2024 08:49:18 +0000 (09:49 +0100)] 
GH-113858: GitHub Actions config: Only save ccache on pushes (GH-113859)

21 months agogh-112182: Replace StopIteration with RuntimeError for future (#113220)
Jamie Phan [Wed, 10 Jan 2024 05:21:00 +0000 (16:21 +1100)] 
gh-112182: Replace StopIteration with RuntimeError for future (#113220)

When an `StopIteration` raises into `asyncio.Future`, this will cause
a thread to hang. This commit address this by not raising an exception
and silently transforming the `StopIteration` with a `RuntimeError`,
which the caller can reconstruct from `fut.exception().__cause__`

21 months agopathlib ABCs: Require one or more initialiser arguments (#113885)
Barney Gale [Wed, 10 Jan 2024 01:12:58 +0000 (01:12 +0000)] 
pathlib ABCs: Require one or more initialiser arguments (#113885)

Refuse to guess what a user means when they initialise a pathlib ABC
without any positional arguments. In mainline pathlib it's normalised to
`.`, but in the ABCs this guess isn't appropriate; for example, the path
type may not represent the current directory as `.`, or may have no concept
of a "current directory" at all.

21 months agoGH-113528: Deoptimise `pathlib._abc.PurePathBase` (#113559)
Barney Gale [Tue, 9 Jan 2024 23:52:15 +0000 (23:52 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PurePathBase` (#113559)

Apply pathlib's normalization and performance tuning in `pathlib.PurePath`, but not `pathlib._abc.PurePathBase`.

With this change, the pathlib ABCs do not normalize away alternate path separators, empty segments, or dot segments. A single string given to the initialiser will round-trip by default, i.e. `str(PurePathBase(my_string)) == my_string`. Implementors can set their own path domain-specific normalization scheme by overriding `__str__()`

Eliminating path normalization makes maintaining and caching the path's parts and string representation both optional and not very useful, so this commit moves the `_drv`, `_root`, `_tail_cached` and `_str` slots from `PurePathBase` to `PurePath`. Only `_raw_paths` and `_resolving` slots remain in `PurePathBase`. This frees the ABCs from the burden of some of pathlib's hardest-to-understand code.

21 months agogh-111968: Introduce _PyFreeListState and _PyFreeListState_GET API (gh-113584)
Donghee Na [Tue, 9 Jan 2024 23:04:41 +0000 (08:04 +0900)] 
gh-111968: Introduce _PyFreeListState and _PyFreeListState_GET API (gh-113584)

21 months agoGH-113528: Deoptimise `pathlib._abc.PurePathBase.relative_to()` (again) (#113882)
Barney Gale [Tue, 9 Jan 2024 23:04:14 +0000 (23:04 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PurePathBase.relative_to()` (again) (#113882)

Restore full battle-tested implementations of `PurePath.[is_]relative_to()`. These were recently split up in 3375dfe and a15a773.

In `PurePathBase`, add entirely new implementations based on `_stack`, which itself calls `pathmod.split()` repeatedly to disassemble a path. These new implementations preserve features like trailing slashes where possible, while still observing that a `..` segment cannot be added to traverse an empty or `.` segment in *walk_up* mode. They do not rely on `parents` nor `__eq__()`, nor do they spin up temporary path objects.

Unfortunately calling `pathmod.relpath()` isn't an option, as it calls `abspath()` and in turn `os.getcwd()`, which is impure.

21 months agoGH-113528: Deoptimise `pathlib._abc.PurePathBase.parts` (#113883)
Barney Gale [Tue, 9 Jan 2024 22:46:50 +0000 (22:46 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PurePathBase.parts` (#113883)

Implement `parts` using `_stack`, which itself calls `pathmod.split()`
repeatedly. This avoids use of `_tail`, which will be moved to `PurePath`
shortly.

21 months agogh-66060: Use actual class name in _io type's __repr__ (#30824)
AN Long [Tue, 9 Jan 2024 20:39:36 +0000 (04:39 +0800)] 
gh-66060: Use actual class name in _io type's __repr__ (#30824)

Use the object's actual class name in the following _io type's __repr__:
- FileIO
- TextIOWrapper
- _WindowsConsoleIO

21 months agoGH-113528: Deoptimise `pathlib._abc.PathBase.resolve()` (#113782)
Barney Gale [Tue, 9 Jan 2024 19:50:23 +0000 (19:50 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PathBase.resolve()` (#113782)

Replace use of `_from_parsed_parts()` with `with_segments()` in
`resolve()`.

No effect on `Path.resolve()`, which uses `os.path.realpath()`.

21 months agoGH-113661: unittest runner: Don't exit 5 if tests were skipped (#113856)
Stefano Rivera [Tue, 9 Jan 2024 19:50:01 +0000 (11:50 -0800)] 
GH-113661: unittest runner: Don't exit 5 if tests were skipped (#113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.

21 months agogh-113781: Silence AttributeError in warning module during Python finalization (GH...
Serhiy Storchaka [Tue, 9 Jan 2024 19:44:05 +0000 (21:44 +0200)] 
gh-113781: Silence AttributeError in warning module during Python finalization (GH-113813)

The tracemalloc module can already be cleared.

21 months agogh-113848: Handle CancelledError subclasses in asyncio TaskGroup() and timeout()...
Serhiy Storchaka [Tue, 9 Jan 2024 19:41:31 +0000 (21:41 +0200)] 
gh-113848: Handle CancelledError subclasses in asyncio TaskGroup() and timeout() (GH-113850)

21 months agogh-113848: Use PyErr_GivenExceptionMatches() for check for CancelledError (GH-113849)
Serhiy Storchaka [Tue, 9 Jan 2024 19:41:02 +0000 (21:41 +0200)] 
gh-113848: Use PyErr_GivenExceptionMatches() for check for CancelledError (GH-113849)

21 months agoGH-113528: Deoptimise `pathlib._abc.PathBase._make_child_relpath()` (#113532)
Barney Gale [Tue, 9 Jan 2024 19:11:17 +0000 (19:11 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PathBase._make_child_relpath()` (#113532)

Call straight through to `joinpath()` in `PathBase._make_child_relpath()`.
Move optimised/caching code to `pathlib.Path._make_child_relpath()`

21 months agoSimplify binomial approximation example with random.binomialvariate() (gh-113871)
Raymond Hettinger [Tue, 9 Jan 2024 19:02:07 +0000 (13:02 -0600)] 
Simplify binomial approximation example with random.binomialvariate() (gh-113871)

21 months agoFix opcode name printing in debug mode (#113870)
Guido van Rossum [Tue, 9 Jan 2024 18:18:11 +0000 (10:18 -0800)] 
Fix opcode name printing in debug mode (#113870)

Fix a few places where the lltrace debug output printed ``(null)`` instead of an opcode name, because it was calling ``_PyUOpName()`` on a Tier-1 opcode.

21 months agogh-113650: Add workaround option for MSVC ARM64 bug affecting string encoding (GH...
Steve Dower [Tue, 9 Jan 2024 17:32:22 +0000 (17:32 +0000)] 
gh-113650: Add workaround option for MSVC ARM64 bug affecting string encoding (GH-113836)

21 months agogh-103092: Test _ctypes type hierarchy and features (#113727)
AN Long [Tue, 9 Jan 2024 17:28:43 +0000 (01:28 +0800)] 
gh-103092: Test _ctypes type hierarchy and features (#113727)

Test the following features for _ctypes types:
- disallow instantiation
- inheritance (MRO)
- immutability
- type name

The following _ctypes types are tested:
- Array
- CField
- COMError
- PyCArrayType
- PyCFuncPtrType
- PyCPointerType
- PyCSimpleType
- PyCStructType
- Structure
- Union
- UnionType
- _CFuncPtr
- _Pointer
- _SimpleCData

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
21 months agogh-87868: Sort and remove duplicates in getenvironment() (GH-102731)
AN Long [Tue, 9 Jan 2024 15:58:26 +0000 (23:58 +0800)] 
gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
22 months agogh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843)
Yan Yanchii [Tue, 9 Jan 2024 10:43:58 +0000 (11:43 +0100)] 
gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843)

22 months agogh-101100: Fix Sphinx warnings for 2.6 port-specific deprecations (#113752)
Hugo van Kemenade [Tue, 9 Jan 2024 08:18:15 +0000 (10:18 +0200)] 
gh-101100: Fix Sphinx warnings for 2.6 port-specific deprecations (#113752)

22 months agogh-113692: skip a test if multiprocessing isn't available. (GH-113704)
Vinay Sajip [Tue, 9 Jan 2024 07:47:42 +0000 (07:47 +0000)] 
gh-113692: skip a test if multiprocessing isn't available. (GH-113704)

22 months agoDocs: Link tokens in the format string grammars (#108184)
William Andrea [Tue, 9 Jan 2024 02:47:59 +0000 (21:47 -0500)] 
Docs: Link tokens in the format string grammars (#108184)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
22 months agogh-112087: Update list.{pop,clear,reverse,remove} to use CS (gh-113764)
Donghee Na [Tue, 9 Jan 2024 00:00:55 +0000 (09:00 +0900)] 
gh-112087: Update list.{pop,clear,reverse,remove} to use CS (gh-113764)

22 months agogh-112808: Fix mimalloc build on Solaris (#112809)
Jakub Kulík [Mon, 8 Jan 2024 23:50:56 +0000 (00:50 +0100)] 
gh-112808: Fix mimalloc build on Solaris (#112809)

22 months agogh-112806: Remove unused function warnings during mimalloc build on Solaris (#112807)
Jakub Kulík [Mon, 8 Jan 2024 23:49:33 +0000 (00:49 +0100)] 
gh-112806: Remove unused function warnings during mimalloc build on Solaris (#112807)

22 months agoreadme: fix displaying issue of command (#113719)
mara004 [Mon, 8 Jan 2024 23:42:56 +0000 (00:42 +0100)] 
readme: fix displaying issue of command (#113719)

Avoid line break in command as this causes displaying issues on GH.

22 months agogh-113027: Fix test_variable_tzname in test_email (#113821)
Serhiy Storchaka [Mon, 8 Jan 2024 22:33:53 +0000 (00:33 +0200)] 
gh-113027: Fix test_variable_tzname in test_email (#113821)

Determine the support of the Kyiv timezone by checking the result of
astimezone() which uses the system tz database and not the one
populated by zoneinfo.

22 months agogh-113827: Move Windows frozen modules directory to allow PGO builds (GH-113828)
Steve Dower [Mon, 8 Jan 2024 21:51:39 +0000 (21:51 +0000)] 
gh-113827: Move Windows frozen modules directory to allow PGO builds (GH-113828)

22 months agoGH-111693: Propagate correct asyncio.CancelledError instance out of asyncio.Condition...
Kristján Valur Jónsson [Mon, 8 Jan 2024 19:57:48 +0000 (19:57 +0000)] 
GH-111693: Propagate correct asyncio.CancelledError instance out of asyncio.Condition.wait() (#111694)

Also fix a race condition in `asyncio.Semaphore.acquire()` when cancelled.

22 months agogh-113791: Expose CLOCK_MONOTONIC_RAW_APPROX and CLOCK_UPTIME_RAW_APROX on macOS...
Ronald Oussoren [Mon, 8 Jan 2024 19:44:00 +0000 (20:44 +0100)] 
gh-113791: Expose CLOCK_MONOTONIC_RAW_APPROX and CLOCK_UPTIME_RAW_APROX on macOS in the time module (#113792)

22 months agoGH-113528: Speed up pathlib ABC tests. (#113788)
Barney Gale [Mon, 8 Jan 2024 19:31:52 +0000 (19:31 +0000)] 
GH-113528: Speed up pathlib ABC tests. (#113788)

- Add `__slots__` to dummy path classes.
- Return namedtuple rather than `os.stat_result` from `DummyPath.stat()`.
- Reduce maximum symlink count in `DummyPathWithSymlinks.resolve()`.

22 months agogh-113688: fix dtrace build on Solaris (#113814)
Jakub Kulík [Mon, 8 Jan 2024 19:28:09 +0000 (20:28 +0100)] 
gh-113688: fix dtrace build on Solaris (#113814)

(the gcmodule -> gc refactoring broke it)

22 months agoGH-113528: Move a few misplaced pathlib tests (#113527)
Barney Gale [Mon, 8 Jan 2024 19:17:18 +0000 (19:17 +0000)] 
GH-113528: Move a few misplaced pathlib tests (#113527)

`PurePathBase` does not define `__eq__()`, and so we have no business checking path equality in `test_eq_common` and `test_equivalences`. The tests only pass at the moment because we define the test class's `__eq__()` for use elsewhere.

Also move `test_parse_path_common` into the main pathlib test suite. It exercises a private `_parse_path()` method that will be moved to `PurePath` soon.

Lastly move a couple more tests concerned with optimisations and path normalisation.

22 months agoMinor algebraic simplification for the totient() recipe (gh-113822)
Raymond Hettinger [Mon, 8 Jan 2024 19:16:22 +0000 (13:16 -0600)] 
Minor algebraic simplification for the totient() recipe (gh-113822)

22 months agogh-113755: Fully adapt gcmodule.c to Argument Clinic (#113756)
Erlend E. Aasland [Mon, 8 Jan 2024 17:32:34 +0000 (18:32 +0100)] 
gh-113755: Fully adapt gcmodule.c to Argument Clinic (#113756)

Adapt the following functions to Argument Clinic:

- gc.set_threshold
- gc.get_referrers
- gc.get_referents

22 months agogh-113787: Fix refleaks in test_capi (gh-113816)
neonene [Mon, 8 Jan 2024 16:34:51 +0000 (01:34 +0900)] 
gh-113787: Fix refleaks in test_capi (gh-113816)

Fix refleaks and a typo.

22 months agogh-113391: fix outdated PyObject_HasAttr docs (#113420)
Sergey B Kirpichev [Mon, 8 Jan 2024 15:23:43 +0000 (18:23 +0300)] 
gh-113391: fix outdated PyObject_HasAttr docs (#113420)

After #53875: PyObject_HasAttr is not an equivalent of hasattr.
PyObject_HasAttrWithError is; it already has the note.

22 months agogh-110721: Remove unused code from suggestions.c after moving PyErr_Display to use...
Pablo Galindo Salgado [Mon, 8 Jan 2024 15:10:45 +0000 (15:10 +0000)] 
gh-110721: Remove unused code from suggestions.c after moving PyErr_Display to use the traceback module (#113712)

22 months agogh-74678: Increase base64 test coverage (GH-21913)
Zackery Spytz [Mon, 8 Jan 2024 11:01:31 +0000 (03:01 -0800)] 
gh-74678: Increase base64 test coverage (GH-21913)

Ensure the character y is disallowed within an Ascii85 5-tuple.

Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
22 months agogh-80109: Fix io.TextIOWrapper dropping the internal buffer during write() (GH-22535)
Zackery Spytz [Mon, 8 Jan 2024 10:33:34 +0000 (02:33 -0800)] 
gh-80109: Fix io.TextIOWrapper dropping the internal buffer during write() (GH-22535)

io.TextIOWrapper was dropping the internal decoding buffer
during read() and write() calls.

22 months agogh-73965: Move PYTHON_HISTORY into the correct usage section (#113798)
Hugo van Kemenade [Mon, 8 Jan 2024 09:58:58 +0000 (11:58 +0200)] 
gh-73965: Move PYTHON_HISTORY into the correct usage section (#113798)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agogh-73965: New environment variable PYTHON_HISTORY (#13208)
Zackery Spytz [Sun, 7 Jan 2024 06:30:12 +0000 (22:30 -0800)] 
gh-73965: New environment variable PYTHON_HISTORY (#13208)

It can be used to set the location of a .python_history file

---------

Co-authored-by: Levi Sabah <0xl3vi@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
22 months agogh-112795: Allow `/` folder in a zipfile (#112932)
AN Long [Sun, 7 Jan 2024 01:14:18 +0000 (09:14 +0800)] 
gh-112795: Allow `/` folder in a zipfile (#112932)

Allow extraction (no-op) of a "/" folder in a zipfile, they are commonly added by some archive creation tools.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
22 months agogh-89532: Remove LibreSSL workarounds (#28728)
Rami [Sat, 6 Jan 2024 23:25:58 +0000 (01:25 +0200)] 
gh-89532: Remove LibreSSL workarounds (#28728)

Remove LibreSSL specific workaround ifdefs from `_ssl.c` and delete the non-version-specific `_ssl_data.h` file (relevant for OpenSSL < 1.1.1, which we no longer support per PEP 644).

Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
22 months agoGH-113528: Deoptimise `pathlib._abc.PurePathBase.relative_to()` (#113529)
Barney Gale [Sat, 6 Jan 2024 21:37:38 +0000 (21:37 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PurePathBase.relative_to()` (#113529)

Replace use of `_from_parsed_parts()` with `with_segments()` in
`PurePathBase.relative_to()`, and move the assignment of `_drv`, `_root`
and `_tail_cached` slots into `PurePath.relative_to()`.

22 months agoGH-113528: Deoptimise `pathlib._abc.PurePathBase.parent` (#113530)
Barney Gale [Sat, 6 Jan 2024 21:17:51 +0000 (21:17 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PurePathBase.parent` (#113530)

Replace use of `_from_parsed_parts()` with `with_segments()`, and move
assignments to `_drv`, `_root`, _tail_cached` and `_str` slots into
`PurePath`.

22 months agoGH-113528: Deoptimise `pathlib._abc.PurePathBase.name` (#113531)
Barney Gale [Sat, 6 Jan 2024 20:50:25 +0000 (20:50 +0000)] 
GH-113528: Deoptimise `pathlib._abc.PurePathBase.name` (#113531)

Replace usage of `_from_parsed_parts()` with `with_segments()` in
`with_name()`, and take a similar approach in `name` for consistency's
sake.

22 months agoGH-113528: Slightly improve `pathlib.Path.glob()` tests for symlink loop handling...
Barney Gale [Sat, 6 Jan 2024 17:03:39 +0000 (17:03 +0000)] 
GH-113528: Slightly improve `pathlib.Path.glob()` tests for symlink loop handling (#113763)

Slightly improve `pathlib.Path.glob()` tests for symlink loop handling

When filtering results, ignore paths with more than one `linkD/` segment,
rather than all paths below the first `linkD/` segment. This allows us
to test that other paths under `linkD/` are correctly returned.

22 months agoGH-113528: Split up pathlib tests for invalid basenames. (#113776)
Barney Gale [Sat, 6 Jan 2024 17:03:07 +0000 (17:03 +0000)] 
GH-113528: Split up pathlib tests for invalid basenames. (#113776)

Split test cases for invalid names into dedicated test methods. This will
make it easier to refactor tests for invalid name handling in ABCs later.

No change of coverage, just a change of test suite organisation.

22 months agoGH-113528: pathlib ABC tests: add repr to dummy path classes. (#113777)
Barney Gale [Sat, 6 Jan 2024 17:02:36 +0000 (17:02 +0000)] 
GH-113528: pathlib ABC tests: add repr to dummy path classes. (#113777)

The `DummyPurePath` and `DummyPath` test classes are simple subclasses of
`PurePathBase` and `PathBase`. This commit adds `__repr__()` methods to the
dummy classes, which makes debugging test failures less painful.

22 months agogh-107901: synthetic jumps which are not at end of loop no longer check the eval...
Irit Katriel [Sat, 6 Jan 2024 14:20:08 +0000 (14:20 +0000)] 
gh-107901: synthetic jumps which are not at end of loop no longer check the eval breaker (#113721)

22 months agogh-111488: Changed error message in case of no 'in' keyword after 'for' in cmp (...
Grigoriev Semyon [Sat, 6 Jan 2024 10:27:49 +0000 (13:27 +0300)] 
gh-111488: Changed error message in case of no 'in' keyword after 'for' in cmp (#113656)

22 months agogh-113537: support loads str in plistlib.loads (#113582)
AN Long [Sat, 6 Jan 2024 09:26:59 +0000 (17:26 +0800)] 
gh-113537: support loads str in plistlib.loads (#113582)

Add support for loading XML plists from a string value instead of a only bytes value.

22 months agogh-113729: Fix IDLE's Help -> "IDLE Help" menu bug in 3.12.1 and 3.11.7 (#113731)
Ronald Oussoren [Sat, 6 Jan 2024 06:23:26 +0000 (07:23 +0100)] 
gh-113729: Fix IDLE's Help -> "IDLE Help" menu bug in 3.12.1 and 3.11.7 (#113731)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
22 months agogh-113750: Fix object resurrection in free-threaded builds (gh-113751)
Sam Gross [Sat, 6 Jan 2024 03:12:26 +0000 (22:12 -0500)] 
gh-113750: Fix object resurrection in free-threaded builds (gh-113751)

gh-113750: Fix object resurrection on free-threaded builds

This avoids the undesired re-initializing of fields like `ob_gc_bits`,
`ob_mutex`, and `ob_tid` when an object is resurrected due to its
finalizer being called.

This change has no effect on the default (with GIL) build.

22 months agoGH-113568: Stop raising deprecation warnings from pathlib ABCs (#113757)
Barney Gale [Fri, 5 Jan 2024 22:56:04 +0000 (22:56 +0000)] 
GH-113568: Stop raising deprecation warnings from pathlib ABCs (#113757)

22 months agogh-113360: Fix the documentation of module's attribute __test__ (GH-113393)
Serhiy Storchaka [Fri, 5 Jan 2024 22:23:16 +0000 (00:23 +0200)] 
gh-113360: Fix the documentation of module's attribute __test__ (GH-113393)

It can only be a dict since Python 2.4.

22 months agogh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618)
Serhiy Storchaka [Fri, 5 Jan 2024 22:12:34 +0000 (00:12 +0200)] 
gh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618)

Explicitly open and close files instead of using FileType.

22 months agoGH-113568: Stop raising auditing events from pathlib ABCs (#113571)
Barney Gale [Fri, 5 Jan 2024 21:41:19 +0000 (21:41 +0000)] 
GH-113568: Stop raising auditing events from pathlib ABCs (#113571)

Raise auditing events in `pathlib.Path.glob()`, `rglob()` and `walk()`,
but not in `pathlib._abc.PathBase` methods. Also move generation of a
deprecation warning into `pathlib.Path` so it gets the right stack level.