]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
13 months agogh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)
Serhiy Storchaka [Tue, 8 Oct 2024 08:27:49 +0000 (11:27 +0300)] 
gh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)

The function now sets temporarily the LC_CTYPE locale to the locale
of the category that determines the requested value if the locales are
different and the resulting string is non-ASCII.
This temporary change affects other threads.

13 months agogh-70870: Clarify dual usage of 'free variable' (#122545)
Alyssa Coghlan [Tue, 8 Oct 2024 07:52:12 +0000 (17:52 +1000)] 
gh-70870: Clarify dual usage of 'free variable' (#122545)

The term "free variable" has unfortunately become genuinely
ambiguous over the years (presumably due to the names of
some relevant code object instance attributes).

While we can't eliminate that ambiguity at this late date, we can
at least alert people to the potential ambiguity by describing
both the formal meaning of the term and the common
alternative use as a direct synonym for "closure variable".

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
13 months agogh-90102: Remove isatty call during regular open (#124922)
Cody Maloney [Tue, 8 Oct 2024 06:50:42 +0000 (23:50 -0700)] 
gh-90102: Remove isatty call during regular open (#124922)

Co-authored-by: Victor Stinner <vstinner@python.org>
13 months agoDocs: make a tutorial example more precise (#125066)
Ned Batchelder [Mon, 7 Oct 2024 23:41:13 +0000 (19:41 -0400)] 
Docs: make a tutorial example more precise (#125066)

Based on discussion here:

https://discuss.python.org/t/omission-in-the-documentation/66816

13 months agogh-125072: Add label for assignment expressions; update tracked section for assignmen...
Emily Morehouse [Mon, 7 Oct 2024 22:51:14 +0000 (16:51 -0600)] 
gh-125072: Add label for assignment expressions; update tracked section for assignment expression topic (#125074)

13 months agogh-124502: Add PyUnicode_Equal() function (#124504)
Victor Stinner [Mon, 7 Oct 2024 21:24:53 +0000 (23:24 +0200)] 
gh-124502: Add PyUnicode_Equal() function (#124504)

13 months agogh-122392: IDLE - Fix overlapping lines in browsers (#122392) (#124975)
Zhikang Yan [Mon, 7 Oct 2024 18:52:09 +0000 (02:52 +0800)] 
gh-122392: IDLE - Fix overlapping lines in browsers (#122392) (#124975)

Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
13 months agogh-124653: Relax (again) detection of queue API for logging handlers (GH-124897)
Bénédikt Tran [Mon, 7 Oct 2024 18:42:19 +0000 (20:42 +0200)] 
gh-124653: Relax (again) detection of queue API for logging handlers  (GH-124897)

13 months agoUse _PyLong_GetOne() and _PyLong_GetZero() in long_invmod() (#125044)
Victor Stinner [Mon, 7 Oct 2024 17:54:42 +0000 (19:54 +0200)] 
Use _PyLong_GetOne() and _PyLong_GetZero() in long_invmod() (#125044)

These functions cannot fail.

13 months agogh-124182: Explain naming rules for struct sequence types (#124335)
ffelixg [Mon, 7 Oct 2024 17:52:34 +0000 (19:52 +0200)] 
gh-124182: Explain naming rules for struct sequence types (#124335)

13 months agogh-124956: Use `#undef` for temp macros in `_csv.c` (#124957)
sobolevn [Mon, 7 Oct 2024 17:35:56 +0000 (20:35 +0300)] 
gh-124956: Use `#undef` for temp macros in `_csv.c` (#124957)

13 months agoGH-121459: Streamline PyObject* to PyStackRef conversions by disallowing NULL pointer...
Mark Shannon [Mon, 7 Oct 2024 17:13:04 +0000 (18:13 +0100)] 
GH-121459: Streamline PyObject* to PyStackRef conversions by disallowing NULL pointers. (GH-124894)

13 months agogh-125018: Fix role syntax (#125050)
Adam Turner [Mon, 7 Oct 2024 16:51:53 +0000 (17:51 +0100)] 
gh-125018: Fix role syntax (#125050)

13 months agogh-120762: make_ssl_certs: Don't set extensions for the temporary CSR (GH-125045)
Petr Viktorin [Mon, 7 Oct 2024 15:37:52 +0000 (17:37 +0200)] 
gh-120762: make_ssl_certs: Don't set extensions for the temporary CSR (GH-125045)

gh-120762: make_ssl_certs: Don't set extensions for the CSR

`openssl req` fails with openssl 3.2.2 because the config line

    authorityKeyIdentifier = keyid:always,issuer:always

is not supported for certificate signing requests (since the issuing
certificate authority is not known).

David von Oheimb, the OpenSSL dev that made the change, commented in:
https://github.com/openssl/openssl/issues/22966#issuecomment-1858396738 :

> This problem did not show up in older OpenSSL versions because of a bug:
> the `req` app ignored the `-extensions` option unless `-x505` is given,
> which I fixed in https://github.com/openssl/openssl/pull/16865.

(I assume `-x505` is a typo for `-x509`.)

In our `make_cert_key` function:

If `sign` is true:
- We don't pass `-x509` to `req`, so in this case it should be safe to
  omit the `-extensions` argument. (Old OpenSSL ignores it, new OpenSSL
  fails on it.)
- The extensions are passed to the `ca` call later in the function.
  There they take effect, and `authorityKeyIdentifier` is valid.

If `sign` is false, this commit has no effect except rearranging the
CLI arguments.

13 months agoGH-119866: Spill the stack around escaping calls. (GH-124392)
Mark Shannon [Mon, 7 Oct 2024 13:56:39 +0000 (14:56 +0100)] 
GH-119866: Spill the stack around escaping calls. (GH-124392)

* Spill the evaluation around escaping calls in the generated interpreter and JIT.

* The code generator tracks live, cached values so they can be saved to memory when needed.

* Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.

13 months agogh-125018: Add importlib.metadata semantic link targets (#125027)
Alyssa Coghlan [Mon, 7 Oct 2024 13:44:18 +0000 (23:44 +1000)] 
gh-125018: Add importlib.metadata semantic link targets (#125027)

This allows direct intersphinx references to APIs via references
like `` :func:`importlib.metadata.version` ``.

---------

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agogh-111178: Fix function signatures in fileio.c (#125043)
Victor Stinner [Mon, 7 Oct 2024 13:27:36 +0000 (15:27 +0200)] 
gh-111178: Fix function signatures in fileio.c (#125043)

* Add "fileio_" prefix to getter functions.
* Small refactoring.

13 months agogh-121249: Support _Complex types in the struct module (#121613)
Sergey B Kirpichev [Mon, 7 Oct 2024 11:53:02 +0000 (14:53 +0300)] 
gh-121249: Support _Complex types in the struct module (#121613)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
13 months agoGH-116968: Remove branch from advance_backoff_counter (GH-124469)
Mark Shannon [Mon, 7 Oct 2024 10:46:33 +0000 (11:46 +0100)] 
GH-116968: Remove branch from advance_backoff_counter (GH-124469)

13 months agoGH-109975: Announce final release in What's New in Python 3.13 (#125007)
Adam Turner [Mon, 7 Oct 2024 04:43:03 +0000 (05:43 +0100)] 
GH-109975: Announce final release in What's New in Python 3.13 (#125007)

Prepare What's New in Python 3.13 for final release

13 months agogh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)
Jan Kaliszewski [Sun, 6 Oct 2024 22:57:03 +0000 (00:57 +0200)] 
gh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)

13 months agoDoc: Simplify the definition of 'soft deprecated' (#124988)
Andrés Delfino [Sun, 6 Oct 2024 22:22:19 +0000 (19:22 -0300)] 
Doc: Simplify the definition of 'soft deprecated' (#124988)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
13 months agogh-125010: Fix `use-after-free` in AST `repr()` (#125015)
Tomas R. [Sun, 6 Oct 2024 19:46:03 +0000 (21:46 +0200)] 
gh-125010: Fix `use-after-free` in AST `repr()` (#125015)

13 months agogh-119535: python𝜋 (#119536)
Shantanu [Sun, 6 Oct 2024 18:47:13 +0000 (11:47 -0700)] 
gh-119535: python𝜋 (#119536)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
13 months agogh-125008: Fix `tokenize.untokenize` roundtrip for `\n{{` (#125013)
Tomas R. [Sun, 6 Oct 2024 13:16:41 +0000 (15:16 +0200)] 
gh-125008: Fix `tokenize.untokenize` roundtrip for `\n{{` (#125013)

13 months agogh-122951: Simplify the grammar of the assignment rule (#124998)
Rigel Di Scala [Sun, 6 Oct 2024 09:55:56 +0000 (11:55 +0200)] 
gh-122951: Simplify the grammar of the assignment rule (#124998)

13 months agogh-111178: Fix function signatures in genobject.c (#124970)
Victor Stinner [Sat, 5 Oct 2024 07:56:44 +0000 (09:56 +0200)] 
gh-111178: Fix function signatures in genobject.c (#124970)

* Add "CAST" macros.
* Rename parameters/variables "o" to "ag", "ags", "agw" or "agt"
  in some functions.

13 months agogh-112804: Clamping timeout value for _PySemaphore_PlatformWait (gh-124914)
Donghee Na [Sat, 5 Oct 2024 02:27:32 +0000 (11:27 +0900)] 
gh-112804: Clamping timeout value for _PySemaphore_PlatformWait (gh-124914)

* gh-112804: Clamping timeout value for _PySemaphore_PlatformWait

* Address code review

* nit

13 months agogh-124552 : Improve the accuracy of possible breakpoint check in bdb (#124553)
Tian Gao [Sat, 5 Oct 2024 01:32:57 +0000 (18:32 -0700)] 
gh-124552 : Improve the accuracy of possible breakpoint check in bdb (#124553)

13 months agogh-119786: Replace a Sphinx role with a link to `Python/errors.c` (#124990)
Adam Turner [Sat, 5 Oct 2024 00:00:19 +0000 (01:00 +0100)] 
gh-119786: Replace a Sphinx role with a link to `Python/errors.c` (#124990)

13 months agogh-117151: increase default buffer size of shutil.copyfileobj() to 256k. (GH-119783)
morotti [Fri, 4 Oct 2024 23:51:22 +0000 (00:51 +0100)] 
gh-117151: increase default buffer size of shutil.copyfileobj() to 256k. (GH-119783)

* gh-117151: increase default buffer size of shutil.copyfileobj() to 256k.

it was set to 16k in the 1990s.
it was raised to 64k in 2019. the discussion at the time mentioned another 5% improvement by raising to 128k and settled for a very conservative setting.

it's 2024 now, I think it should be revisited to match modern hardware. I am measuring 0-15% performance improvement when raising to 256k on various types of disk. there is no downside as far as I can tell.

this function is only intended for sequential copy of full files (or file like objects). it's the typical use case that benefits from larger operations.

for reference, I came across this function while trying to profile pip that is using it to copy files when installing python packages.

* add news

---------

Co-authored-by: rmorotti <romain.morotti@man.com>
13 months agogh-119786: move a few more details on exception handling from devguide to InternalDoc...
Irit Katriel [Fri, 4 Oct 2024 23:48:12 +0000 (00:48 +0100)] 
gh-119786: move a few more details on exception handling from devguide to InternalDocs (#124989)

13 months agogh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)
Irit Katriel [Fri, 4 Oct 2024 16:37:38 +0000 (17:37 +0100)] 
gh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)

13 months agogh-124962: Convert leftover rst to markup in `InternalDocs/compiler.md` (#124971)
isaacjones99 [Fri, 4 Oct 2024 14:23:02 +0000 (15:23 +0100)] 
gh-124962: Convert leftover rst to markup in `InternalDocs/compiler.md` (#124971)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agoFix console prompt syntax in What's New in Python 3.8 (#124968)
Nice Zombies [Fri, 4 Oct 2024 11:33:54 +0000 (13:33 +0200)] 
Fix console prompt syntax in What's New in Python 3.8 (#124968)

13 months agogh-118658: Modify cert generation script to extract cert3.pem (GH-124598)
Felix Fontein [Fri, 4 Oct 2024 11:15:08 +0000 (13:15 +0200)] 
gh-118658: Modify cert generation script to extract cert3.pem (GH-124598)

13 months agogh-111178: Fix function signatures in _threadmodule.c (#124964)
Victor Stinner [Fri, 4 Oct 2024 10:50:01 +0000 (12:50 +0200)] 
gh-111178: Fix function signatures in _threadmodule.c (#124964)

13 months agogh-109975: Suggest ``pynntp`` instead of ``nntplib`` (#124830)
Christian Clauss [Fri, 4 Oct 2024 10:21:03 +0000 (12:21 +0200)] 
gh-109975: Suggest ``pynntp`` instead of ``nntplib`` (#124830)

The ``nntplib`` library has been deleted from PyPI by its author.

13 months agogh-111178: Fix function signatures in classobject.c (#124943)
Victor Stinner [Fri, 4 Oct 2024 10:00:00 +0000 (12:00 +0200)] 
gh-111178: Fix function signatures in classobject.c (#124943)

13 months agogh-111178: Fix function signatures in bytearrayobject.c (#124940)
Victor Stinner [Fri, 4 Oct 2024 09:59:51 +0000 (11:59 +0200)] 
gh-111178: Fix function signatures in bytearrayobject.c (#124940)

13 months agogh-111178: Fix function signatures in Python-ast.c (#124942)
Victor Stinner [Fri, 4 Oct 2024 09:59:08 +0000 (11:59 +0200)] 
gh-111178: Fix function signatures in Python-ast.c (#124942)

13 months agogh-123961: Convert `curses.window` static type into a heap type (#124934)
Bénédikt Tran [Fri, 4 Oct 2024 09:58:34 +0000 (11:58 +0200)] 
gh-123961: Convert `curses.window` static type into a heap type (#124934)

13 months agogh-124613: Deactivate perf support in tests if the jit is set (#124794)
Pablo Galindo Salgado [Fri, 4 Oct 2024 00:00:32 +0000 (02:00 +0200)] 
gh-124613: Deactivate perf support in tests if the jit is set (#124794)

gh-124613: Deactivate the JIT during perf tests

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Remove references to the incremental GC (#124947)
Adam Turner [Thu, 3 Oct 2024 20:06:29 +0000 (21:06 +0100)] 
GH-109975: Copyedit 3.13 What's New: Remove references to the incremental GC (#124947)

13 months agoSimplify partial() rough equivalent code (gh-124941)
Raymond Hettinger [Thu, 3 Oct 2024 19:54:53 +0000 (14:54 -0500)] 
Simplify partial() rough equivalent code (gh-124941)

13 months agogh-124889: Remove redundant artificial rules in PEG parser (#124893)
efimov-mikhail [Thu, 3 Oct 2024 12:58:56 +0000 (15:58 +0300)] 
gh-124889: Remove redundant artificial rules in PEG parser (#124893)

Cache in C PEG-generator reworked:
we save artificial rules in cache by Node string representation as a key instead of Node object itself.
As a result total count of artificial rules in parsers.c is lowered from 283 to 170.
More natural number ordering is used for the names of artificial rules.

Auxiliary method CCallMakerVisitor._generate_artificial_rule_call is added.
Its purpose is abstracting work with artificial rules cache.

Explicit using of "is_repeat1" kwarg is added to visit_Repeat0 and visit_Repeat1 methods.
Its slightly improve code readabitily.

13 months agogh-123961: Clean up curses C API/capsule (#124907)
Bénédikt Tran [Thu, 3 Oct 2024 10:48:50 +0000 (12:48 +0200)] 
gh-123961: Clean up curses C API/capsule (#124907)

13 months agogh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920)
Donghee Na [Thu, 3 Oct 2024 10:34:47 +0000 (19:34 +0900)] 
gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920)

13 months agogh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. (#121983)
Tomas R [Thu, 3 Oct 2024 08:14:57 +0000 (10:14 +0200)] 
gh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. (#121983)

Test invalid quoting constant

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
13 months agogh-124858: fix happy eyeballs refcyles (#124859)
Thomas Grainger [Wed, 2 Oct 2024 23:32:31 +0000 (00:32 +0100)] 
gh-124858: fix happy eyeballs refcyles (#124859)

13 months agoGH-118093: Don't lose confidence when tracing through 100% biased branches (GH-124813)
Brandt Bucher [Wed, 2 Oct 2024 19:24:37 +0000 (12:24 -0700)] 
GH-118093: Don't lose confidence when tracing through 100% biased branches (GH-124813)

13 months agoGH-119726: Deduplicate AArch64 trampolines within a trace (GH-123872)
Diego Russo [Wed, 2 Oct 2024 19:07:20 +0000 (20:07 +0100)] 
GH-119726: Deduplicate AArch64 trampolines within a trace (GH-123872)

13 months agogh-111178: Fix function signatures in funcobject.c (#124908)
Victor Stinner [Wed, 2 Oct 2024 17:29:56 +0000 (19:29 +0200)] 
gh-111178: Fix function signatures in funcobject.c (#124908)

13 months agogh-120619: Optimize through `_Py_FRAME_GENERAL` (GH-124518)
Ken Jin [Wed, 2 Oct 2024 17:10:51 +0000 (01:10 +0800)] 
gh-120619: Optimize through `_Py_FRAME_GENERAL` (GH-124518)

* Optimize through _Py_FRAME_GENERAL

* refactor

13 months agogh-87135: Hang non-main threads that attempt to acquire the GIL during finalization...
Jeremy Maitin-Shepard [Wed, 2 Oct 2024 16:17:49 +0000 (09:17 -0700)] 
gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805)

Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
13 months agogh-111178: Fix function signatures in longobject.c (#124895)
Victor Stinner [Wed, 2 Oct 2024 15:41:19 +0000 (17:41 +0200)] 
gh-111178: Fix function signatures in longobject.c (#124895)

* Add _PyLong_CAST() macro.
* Move forward declarations to the top of longobject.c.
* Change long_add(), long_sub(), long_mul(), long_neg(),
  long_lshift(), long_abs() to take PyLongObject* and return
  PyLongObject*. Avoid CHECK_BINOP() test.
* Add long_add_method(), long_sub_method(), long_mul_method(),
  long_neg_method(), long_lshift_method(), and long_abs_method()
  which take PyObject* and return PyObject*. Implement CHECK_BINOP()
  test.
* Add long_lshift_int64() function.
* _PyLong_DivmodNear() calls long_lshift_int64(obj, 1) instead of
  long_lshift_obj(obj, one).

13 months agogh-111178: Fix function signatures in methodobject.c (#124902)
Victor Stinner [Wed, 2 Oct 2024 15:24:10 +0000 (17:24 +0200)] 
gh-111178: Fix function signatures in methodobject.c (#124902)

13 months agogh-111178: Fix function signatures in weakrefobject.c (#124903)
Victor Stinner [Wed, 2 Oct 2024 15:01:23 +0000 (17:01 +0200)] 
gh-111178: Fix function signatures in weakrefobject.c (#124903)

13 months agogh-124213: Fix incorrect context manager use in in_systemd_nspawn_sync_suppressed...
Michał Górny [Wed, 2 Oct 2024 14:31:42 +0000 (16:31 +0200)] 
gh-124213: Fix incorrect context manager use in in_systemd_nspawn_sync_suppressed() (#124892)

Fix the incorrect use of `os.open()` result as a context manager,
while it is actually a numeric file descriptor.

I have missed the problem, because in the original version the
`os.open()` call would always fail, and I failed to test the final
version in all possible scenarios properly.

13 months agogh-120378: Fix crash caused by integer overflow in `curses` (#124555)
Peter Bierma [Wed, 2 Oct 2024 14:31:23 +0000 (10:31 -0400)] 
gh-120378: Fix crash caused by integer overflow in `curses` (#124555)

This is actually an upstream problem in curses, and has been reported
to them already:
https://lists.gnu.org/archive/html/bug-ncurses/2024-09/msg00101.html

This is a nice workaround in the meantime to prevent the segfault.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agogh-111178: Fix function signatures in moduleobject.c (#124900)
Victor Stinner [Wed, 2 Oct 2024 14:31:04 +0000 (16:31 +0200)] 
gh-111178: Fix function signatures in moduleobject.c (#124900)

13 months agogh-111178: Fix function signatures in setobject.c (#124888)
Victor Stinner [Wed, 2 Oct 2024 14:03:23 +0000 (16:03 +0200)] 
gh-111178: Fix function signatures in setobject.c (#124888)

13 months agogh-111178: Fix locale_free() signature (#124896)
Victor Stinner [Wed, 2 Oct 2024 13:58:47 +0000 (15:58 +0200)] 
gh-111178: Fix locale_free() signature (#124896)

13 months agogh-85935: Improve tests for invalid arguments in test_argparse (GH-124891)
Serhiy Storchaka [Wed, 2 Oct 2024 13:28:05 +0000 (16:28 +0300)] 
gh-85935: Improve tests for invalid arguments in test_argparse (GH-124891)

Check also specific error messages.

13 months agogh-111178: Fix function signatures in tupleobject.c (#124804)
Victor Stinner [Wed, 2 Oct 2024 11:37:04 +0000 (13:37 +0200)] 
gh-111178: Fix function signatures in tupleobject.c (#124804)

13 months agogh-111178: Fix function signatures in bytesobject.c (#124806)
Victor Stinner [Wed, 2 Oct 2024 11:35:51 +0000 (13:35 +0200)] 
gh-111178: Fix function signatures in bytesobject.c (#124806)

13 months agogh-122864: Fix a ``test_funcattrs.test___builtins__`` when executing directly (#124845)
Mark Byrne [Wed, 2 Oct 2024 09:58:39 +0000 (11:58 +0200)] 
gh-122864: Fix a ``test_funcattrs.test___builtins__`` when executing directly (#124845)

Previously when executing ``test_functattrs.test___builtins__`` directly, it failed because the fact, that ``__builtins__`` is refers to the built-in module ``builtins`` while it's expects a ``__builtins__.__dict__``. But when this test is being run from another module, then ``__builtins__`` is refers to ``builtins.__dict__``. Now this part of the behaviour is covered.
---------

Co-authored-by: Victor Stinner <vstinner@python.org>
13 months agoGH-124820: Move `-mno-outline-atomics` flag to aarch64 Linux JIT builds only (#124821)
Savannah Ostrowski [Wed, 2 Oct 2024 09:40:59 +0000 (02:40 -0700)] 
GH-124820: Move `-mno-outline-atomics` flag to aarch64 Linux JIT builds only (#124821)

13 months agogh-58282: Fix support of tuple metavar for positional arguments in argparse (GH-124782)
Serhiy Storchaka [Wed, 2 Oct 2024 08:28:02 +0000 (11:28 +0300)] 
gh-58282: Fix support of tuple metavar for positional arguments in argparse (GH-124782)

Previously, formatting help output or error message for positional argument
with a tuple metavar raised exception.

Co-authored-by: Cyker Way <cykerway@gmail.com>
13 months agogh-124835: `tomllib.loads`: Raise TypeError not AttributeError. Improve message ...
Taneli Hukkinen [Wed, 2 Oct 2024 02:58:08 +0000 (05:58 +0300)] 
gh-124835: `tomllib.loads`: Raise TypeError not AttributeError. Improve message (#124587)

13 months agoMinor code beautifications in statistics.py (gh-124866)
Raymond Hettinger [Tue, 1 Oct 2024 20:55:36 +0000 (15:55 -0500)] 
Minor code beautifications in statistics.py (gh-124866)

13 months agogh-66436: Improved prog default value for argparse.ArgumentParser (GH-124799)
Serhiy Storchaka [Tue, 1 Oct 2024 19:51:40 +0000 (22:51 +0300)] 
gh-66436: Improved prog default value for argparse.ArgumentParser (GH-124799)

It can now have one of three forms:

* basename(argv0) -- for simple scripts
* python arv0 -- for directories, ZIP files, etc
* python -m module -- for imported modules

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
14 months agoHighlight `datetime.timedelta.seconds` vs `.total_seconds()` in docs. (GH-124811)
Gregory P. Smith [Tue, 1 Oct 2024 18:10:13 +0000 (11:10 -0700)] 
Highlight `datetime.timedelta.seconds` vs `.total_seconds()` in docs. (GH-124811)

Thanks to the reviewers for suggesting the use of a "caution" section instead of "warning" or "note".

14 months agogh-116750: Add clear_tool_id function to unregister events and callbacks (#124568)
Tian Gao [Tue, 1 Oct 2024 17:32:55 +0000 (10:32 -0700)] 
gh-116750: Add clear_tool_id function to unregister events and callbacks (#124568)

14 months agogh-124218: Refactor per-thread reference counting (#124844)
Sam Gross [Tue, 1 Oct 2024 17:05:42 +0000 (13:05 -0400)] 
gh-124218: Refactor per-thread reference counting (#124844)

Currently, we only use per-thread reference counting for heap type objects and
the naming reflects that. We will extend it to a few additional types in an
upcoming change to avoid scaling bottlenecks when creating nested functions.

Rename some of the files and functions in preparation for this change.

14 months agogh-124296: Remove private dictionary version tag (PEP 699) (#124472)
Sam Gross [Tue, 1 Oct 2024 16:39:56 +0000 (12:39 -0400)] 
gh-124296: Remove private dictionary version tag (PEP 699) (#124472)

14 months agogh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843)
Serhiy Storchaka [Tue, 1 Oct 2024 16:05:17 +0000 (19:05 +0300)] 
gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843)

For source file "path/to/file.py" it created file with incorrect path
"/absolute/path/to/path/to/file.pyc" instead of "path/to/file.pyc".

14 months agogh-124487: Updated installer messages and internal docs regarding minimum Windows...
Wulian [Tue, 1 Oct 2024 14:44:18 +0000 (22:44 +0800)] 
gh-124487: Updated installer messages and internal docs regarding minimum Windows version (GH-124822)

14 months agogh-124594: Create and reuse the same context for the entire asyncio REPL session...
Bartosz Sławecki [Tue, 1 Oct 2024 14:17:22 +0000 (16:17 +0200)] 
gh-124594: Create and reuse the same context for the entire asyncio REPL session (#124595)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
14 months agogh-118974: Add `decorator` argument to `make_dataclass` (gh-122723)
Victorien [Tue, 1 Oct 2024 13:51:51 +0000 (15:51 +0200)] 
gh-118974: Add `decorator` argument to `make_dataclass` (gh-122723)

This is to allow the `dataclasses.make_dataclass` infrastructure to be used with another decorator that's compliant with `typing.dataclass_transform`. The new `decorator` argument to `dataclasses.make_dataclass` is `dataclasses.dataclass`, which used to be hard coded.

14 months agoDoc: Fix archive filenames for standard builds (#124826)
Adam Turner [Tue, 1 Oct 2024 09:43:55 +0000 (10:43 +0100)] 
Doc: Fix archive filenames for standard builds (#124826)

14 months agoGH-109975: Copyedit 3.13 What's New: Link to installing free-threaded binaries on...
Adam Turner [Tue, 1 Oct 2024 08:27:59 +0000 (09:27 +0100)] 
GH-109975: Copyedit 3.13 What's New: Link to installing free-threaded binaries on macOS (#124831)

14 months agoGH-109975: Copyedit 3.13 What's New: Note delayed expected release date for Python...
Adam Turner [Tue, 1 Oct 2024 07:18:59 +0000 (08:18 +0100)] 
GH-109975: Copyedit 3.13 What's New: Note delayed expected release date for Python 3.13.0 (GH-124827)

Note delayed expected release date of 3.13.0

14 months agogh-124309: Revert eager task factory fix to prevent breaking downstream (#124810)
Peter Bierma [Tue, 1 Oct 2024 01:37:27 +0000 (21:37 -0400)] 
gh-124309: Revert eager task factory fix to prevent breaking downstream (#124810)

* Revert "GH-124639: add back loop param to staggered_race (#124700)"

This reverts commit e0a41a5dd12cb6e9277b05abebac5c70be684dd7.

* Revert "gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)"

This reverts commit de929f353c413459834a2a37b2d9b0240673d874.

14 months agogh-124785: Revert "gh-116510: Fix crash due to shared immortal interned strings ...
T. Wouters [Mon, 30 Sep 2024 23:41:46 +0000 (16:41 -0700)] 
gh-124785: Revert "gh-116510: Fix crash due to shared immortal interned strings (gh-124646)" (gh-124807)

Revert "gh-116510: Fix crash due to shared immortal interned strings. (gh-124646)"

This reverts commit 98b2ed7e239c807f379cd2bf864f372d79064aac.

14 months agoMinor edit for code clarification in annotationlib. (#124805)
larryhastings [Mon, 30 Sep 2024 22:25:56 +0000 (15:25 -0700)] 
Minor edit for code clarification in annotationlib. (#124805)

14 months agogh-116810: fix memory leak in ssl module (GH-123249)
Jeffrey R. Van Voorst [Mon, 30 Sep 2024 19:43:50 +0000 (14:43 -0500)] 
gh-116810: fix memory leak in ssl module (GH-123249)

Resolve a memory leak introduced in CPython 3.10's :mod:`ssl` when the :attr:`ssl.SSLSocket.session` property was accessed. Speeds up read and write access to said property by no longer unnecessarily cloning session objects via serialization.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Antoine Pitrou <antoine@python.org>
14 months agogh-115142: Skip some test cases in ``Lib/test/test_compile`` if ``_testinternalcapi...
Kirill Podoprigora [Mon, 30 Sep 2024 19:13:23 +0000 (22:13 +0300)] 
gh-115142: Skip some test cases in ``Lib/test/test_compile`` if ``_testinternalcapi`` is not available (#124474)

* Skip some test cases if "_testinternalcapi" is not available and if the test suite is
   running on another implementation than CPython.

14 months agogh-124613, regrtest: Detect JIT in build info (#124793)
Victor Stinner [Mon, 30 Sep 2024 18:50:41 +0000 (20:50 +0200)] 
gh-124613, regrtest: Detect JIT in build info (#124793)

14 months agogh-124613: Don't run perf tests in JIT builds (#124792)
Pablo Galindo Salgado [Mon, 30 Sep 2024 17:57:00 +0000 (18:57 +0100)] 
gh-124613: Don't run perf tests in JIT builds (#124792)

* gh-124613: Don't run perf tests in JIT builds

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* Apply suggestions from code review

Co-authored-by: Victor Stinner <vstinner@python.org>
---------

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
14 months agogh-124487: Require at least Windows 10 SDK and update install check (GH-124672)
Steve Dower [Mon, 30 Sep 2024 17:50:46 +0000 (18:50 +0100)] 
gh-124487: Require at least Windows 10 SDK and update install check (GH-124672)

14 months agogh-124642: Dictionaries aren't marking objects as weakref'd (#124643)
Dino Viehland [Mon, 30 Sep 2024 17:04:32 +0000 (10:04 -0700)] 
gh-124642: Dictionaries aren't marking objects as weakref'd (#124643)

Dictionaries aren't marking objects as weakref'd

14 months agoDoc: Run HTML and non-HTML daily builds separately (#124493)
Adam Turner [Mon, 30 Sep 2024 16:48:12 +0000 (17:48 +0100)] 
Doc: Run HTML and non-HTML daily builds separately (#124493)

14 months agogh-124722: Fix leak in `test_detach_materialized_dict_no_memory` (GH-124769)
sobolevn [Mon, 30 Sep 2024 01:47:45 +0000 (04:47 +0300)] 
gh-124722: Fix leak in `test_detach_materialized_dict_no_memory` (GH-124769)

14 months agogh-124400: Use the normal command path for breakpoint commands (#124401)
Tian Gao [Sun, 29 Sep 2024 23:46:16 +0000 (16:46 -0700)] 
gh-124400: Use the normal command path for breakpoint commands (#124401)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
14 months agogh-124720: Update "Using Python on a Mac" document (#124721)
Ned Deily [Sun, 29 Sep 2024 23:39:46 +0000 (17:39 -0600)] 
gh-124720: Update "Using Python on a Mac" document (#124721)

Update "Using Python on a Mac" section of the "Python Setup and Usage"
document and include information on installing free-threading support.

14 months agogh-111495: Add tests for `PyCodec_*` C API (#123343)
Bénédikt Tran [Sun, 29 Sep 2024 15:22:39 +0000 (17:22 +0200)] 
gh-111495: Add tests for `PyCodec_*` C API (#123343)

14 months agogh-123961: Add a global state to _curses (#124729)
Bénédikt Tran [Sun, 29 Sep 2024 15:17:20 +0000 (17:17 +0200)] 
gh-123961: Add a global state to _curses (#124729)

14 months agogh-123290: Fix decref in _curses update_lines_cols() (#124767)
Bénédikt Tran [Sun, 29 Sep 2024 15:02:43 +0000 (17:02 +0200)] 
gh-123290: Fix decref in _curses update_lines_cols() (#124767)

14 months agofunctools: Give up on lazy-importing types (#124736)
Jelle Zijlstra [Sun, 29 Sep 2024 13:31:06 +0000 (06:31 -0700)] 
functools: Give up on lazy-importing types (#124736)

PR #121089 added an eager import for types.MethodType, but
still left the existing hacks for lazily importing from types.

We could also create MethodType internally in functools.py (e.g.,
by using `type(Placeholder.__repr__)`, but it feels not worth it at
this point, so instead I unlazified all the usages of types in the
module.