]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
17 months agoGH-110383: Improve Tutorial for Input Ouput (#119230)
Blaise Pabon [Tue, 21 May 2024 16:25:37 +0000 (12:25 -0400)] 
GH-110383: Improve Tutorial for Input Ouput (#119230)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
17 months agogh-110383: Document `socket.makefile()` accepts combined modes (#119150)
Daniel Williams [Tue, 21 May 2024 16:23:50 +0000 (12:23 -0400)] 
gh-110383: Document `socket.makefile()` accepts combined modes (#119150)

The supported mode values are 'r', 'w', and 'b', or a combination of those.

17 months agogh-119035: Add Ctrl+← and Ctrl+→ word-skipping keybindings to new repl (#119248)
Alastair Stanley [Tue, 21 May 2024 16:17:41 +0000 (12:17 -0400)] 
gh-119035: Add Ctrl+← and Ctrl+→ word-skipping keybindings to new repl (#119248)

add word-skipping ctrl keybindings to new repl

17 months agoGH-119292: Add job to JIT CI to build and test with --disable-gil (GH-119293)
Savannah Ostrowski [Tue, 21 May 2024 15:00:52 +0000 (08:00 -0700)] 
GH-119292: Add job to JIT CI to build and test with --disable-gil (GH-119293)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months agogh-119053: Implement the fast path for list.__getitem__ (gh-119112)
Donghee Na [Tue, 21 May 2024 13:49:18 +0000 (09:49 -0400)] 
gh-119053: Implement the fast path for list.__getitem__ (gh-119112)

17 months agogh-119102: Fix REPL for dumb terminal (#119269)
Victor Stinner [Tue, 21 May 2024 12:53:20 +0000 (08:53 -0400)] 
gh-119102: Fix REPL for dumb terminal (#119269)

Use CAN_USE_PYREPL of _pyrepl.__main__ in the site module to decide
if _pyrepl.write_history_file() can be used.

17 months agoUse `fail-fast: false` in `mypy.yml` (#119297)
Nikita Sobolev [Tue, 21 May 2024 11:52:43 +0000 (14:52 +0300)] 
Use `fail-fast: false` in `mypy.yml` (#119297)

See docs about this setting: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast

17 months agogh-74929: PEP 667 general docs update (gh-119201)
Alyssa Coghlan [Tue, 21 May 2024 03:32:15 +0000 (13:32 +1000)] 
gh-74929: PEP 667 general docs update (gh-119201)

* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)

17 months agogh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry...
Wulian233 [Tue, 21 May 2024 03:32:00 +0000 (11:32 +0800)] 
gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (#119175)

------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
17 months agogh-102136: Add -m to options that work with -i (GH-119271)
Melanie Arbor [Mon, 20 May 2024 23:38:33 +0000 (19:38 -0400)] 
gh-102136: Add -m to options that work with -i (GH-119271)

* GH-102136: Add -m to options that work with -i

* Linting

17 months agogh-108267 Fix another dataclasses docs typo (#119277)
Alex Waygood [Mon, 20 May 2024 22:34:57 +0000 (18:34 -0400)] 
gh-108267 Fix another dataclasses docs typo (#119277)

17 months agogh-111201: Add tests for unix console class in pyrepl (#118653)
Lysandros Nikolaou [Mon, 20 May 2024 21:57:32 +0000 (17:57 -0400)] 
gh-111201: Add tests for unix console class in pyrepl (#118653)

17 months agogh-119050: Add XML support to libregrtest refleak checker (#119148)
Victor Stinner [Mon, 20 May 2024 21:05:39 +0000 (17:05 -0400)] 
gh-119050: Add XML support to libregrtest refleak checker (#119148)

regrtest test runner: Add XML support to the refleak checker
(-R option).

* run_unittest() now stores XML elements as string, rather than
  objects, in support.junit_xml_list.
* runtest_refleak() now saves/restores XML strings before/after
  checking for reference leaks. Save XML into a temporary file.

17 months agogh-119253: use ImportError in _ios_support (#119254)
Shantanu [Mon, 20 May 2024 20:39:30 +0000 (13:39 -0700)] 
gh-119253: use ImportError in _ios_support (#119254)

17 months agogh-94808: Add test coverage for "starred kind" in _PyPegen_set_expr_context (GH-119222)
Mark Jason Dominus (陶敏修) [Mon, 20 May 2024 20:29:17 +0000 (16:29 -0400)] 
gh-94808: Add test coverage for "starred kind" in _PyPegen_set_expr_context (GH-119222)

Add test coverage for "starred kind" in _PyPegen_set_expr_context

17 months agogh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (#119232)
Shauna [Mon, 20 May 2024 20:10:53 +0000 (16:10 -0400)] 
gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (#119232)

* Remove description of issue fixed in 3.5 from autospeccing guide

* Make autospeccing note text more succint and lint whitespace

* Add linting changes (missed in last commit)

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
17 months agogh-111201: Add more tests to test_pyrepl to cover key translation (#118705)
Pablo Galindo Salgado [Mon, 20 May 2024 20:04:52 +0000 (16:04 -0400)] 
gh-111201: Add more tests to test_pyrepl to cover key translation (#118705)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-119189: Add more tests for mixed Fraction arithmetic (GH-119236)
Serhiy Storchaka [Mon, 20 May 2024 19:34:48 +0000 (22:34 +0300)] 
gh-119189: Add more tests for mixed Fraction arithmetic (GH-119236)

17 months agoDocs: Ensure no warnings are found in the NEWS file before a given line number (...
Hugo van Kemenade [Mon, 20 May 2024 19:31:38 +0000 (15:31 -0400)] 
Docs: Ensure no warnings are found in the NEWS file before a given line number (#119221)

17 months agogh-118760: Restore the default value of tkinter.wantobjects to 1 (GH-118784)
Serhiy Storchaka [Mon, 20 May 2024 19:21:04 +0000 (22:21 +0300)] 
gh-118760: Restore the default value of tkinter.wantobjects to 1 (GH-118784)

It was set to 2 in 65f5e586a1239ed1a66d8284773d7b02ce40e480 (GH-98592).

17 months agoUse correct markup in unittest.mock.reset_mock documentation (GH-119207)
Tialo [Mon, 20 May 2024 19:17:44 +0000 (22:17 +0300)] 
Use correct markup in unittest.mock.reset_mock documentation (GH-119207)

17 months agogh-92081: Fix for email.generator.Generator with whitespace between encoded words...
Toshio Kuratomi [Mon, 20 May 2024 19:10:47 +0000 (12:10 -0700)] 
gh-92081: Fix for email.generator.Generator with whitespace between encoded words. (#92281)

* Fix for email.generator.Generator with whitespace between encoded words.

email.generator.Generator currently does not handle whitespace between
encoded words correctly when the encoded words span multiple lines.  The
current generator will create an encoded word for each line.  If the end
of the line happens to correspond with the end real word in the
plaintext, the generator will place an unencoded space at the start of
the subsequent lines to represent the whitespace between the plaintext
words.

A compliant decoder will strip all the whitespace from between two
encoded words which leads to missing spaces in the round-tripped
output.

The fix for this is to make sure that whitespace between two encoded
words ends up inside of one or the other of the encoded words.  This
fix places the space inside of the second encoded word.

A second problem happens with continuation lines.  A continuation line that
starts with whitespace and is followed by a non-encoded word is fine because
the newline between such continuation lines is defined as condensing to
a single space character.  When the continuation line starts with whitespace
followed by an encoded word, however, the RFCs specify that the word is run
together with the encoded word on the previous line.  This is because normal
words are filded on syntactic breaks by encoded words are not.

The solution to this is to add the whitespace to the start of the encoded word
on the continuation line.

Test cases are from #92081

* Rename a variable so it's not confused with the final variable.

17 months agogh-118877: Fix AssertionError crash in pyrepl (#118936)
Daniel Hollas [Mon, 20 May 2024 18:21:56 +0000 (19:21 +0100)] 
gh-118877: Fix AssertionError crash in pyrepl (#118936)

17 months agoDOCS: Suggest always calling exec with a globals argument and no locals argument...
Hood Chatham [Mon, 20 May 2024 17:42:15 +0000 (13:42 -0400)] 
DOCS: Suggest always calling exec with a globals argument and no locals argument (GH-119235)

Many users think they want a locals argument for various reasons but they do not
understand that it makes code be treated as a class definition. They do not want
their code treated as a class definition and get surprised. The reason not
to pass locals specifically is that the following code raises a `NameError`:

```py
exec("""
def f():
    print("hi")

f()

def g():
    f()
g()
""", {}, {})
```

The reason not to leave out globals is as follows:

```py
def t():
    exec("""
def f():
    print("hi")

f()

def g():
    f()
g()
    """)
```

17 months agogh-112844: Update CPE references for external dependencies (#118521)
Seth Michael Larson [Mon, 20 May 2024 17:27:09 +0000 (13:27 -0400)] 
gh-112844: Update CPE references for external dependencies (#118521)

17 months agogh-119219: Remove two obsolete TODOs. (#119223)
Jeremy Hylton [Mon, 20 May 2024 16:54:16 +0000 (12:54 -0400)] 
gh-119219: Remove two obsolete TODOs. (#119223)

Remove two obsolete TODOs.

17 months agoAmend NEWS category for gh-119196 (#119218)
Erlend E. Aasland [Mon, 20 May 2024 15:32:05 +0000 (11:32 -0400)] 
Amend NEWS category for gh-119196 (#119218)

17 months ago[docs] TypeVarTuple default is keyword-only (#119215)
Sebastian Rittau [Mon, 20 May 2024 15:31:45 +0000 (17:31 +0200)] 
[docs] TypeVarTuple default is keyword-only (#119215)

17 months agogh-115119: Fall back to bundled libmpdec if system libmpdec is not found (#119196)
Erlend E. Aasland [Mon, 20 May 2024 14:58:08 +0000 (10:58 -0400)] 
gh-115119: Fall back to bundled libmpdec if system libmpdec is not found (#119196)

17 months agotyping docs: Fix formatting issue (#119210)
David Foster [Mon, 20 May 2024 14:32:51 +0000 (10:32 -0400)] 
typing docs: Fix formatting issue (#119210)

17 months agogh-119185: Fix typo in `_pyrepl.pager`: `tempfilepager` should be `tempfile_pager...
Thanos [Mon, 20 May 2024 14:31:43 +0000 (10:31 -0400)] 
gh-119185: Fix typo in `_pyrepl.pager`: `tempfilepager` should be `tempfile_pager` (#118881)

Fix typo in `_pyrepl.pager`: `tempfilepager` should be `tempfile_pager`

The name with no underscore doesn't exist.

17 months agogh-103134: Update multiprocessing.managers.ListProxy and DictProxy (GH-103133)
Roy Hyunjin Han [Mon, 20 May 2024 14:28:36 +0000 (10:28 -0400)] 
gh-103134: Update multiprocessing.managers.ListProxy and DictProxy  (GH-103133)

17 months agogh-118928: Remove unneeded sqlite3 NEWS entry (#119208)
Erlend E. Aasland [Mon, 20 May 2024 13:51:02 +0000 (09:51 -0400)] 
gh-118928: Remove unneeded sqlite3 NEWS entry (#119208)

The regression in d8e0e0091 was never part of an official release.

17 months agogh-118928: sqlite3: correctly bail if sequences of params are used with named placeho...
Erlend E. Aasland [Mon, 20 May 2024 13:44:42 +0000 (09:44 -0400)] 
gh-118928: sqlite3: correctly bail if sequences of params are used with named placeholders (#119197)

17 months agoEnable some stricter mypy settings on `Lib/_pyrepl` (#119077)
Alex Waygood [Mon, 20 May 2024 12:52:32 +0000 (08:52 -0400)] 
Enable some stricter mypy settings on `Lib/_pyrepl` (#119077)

17 months agogh-119121: Fix and test `async.staggered.staggered_race` (#119173)
Nikita Sobolev [Mon, 20 May 2024 11:06:50 +0000 (14:06 +0300)] 
gh-119121: Fix and test `async.staggered.staggered_race` (#119173)

17 months agoIDLE: fix url in config.py comment (#119198)
Terry Jan Reedy [Mon, 20 May 2024 06:04:50 +0000 (02:04 -0400)] 
IDLE: fix url in config.py comment (#119198)

17 months agogh-119105: difflib: improve recursion for degenerate cases (#119131)
pulkin [Sun, 19 May 2024 21:46:37 +0000 (23:46 +0200)] 
gh-119105: difflib: improve recursion for degenerate cases (#119131)

Code from https://github.com/pulkin, in PR
https://github.com/python/cpython/pull/119131

Greatly speeds `Differ` when there are many identically scoring pairs, by splitting the recursion near the inputs' midpoints instead of degenerating (as now) into just peeling off the first two lines.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
17 months agoGH-119113: Raise `TypeError` from `pathlib.PurePath.with_suffix(None)` (#119124)
Barney Gale [Sun, 19 May 2024 16:04:56 +0000 (17:04 +0100)] 
GH-119113: Raise `TypeError` from `pathlib.PurePath.with_suffix(None)` (#119124)

Restore behaviour from 3.12 when `path.with_suffix(None)` is called.

17 months agoGH-118447: Fix FreeBSD test failures. (#119170)
Barney Gale [Sun, 19 May 2024 15:39:00 +0000 (16:39 +0100)] 
GH-118447: Fix FreeBSD test failures. (#119170)

Apparently only macOS requires read permission to call `readlink()` on a
symlink.

17 months agoGH-119146: Don't run JIT CI on unrelated changes (GH-119147)
Savannah Ostrowski [Sun, 19 May 2024 12:59:12 +0000 (08:59 -0400)] 
GH-119146: Don't run JIT CI on unrelated changes  (GH-119147)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
17 months agomarshal docs: Remove reference to "Sun" (#119161)
Jelle Zijlstra [Sun, 19 May 2024 02:15:14 +0000 (22:15 -0400)] 
marshal docs: Remove reference to "Sun" (#119161)

Nobody has been using a Sun machine for a long time. When I saw
this sentence in a lightning talk just now, I thought it was talking
about sending Python code on a spacecraft.

17 months agoTry to repair oddball test bots timing out in test_int (#119166)
Tim Peters [Sun, 19 May 2024 01:54:23 +0000 (20:54 -0500)] 
Try to repair oddball test bots timing out in test_int (#119166)

Various test bots (outside the ones GH normally runs) are timing out during test_int after ecd8664 (asymptotically faster str->int). Best guess is that they don't build the C _decimal module. So require that module in the most likely tests to time out then. Flying mostly blind, though!

17 months agogh-118750: Asymptotically faster `int(string)` (#118751)
Tim Peters [Sun, 19 May 2024 00:19:57 +0000 (19:19 -0500)] 
gh-118750: Asymptotically faster `int(string)` (#118751)

Asymptotically faster (O(n log n)) str->int for very large strings, leveraging the faster multiplication scheme in the C-coded `_decimal` when available. This is used instead of the current Karatsuba-limited method starting at 2 million digits.

Lots of opportunity remains for fine-tuning. Good targets include changing BYTELIM, and possibly changing the internal output base (from 256 to a higher number of bytes).

Doing this was substantial work, and many of the new lines are actually comments giving correctness proofs. The obvious approaches sticking to integers were too slow to be useful, so this is doing variable-precision decimal floating-point arithmetic. Much faster, but worst-possible rounding errors have to be wholly accounted for, using as little precision as possible.

Special thanks to Serhiy Storchaka for asking many good questions in his code reviews!

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: sstandre <43125375+sstandre@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
17 months agoGH-118447: Fix handling of unreadable symlinks in `os.path.realpath()` (#118489)
Barney Gale [Sat, 18 May 2024 22:40:51 +0000 (23:40 +0100)] 
GH-118447: Fix handling of unreadable symlinks in `os.path.realpath()` (#118489)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
17 months agogh-119050: Add type hints to libregrtest/results.py (#119144)
Victor Stinner [Sat, 18 May 2024 20:21:05 +0000 (16:21 -0400)] 
gh-119050: Add type hints to libregrtest/results.py (#119144)

Sort also 'omitted' in TestResults.display_result().

17 months agogh-119132: Update sys.version to identify free-threaded or not. (gh-119134)
Donghee Na [Sat, 18 May 2024 19:44:40 +0000 (15:44 -0400)] 
gh-119132: Update sys.version to identify free-threaded or not. (gh-119134)

17 months agodocs: make mimalloc license text literal (#119046)
Rafael Fontenelle [Sat, 18 May 2024 16:22:54 +0000 (13:22 -0300)] 
docs: make mimalloc license text literal (#119046)

17 months agogh-119132: Log sys._is_gil_enabled() in test.pythoninfo (#119140)
Victor Stinner [Sat, 18 May 2024 13:24:22 +0000 (09:24 -0400)] 
gh-119132: Log sys._is_gil_enabled() in test.pythoninfo (#119140)

17 months agogh-119078: Clarify venv tutorial (GH-119129)
Nice Zombies [Sat, 18 May 2024 11:44:02 +0000 (13:44 +0200)] 
gh-119078: Clarify venv tutorial (GH-119129)

17 months agoMinor improvements to the docs for itertools.tee() (gh-119135)
Raymond Hettinger [Sat, 18 May 2024 06:32:34 +0000 (01:32 -0500)] 
Minor improvements to the docs for itertools.tee() (gh-119135)

17 months agogh-119049: Defer `import warnings` in `pathlib._local` (#119111)
Kirill Podoprigora [Fri, 17 May 2024 16:12:02 +0000 (19:12 +0300)] 
gh-119049: Defer `import warnings` in `pathlib._local` (#119111)

17 months agogh-112066: Fix versionadded in PyDict_SetDefaultRef docs (#118696)
Lysandros Nikolaou [Fri, 17 May 2024 16:10:21 +0000 (12:10 -0400)] 
gh-112066: Fix versionadded in PyDict_SetDefaultRef docs (#118696)

17 months agoFix typos in documentation (#119092)
Xie Yanbo [Fri, 17 May 2024 10:37:35 +0000 (18:37 +0800)] 
Fix typos in documentation (#119092)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
17 months agoImprove `pyrepl` type-annotation coverage (#119081)
Alex Waygood [Fri, 17 May 2024 10:13:24 +0000 (06:13 -0400)] 
Improve `pyrepl` type-annotation coverage (#119081)

17 months agogh-119049: Fix incorrect display of warning which is constructed by C API (GH-119063)
Kirill Podoprigora [Thu, 16 May 2024 20:27:59 +0000 (23:27 +0300)] 
gh-119049: Fix incorrect display of warning which is constructed by C API (GH-119063)

The source line was not displayed if the warnings module had not yet
been imported.

17 months agoGH-118943: Fix a race condition when generating jit_stencils.h (GH-118957)
Brandt Bucher [Thu, 16 May 2024 16:11:42 +0000 (12:11 -0400)] 
GH-118943: Fix a race condition when generating jit_stencils.h (GH-118957)

17 months agoExplain how to install LLVM on Fedora (GH-118983)
Miro Hrončok [Thu, 16 May 2024 16:09:52 +0000 (18:09 +0200)] 
Explain how to install LLVM on Fedora (GH-118983)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
17 months agogh-108267: Fix object.__setattr__ regression in dataclasses docs (#119082)
Shantanu [Thu, 16 May 2024 13:39:37 +0000 (06:39 -0700)] 
gh-108267: Fix object.__setattr__ regression in dataclasses docs (#119082)

17 months agoAdd Tkinter tests for different events (GH-118778)
Serhiy Storchaka [Thu, 16 May 2024 08:16:46 +0000 (11:16 +0300)] 
Add Tkinter tests for different events (GH-118778)

17 months agogh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)
Serhiy Storchaka [Thu, 16 May 2024 07:25:10 +0000 (10:25 +0300)] 
gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)

17 months agoFix typos in test_buffer.py and update numpy issue links (#118963)
Wulian233 [Thu, 16 May 2024 05:16:34 +0000 (13:16 +0800)] 
Fix typos in test_buffer.py and update numpy issue links (#118963)

17 months agoUse literal syntax in origin property (#119029)
Rafael Fontenelle [Thu, 16 May 2024 05:13:47 +0000 (02:13 -0300)] 
Use literal syntax in origin property (#119029)

17 months agoDocs: fix typos in documentation (gh-118941)
Xie Yanbo [Wed, 15 May 2024 23:38:32 +0000 (07:38 +0800)] 
Docs: fix typos in documentation (gh-118941)

17 months agogh-119009: Add gettext target (#119006)
Rafael Fontenelle [Wed, 15 May 2024 18:13:52 +0000 (15:13 -0300)] 
gh-119009: Add gettext target (#119006)

17 months agogh-118760: Fix errors in calling Tkinter bindings on Windows (GH-118782)
Serhiy Storchaka [Wed, 15 May 2024 16:49:00 +0000 (19:49 +0300)] 
gh-118760: Fix errors in calling Tkinter bindings on Windows (GH-118782)

For unknown reasons some arguments for Tkinter binding can be created
as a 1-tuple containing a Tcl_Obj when wantobjects is 2.

17 months agoRemove references to private symbols from zipimport module docstring (GH-119015)
Thomas Grainger [Wed, 15 May 2024 16:21:52 +0000 (17:21 +0100)] 
Remove references to private symbols from zipimport module docstring (GH-119015)

17 months agogh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-119056)
Steve Dower [Wed, 15 May 2024 10:59:41 +0000 (11:59 +0100)] 
gh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-119056)

17 months ago3.13 What's New: Add PEP 702 (#118922)
Jelle Zijlstra [Wed, 15 May 2024 02:39:12 +0000 (22:39 -0400)] 
3.13 What's New: Add PEP 702 (#118922)

I honestly forgot this slipped into 3.13, but I think it's worth highlighting more, as it is a PEP-sized change that makes the type system significantly more powerful.

@Yhg1s I think it's also worth mentioning in your release announcements.

17 months agoGH-74033: Drop deprecated `pathlib.Path` keyword arguments (#118793)
Barney Gale [Tue, 14 May 2024 20:14:07 +0000 (21:14 +0100)] 
GH-74033: Drop deprecated `pathlib.Path` keyword arguments (#118793)

Remove support for supplying keyword arguments to `pathlib.Path()`. This
has been deprecated since Python 3.12.

17 months agoGH-101357: Suppress `OSError` from `pathlib.Path.exists()` and `is_*()` (#118243)
Barney Gale [Tue, 14 May 2024 17:53:15 +0000 (18:53 +0100)] 
GH-101357: Suppress `OSError` from `pathlib.Path.exists()` and `is_*()` (#118243)

Suppress all `OSError` exceptions from `pathlib.Path.exists()` and `is_*()`
rather than a selection of more common errors as we do presently. Also
adjust the implementations to call `os.path.exists()` etc, which are much
faster on Windows thanks to GH-101196.

17 months agogh-118928: sqlite3: disallow sequences of params with named placeholders (#118929)
Erlend E. Aasland [Tue, 14 May 2024 16:10:55 +0000 (12:10 -0400)] 
gh-118928: sqlite3: disallow sequences of params with named placeholders (#118929)

Follow-up of gh-101693. The previous DeprecationWarning is replaced with
raising sqlite3.ProgrammingError.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months agoMisc improvements to the itertools docs (gh-119040)
Raymond Hettinger [Tue, 14 May 2024 15:18:19 +0000 (10:18 -0500)] 
Misc improvements to the itertools docs (gh-119040)

17 months agotyping tests: remove some unnecessary uses of `exec()` (#119005)
Alex Waygood [Tue, 14 May 2024 14:16:14 +0000 (10:16 -0400)] 
typing tests: remove some unnecessary uses of `exec()` (#119005)

17 months agoAdd yet few cases for urlparse/urlunparse roundtrip tests (GH-119031)
Serhiy Storchaka [Tue, 14 May 2024 13:59:21 +0000 (16:59 +0300)] 
Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031)

Add yet few cases for urlparse/urlunparse tests

17 months agogh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple...
Serhiy Storchaka [Tue, 14 May 2024 09:24:37 +0000 (12:24 +0300)] 
gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority (GH-113563)

17 months agoGH-118836: Fix JIT build error when SHT_NOTE section is present (GH-119000)
Michał Górny [Mon, 13 May 2024 21:37:02 +0000 (23:37 +0200)] 
GH-118836: Fix JIT build error when SHT_NOTE section is present (GH-119000)

17 months agogh-118998: Handle errors correctly in `tmtotuple` in `timemodule` (#118999)
Nikita Sobolev [Mon, 13 May 2024 21:20:59 +0000 (00:20 +0300)] 
gh-118998: Handle errors correctly in `tmtotuple` in `timemodule` (#118999)

17 months agogh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (#119012)
Nikita Sobolev [Mon, 13 May 2024 20:01:05 +0000 (23:01 +0300)] 
gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (#119012)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
17 months agogh-117873: Revert _posixshmem.shm_open() change (#118901)
Victor Stinner [Mon, 13 May 2024 14:03:52 +0000 (16:03 +0200)] 
gh-117873: Revert _posixshmem.shm_open() change (#118901)

17 months agogh-58933: Make pdb return to caller frame correctly when f_trace is not set (#118979)
Tian Gao [Mon, 13 May 2024 12:38:21 +0000 (05:38 -0700)] 
gh-58933: Make pdb return to caller frame correctly when f_trace is not set (#118979)

17 months agogh-118876: Ensure PC/layout sets ns.temp before using it (GH-118880)
I-Shen Leong [Mon, 13 May 2024 11:30:16 +0000 (04:30 -0700)] 
gh-118876: Ensure PC/layout sets ns.temp before using it (GH-118880)

Fixes an AttributeError that occurs when checking if ns.temp is an absolute path during building from source on Windows.

17 months agoImprove the `rmtree` doc for `dir_fd` param addition in 3.11 (#118964)
Nikita Sobolev [Mon, 13 May 2024 11:04:14 +0000 (14:04 +0300)] 
Improve the `rmtree` doc for `dir_fd` param addition in 3.11 (#118964)

17 months agogh-87106: Fix inspect.signature.bind() handling of positional-only arguments with...
Jacob Walls [Mon, 13 May 2024 07:56:09 +0000 (03:56 -0400)] 
gh-87106: Fix inspect.signature.bind() handling of positional-only arguments with **kwargs (GH-103404)

17 months agoItertools docs: fix parameter names and indentation in Python equivalents (gh-118977)
pochmann3 [Sun, 12 May 2024 21:11:38 +0000 (23:11 +0200)] 
Itertools docs: fix parameter names and indentation in Python equivalents (gh-118977)

17 months agogh-118899: Add tests for `NotImplemented` attribute access (#118902)
Nikita Sobolev [Sun, 12 May 2024 14:00:49 +0000 (17:00 +0300)] 
gh-118899: Add tests for `NotImplemented` attribute access (#118902)

18 months agoGH-118844: Fix build failures when combining --disable-gil with --enable-experimental...
Savannah Ostrowski [Sat, 11 May 2024 23:19:31 +0000 (16:19 -0700)] 
GH-118844: Fix build failures when combining --disable-gil with --enable-experimental-jit (GH-118935)

18 months agogh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)
Nice Zombies [Sat, 11 May 2024 21:46:07 +0000 (23:46 +0200)] 
gh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)

* Fix `test_strptime` raises a DeprecationWarning
* Ignore deprecation warnings where appropriate.
* Update Lib/test/datetimetester.py

This is follow on work to silence unnecessary warnings from the test suite that changes for https://github.com/python/cpython/issues/70647 added.

18 months agogh-118932: ChainMap.__contains__ performance improvement (gh-118946)
d.grigonis [Sat, 11 May 2024 20:55:23 +0000 (23:55 +0300)] 
gh-118932: ChainMap.__contains__ performance improvement (gh-118946)

18 months agoDocs: Fix SOURCE_URI (#118945)
Nice Zombies [Sat, 11 May 2024 11:47:45 +0000 (13:47 +0200)] 
Docs: Fix SOURCE_URI (#118945)

18 months agogh-118921: Add `copy()` method for `FrameLocalsProxy` (#118923)
Tian Gao [Fri, 10 May 2024 22:53:10 +0000 (15:53 -0700)] 
gh-118921: Add `copy()` method for `FrameLocalsProxy` (#118923)

18 months agogh-117657: Log TSAN warnings to separate files and archive them (#118747)
mpage [Fri, 10 May 2024 21:54:23 +0000 (14:54 -0700)] 
gh-117657: Log TSAN warnings to separate files and archive them (#118747)

This ensures we don't lose races that occur in subprocesses or
interleave races from workers running in parallel.

Log files are collected and packaged into a zipfile that can be
downloaded from the "Artifacts" section of the workflow run.

18 months agogh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)
Hugo van Kemenade [Fri, 10 May 2024 20:42:34 +0000 (23:42 +0300)] 
gh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)

18 months agogh-118846: Fix free-threading test failures when run sequentially (#118864)
Sam Gross [Fri, 10 May 2024 20:29:29 +0000 (16:29 -0400)] 
gh-118846: Fix free-threading test failures when run sequentially (#118864)

The free-threaded build currently immortalizes some objects once the
first thread is started. This can lead to test failures depending on the
order in which tests are run. This PR addresses those failures by
suppressing immortalization or skipping the affected tests.

18 months agogh-118702: Implement vectorcall for BaseException (#118703)
Victor Stinner [Fri, 10 May 2024 19:08:24 +0000 (21:08 +0200)] 
gh-118702: Implement vectorcall for BaseException (#118703)

* BaseException_vectorcall() now creates a tuple from 'args' array.
* Creation an exception using BaseException_vectorcall() is now a
  single function call, rather than having to call
  BaseException_new() and then BaseException_init().
  Calling BaseException_init() is inefficient since it overrides
  the 'args' attribute.
* _PyErr_SetKeyError() now uses PyObject_CallOneArg() to create the
  KeyError instance to use BaseException_vectorcall().

18 months agoRename typing._collect_parameters (#118900)
Jelle Zijlstra [Fri, 10 May 2024 16:55:49 +0000 (09:55 -0700)] 
Rename typing._collect_parameters (#118900)

Unfortunately, released versions of typing_extensions
monkeypatch this function without the extra parameter, which makes
it so things break badly if current main is used with typing_extensions.

Fortunately, the monkeypatching is not needed on Python 3.13, because CPython
now implements PEP 696. By renaming the function, we prevent the monkeypatch
from breaking typing.py internals.

We keep the old name (raising a DeprecationWarning) to help other external users who call it.

18 months agoGH-118910: Less boilerplate in the tier 2 optimizer (#118913)
Mark Shannon [Fri, 10 May 2024 16:43:23 +0000 (17:43 +0100)] 
GH-118910: Less boilerplate in the tier 2 optimizer (#118913)

18 months agogh-118771: Ensure names defined in optimizer.h start with Py/_Py (GH-118825)
Petr Viktorin [Fri, 10 May 2024 16:20:12 +0000 (18:20 +0200)] 
gh-118771: Ensure names defined in optimizer.h start with Py/_Py (GH-118825)

18 months agoGH-78707: Drop deprecated `pathlib.PurePath.[is_]relative_to()` arguments (#118780)
Barney Gale [Fri, 10 May 2024 15:53:46 +0000 (16:53 +0100)] 
GH-78707: Drop deprecated `pathlib.PurePath.[is_]relative_to()` arguments (#118780)

Remove support for supplying additional positional arguments to
`PurePath.relative_to()` and `is_relative_to()`. This has been deprecated
since Python 3.12.

18 months agogh-118895: Call PyType_Ready() on typing.NoDefault (#118897)
Jelle Zijlstra [Fri, 10 May 2024 15:42:00 +0000 (08:42 -0700)] 
gh-118895: Call PyType_Ready() on typing.NoDefault (#118897)