]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-95588: Drop the safety claim from `ast.literal_eval` docs. (#95919)
Gregory P. Smith [Sun, 2 Oct 2022 00:55:40 +0000 (17:55 -0700)] 
gh-95588: Drop the safety claim from `ast.literal_eval` docs. (#95919)

It was never really safe and this claim conflicts directly with the big warning in the docs about it being able to crash the interpreter.

3 years agoFix capitalization of Unix in documentation (#96913)
Will Hawkins [Sat, 1 Oct 2022 23:41:06 +0000 (19:41 -0400)] 
Fix capitalization of Unix in documentation (#96913)

3 years agogh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (#95253)
Łukasz Langa [Sat, 1 Oct 2022 17:42:36 +0000 (19:42 +0200)] 
gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (#95253)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
3 years agogh-90110: Update the c-analyzer Tool (gh-97695)
Eric Snow [Sat, 1 Oct 2022 01:32:46 +0000 (19:32 -0600)] 
gh-90110: Update the c-analyzer Tool (gh-97695)

https://github.com/python/cpython/issues/90110

3 years agoGH-97592: Fix crash in C remove_done_callback due to evil code (#97660)
Guido van Rossum [Fri, 30 Sep 2022 19:57:09 +0000 (12:57 -0700)] 
GH-97592: Fix crash in C remove_done_callback due to evil code (#97660)

Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.

3 years agoGH-96827: Don't touch closed loops from executor threads (#96837)
Guido van Rossum [Fri, 30 Sep 2022 19:55:40 +0000 (12:55 -0700)] 
GH-96827: Don't touch closed loops from executor threads (#96837)

* When chaining futures, skip callback if loop closed.
* When shutting down an executor, don't wake a closed loop.

3 years agogh-87597: Document TimeoutExpired.stdout & .stderr types (#97685)
Gregory P. Smith [Fri, 30 Sep 2022 17:45:47 +0000 (10:45 -0700)] 
gh-87597: Document TimeoutExpired.stdout & .stderr types (#97685)

This documents the behavior that has always been the case since timeout
support was introduced in Python 3.3.

3 years agobpo-35675: IDLE - separate config_key window and frame (#11427)
Cheryl Sabella [Fri, 30 Sep 2022 16:44:44 +0000 (12:44 -0400)] 
bpo-35675: IDLE  - separate config_key window and frame (#11427)

bpo-35598: IDLE: Refactor window and frame class

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 years agogh-94526: getpath_dirname() no longer encodes the path (#97645)
Victor Stinner [Fri, 30 Sep 2022 12:58:30 +0000 (14:58 +0200)] 
gh-94526: getpath_dirname() no longer encodes the path (#97645)

Fix the Python path configuration used to initialized sys.path at
Python startup. Paths are no longer encoded to UTF-8/strict to avoid
encoding errors if it contains surrogate characters (bytes paths are
decoded with the surrogateescape error handler).

getpath_basename() and getpath_dirname() functions no longer encode
the path to UTF-8/strict, but work directly on Unicode strings. These
functions now use PyUnicode_FindChar() and PyUnicode_Substring() on
the Unicode path, rather than strrchr() on the encoded bytes string.

3 years agogh-90989: Install Windows launcher per-user, and clarify some installer text (GH...
Steve Dower [Fri, 30 Sep 2022 09:29:31 +0000 (10:29 +0100)] 
gh-90989: Install Windows launcher per-user, and clarify some installer text (GH-97655)

3 years agogh-97649: The Tools directory is no longer installed on Windows (GH-97653)
Steve Dower [Fri, 30 Sep 2022 09:25:00 +0000 (10:25 +0100)] 
gh-97649: The Tools directory is no longer installed on Windows (GH-97653)

3 years agoUse SyntaxError invalid range in tutorial introduction example (GH-93031)
Eddie Hebert [Fri, 30 Sep 2022 08:59:46 +0000 (04:59 -0400)] 
Use SyntaxError invalid range in tutorial introduction example (GH-93031)

Use output from a 3.10+ REPL, showing invalid range, for the
SyntaxError examples in the tutorial introduction page.

Automerge-Triggered-By: GH:iritkatriel
3 years agogh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH...
Ofey Chan [Fri, 30 Sep 2022 08:43:02 +0000 (16:43 +0800)] 
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)

3 years agogh-96397: Document that attributes need not be identifiers (#96454)
Jeff Allen [Thu, 29 Sep 2022 23:02:27 +0000 (00:02 +0100)] 
gh-96397: Document that attributes need not be identifiers (#96454)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agocloses gh-97650: correct sphinx executable (gh-97651)
NoSuck [Thu, 29 Sep 2022 22:53:41 +0000 (17:53 -0500)] 
closes gh-97650: correct sphinx executable (gh-97651)

3 years agogh-91212: Fixed flickering when the tracer is turned off (#95129)
Shin-myoung-serp [Thu, 29 Sep 2022 06:40:51 +0000 (15:40 +0900)] 
gh-91212: Fixed flickering when the tracer is turned off (#95129)

Fixed flickering when the tracer is turned off.

3 years agogh-52597: Add position-only markers for os functions (#94735)
Stanley [Thu, 29 Sep 2022 01:06:50 +0000 (18:06 -0700)] 
gh-52597: Add position-only markers for os functions (#94735)

3 years agogh-97612: Fix shell injection in get-remote-certificate.py (#97613)
Victor Stinner [Wed, 28 Sep 2022 23:17:27 +0000 (01:17 +0200)] 
gh-97612: Fix shell injection in get-remote-certificate.py (#97613)

Fix a shell code injection vulnerability in the
get-remote-certificate.py example script. The script no longer uses a
shell to run "openssl" commands. Issue reported and initial fix by
Caleb Shortt.

Remove the Windows code path to send "quit" on stdin to the "openssl
s_client" command: use DEVNULL on all platforms instead.

Co-authored-by: Caleb Shortt <caleb@rgauge.com>
3 years agogh-97616: list_resize() checks for integer overflow (#97617)
Victor Stinner [Wed, 28 Sep 2022 22:07:07 +0000 (00:07 +0200)] 
gh-97616: list_resize() checks for integer overflow (#97617)

Fix multiplying a list by an integer (list *= int): detect the
integer overflow when the new allocated length is close to the
maximum size.  Issue reported by Jordan Limor.

list_resize() now checks for integer overflow before multiplying the
new allocated length by the list item size (sizeof(PyObject*)).

3 years agoFix typo in error message in plistlib (GH-97540)
Jakob Weigert [Wed, 28 Sep 2022 17:46:09 +0000 (19:46 +0200)] 
Fix typo in error message in plistlib (GH-97540)

3 years agoGH-82448: Add thread timeout for loop.shutdown_default_executor (#97561)
Kumar Aditya [Wed, 28 Sep 2022 17:39:42 +0000 (23:09 +0530)] 
GH-82448: Add thread timeout for loop.shutdown_default_executor (#97561)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
3 years agofixup policy docs (#97618)
Kumar Aditya [Wed, 28 Sep 2022 17:34:49 +0000 (23:04 +0530)] 
fixup policy docs (#97618)

3 years agobpo-47243: Duplicate entry in 'Objects/unicodetype_db.h' (GH-32376)
LiarPrincess [Wed, 28 Sep 2022 13:57:14 +0000 (15:57 +0200)] 
bpo-47243: Duplicate entry in 'Objects/unicodetype_db.h' (GH-32376)

Fix for duplicate 1st entry in 'Objects/unicodetype_db.h':

```c
/* a list of unique character type descriptors */
const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0}, <--- HERE
    {0, 0, 0, 0, 0, 32},
    {0, 0, 0, 0, 0, 48},
    …
```

https://bugs.python.org/issue47243

Automerge-Triggered-By: GH:isidentical
3 years agogh-65046: Add note about logging from async code. (GH-97602)
Vinay Sajip [Wed, 28 Sep 2022 04:17:42 +0000 (05:17 +0100)] 
gh-65046: Add note about logging from async code. (GH-97602)

3 years agoFix docs on conditional expression grouping (GH-96447)
Andrew Kay [Wed, 28 Sep 2022 02:57:32 +0000 (03:57 +0100)] 
Fix docs on conditional expression grouping (GH-96447)

3 years agogh-96377: Update asyncio policy doc intro paras to be clear and accurate (#97603)
C.A.M. Gerlach [Tue, 27 Sep 2022 23:47:14 +0000 (18:47 -0500)] 
gh-96377: Update asyncio policy doc intro paras to be clear and accurate (#97603)

Also fix up some cross-references in the asyncio docs.

3 years agogh-96670: Raise SyntaxError when parsing NULL bytes (#97594)
Pablo Galindo Salgado [Tue, 27 Sep 2022 22:23:42 +0000 (23:23 +0100)] 
gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)

3 years agogh-96959: Update more HTTP links (GH-97536)
Serhiy Storchaka [Tue, 27 Sep 2022 11:08:11 +0000 (14:08 +0300)] 
gh-96959: Update more HTTP links (GH-97536)

Use HTTPS for documents which are available by both HTTP and HTTPS
links, but there is no redirection from HTTP to HTTPS or vice versa.

3 years agogh-73588: Fix generation of the default name of tkinter.Checkbutton. (GH-97547)
Serhiy Storchaka [Tue, 27 Sep 2022 11:05:05 +0000 (14:05 +0300)] 
gh-73588: Fix generation of the default name of tkinter.Checkbutton. (GH-97547)

Previously, checkbuttons in different parent widgets could have the same
short name and share the same state if arguments "name" and "variable" are
not specified. Now they are globally unique.

3 years agogh-97545: Make Semaphore run faster. (#97549)
Cyker Way [Mon, 26 Sep 2022 23:38:00 +0000 (19:38 -0400)] 
gh-97545: Make Semaphore run faster. (#97549)

3 years agoGH-65046: Fix docs about logging in `asyncio` (#97559)
Kumar Aditya [Mon, 26 Sep 2022 22:27:15 +0000 (03:57 +0530)] 
GH-65046: Fix docs about logging in `asyncio` (#97559)

Explain that logging should not use network I/O.

3 years agobpo-38748: Add ctypes test for stack corruption due to misaligned arguments (GH-26204)
Michael Curran [Mon, 26 Sep 2022 16:27:44 +0000 (02:27 +1000)] 
bpo-38748: Add ctypes test for stack corruption due to misaligned arguments (GH-26204)

3 years agoFix typo in docstring and remove duplicate signal.h include in faulthandler.c (#96720)
chgnrdv [Mon, 26 Sep 2022 16:12:19 +0000 (19:12 +0300)] 
Fix typo in docstring and remove duplicate signal.h include in faulthandler.c (#96720)

This fix corrects a typo in dump_traceback_later function docstring and removes duplicate signal.h include directive

3 years agogh-96848: Fix -X int_max_str_digits option parsing (#96988)
Victor Stinner [Mon, 26 Sep 2022 15:20:08 +0000 (17:20 +0200)] 
gh-96848: Fix -X int_max_str_digits option parsing (#96988)

Fix command line parsing: reject "-X int_max_str_digits" option with
no value (invalid) when the PYTHONINTMAXSTRDIGITS environment
variable is set to a valid limit.

3 years agogh-82530: Create blank function instead of invalid import for email example (#97529)
Stanley [Mon, 26 Sep 2022 04:06:11 +0000 (21:06 -0700)] 
gh-82530: Create blank function instead of invalid import for email example (#97529)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 years agoReject invalid opcode names in assertInBytecode (GH-97548)
Dennis Sweeney [Sun, 25 Sep 2022 19:55:53 +0000 (15:55 -0400)] 
Reject invalid opcode names in assertInBytecode (GH-97548)

3 years agoGH-78724: Initialize struct.Struct in __new__ (GH-94532)
Kumar Aditya [Sun, 25 Sep 2022 13:32:48 +0000 (19:02 +0530)] 
GH-78724: Initialize struct.Struct in __new__  (GH-94532)

Closes https://github.com/python/cpython/issues/75960
Closes https://github.com/python/cpython/issues/78724

3 years agogh-96735: Fix undefined behaviour in struct unpacking functions (#96739)
Mark Dickinson [Sun, 25 Sep 2022 09:55:33 +0000 (10:55 +0100)] 
gh-96735: Fix undefined behaviour in struct unpacking functions (#96739)

This PR fixes undefined behaviour in the struct module unpacking support functions `bu_longlong`, `lu_longlong`, `bu_int` and `lu_int`; thanks to @kumaraditya303 for finding these.

The fix is to accumulate the bytes in an unsigned integer type instead of a signed integer type, then to convert to the appropriate signed type. In cases where the width matches, that conversion will typically be compiled away to a no-op.
(Evidence from Godbolt: https://godbolt.org/z/5zvxodj64 .)

To make the conversions efficient, I've specialised the relevant functions for their output size: for `bu_longlong` and `lu_longlong`, this only entails checking that the output size is indeed `8`. But `bu_int` and `lu_int` were used for format sizes `2` and `4` - I've split those into two separate functions each.

No tests, because all of the affected cases are already exercised by the test suite.

3 years agogh-90716: Refactor PyLong_FromString to separate concerns (GH-96808)
Oscar Benjamin [Sun, 25 Sep 2022 09:09:50 +0000 (10:09 +0100)] 
gh-90716: Refactor PyLong_FromString to separate concerns (GH-96808)

This is a preliminary PR to refactor `PyLong_FromString` which is currently quite messy and has spaghetti like code that mixes up different concerns as well as duplicating logic.

In particular:

- `PyLong_FromString` now only handles sign, base and prefix detection and calls a new function `long_from_string_base` to parse the main body of the string.
- The `long_from_string_base` function handles all string validation and then calls `long_from_binary_base` or a new function `long_from_non_binary_base` to construct the actual `PyLong`.
- The existing `long_from_binary_base` function is simplified by factoring duplicated logic to `long_from_string_base`.
- The new function `long_from_non_binary_base` factors out much of the code from `PyLong_FromString` including in particular the quadratic algorithm reffered to in gh-95778 so that this can be seen separately from unrelated concerns such as string validation.

3 years agogh-97519: Synchronize links in other copies of HISTORY OF THE SOFTWARE (GH-97520)
Serhiy Storchaka [Sun, 25 Sep 2022 08:25:24 +0000 (11:25 +0300)] 
gh-97519: Synchronize links in other copies of HISTORY OF THE SOFTWARE (GH-97520)

HTTP links in the "HISTORY OF THE SOFTWARE" section of Doc/license.rst
were converted to HTTPS in f62ff97f31a775cc7956adeae32c14e7c85bdc15.
But there were other copies of these links, which were left HTTP links.

3 years agogh-97527: IDLE: protect macosx Tk() call when no GUI (#97530)
Terry Jan Reedy [Sat, 24 Sep 2022 21:38:58 +0000 (17:38 -0400)] 
gh-97527: IDLE: protect macosx Tk() call when no GUI (#97530)

Only call tkinter.tk and its follow-up code in _init_tk_type when requires('gui')
does not raise.  This function can be called as an unintended side-effect of
calling other idlelib code as part of tests on macOS without a GUI enabled.

3 years agogh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)
Serhiy Storchaka [Sat, 24 Sep 2022 11:38:53 +0000 (14:38 +0300)] 
gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)

3 years agogh-94808: Coverage: Test uppercase string literal prefixes (GH-95925)
Michael Droettboom [Sat, 24 Sep 2022 10:43:16 +0000 (06:43 -0400)] 
gh-94808: Coverage: Test uppercase string literal prefixes (GH-95925)

3 years agogh-77171: Fixes SubFormat check to compare the entire value. Add docs (GH-97509)
Steve Dower [Fri, 23 Sep 2022 15:08:21 +0000 (16:08 +0100)] 
gh-77171: Fixes SubFormat check to compare the entire value. Add docs (GH-97509)

3 years agogh-96965: Update Windows release to libffi 3.4.3 (GH-97512)
Steve Dower [Fri, 23 Sep 2022 15:07:53 +0000 (16:07 +0100)] 
gh-96965: Update Windows release to libffi 3.4.3 (GH-97512)

3 years agogh-75608: Add Windows FAQ entry for missing UCRT (GH-92765)
Stanley [Fri, 23 Sep 2022 10:44:01 +0000 (03:44 -0700)] 
gh-75608: Add Windows FAQ entry for missing UCRT (GH-92765)

3 years agogh-96761: Fix build process of the clang compiler for _bootstrap_python (gh-96945)
Dong-hee Na [Fri, 23 Sep 2022 02:00:44 +0000 (11:00 +0900)] 
gh-96761: Fix build process of the clang compiler for _bootstrap_python (gh-96945)

Co-authored-by: Matthias Goergens <matthias.goergens@gmail.com>
3 years agogh-96397: Document that keywords in calls need not be identifiers (#96393)
Jeff Allen [Thu, 22 Sep 2022 18:10:15 +0000 (19:10 +0100)] 
gh-96397: Document that keywords in calls need not be identifiers (#96393)

This represents the official SC stance, see
https://github.com/python/steering-council/issues/142#issuecomment-1252172695

3 years agoGH-85760: Fix race in calling process_exited callback too early (#97009)
Kumar Aditya [Thu, 22 Sep 2022 16:43:47 +0000 (22:13 +0530)] 
GH-85760: Fix race in calling process_exited callback too early (#97009)

3 years agogh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (#93222)
Cyker Way [Thu, 22 Sep 2022 16:34:45 +0000 (12:34 -0400)] 
gh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (#93222)

The main problem was that an unluckily timed task cancellation could cause
the semaphore to be stuck. There were also doubts about strict FIFO ordering
of tasks allowed to pass.

The Semaphore implementation was rewritten to be more similar to Lock.
Many tests for edge cases (including cancellation) were added.

3 years agoGH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97003)
Brandt Bucher [Thu, 22 Sep 2022 16:16:52 +0000 (09:16 -0700)] 
GH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97003)

3 years agoinclude OrderedDict import in TimeBoundedLRU example (GH-96962)
Harry [Thu, 22 Sep 2022 15:58:19 +0000 (16:58 +0100)] 
include OrderedDict import in TimeBoundedLRU example (GH-96962)

3 years agogh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006)
Dong-hee Na [Thu, 22 Sep 2022 12:25:05 +0000 (21:25 +0900)] 
gh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006)

Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
3 years agoDoc: fix link redirect (GH-96606)
partev [Wed, 21 Sep 2022 19:47:46 +0000 (15:47 -0400)] 
Doc: fix link redirect (GH-96606)

"Hyperbolic_function" -> "Hyperbolic_functions"

3 years agogh-81039: Add small example of f-string's "=}" to tutorial (gh-92291)
Stanley [Wed, 21 Sep 2022 12:57:03 +0000 (05:57 -0700)] 
gh-81039: Add small example of f-string's "=}" to tutorial (gh-92291)

3 years agogh-96954: Add tests for unicodedata.name/lookup (#96955)
Batuhan Taskaya [Wed, 21 Sep 2022 12:52:40 +0000 (14:52 +0200)] 
gh-96954: Add tests for unicodedata.name/lookup (#96955)

They were undertested, and since #96954 might involve a
rewrite of this part of the code we want to ensure that
there won't be any behavioral change.

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
3 years agogh-71141: Add note on rejecting "leading-dot" syntax for with statements (#96928) 95567/head
Stanley [Wed, 21 Sep 2022 04:16:39 +0000 (21:16 -0700)] 
gh-71141: Add note on rejecting "leading-dot" syntax for with statements (#96928)

Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
3 years agogh-90808: add more examples to `test_sched.test_priority` (#31144)
Nikita Sobolev [Wed, 21 Sep 2022 01:34:13 +0000 (04:34 +0300)] 
gh-90808: add more examples to `test_sched.test_priority` (#31144)

3 years ago[Enum] fix typos (GH-96285)
wim glenn [Tue, 20 Sep 2022 23:31:05 +0000 (18:31 -0500)] 
[Enum] fix typos (GH-96285)

3 years agogh-95591: [Enum] use `_FlagTests` base class (GH-96475)
Nikita Sobolev [Tue, 20 Sep 2022 23:08:39 +0000 (02:08 +0300)] 
gh-95591: [Enum] use `_FlagTests` base class (GH-96475)

3 years agogh-96947: Fix comment on `pyruntimestate->pyinterpreters` struct for `next_id` (GH...
Виталий Дмитриев [Tue, 20 Sep 2022 19:54:33 +0000 (22:54 +0300)] 
gh-96947: Fix comment on `pyruntimestate->pyinterpreters` struct for `next_id` (GH-96949)

`_next_interp_id` appeared on [this commit](https://github.com/python/cpython/commit/e377416c10eb0bf055b0728cdcdc4488fdfd3b5f#diff-7ac11e526f79b42d6ea9d3592cb99da46775640c69fa5510f4a6de87cced7141R68) renamed to `next_id` ([by this commit](https://github.com/python/cpython/commit/2ebc5ce42a8a9e047e790aefbf9a94811569b2b6#diff-bccfc01bd96b58c022dde77486b8a896cbb31d7581bd4a4156b32c3654afe468R59)).

Also, now, `next_id` gets initialized in` _PyInterpreterState_Enable()` https://github.com/python/cpython/blob/12c5f328d2479ac3432df5e266adc4e59adeabfe/Python/pystate.c#L241-L244 because `_PyInterpreterState_Init()` function doesn't exist at all.

3 years agoGH-95921: Fix positions for some chained comparisons (GH-96968)
Brandt Bucher [Tue, 20 Sep 2022 19:22:24 +0000 (12:22 -0700)] 
GH-95921: Fix positions for some chained comparisons (GH-96968)

3 years agoFix minor comment typo in dictobject.c (GH-96960)
Samuel [Tue, 20 Sep 2022 12:17:40 +0000 (13:17 +0100)] 
Fix minor comment typo in dictobject.c (GH-96960)

Fix a minor comment typo in the Objects/dictobject.c file.

Automerge-Triggered-By: GH:methane
3 years agogh-87092: in compiler, move the detection of exception handlers before the CFG optimi...
Irit Katriel [Tue, 20 Sep 2022 12:14:07 +0000 (13:14 +0100)] 
gh-87092: in compiler, move the detection of exception handlers before the CFG optimization stage (GH-96935)

3 years agogh-96711: Enhance SystemError message upon Invalid opcode (#96712)
serge-sans-paille [Tue, 20 Sep 2022 10:00:34 +0000 (10:00 +0000)] 
gh-96711: Enhance SystemError message upon Invalid opcode (#96712)

Raise verbose SystemError instead of printing debug information
upon Invalid opcode.

Fix #96711

3 years agogh-96727: Document restrictions on Handler.emit() with respect to locking. (GH-96948)
Vinay Sajip [Tue, 20 Sep 2022 08:40:06 +0000 (09:40 +0100)] 
gh-96727: Document restrictions on Handler.emit() with respect to locking. (GH-96948)

3 years agogh-96512: Update int_max_str docs to say 3.11 (#96942)
Gregory P. Smith [Mon, 19 Sep 2022 23:43:11 +0000 (16:43 -0700)] 
gh-96512: Update int_max_str docs to say 3.11 (#96942)

It was unknown if it'd be before 3.11.0 when creating the original
changes.  It's in 3.11rc2, so 3.11 it is.

3 years agogh-95865: Further reduce quote_from_bytes memory consumption (#96860)
Gregory P. Smith [Mon, 19 Sep 2022 23:06:25 +0000 (16:06 -0700)] 
gh-95865: Further reduce quote_from_bytes memory consumption (#96860)

on large input values.  Based on Dennis Sweeney's chunking idea.

3 years agogh-96387: take_gil() resets drop request before exit (#96869)
Victor Stinner [Mon, 19 Sep 2022 22:13:56 +0000 (00:13 +0200)] 
gh-96387: take_gil() resets drop request before exit (#96869)

At Python exit, sometimes a thread holding the GIL can wait forever
for a thread (usually a daemon thread) which requested to drop the
GIL, whereas the thread already exited. To fix the race condition,
the thread which requested the GIL drop now resets its request before
exiting.

take_gil() now calls RESET_GIL_DROP_REQUEST() before
PyThread_exit_thread() if it called SET_GIL_DROP_REQUEST to fix a
race condition with drop_gil().

Issue discovered and analyzed by Mingliang ZHAO.

3 years agoGH-96864: Check for error between line and opcode events (GH-96880)
Brandt Bucher [Mon, 19 Sep 2022 21:02:24 +0000 (14:02 -0700)] 
GH-96864: Check for error between line and opcode events (GH-96880)

3 years agogh-96917: link to typing.readthedocs.io from typing.rst (#96921)
Shantanu [Mon, 19 Sep 2022 19:09:41 +0000 (12:09 -0700)] 
gh-96917: link to typing.readthedocs.io from typing.rst (#96921)

See the discussion at https://github.com/python/cpython/issues/91533

3 years agogh-95913: Copyedit, link & format Typing Features section in 3.11 What's New (GH...
C.A.M. Gerlach [Mon, 19 Sep 2022 13:44:01 +0000 (08:44 -0500)] 
gh-95913: Copyedit, link & format Typing Features section in 3.11 What's New (GH-96097)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agogh-95913: Fix and copyedit New Features section of 3.11 What's New (GH-95915)
C.A.M. Gerlach [Mon, 19 Sep 2022 13:32:51 +0000 (08:32 -0500)] 
gh-95913: Fix and copyedit New Features section of 3.11 What's New (GH-95915)

3 years agogh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915)
Matthias Görgens [Mon, 19 Sep 2022 07:59:13 +0000 (15:59 +0800)] 
gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915)

* gh-96821: Assert for demonstrating undefined behaviour

* Fix UB

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agoGH-96851: Add link to FAQ entry for caching method calls. (GH-96902)
Raymond Hettinger [Sun, 18 Sep 2022 21:36:20 +0000 (16:36 -0500)] 
GH-96851: Add link to FAQ entry for caching method calls. (GH-96902)

3 years agofix various typos in random module's documentation (GH-96912)
partev [Sun, 18 Sep 2022 21:35:22 +0000 (17:35 -0400)] 
fix various typos in random module's documentation (GH-96912)

3 years agogh-94787: [doc] Add to argparse doc an example of a mutually-exclusive group nested...
Scott Main [Sun, 18 Sep 2022 08:05:43 +0000 (01:05 -0700)] 
gh-94787: [doc] Add to argparse doc an example of a mutually-exclusive group nested in an argument group (GH-94807)

3 years agoClarify that the expression is regular math notation, not Python. (#96903)
Raymond Hettinger [Sun, 18 Sep 2022 02:09:39 +0000 (21:09 -0500)] 
Clarify that the expression is regular math notation, not Python. (#96903)

3 years agogh-87179: Fix more IDLE class headers (#96899)
Terry Jan Reedy [Sat, 17 Sep 2022 21:53:23 +0000 (17:53 -0400)] 
gh-87179: Fix more IDLE class headers (#96899)

Remove unneeded '(object)' and '()'.

3 years agoRevert "gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807...
Guido van Rossum [Sat, 17 Sep 2022 21:12:45 +0000 (14:12 -0700)] 
Revert "gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)" (#96898)

This reverts commit 05878106989c6f5b9dd35a6c15a21bee59312827.
Reason: This broke buildbots (some warnings added by that commit are turned to errors in the SSL buildbot).
Repro:  ./python Lib/test/ssltests.py

3 years agogh-91210: Improve error message when non-default param follows default (GH-95933)
Lysandros Nikolaou [Sat, 17 Sep 2022 17:09:28 +0000 (19:09 +0200)] 
gh-91210: Improve error message when non-default param follows default (GH-95933)

- Improve error message when parameter without a default follows one with a default
- Show same error message when positional-only params precede the default/non-default sequence

3 years agoSimplify sieve() recipe. Add edge case tests. (GH-96892)
Raymond Hettinger [Sat, 17 Sep 2022 16:31:04 +0000 (11:31 -0500)] 
Simplify sieve() recipe. Add edge case tests. (GH-96892)

3 years agogh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)
Michel Hidalgo [Sat, 17 Sep 2022 15:07:54 +0000 (12:07 -0300)] 
gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)

Warn on loop initialization, when setting the wakeup fd disturbs a previously set wakeup fd, and on loop closing, when upon resetting the wakeup fd, we find it has been changed by someone else.

3 years agogh-96861: Check for unset sys.executable during venv creation. (GH-96887)
Vinay Sajip [Sat, 17 Sep 2022 11:58:31 +0000 (14:58 +0300)] 
gh-96861: Check for unset sys.executable during venv creation. (GH-96887)

3 years agogh-96883: browser: include concurrent.futures (GH-96886)
Christian Heimes [Sat, 17 Sep 2022 11:23:39 +0000 (13:23 +0200)] 
gh-96883: browser: include concurrent.futures (GH-96886)

3 years agofixes gh-96841: replace Mercurial with VCS (#96879)
Benjamin Peterson [Fri, 16 Sep 2022 18:26:02 +0000 (11:26 -0700)] 
fixes gh-96841: replace Mercurial with VCS (#96879)

3 years agogh-95778: Mention sys.set_int_max_str_digits() in error message (#96874)
Victor Stinner [Fri, 16 Sep 2022 18:04:37 +0000 (20:04 +0200)] 
gh-95778: Mention sys.set_int_max_str_digits() in error message (#96874)

When ValueError is raised if an integer is larger than the limit,
mention sys.set_int_max_str_digits() in the error message.

3 years agogh-96052: codeop: fix handling compiler warnings in incomplete input (GH-96132)
Serhiy Storchaka [Fri, 16 Sep 2022 14:37:30 +0000 (17:37 +0300)] 
gh-96052: codeop: fix handling compiler warnings in incomplete input (GH-96132)

Previously codeop.compile_command() emitted compiler warnings (SyntaxWarning or
DeprecationWarning) and raised a SyntaxError for incomplete input containing
a potentially incorrect code. Now it always returns None for incomplete input
without emitting any warnings.

3 years agogh-89536: Use ThinLTO policy if possible (gh-96766)
Dong-hee Na [Fri, 16 Sep 2022 10:40:05 +0000 (19:40 +0900)] 
gh-89536: Use ThinLTO policy if possible (gh-96766)

3 years agogh-96810: Clarify for which statements sqlite3 implicitly opens transactions (#96832)
Erlend E. Aasland [Thu, 15 Sep 2022 21:11:52 +0000 (23:11 +0200)] 
gh-96810: Clarify for which statements sqlite3 implicitly opens transactions (#96832)

3 years agoFix ResourceWarning in test.test_frame (GH-96831)
Dennis Sweeney [Thu, 15 Sep 2022 17:31:45 +0000 (13:31 -0400)] 
Fix ResourceWarning in test.test_frame (GH-96831)

3 years agoGH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)
adphrost [Thu, 15 Sep 2022 15:42:37 +0000 (08:42 -0700)] 
GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)

Co-authored-by: Andrew Frost <adfrost@fb.com>
Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
3 years agogh-96751: Remove dead code from `CALL_FUNCTION_EX` opcode (GH-96752)
Nikita Sobolev [Thu, 15 Sep 2022 09:33:13 +0000 (12:33 +0300)] 
gh-96751: Remove dead code from `CALL_FUNCTION_EX` opcode (GH-96752)

3 years agoFix type annotation of `pstats.FunctionProfile.ncalls` (#96741)
Ruan Comelli [Thu, 15 Sep 2022 01:33:43 +0000 (22:33 -0300)] 
Fix type annotation of `pstats.FunctionProfile.ncalls` (#96741)

* fix: annotate `pstats.FunctionProfile.ncalls` as `str`

This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type.

3 years agoGH-90997: Improve inline cache performance for MSVC (GH-96781)
Brandt Bucher [Thu, 15 Sep 2022 00:05:04 +0000 (17:05 -0700)] 
GH-90997: Improve inline cache performance for MSVC (GH-96781)

3 years agoRevert accidental removal from 3.12 doc. (gh-96826)
Benjamin Peterson [Wed, 14 Sep 2022 14:59:23 +0000 (07:59 -0700)] 
Revert accidental removal from 3.12 doc. (gh-96826)

3 years agogh-77171 Support WAVE_FORMAT_EXTENSIBLE in the wave module (GH-96777)
Yusuke Kadowaki [Wed, 14 Sep 2022 13:34:40 +0000 (22:34 +0900)] 
gh-77171 Support WAVE_FORMAT_EXTENSIBLE in the wave module (GH-96777)

The test file, a modified version of Lib/test/audiodata/pluck-pcm24.wav, was provided by Andrea Celletti on the bug tracker.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
3 years agoceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
Kevin Modzelewski [Wed, 14 Sep 2022 03:44:32 +0000 (23:44 -0400)] 
ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)

3 years agogh-96784: Cover more typing special forms in `get_args()` (#96791)
Nikita Sobolev [Wed, 14 Sep 2022 02:35:52 +0000 (05:35 +0300)] 
gh-96784: Cover more typing special forms in `get_args()` (#96791)

3 years agogh-96769: Cover more typing special forms to be unsubclassable (#96772)
Nikita Sobolev [Wed, 14 Sep 2022 02:35:16 +0000 (05:35 +0300)] 
gh-96769: Cover more typing special forms to be unsubclassable (#96772)