]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
17 months agogh-117505: Run ensurepip in isolated env in Windows installer (GH-118257)
Michael Vincent [Wed, 22 May 2024 17:59:47 +0000 (12:59 -0500)] 
gh-117505: Run ensurepip in isolated env in Windows installer (GH-118257)

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.

17 months agogh-119247: Add macros to use PySequence_Fast safely in free-threaded build (#119315)
Josh {*()} Rosenberg [Wed, 22 May 2024 17:45:34 +0000 (17:45 +0000)] 
gh-119247: Add macros to use PySequence_Fast safely in free-threaded build (#119315)

Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and
`Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use
them. Also add a regression test that would crash reliably without this
patch.

17 months agogh-117657: Fix missing atomic in dict_resize (#119312)
Dino Viehland [Wed, 22 May 2024 17:38:56 +0000 (13:38 -0400)] 
gh-117657: Fix missing atomic in dict_resize (#119312)

Fix missing atomic in dict_resize

17 months agoRemove almost all unpaired backticks in docstrings (#119231)
Geoffrey Thomas [Wed, 22 May 2024 16:35:18 +0000 (12:35 -0400)] 
Remove almost all unpaired backticks in docstrings (#119231)

As reported in #117847 and #115366, an unpaired backtick in a docstring
tends to confuse e.g. Sphinx running on subclasses of standard library
objects, and the typographic style of using a backtick as an opening
quote is no longer in favor. Convert almost all uses of the form

    The variable `foo' should do xyz

to

    The variable 'foo' should do xyz

and also fix up miscellaneous other unpaired backticks (extraneous /
missing characters).

No functional change is intended here other than in human-readable
docstrings.

17 months agogh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters (gh-119331)
Eric Snow [Wed, 22 May 2024 15:57:52 +0000 (11:57 -0400)] 
gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters (gh-119331)

_PyArg_Parser holds static global data generated for modules by Argument Clinic.  The _PyArg_Parser.kwtuple field is a tuple object, even though it's stored within a static global.  In some cases the tuple is statically allocated and thus it's okay that it gets shared by multiple interpreters.  However, in other cases the tuple is set lazily, allocated from the heap using the active interprepreter at the point the tuple is needed.

This is a problem once that interpreter is destroyed since _PyArg_Parser.kwtuple becomes at dangling pointer, leading to crashes.  It isn't a problem if the tuple is allocated under the main interpreter, since its lifetime is bound to the lifetime of the runtime.  The solution here is to temporarily switch to the main interpreter.  The alternative would be to always statically allocate the tuple.

This change also fixes a bug where only the most recent parser was added to the global linked list.

17 months agogh-119391: Amend comment description of PyMapping_Items, PyMapping_Values and PyMappi...
Pieter Eendebak [Wed, 22 May 2024 12:52:36 +0000 (14:52 +0200)] 
gh-119391: Amend comment description of PyMapping_Items, PyMapping_Values and PyMapping_Keys (#119392)

The behaviour was changed in 0ccc0f6c7.

17 months agogh-118643: Fix AttributeError in the email module (GH-119099)
Serhiy Storchaka [Wed, 22 May 2024 10:17:46 +0000 (13:17 +0300)] 
gh-118643: Fix AttributeError in the email module (GH-119099)

Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.

17 months agoFix version number in use_load_tests deprecation reference (GH-119151)
Jacob Walls [Wed, 22 May 2024 09:43:56 +0000 (05:43 -0400)] 
Fix version number in use_load_tests deprecation reference (GH-119151)

Deprecation took place in d78742a260ba09e53c844de7b1fd11a11c674945 (3.5)

17 months agoFix typos in NEWS entries for 3.13 (GH-119374)
Xie Yanbo [Wed, 22 May 2024 09:31:37 +0000 (17:31 +0800)] 
Fix typos in NEWS entries for 3.13 (GH-119374)

17 months agoClarify that dklen is expected in bytes for the hashlib functions (GH-106624)
Mathijs Mortimer [Wed, 22 May 2024 08:51:25 +0000 (10:51 +0200)] 
Clarify that dklen is expected in bytes for the hashlib functions (GH-106624)

17 months agoDOCS: fix error in exec namespace note (gh-119378)
Alyssa Coghlan [Wed, 22 May 2024 06:38:06 +0000 (16:38 +1000)] 
DOCS: fix error in exec namespace note (gh-119378)

When updating the new exec note added in gh-119235 as part of the
PEP 667 general docs PR, I suggested a workaround that isn't valid.

The first half of the note is still reasonable, so just omit the invalid text.

17 months agogh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating...
Aya Elsayed [Wed, 22 May 2024 05:56:35 +0000 (06:56 +0100)] 
gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block (#119355)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-111201: Speed up paste mode in the REPL (#119341)
Pablo Galindo Salgado [Wed, 22 May 2024 05:28:32 +0000 (01:28 -0400)] 
gh-111201: Speed up paste mode in the REPL (#119341)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-111201: auto-indentation in _pyrepl (#119348)
Arnon Yaari [Wed, 22 May 2024 04:21:14 +0000 (00:21 -0400)] 
gh-111201: auto-indentation in _pyrepl (#119348)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-119180: PEP 649: Add __annotate__ attributes (#119209)
Jelle Zijlstra [Wed, 22 May 2024 02:38:12 +0000 (22:38 -0400)] 
gh-119180: PEP 649: Add __annotate__ attributes (#119209)

17 months agogh-119357: Increase test coverage for keymap in _pyrepl (#119358)
Eugene Triguba [Wed, 22 May 2024 02:36:01 +0000 (22:36 -0400)] 
gh-119357: Increase test coverage for keymap in _pyrepl (#119358)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-111201: Add append to screen method to avoid recalculation (#119274)
Lysandros Nikolaou [Wed, 22 May 2024 02:35:44 +0000 (22:35 -0400)] 
gh-111201: Add append to screen method to avoid recalculation (#119274)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-60191: Implement ast.compare (#19211)
Batuhan Taskaya [Wed, 22 May 2024 01:39:26 +0000 (04:39 +0300)] 
gh-60191: Implement ast.compare (#19211)

* bpo-15987: Implement ast.compare

Add a compare() function that compares two ASTs for structural equality. There are two set of attributes on AST node objects, fields and attributes. The fields are always compared, since they represent the actual structure of the code. The attributes can be optionally be included in the comparison. Attributes capture things like line numbers of column offsets, so comparing them involves test whether the layout of the program text is the same. Since whitespace seems inessential for comparing ASTs, the default is to compare fields but not attributes.

ASTs are just Python objects that can be modified in arbitrary ways. The API for ASTs is under-specified in the presence of user modifications to objects. The comparison respects modifications to fields and attributes, and to _fields and _attributes attributes. A user could create obviously malformed objects, and the code will probably fail with an AttributeError when that happens. (For example, adding "spam" to _fields but not adding a "spam" attribute to the object.)

Co-authored-by: Jeremy Hylton <jeremy@alum.mit.edu>
17 months agogh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings...
Landon Wood [Wed, 22 May 2024 01:15:40 +0000 (21:15 -0400)] 
gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (#119330)

17 months agogh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)
Jelle Zijlstra [Wed, 22 May 2024 00:46:39 +0000 (20:46 -0400)] 
gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)

The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
17 months agogh-119205: Fix autocompletion bug in new repl (#119229)
Koudai Aono [Tue, 21 May 2024 23:22:21 +0000 (19:22 -0400)] 
gh-119205: Fix autocompletion bug in new repl (#119229)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agogh-118893: Evaluate all statements in the new REPL separately (#119318)
Pablo Galindo Salgado [Tue, 21 May 2024 23:16:56 +0000 (19:16 -0400)] 
gh-118893: Evaluate all statements in the new REPL separately (#119318)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
17 months agoDocs: Add central references to free-threading-related options (#119017)
Brett Simmers [Tue, 21 May 2024 21:49:23 +0000 (17:49 -0400)] 
Docs: Add central references to free-threading-related options (#119017)

17 months agogh-118692: Avoid creating unnecessary StopIteration instances for monitoring (#119216)
Irit Katriel [Tue, 21 May 2024 20:42:51 +0000 (16:42 -0400)] 
gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (#119216)

17 months agogh-118507 : Refactor `nt._path_is*` to improve applicability for other cases (GH...
Nice Zombies [Tue, 21 May 2024 20:36:36 +0000 (22:36 +0200)] 
gh-118507 : Refactor `nt._path_is*` to improve applicability for other cases (GH-118755)

17 months agogh-119102: Fix REPL for dumb terminal (#119332)
Victor Stinner [Tue, 21 May 2024 20:33:52 +0000 (22:33 +0200)] 
gh-119102: Fix REPL for dumb terminal (#119332)

The site module gets the __main__ module to get _pyrepl.__main__.

17 months agogh-111201: Remove readline dependency from the PyREPL (#119262)
Lysandros Nikolaou [Tue, 21 May 2024 20:30:45 +0000 (16:30 -0400)] 
gh-111201: Remove readline dependency from the PyREPL (#119262)

17 months agogh-90562: Mention slots pitfall in dataclass docs (#107391)
Josh Cannon [Tue, 21 May 2024 19:37:32 +0000 (14:37 -0500)] 
gh-90562: Mention slots pitfall in dataclass docs (#107391)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
17 months agogh-119189: Add yet more tests for mixed Fraction arithmetic (GH-119298)
Serhiy Storchaka [Tue, 21 May 2024 19:28:05 +0000 (22:28 +0300)] 
gh-119189: Add yet more tests for mixed Fraction arithmetic (GH-119298)

17 months agoFix typos in documentation (#119295)
Xie Yanbo [Tue, 21 May 2024 18:35:05 +0000 (02:35 +0800)] 
Fix typos in documentation (#119295)

17 months agogh-111389: Add PyHASH_MULTIPLIER constant (#119214)
Victor Stinner [Tue, 21 May 2024 17:51:51 +0000 (19:51 +0200)] 
gh-111389: Add PyHASH_MULTIPLIER constant (#119214)

17 months agogh-117657: Fix itertools.count thread safety (#119268)
Arnon Yaari [Tue, 21 May 2024 17:16:34 +0000 (13:16 -0400)] 
gh-117657: Fix itertools.count thread safety (#119268)

Fix itertools.count in free-threading mode

17 months agogh-109176: replace _PyFrame_OpAlreadyRan by an assertion that the frame is complete...
Irit Katriel [Tue, 21 May 2024 17:08:51 +0000 (13:08 -0400)] 
gh-109176: replace _PyFrame_OpAlreadyRan by an assertion that the frame is complete. (#119234)

17 months agogh-119306: Break up _pyrepl tests (#119307)
Eugene Triguba [Tue, 21 May 2024 16:44:09 +0000 (12:44 -0400)] 
gh-119306: Break up _pyrepl tests (#119307)

17 months agogh-113978: Ignore warnings on text completion inside REPL (#113979)
Yan Yanchii [Tue, 21 May 2024 16:28:21 +0000 (18:28 +0200)] 
gh-113978: Ignore warnings on text completion inside REPL (#113979)

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)