]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-100228: Document the os.fork threads DeprecationWarning. (#109767)
Gregory P. Smith [Sat, 23 Sep 2023 05:04:20 +0000 (22:04 -0700)] 
gh-100228: Document the os.fork threads DeprecationWarning. (#109767)

Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.

Many reviews and doc cleanup edits by Adam & Hugo. 🥳

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-109505: Remove unnecessary `hasattr` checks from `test_asyncio` (#109506)
Nikita Sobolev [Sat, 23 Sep 2023 04:14:15 +0000 (07:14 +0300)] 
gh-109505: Remove unnecessary `hasattr` checks from `test_asyncio` (#109506)

2 years agoGH-95913: Add the release date for Python 3.11 (#109750)
Adam Turner [Sat, 23 Sep 2023 04:07:06 +0000 (05:07 +0100)] 
GH-95913: Add the release date for Python 3.11 (#109750)

2 years agoFix indentation in 3.13 What's New (#109769)
Jelle Zijlstra [Sat, 23 Sep 2023 03:45:26 +0000 (20:45 -0700)] 
Fix indentation in 3.13 What's New (#109769)

The previous layout made it look like the other three deprecations are part of the first one, when in fact they are independent.

The new layout is consistent with that used for sqlite3 in 3.12 (https://docs.python.org/3.13/whatsnew/3.12.html#deprecated).

2 years agogh-109706: Fix multiprocessing test_nested_startmethod() (#109707)
Victor Stinner [Fri, 22 Sep 2023 21:49:32 +0000 (23:49 +0200)] 
gh-109706: Fix multiprocessing test_nested_startmethod() (#109707)

Don't check order, queue items can be written in any order.

2 years agoGH-107265: Add missing deoptimizations for ENTER_EXECUTOR's original opcode (GH-109420)
Tian Gao [Fri, 22 Sep 2023 21:13:31 +0000 (14:13 -0700)] 
GH-107265: Add missing deoptimizations for ENTER_EXECUTOR's original opcode (GH-109420)

2 years agogh-109721: Guard `_testinternalcapi` imports in tests (GH-109722)
Nikita Sobolev [Fri, 22 Sep 2023 20:51:58 +0000 (23:51 +0300)] 
gh-109721: Guard `_testinternalcapi` imports in tests (GH-109722)

2 years agoDocs: Update Donghee Na's name (#109743)
Hugo van Kemenade [Fri, 22 Sep 2023 18:52:57 +0000 (12:52 -0600)] 
Docs: Update Donghee Na's name (#109743)

2 years agogh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect...
Pablo Galindo Salgado [Fri, 22 Sep 2023 18:03:23 +0000 (19:03 +0100)] 
gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect soft keywords (#109606)

2 years agogh-109719: Fix missing jump target labels when compiler reorders cold/warm blocks...
Irit Katriel [Fri, 22 Sep 2023 16:59:35 +0000 (17:59 +0100)] 
gh-109719: Fix missing jump target labels when compiler reorders cold/warm blocks (#109734)

2 years agogh-109164: Replace `getopt` with `argparse` in pdb (#109165)
Tian Gao [Fri, 22 Sep 2023 16:55:48 +0000 (09:55 -0700)] 
gh-109164: Replace `getopt` with `argparse` in pdb (#109165)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agoACKS: Fix ordering; Correct Itamar Oren's surname; Add Adam Turner (#109737)
Adam Turner [Fri, 22 Sep 2023 14:56:07 +0000 (15:56 +0100)] 
ACKS: Fix ordering; Correct Itamar Oren's surname; Add Adam Turner  (#109737)

2 years agogh-109723: Disable Py_BUILD_CORE in _testcapi (#109727)
Victor Stinner [Fri, 22 Sep 2023 14:54:37 +0000 (16:54 +0200)] 
gh-109723: Disable Py_BUILD_CORE in _testcapi (#109727)

Make sure that the internal C API is not tested by mistake by
_testcapi.

Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in
Modules/_testcapi/parts.h: move code from _testcapimodule.c.

heaptype_relative.c and vectorcall_limited.c are using the limited C
API which is incompatible with the internal C API.

Move test_long_numbits() from _testcapi to _testinternalcapi since it
uses the internal C API "pycore_long.h".

Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly,
just include _testcapi/parts.h.

Ajust "make check-c-globals" for these changes.

2 years agoGH-109190: Copyedit 3.12 What's New: asyncio (#109661)
Adam Turner [Fri, 22 Sep 2023 13:32:32 +0000 (14:32 +0100)] 
GH-109190: Copyedit 3.12 What's New: asyncio (#109661)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago GH-109190: Copyedit 3.12 What's New: PEP 669 (#109658)
Adam Turner [Fri, 22 Sep 2023 13:31:49 +0000 (14:31 +0100)] 
 GH-109190: Copyedit 3.12 What's New: PEP 669 (#109658)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-109709: Fix asyncio test_stdin_broken_pipe() (#109710)
Victor Stinner [Fri, 22 Sep 2023 13:29:42 +0000 (15:29 +0200)] 
gh-109709: Fix asyncio test_stdin_broken_pipe() (#109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().

2 years agoRemove outdated docstring from the `quantify` itertools recipe (#109726)
Łukasz Langa [Fri, 22 Sep 2023 13:09:32 +0000 (15:09 +0200)] 
Remove outdated docstring from the `quantify` itertools recipe (#109726)

2 years agoGH-109190: Copyedit 3.12 What's New: Other Language Changes (#109660)
Adam Turner [Fri, 22 Sep 2023 13:05:39 +0000 (14:05 +0100)] 
GH-109190: Copyedit 3.12 What's New: Other Language Changes (#109660)

2 years agogh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock (#108513)
elfstrom [Fri, 22 Sep 2023 12:55:56 +0000 (14:55 +0200)] 
gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock (#108513)

This fixes issue #105829, https://github.com/python/cpython/issues/105829

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Chris Withers <chris@withers.org>
Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2 years agoGH-109190: Copyedit 3.12 What's New: PEP 684 (#109657)
Adam Turner [Fri, 22 Sep 2023 12:53:53 +0000 (13:53 +0100)] 
GH-109190: Copyedit 3.12 What's New: PEP 684 (#109657)

2 years agoGH-109190: Copyedit 3.12 What's New: bytecode (LOAD_METHOD) (#109665)
Adam Turner [Fri, 22 Sep 2023 12:50:20 +0000 (13:50 +0100)] 
GH-109190: Copyedit 3.12 What's New: bytecode (LOAD_METHOD) (#109665)

bytecode: suppress reference to removed LOAD_METHOD

2 years agogh-106584: Fix exit code for unittest in Python 3.12 (#106588)
EliseevEgor [Fri, 22 Sep 2023 12:26:27 +0000 (15:26 +0300)] 
gh-106584: Fix exit code for unittest in Python 3.12 (#106588)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agoGH-109190: Copyedit 3.12 What's New: calendar (#109662)
Adam Turner [Fri, 22 Sep 2023 06:29:48 +0000 (07:29 +0100)] 
GH-109190: Copyedit 3.12 What's New: calendar (#109662)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoGH-109190: Copyedit 3.12 What's New: tokenize (#109663)
Adam Turner [Fri, 22 Sep 2023 06:28:13 +0000 (07:28 +0100)] 
GH-109190: Copyedit 3.12 What's New: tokenize (#109663)

2 years ago GH-109190: Copyedit 3.12 What's New: Consistently show module names (#109664)
Adam Turner [Fri, 22 Sep 2023 05:37:44 +0000 (06:37 +0100)] 
 GH-109190: Copyedit 3.12 What's New: Consistently show module names (#109664)

Consistently show module names

2 years agogh-109566: Fix typo in PCbuild/rt.bat (#109701)
Victor Stinner [Fri, 22 Sep 2023 02:43:48 +0000 (04:43 +0200)] 
gh-109566: Fix typo in PCbuild/rt.bat (#109701)

2 years agogh-109702: Increase concurrent_futures deadlock timeout (#109703)
Victor Stinner [Fri, 22 Sep 2023 01:13:31 +0000 (03:13 +0200)] 
gh-109702: Increase concurrent_futures deadlock timeout (#109703)

Replace SHORT_TIMEOUT with LONG_TIMEOUT in test_deadlock of
test_concurrent_futures.

2 years agogh-108996: fix and enable test_msvcrt (#109226)
AN Long [Fri, 22 Sep 2023 00:19:48 +0000 (08:19 +0800)] 
gh-108996: fix and enable test_msvcrt (#109226)

* Add _testconsole.flush_console_input_buffer() function.
* test_kbhit(), test_getwch() and test_getwche() now call
  flush_console_input_buffer().
* Don't override sys.stdin anymore (not needed).

2 years agogh-104469: Disallow using Py_LIMITED_API with Py_BUILD_CORE (#109690)
Victor Stinner [Thu, 21 Sep 2023 23:21:07 +0000 (01:21 +0200)] 
gh-104469: Disallow using Py_LIMITED_API with Py_BUILD_CORE (#109690)

Fix make check-c-globals: complete USE_LIMITED_C_API list of the
c-analyzer.

2 years agogh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697)
Victor Stinner [Thu, 21 Sep 2023 22:59:08 +0000 (00:59 +0200)] 
gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697)

On FreeBSD, regular users cannot set the sticky bit. Skip the test if
chmod() fails with EFTYPE error.

2 years agogh-109582: test_fork_signal_handling should wait for event (#109605)
Davide Rizzo [Thu, 21 Sep 2023 21:20:29 +0000 (23:20 +0200)] 
gh-109582: test_fork_signal_handling should wait for event (#109605)

Sometimes the child_handled event was missing because either
the child quits before it gets a chance to handle the signal,
or the parent asserts before the event notification is
delivered via IPC.  Synchronize explicitly to avoid this.

2 years agogh-109693: Remove pycore_atomic_funcs.h (#109694)
Sam Gross [Thu, 21 Sep 2023 20:57:20 +0000 (16:57 -0400)] 
gh-109693: Remove pycore_atomic_funcs.h (#109694)

_PyUnicode_FromId() now uses pyatomic.h functions instead.

2 years agogh-108303: Update test_fractions for new Lib/test/mathdata/ (#109686)
Victor Stinner [Thu, 21 Sep 2023 19:48:20 +0000 (21:48 +0200)] 
gh-108303: Update test_fractions for new Lib/test/mathdata/ (#109686)

2 years agoGH-109190: Copyedit 3.12 What's New: PEP 701 (#109655)
Adam Turner [Thu, 21 Sep 2023 19:37:28 +0000 (20:37 +0100)] 
GH-109190: Copyedit 3.12 What's New: PEP 701 (#109655)

2 years agoGH-109190: Copyedit 3.12 What's New: Improved Error Messages (#109654)
Adam Turner [Thu, 21 Sep 2023 19:24:44 +0000 (20:24 +0100)] 
GH-109190: Copyedit 3.12 What's New: Improved Error Messages (#109654)

2 years agogh-108303: Move all math files to `Lib/test/mathdata/` (#109512)
Nikita Sobolev [Thu, 21 Sep 2023 19:14:41 +0000 (22:14 +0300)] 
gh-108303: Move all math files to `Lib/test/mathdata/` (#109512)

2 years agoGH-109190: Copyedit 3.12 What's New: Typing PEPs (#109659)
Adam Turner [Thu, 21 Sep 2023 19:05:54 +0000 (20:05 +0100)] 
GH-109190: Copyedit 3.12 What's New: Typing PEPs (#109659)

2 years agoGH-109190: Copyedit 3.12 What's New: PEP 709 (#109656)
Adam Turner [Thu, 21 Sep 2023 18:50:33 +0000 (19:50 +0100)] 
GH-109190: Copyedit 3.12 What's New: PEP 709 (#109656)

2 years agogh-74481: Add missing debug function docs and constants to msvcrt (GH-109650)
AN Long [Thu, 21 Sep 2023 15:44:24 +0000 (23:44 +0800)] 
gh-74481: Add missing debug function docs and constants to msvcrt (GH-109650)

2 years agogh-109613: _pystat_fromstructstat() checks for exceptions (#109618)
Victor Stinner [Thu, 21 Sep 2023 07:55:06 +0000 (09:55 +0200)] 
gh-109613: _pystat_fromstructstat() checks for exceptions (#109618)

Fix os.stat() and os.DirEntry.stat(): check for exceptions.
Previously, on Python built in debug mode, these functions could
trigger a fatal Python error (and abort the process) when a function
succeeded with an exception set.

_pystat_fromstructstat() now exits immediately if an exception is
raised, rather only checking for exceptions at the end. It fix
following fatal error in fill_time():

    Fatal Python error: _Py_CheckSlotResult:
    Slot * of type int succeeded with an exception set

2 years agogh-109625: Move _ready_to_import() from test_import to support.import_helper (#109626)
Nikita Sobolev [Thu, 21 Sep 2023 07:39:36 +0000 (10:39 +0300)] 
gh-109625: Move _ready_to_import() from test_import to support.import_helper (#109626)

2 years agoGH-109209: Bump the minimum Sphinx version to 4.2 (#109210)
Adam Turner [Thu, 21 Sep 2023 06:06:36 +0000 (07:06 +0100)] 
GH-109209: Bump the minimum Sphinx version to 4.2 (#109210)

2 years agogh-109627: duplicated smalll exit blocks need to be assigned jump target labels ...
Irit Katriel [Wed, 20 Sep 2023 23:08:06 +0000 (00:08 +0100)] 
gh-109627: duplicated smalll exit blocks need to be assigned jump target labels (#109630)

2 years agogh-109408: Move Windows builds from Azure Pipelines PR to GitHub Actions (#109569)
Hugo van Kemenade [Wed, 20 Sep 2023 18:56:42 +0000 (12:56 -0600)] 
gh-109408: Move Windows builds from Azure Pipelines PR to GitHub Actions (#109569)

2 years agoFix typos in docs and comments (#109619)
Heinz-Alexander Fuetterer [Wed, 20 Sep 2023 16:58:23 +0000 (18:58 +0200)] 
Fix typos in docs and comments (#109619)

2 years agogh-109390: add dump_symtable utility under #if 0 (#109391)
Carl Meyer [Wed, 20 Sep 2023 16:55:56 +0000 (10:55 -0600)] 
gh-109390: add dump_symtable utility under #if 0 (#109391)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-109054: Document configure variables (#109224)
Victor Stinner [Wed, 20 Sep 2023 16:51:53 +0000 (18:51 +0200)] 
gh-109054: Document configure variables (#109224)

2 years agogh-108973: Fix asyncio test_subprocess_consistent_callbacks() (#109431)
Victor Stinner [Wed, 20 Sep 2023 13:54:19 +0000 (15:54 +0200)] 
gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (#109431)

SubprocessProtocol process_exited() method can be called before
pipe_data_received() and pipe_connection_lost() methods. Document it
and adapt the test for that.

Revert commit 282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6.
_child_watcher_callback() calls immediately _process_exited(): don't
add an additional delay with call_soon(). The reverted change didn't
make _process_exited() more determistic: it can still be called
before pipe_connection_lost() for example.

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2 years agogh-109559: Update unicodedata checksums for 15.1.0. (#109597)
Benjamin Peterson [Wed, 20 Sep 2023 05:40:34 +0000 (22:40 -0700)] 
gh-109559: Update unicodedata checksums for 15.1.0. (#109597)

Update unicodedata checksums for 15.1.0.

2 years agofixes gh-109559: Update `unicodedata` for Unicode 15.1.0 (GH-109560)
James Gerity [Wed, 20 Sep 2023 05:07:47 +0000 (01:07 -0400)] 
fixes gh-109559: Update `unicodedata` for Unicode 15.1.0 (GH-109560)

---------

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2 years agogh-109543: Remove unnecessary hasattr check (#109544)
Jelle Zijlstra [Wed, 20 Sep 2023 03:15:52 +0000 (20:15 -0700)] 
gh-109543: Remove unnecessary hasattr check (#109544)

Also added a new test case covering the scenario I thought this
might be about.

2 years agogh-103053: Skip test_freeze_simple_script() on PGO build (#109591)
Victor Stinner [Wed, 20 Sep 2023 01:58:34 +0000 (03:58 +0200)] 
gh-103053: Skip test_freeze_simple_script() on PGO build (#109591)

Skip test_freeze_simple_script() of test_tools.test_freeze if Python
is built with "./configure --enable-optimizations", which means with
Profile Guided Optimization (PGO): it just makes the test too slow.
The freeze tool is tested by many other CIs with other (faster)
compiler flags.

test.pythoninfo now gets also get_build_info() of
test.libregrtests.utils.

2 years agogh-90108: Disable LTO on _freeze_module and _testembed (#109581)
Victor Stinner [Wed, 20 Sep 2023 01:40:32 +0000 (03:40 +0200)] 
gh-90108: Disable LTO on _freeze_module and _testembed (#109581)

LTO optimization is nice to make Python faster, but _freeze_module
and _testembed performance is not important. Using LTO to build these
two programs make a whole Python build way slower, especially
combined with a sanitizer (like ASAN).

2 years agogh-109109: Expose retrieving certificate chains in SSL module (#109113)
Mateusz Nowak [Wed, 20 Sep 2023 01:20:54 +0000 (03:20 +0200)] 
gh-109109: Expose retrieving certificate chains in SSL module (#109113)

Adds APIs to get the TLS certificate chains, verified or full unverified, from SSLSocket and SSLObject.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2 years agogh-109033: Return filename with os.utime errors (#109034)
Ronan Pigott [Tue, 19 Sep 2023 23:18:23 +0000 (16:18 -0700)] 
gh-109033: Return filename with os.utime errors (#109034)

The filename was previously intentionally omitted from exception because
"it might confuse the user". Uncaught exceptions are not generally a
replacement for user-facing error messages, so obscuring this
information only has the effect of making the programmer's life more
difficult.

2 years agogh-76785: Use Pending Calls When Releasing Cross-Interpreter Data (gh-109556)
Eric Snow [Tue, 19 Sep 2023 21:01:34 +0000 (15:01 -0600)] 
gh-76785: Use Pending Calls When Releasing Cross-Interpreter Data (gh-109556)

This fixes some crashes in the _xxinterpchannels module, due to a race between interpreters.

2 years agogh-109580: Skip test_perf_profiler on ASAN build (#109584)
Victor Stinner [Tue, 19 Sep 2023 17:42:51 +0000 (19:42 +0200)] 
gh-109580: Skip test_perf_profiler on ASAN build (#109584)

Skip test_perf_profiler if Python is built with ASAN, MSAN or UBSAN
sanitizer. Python does crash randomly in this test on such build.

2 years agogh-108724: Fix _PySemaphore compile error on WASM (gh-109583)
Sam Gross [Tue, 19 Sep 2023 17:35:11 +0000 (13:35 -0400)] 
gh-108724: Fix _PySemaphore compile error on WASM (gh-109583)

Some WASM platforms have POSIX semaphores, but not sem_timedwait.

2 years agogh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344)
Sam Gross [Tue, 19 Sep 2023 15:54:29 +0000 (11:54 -0400)] 
gh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344)

PyMutex is a one byte lock with fast, inlineable lock and unlock functions for the common uncontended case.  The design is based on WebKit's WTF::Lock.

PyMutex is built using the _PyParkingLot APIs, which provides a cross-platform futex-like API (based on WebKit's WTF::ParkingLot).  This internal API will be used for building other synchronization primitives used to implement PEP 703, such as one-time initialization and events.

This also includes tests and a mini benchmark in Tools/lockbench/lockbench.py to compare with the existing PyThread_type_lock.

Uncontended acquisition + release:
* Linux (x86-64): PyMutex: 11 ns, PyThread_type_lock: 44 ns
* macOS (arm64): PyMutex: 13 ns, PyThread_type_lock: 18 ns
* Windows (x86-64): PyMutex: 13 ns, PyThread_type_lock: 38 ns

PR Overview:

The primary purpose of this PR is to implement PyMutex, but there are a number of support pieces (described below).

* PyMutex:  A 1-byte lock that doesn't require memory allocation to initialize and is generally faster than the existing PyThread_type_lock.  The API is internal only for now.
* _PyParking_Lot:  A futex-like API based on the API of the same name in WebKit.  Used to implement PyMutex.
* _PyRawMutex:  A word sized lock used to implement _PyParking_Lot.
* PyEvent:  A one time event.  This was used a bunch in the "nogil" fork and is useful for testing the PyMutex implementation, so I've included it as part of the PR.
* pycore_llist.h:  Defines common operations on doubly-linked list.  Not strictly necessary (could do the list operations manually), but they come up frequently in the "nogil" fork. ( Similar to https://man.freebsd.org/cgi/man.cgi?queue)

---------

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2 years agogh-109496: Skip test_capi.test_decref_freed_object() on ASAN (#109573)
Victor Stinner [Tue, 19 Sep 2023 14:42:08 +0000 (16:42 +0200)] 
gh-109496: Skip test_capi.test_decref_freed_object() on ASAN (#109573)

Skip test_decref_freed_object() of test_capi.test_misc if Python is
built with ASAN, MSAN or UBSAN sanitizers.

2 years agogh-109566: Run GHA and buildbot tests with --fail-rerun (#109567)
Victor Stinner [Tue, 19 Sep 2023 13:50:27 +0000 (15:50 +0200)] 
gh-109566: Run GHA and buildbot tests with --fail-rerun (#109567)

2 years agoMisc itertool recipe improvements, mostly docstrings and comments (gh-109555)
Raymond Hettinger [Tue, 19 Sep 2023 12:39:44 +0000 (07:39 -0500)] 
Misc itertool recipe improvements, mostly docstrings and comments (gh-109555)

2 years agogh-109485: Further improve `test_future_stmt` tests (#109486)
Nikita Sobolev [Tue, 19 Sep 2023 12:01:59 +0000 (15:01 +0300)] 
gh-109485: Further improve `test_future_stmt` tests (#109486)

Add assertSyntaxError() which run tests with an additional docstring
and without docstring, and checks for the error message.

2 years agogh-109435: Add Doc/library/cmdline.rst (#109436)
Victor Stinner [Tue, 19 Sep 2023 11:57:28 +0000 (13:57 +0200)] 
gh-109435: Add Doc/library/cmdline.rst (#109436)

Document modules providing a command-line interface (CLI).

2 years agono-issue: Fix typo TestContentTyopeHeader to TestContentTypeHeader (gh-109069)
Jenner [Tue, 19 Sep 2023 09:50:35 +0000 (18:50 +0900)] 
no-issue: Fix typo TestContentTyopeHeader to TestContentTypeHeader (gh-109069)

2 years agogh-109125: Run mypy on `Tools/wasm` (#109126)
Nikita Sobolev [Tue, 19 Sep 2023 05:49:26 +0000 (08:49 +0300)] 
gh-109125: Run mypy on `Tools/wasm` (#109126)

2 years agogh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533)
Serhiy Storchaka [Tue, 19 Sep 2023 05:12:29 +0000 (08:12 +0300)] 
gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533)

2 years agogh-109546: Add more tests for formatting floats and fractions (GH-109548)
Serhiy Storchaka [Tue, 19 Sep 2023 05:09:11 +0000 (08:09 +0300)] 
gh-109546: Add more tests for formatting floats and fractions (GH-109548)

2 years agoFix error handling in _PySys_UpdateConfig() (GH-109524)
Serhiy Storchaka [Mon, 18 Sep 2023 17:09:59 +0000 (20:09 +0300)] 
Fix error handling in _PySys_UpdateConfig() (GH-109524)

2 years agogh-102757: fix function signature mismatch for `functools.reduce` between code and...
Xuehai Pan [Mon, 18 Sep 2023 16:42:58 +0000 (00:42 +0800)] 
gh-102757: fix function signature mismatch for `functools.reduce` between code and documentation (#102759)

2 years agogh-109496: Detect Py_DECREF() after dealloc in debug mode (#109539)
Victor Stinner [Mon, 18 Sep 2023 14:59:09 +0000 (16:59 +0200)] 
gh-109496: Detect Py_DECREF() after dealloc in debug mode (#109539)

On a Python built in debug mode, Py_DECREF() now calls
_Py_NegativeRefcount() if the object is a dangling pointer to
deallocated memory: memory filled with 0xDD "dead byte" by the debug
hook on memory allocators. The fix is to check the reference count
*before* checking for _Py_IsImmortal().

Add test_decref_freed_object() to test_capi.test_misc.

2 years agogh-109508: Fix libregrtest formatting of getcwd() (#109537)
Victor Stinner [Mon, 18 Sep 2023 14:45:48 +0000 (16:45 +0200)] 
gh-109508: Fix libregrtest formatting of getcwd() (#109537)

2 years agogh-109371: Fix monitoring with instruction events set (gh-109385)
Tian Gao [Mon, 18 Sep 2023 14:30:08 +0000 (07:30 -0700)] 
gh-109371: Fix monitoring with instruction events set (gh-109385)

2 years agogh-108843: fix ast.unparse for f-string with many quotes (#108981)
Shantanu [Mon, 18 Sep 2023 13:56:19 +0000 (06:56 -0700)] 
gh-108843: fix ast.unparse for f-string with many quotes (#108981)

2 years agogh-108303: Fix and move `badsyntax_pep3120.py` (#109513)
Nikita Sobolev [Mon, 18 Sep 2023 13:04:17 +0000 (16:04 +0300)] 
gh-108303: Fix and move `badsyntax_pep3120.py` (#109513)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-109408: Azure Pipelines: test 3.12 branch (#109453)
Hugo van Kemenade [Mon, 18 Sep 2023 12:37:23 +0000 (06:37 -0600)] 
gh-109408: Azure Pipelines: test 3.12 branch (#109453)

2 years agoDocs: getopt is deprecated in Python 3.13 (#109438)
Hugo van Kemenade [Mon, 18 Sep 2023 10:45:59 +0000 (04:45 -0600)] 
Docs: getopt is deprecated in Python 3.13 (#109438)

2 years agoFix a typo in c-analyzer (#109213)
DongWoo Son [Mon, 18 Sep 2023 07:27:54 +0000 (16:27 +0900)] 
Fix a typo in c-analyzer (#109213)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Dale Collison <92315623+dcollison@users.noreply.github.com>
2 years agoFix extraneous backslashes in hashlib docs (#109468)
Anthony Sottile [Mon, 18 Sep 2023 07:25:33 +0000 (03:25 -0400)] 
Fix extraneous backslashes in hashlib docs (#109468)

2 years agogh-109413: Improve mypy config for libregrtest (#109518)
Alex Waygood [Mon, 18 Sep 2023 00:35:51 +0000 (01:35 +0100)] 
gh-109413: Improve mypy config for libregrtest (#109518)

Improve the mypy config file for libregrtest

2 years agogh-109408: Remove Ubuntu unit tests from Azure Pipelines (#109452)
Hugo van Kemenade [Sun, 17 Sep 2023 17:46:15 +0000 (11:46 -0600)] 
gh-109408: Remove Ubuntu unit tests from Azure Pipelines (#109452)

2 years agogh-108511: Add C API functions which do not silently ignore errors (GH-109025)
Serhiy Storchaka [Sun, 17 Sep 2023 11:23:31 +0000 (14:23 +0300)] 
gh-108511: Add C API functions which do not silently ignore errors (GH-109025)

Add the following functions:

* PyObject_HasAttrWithError()
* PyObject_HasAttrStringWithError()
* PyMapping_HasKeyWithError()
* PyMapping_HasKeyStringWithError()

2 years agogh-108303: Move all certificates to `Lib/test/certdata/` (#109489)
Nikita Sobolev [Sat, 16 Sep 2023 16:47:18 +0000 (19:47 +0300)] 
gh-108303: Move all certificates to `Lib/test/certdata/` (#109489)

2 years agogh-109451: Fix wrong format specifier in logging documentation (GH-109465)
AlberLC [Sat, 16 Sep 2023 09:06:04 +0000 (11:06 +0200)] 
gh-109451: Fix wrong format specifier in logging documentation (GH-109465)

2 years agogh-109414: Add some basic information about venvs in the introduction. (GH-109440)
Vinay Sajip [Sat, 16 Sep 2023 08:49:02 +0000 (09:49 +0100)] 
gh-109414: Add some basic information about venvs in the introduction. (GH-109440)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-109474: Update two Unix packaging URLs (#109307)
partev [Sat, 16 Sep 2023 07:46:09 +0000 (03:46 -0400)] 
gh-109474: Update two Unix packaging URLs  (#109307)

update packaging URLs

fix a broken URL for fedora RPM packaging guide and fix a URL redirect for Slackware packaging guide.

2 years agoGH-83417: Allow `venv` to add a `.gitignore` file to environments via a new `scm_igno...
Brett Cannon [Fri, 15 Sep 2023 22:38:08 +0000 (15:38 -0700)] 
GH-83417: Allow `venv` to add a `.gitignore` file to environments via a new `scm_ignore_file` parameter (GH-108125)

This feature is off by default via code but on by default via the CLI. The `.gitignore` file contains `*` which causes the entire directory to be ignored.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106213: Make Emscripten trampolines work with JSPI (GH-106219)
Hood Chatham [Fri, 15 Sep 2023 22:04:21 +0000 (15:04 -0700)] 
gh-106213: Make Emscripten trampolines work with JSPI (GH-106219)

There is a WIP proposal to enable webassembly stack switching which have been
implemented in v8:

https://github.com/WebAssembly/js-promise-integration

It is not possible to switch stacks that contain JS frames so the Emscripten JS
trampolines that allow calling functions with the wrong number of arguments
don't work in this case. However, the js-promise-integration proposal requires
the [type reflection for Wasm/JS API](https://github.com/WebAssembly/js-types)
proposal, which allows us to actually count the number of arguments a function
expects.

For better compatibility with stack switching, this PR checks if type reflection
is available, and if so we use a switch block to decide the appropriate
signature. If type reflection is unavailable, we should use the current EMJS
trampoline.

We cache the function argument counts since when I didn't cache them performance
was negatively affected.

Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
2 years agogh-109096: Deprecate `http.server.CGIHTTPRequestHandler` (#109387)
Gregory P. Smith [Fri, 15 Sep 2023 21:26:45 +0000 (14:26 -0700)] 
gh-109096: Deprecate `http.server.CGIHTTPRequestHandler` (#109387)

Deprecate `http.server.CGIHTTPRequestHandler`.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agoGH-109373: Store metadata required for pystats comparison in the JSON (GH-109374)
Michael Droettboom [Fri, 15 Sep 2023 20:10:46 +0000 (16:10 -0400)] 
GH-109373: Store metadata required for pystats comparison in the JSON (GH-109374)

2 years agogh-109350: Fix outdated captured output in unittest.mock documentation (#109353)
Egil Martinsson [Fri, 15 Sep 2023 18:25:16 +0000 (20:25 +0200)] 
gh-109350: Fix outdated captured output in unittest.mock documentation (#109353)

2 years agogh-109413: Fix some trivial mypy nitpicks in libregrtest (#109454)
Alex Waygood [Fri, 15 Sep 2023 17:01:28 +0000 (18:01 +0100)] 
gh-109413: Fix some trivial mypy nitpicks in libregrtest (#109454)

2 years agogh-91960: Disable Cirrus CI for now (#109457)
Victor Stinner [Fri, 15 Sep 2023 16:41:25 +0000 (18:41 +0200)] 
gh-91960: Disable Cirrus CI for now (#109457)

Python is out of free credit and so all jobs are reported as failure.

Rename .cirrus.yml to .cirrus-DISABLED.yml to disable the job.

2 years agogh-109287: Desugar inst(X) to op(X); macro(X) = X (#109294)
Guido van Rossum [Fri, 15 Sep 2023 15:39:05 +0000 (08:39 -0700)] 
gh-109287: Desugar inst(X) to op(X); macro(X) = X (#109294)

This makes the internal representation in the code generator simpler: there's a list of ops, and a list of macros, and there's no special-casing needed for ops that aren't macros. (There's now special-casing for ops that are also macros, but that's simpler.)

2 years agoAdd missing `PyDoc_STR` calls (#109393)
Nikita Sobolev [Fri, 15 Sep 2023 13:10:48 +0000 (16:10 +0300)] 
Add missing `PyDoc_STR` calls (#109393)

In files:

* Modules/_ctypes/cfield.c
* Modules/_struct.c
* Objects/dictobject.c
* Objects/typevarobject.c
* Objects/unionobject.c

2 years agoFix date.__repr__() docstring (#109422)
Christopher Yeh [Fri, 15 Sep 2023 13:05:19 +0000 (06:05 -0700)] 
Fix date.__repr__() docstring (#109422)

2 years agoDocs: Superseded modules: list only module names (#109439)
Hugo van Kemenade [Fri, 15 Sep 2023 12:56:23 +0000 (06:56 -0600)] 
Docs: Superseded modules: list only module names (#109439)

2 years agogh-109395: Remove skipped macOS builds from Azure Pipelines (#109400)
Nikita Sobolev [Fri, 15 Sep 2023 08:55:09 +0000 (11:55 +0300)] 
gh-109395: Remove skipped macOS builds from Azure Pipelines (#109400)

2 years agogh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)
Nikita Sobolev [Fri, 15 Sep 2023 07:52:24 +0000 (10:52 +0300)] 
gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)

2 years agogh-109395: Remove skipped coverage job from Azure Pipelines (#109412)
Hugo van Kemenade [Fri, 15 Sep 2023 05:27:47 +0000 (23:27 -0600)] 
gh-109395: Remove skipped coverage job from Azure Pipelines (#109412)