]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-95112: Fix What's New 3.11 contribution note periods (#95115)
Terry Jan Reedy [Fri, 22 Jul 2022 00:35:56 +0000 (20:35 -0400)] 
gh-95112: Fix What's New 3.11 contribution note periods (#95115)

Some are missing, a few placed after the ')'.

3 years agogh-95112: Fix What's New 3.10 contribution note periods (#95114)
Terry Jan Reedy [Fri, 22 Jul 2022 00:00:52 +0000 (20:00 -0400)] 
gh-95112: Fix What's New 3.10 contribution note periods (#95114)

Some are missing, a few placed after the ')'.
One ') was missing.

3 years agogh-95105: Return Iterator from wsgiref.types.InputStream.__iter__ (#95106)
Shantanu [Thu, 21 Jul 2022 20:26:04 +0000 (13:26 -0700)] 
gh-95105: Return Iterator from wsgiref.types.InputStream.__iter__ (#95106)

3 years agogh-95095: Use SSL_CTX_get_max_proto_version instead of SSL_CTX_ctrl (GH-95096)
David Benjamin [Thu, 21 Jul 2022 18:44:30 +0000 (11:44 -0700)] 
gh-95095: Use SSL_CTX_get_max_proto_version instead of SSL_CTX_ctrl (GH-95096)

The wrapper macros are more readable and match the form recommended in
the OpenSSL documentation. They also slightly less error-prone, as the
mapping of arguments to SSL_CTX_ctrl is not always clear. (Though in
this case it's straightforward.)
https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_get_max_proto_version.html

3 years agoFix PyCode_Addr2Location when addrq < 0 (GH-95091)
Ken Jin [Thu, 21 Jul 2022 13:49:49 +0000 (21:49 +0800)] 
Fix PyCode_Addr2Location when addrq < 0 (GH-95091)

3 years agogh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fails_with_inactive_...
Thomas Grainger [Thu, 21 Jul 2022 11:35:20 +0000 (12:35 +0100)] 
gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fails_with_inactive_watcher (GH-95009)

The test was never run, because it was missing the TestCase class.
The test failed because the wrong attribute was patched.

3 years agoGH-95029: Describe Windows Store package isolation and redirection in more detail...
Anthony Shaw [Thu, 21 Jul 2022 00:01:23 +0000 (01:01 +0100)] 
GH-95029: Describe Windows Store package isolation and redirection in more detail (GH-95030)

3 years agodocs: use 'recursively' in the description of rglob, and mention globs in the os...
Ned Batchelder [Wed, 20 Jul 2022 21:47:43 +0000 (14:47 -0700)] 
docs: use 'recursively' in the description of rglob, and mention globs in the os equivalences (GH-94954)

The r in `rglob` stands for "recursively", so use the word in the description. Also, glob and rglob can usefully be mentioned as the pathlib equivalent of os.walk.

Automerge-Triggered-By: GH:brettcannon
3 years agogh-82116: add comment explaining use of `list(scandir_it)` in pathlib. (GH-94939)
Barney Gale [Wed, 20 Jul 2022 21:34:13 +0000 (22:34 +0100)] 
gh-82116: add comment explaining use of `list(scandir_it)` in pathlib. (GH-94939)

Automerge-Triggered-By: GH:brettcannon
3 years agoGH-91409: Don't overwrite valid locations with NOP locations (GH-95067)
Brandt Bucher [Wed, 20 Jul 2022 21:27:31 +0000 (14:27 -0700)] 
GH-91409: Don't overwrite valid locations with NOP locations (GH-95067)

3 years agogh-91102: Port 8-argument _warnings.warn_explicit to Argument Clinic (#92891)
Oleg Iarygin [Wed, 20 Jul 2022 20:24:51 +0000 (23:24 +0300)] 
gh-91102: Port 8-argument _warnings.warn_explicit to Argument Clinic (#92891)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
3 years agogh-90016: Deprecate default sqlite3 adapters and converters (#94276)
Erlend Egeberg Aasland [Wed, 20 Jul 2022 19:37:59 +0000 (21:37 +0200)] 
gh-90016: Deprecate default sqlite3 adapters and converters (#94276)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agoGH-94382: port multiprocessing static types to heap types (#94336)
Kumar Aditya [Wed, 20 Jul 2022 19:26:01 +0000 (00:56 +0530)] 
GH-94382: port multiprocessing static types to heap types (#94336)

3 years agogh-54781: Move NEWS item to Tests, and improve wording (#95063)
Erlend Egeberg Aasland [Wed, 20 Jul 2022 19:23:59 +0000 (21:23 +0200)] 
gh-54781: Move NEWS item to Tests, and improve wording (#95063)

3 years agogh-94998: Remove redundant condition in test_sqlite3/__main__.py (#95052)
Erlend Egeberg Aasland [Wed, 20 Jul 2022 16:07:47 +0000 (18:07 +0200)] 
gh-94998: Remove redundant condition in test_sqlite3/__main__.py (#95052)

3 years agogh-94844: Add pathlib support to shutil archive management (GH-94846)
Oleg Iarygin [Wed, 20 Jul 2022 15:55:12 +0000 (18:55 +0300)] 
gh-94844: Add pathlib support to shutil archive management (GH-94846)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
3 years agoGH-94851: fix immortal objects refcounting in compiler (gh-95040)
Kumar Aditya [Wed, 20 Jul 2022 09:53:27 +0000 (15:23 +0530)] 
GH-94851: fix immortal objects refcounting in compiler (gh-95040)

3 years agogh-90654: Remove unneeded blank line (#95044)
Terry Jan Reedy [Wed, 20 Jul 2022 09:38:56 +0000 (05:38 -0400)] 
gh-90654: Remove unneeded blank line (#95044)

3 years agogh-90654: Add item missing from idlelib/NEWS.txt (#95038)
Terry Jan Reedy [Wed, 20 Jul 2022 07:18:10 +0000 (03:18 -0400)] 
gh-90654: Add item missing from idlelib/NEWS.txt (#95038)

3 years agogh-93939: Use new MODULE_name_STATE in wasm_assets script (GH-95035)
Christian Heimes [Wed, 20 Jul 2022 06:53:26 +0000 (08:53 +0200)] 
gh-93939: Use new MODULE_name_STATE in wasm_assets script (GH-95035)

3 years agoGH-90699: fix ref counting of static immortal strings (gh-94850)
Kumar Aditya [Wed, 20 Jul 2022 06:23:30 +0000 (11:53 +0530)] 
GH-90699: fix ref counting of static immortal strings (gh-94850)

3 years agoRemove blurb boilerplate from news item (#95033)
Terry Jan Reedy [Wed, 20 Jul 2022 05:48:35 +0000 (01:48 -0400)] 
Remove blurb boilerplate from news item (#95033)

3 years agogh-95007: Remove the NoneType return converter (GH-95019)
Serhiy Storchaka [Wed, 20 Jul 2022 05:42:02 +0000 (08:42 +0300)] 
gh-95007: Remove the NoneType return converter (GH-95019)

It has confusing semantic which does not provide any benefit (the
only difference is that you should write "return Py_None" instead
of "Py_RETURN_NONE"), it is not currently used, and it is broken.

3 years agogh-93370: Don't print deprecated pysqlite version in test_sqlite3 (#95017)
Erlend Egeberg Aasland [Tue, 19 Jul 2022 21:04:20 +0000 (23:04 +0200)] 
gh-93370: Don't print deprecated pysqlite version in test_sqlite3 (#95017)

3 years agogh-91256: Ensure help text has the program name even before getpath is called (GH...
Steve Dower [Tue, 19 Jul 2022 18:39:11 +0000 (19:39 +0100)] 
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)

3 years agogh-93678: move normalize_basic_block and extend_block call into optimize_cfg (GH...
Irit Katriel [Tue, 19 Jul 2022 16:48:56 +0000 (17:48 +0100)] 
gh-93678: move normalize_basic_block and extend_block call into optimize_cfg (GH-95002)

3 years agoGH-91153: Handle mutating __index__ methods in bytearray item assignment (GH-94891)
Brandt Bucher [Tue, 19 Jul 2022 16:42:40 +0000 (09:42 -0700)] 
GH-91153: Handle mutating __index__ methods in bytearray item assignment (GH-94891)

3 years agoGH-94979: Pop the exception stack when jumping out of exception handlers. (#95003)
Mark Shannon [Tue, 19 Jul 2022 15:33:18 +0000 (16:33 +0100)] 
GH-94979: Pop the exception stack when jumping out of exception handlers. (#95003)

3 years agotest_concurrent_futures: Fix unneeded/confusing format call (#93119)
Florian Bruhin [Tue, 19 Jul 2022 02:12:40 +0000 (19:12 -0700)] 
test_concurrent_futures: Fix unneeded/confusing format call (#93119)

Added in 339fd46cb764277cbbdc3e78dcc5b45b156bb6ae - but as noted in a comment, the test only tests ThreadPoolExecutor.

3 years agogh-94673: [c-analyzer] Add a Script to Identify Static Types (#94989)
Eric Snow [Tue, 19 Jul 2022 01:03:57 +0000 (19:03 -0600)] 
gh-94673: [c-analyzer] Add a Script to Identify Static Types (#94989)

issue: https://github.com/python/cpython/issues/94673

3 years agogh-94949: Disallow parsing parenthesised ctx mgr with old feature_version (#94950)
Shantanu [Mon, 18 Jul 2022 21:10:49 +0000 (14:10 -0700)] 
gh-94949: Disallow parsing parenthesised ctx mgr with old feature_version (#94950)

* gh-94949: Disallow parsing parenthesised ctx manager with old feature_version

* 📜🤖 Added by blurb_it.

* Allow it with feature_version=(3, 9) as well

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agoRevert "gh-93910: [Enum] restore member.member restriction while keeping performance...
Ethan Furman [Mon, 18 Jul 2022 20:22:52 +0000 (13:22 -0700)] 
Revert "gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)" (#94985)

This reverts commit c20186c3972ff38577c4c5e32ca86748210983d2.

3 years agoRevert "gh-94816: Improve coverage of decode_linetable (GH-94853)" (GH-94982)
Michael Droettboom [Mon, 18 Jul 2022 20:08:31 +0000 (16:08 -0400)] 
Revert "gh-94816: Improve coverage of decode_linetable (GH-94853)" (GH-94982)

This reverts commit 20b9d2a658059c8c1624400f60bb6ba19a31ee9b.

3 years agoFix documentation to include possible Exception (#94818)
Guy Yagev [Mon, 18 Jul 2022 19:31:17 +0000 (22:31 +0300)] 
Fix documentation to include possible Exception (#94818)

3 years agoFix incorrect double indent in ast doc (#94976)
Terry Jan Reedy [Mon, 18 Jul 2022 17:24:18 +0000 (13:24 -0400)] 
Fix incorrect double indent in ast doc (#94976)

Warning directive indent was 4 rather than 3 spaces.

3 years agoGH-94822: Don't specialize when metaclasses are involved (GH-94892)
Brandt Bucher [Mon, 18 Jul 2022 17:10:22 +0000 (10:10 -0700)] 
GH-94822: Don't specialize when metaclasses are involved (GH-94892)

3 years agoRemove out of date reference to YIELD_FROM from docs. (#94966)
Mark Shannon [Mon, 18 Jul 2022 17:04:07 +0000 (18:04 +0100)] 
Remove out of date reference to YIELD_FROM from docs. (#94966)

3 years agoIn ast doc, update 'below' to 'above' (#94967)
Terry Jan Reedy [Mon, 18 Jul 2022 16:38:52 +0000 (12:38 -0400)] 
In ast doc, update 'below' to 'above' (#94967)

The included asdl file was moved from 'below' to 'above' in 3.9.

3 years agoGH-94893: Ignore caches when adding LOAD_FAST_CHECKs (GH-94894)
Brandt Bucher [Mon, 18 Jul 2022 16:00:41 +0000 (09:00 -0700)] 
GH-94893: Ignore caches when adding LOAD_FAST_CHECKs (GH-94894)

3 years agogh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)
Serhiy Storchaka [Mon, 18 Jul 2022 15:07:31 +0000 (18:07 +0300)] 
gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)

3 years agoGH-94739: Mark stacks of exception handling blocks for setting frame.f_lineno in...
Mark Shannon [Mon, 18 Jul 2022 15:06:42 +0000 (16:06 +0100)] 
GH-94739: Mark stacks of exception handling blocks for setting frame.f_lineno in the debugger. (GH-94958)

3 years agoGH-94857: fix test_io refleak (GH-94858)
Kumar Aditya [Mon, 18 Jul 2022 13:48:04 +0000 (19:18 +0530)] 
GH-94857: fix test_io refleak (GH-94858)

3 years agogh-94947: Disallow parsing walrus with feature_version < (3, 8) (#94948)
Shantanu [Mon, 18 Jul 2022 09:20:12 +0000 (02:20 -0700)] 
gh-94947: Disallow parsing walrus with feature_version < (3, 8) (#94948)

* gh-94947: Disallow parsing walrus with feature_version < (3, 8)

* oops, commit the parser

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agogh-94847: Don't force inlining in debug builds of libmpdec (GH-94848)
Christian Heimes [Mon, 18 Jul 2022 06:47:03 +0000 (08:47 +0200)] 
gh-94847: Don't force inlining in debug builds of libmpdec (GH-94848)

3 years agogh-94601: [Enum] fix inheritance for __str__ and friends (GH-94942)
Ethan Furman [Mon, 18 Jul 2022 01:51:04 +0000 (18:51 -0700)] 
gh-94601: [Enum] fix inheritance for __str__ and friends (GH-94942)

3 years agogh-72889: Remove redundant mock.Mock()._is_coroutine = False workarounds (#94926)
Thomas Grainger [Sun, 17 Jul 2022 17:21:58 +0000 (18:21 +0100)] 
gh-72889: Remove redundant mock.Mock()._is_coroutine = False workarounds (#94926)

3 years agogh-91348: Restore frame argument to sys._getframe audit event (GH-94928)
Steve Dower [Sun, 17 Jul 2022 15:11:24 +0000 (16:11 +0100)] 
gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)

3 years agogh-92348: Add quotes to support building on Windows with spaces in directory name...
Steve Dower [Sun, 17 Jul 2022 14:20:24 +0000 (15:20 +0100)] 
gh-92348: Add quotes to support building on Windows with spaces in directory name (GH-94925)

3 years agogh-91181: Add a What's New entry for dropping bytes support for `sys.path` (GH-94918)
Brett Cannon [Sun, 17 Jul 2022 02:14:40 +0000 (19:14 -0700)] 
gh-91181: Add a What's New entry for dropping bytes support for `sys.path` (GH-94918)

3 years agogh-93910: [Enum] restore member.member restriction while keeping performance boost...
Ethan Furman [Sun, 17 Jul 2022 01:13:57 +0000 (18:13 -0700)] 
gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)

3 years agogh-91181: drop support for bytes on sys.path (GH-31934)
Thomas Grainger [Sun, 17 Jul 2022 01:07:53 +0000 (02:07 +0100)] 
gh-91181: drop support for bytes on sys.path (GH-31934)

Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it.

Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
3 years agogh-94869: Fix the location in some expressions for multi-line f-string ast nodes...
Pablo Galindo Salgado [Sat, 16 Jul 2022 18:51:53 +0000 (19:51 +0100)] 
gh-94869: Fix the location in some expressions for multi-line f-string ast nodes (#94895)

3 years agogh-90844: Allow virtual environments to correctly launch when they have spaces in...
Steve Dower [Sat, 16 Jul 2022 16:38:36 +0000 (17:38 +0100)] 
gh-90844: Allow virtual environments to correctly launch when they have spaces in the path (GH-94903)

3 years agogh-94698: add Subscript and Attribute targets to ast.for documentation (GH-94901)
anilbey [Sat, 16 Jul 2022 11:26:43 +0000 (12:26 +0100)] 
gh-94698: add Subscript and Attribute targets to ast.for documentation (GH-94901)

### Summary

Add Attribute and Subscript as possible targets for the "ast for loop documentation".

Automerge-Triggered-By: GH:isidentical
3 years agogh-94772: Fix off-by-one error in Windows launcher (GH-94779)
Paul Moore [Sat, 16 Jul 2022 09:02:22 +0000 (10:02 +0100)] 
gh-94772: Fix off-by-one error in Windows launcher (GH-94779)

3 years ago[3.11] bpo-14916: interactive fd is not tied to stdin [type-bug] (#91469)
Paul m. p. Peny [Sat, 16 Jul 2022 08:35:19 +0000 (10:35 +0200)] 
[3.11] bpo-14916: interactive fd is not tied to stdin [type-bug] (#91469)

* bpo-14916: interactive fd is not always stdin

related to https://github.com/python/cpython/pull/31006 merged bugfix

following https://bugs.python.org/issue14916

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agoTutorial sys.argv example should not have interactive prompt (GH-94880)
Marco Buttu [Sat, 16 Jul 2022 02:10:19 +0000 (04:10 +0200)] 
Tutorial sys.argv example should not have interactive prompt (GH-94880)

3 years agoAdd additional pointers to pathlib's mapping to os.path functions (#94828)
Chris Adams [Fri, 15 Jul 2022 22:09:27 +0000 (18:09 -0400)] 
Add additional pointers to pathlib's mapping to os.path functions (#94828)

* Add additional pointers to pathlib's mapping to os.path functions

os.path.splitext has a somewhat quirky signature since it mixes the path and filename components but I wanted the documentation to mention `PurePath.stem` as the natural counterpart to `PurePath.suffix` for the common use of `os.path.splitext` to turn "file.py" into "file" and "py".

Technically this could have some discussion of how to handle the parent directory hierarchy but that seems a bit out of keeping with the spirit of this table so I omitted mentioning `PurePath.parents` here.

* Update Doc/library/pathlib.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-94814: Improve coverage of _PyCode_CreateLineArray (GH-94852)
Michael Droettboom [Fri, 15 Jul 2022 17:00:27 +0000 (13:00 -0400)] 
gh-94814: Improve coverage of _PyCode_CreateLineArray (GH-94852)

The case where there are more than (1 << 15) lines was not covered.

I don't know if increasing test coverage requires a blurb -- let me know if it does.

Automerge-Triggered-By: GH:brandtbucher
3 years agogh-94801: Use custom flags to check for headers and libs (#94802)
Christian Heimes [Fri, 15 Jul 2022 12:48:01 +0000 (14:48 +0200)] 
gh-94801: Use custom flags to check for headers and libs (#94802)

3 years agogh-94821: Fix autobind of empty unix domain address (GH-94826)
Nir Soffer [Fri, 15 Jul 2022 06:13:33 +0000 (09:13 +0300)] 
gh-94821: Fix autobind of empty unix domain address (GH-94826)

When binding a unix socket to an empty address on Linux, the socket is
automatically bound to an available address in the abstract namespace.

    >>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    >>> s.bind("")
    >>> s.getsockname()
    b'\x0075499'

Since python 3.9, the socket is bound to the one address:

    >>> s.getsockname()
    b'\x00'

And trying to bind multiple sockets will fail with:

    Traceback (most recent call last):
      File "/home/nsoffer/src/cpython/Lib/test/test_socket.py", line 5553, in testAutobind
        s2.bind("")
    OSError: [Errno 98] Address already in use

Added 2 tests:
- Auto binding empty address on Linux
- Failing to bind an empty address on other platforms

Fixes f6b3a07b7df6 (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)

3 years ago[doc] Update cookbook example and add information about queue types. (GH-94854)
Vinay Sajip [Fri, 15 Jul 2022 05:03:58 +0000 (06:03 +0100)] 
[doc] Update cookbook example and add information about queue types. (GH-94854)

3 years agoGH-46771: docs for asyncio.timeout and task cancellation (#94794)
Tin Tvrtković [Fri, 15 Jul 2022 02:38:38 +0000 (04:38 +0200)] 
GH-46771: docs for asyncio.timeout and task cancellation (#94794)

3 years agogh-94808: Add coverage for boolobject.c:bool_new (GH-94859)
Michael Droettboom [Thu, 14 Jul 2022 23:53:06 +0000 (19:53 -0400)] 
gh-94808: Add coverage for boolobject.c:bool_new (GH-94859)

`bool_new` had no coverage.

Automerge-Triggered-By: GH:brandtbucher
3 years agoDocs: fix typo in sqlite3.rst (#94798)
Ikko Ashimine [Thu, 14 Jul 2022 21:47:46 +0000 (06:47 +0900)] 
Docs: fix typo in sqlite3.rst (#94798)

Colum -> Column

3 years agoGH-94808: Cover handling non-finite numbers from round when ndigits is provided ...
Michael Droettboom [Thu, 14 Jul 2022 21:46:40 +0000 (17:46 -0400)] 
GH-94808: Cover handling non-finite numbers from round when ndigits is provided (GH-94860)

3 years agogh-94816: Improve coverage of decode_linetable (GH-94853)
Michael Droettboom [Thu, 14 Jul 2022 21:34:50 +0000 (17:34 -0400)] 
gh-94816: Improve coverage of decode_linetable (GH-94853)

This makes calls to co_lnotab to exercise this code, as well
as generating synthetically large code to exercise the corner
cases where line numbers need multiple bytes.

Automerge-Triggered-By: GH:brandtbucher
3 years agogh-94841: Ensure arena_map_get() is inlined in PyObject_Free() (#94842)
neonene [Thu, 14 Jul 2022 18:33:25 +0000 (03:33 +0900)] 
gh-94841: Ensure arena_map_get() is inlined in PyObject_Free() (#94842)

3 years agogh-94731: Revert to C-style casts for _Py_CAST (GH-94782)
Petr Viktorin [Thu, 14 Jul 2022 09:57:18 +0000 (11:57 +0200)] 
gh-94731: Revert to C-style casts for _Py_CAST (GH-94782)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
3 years agogh-93939: Build C extensions without setup.py (GH-94474)
Christian Heimes [Thu, 14 Jul 2022 07:51:49 +0000 (09:51 +0200)] 
gh-93939: Build C extensions without setup.py (GH-94474)

Combines GH-93940, GH-94452, and GH-94433

3 years agogh-94309: Add typing.Hashable and typing.Sized for "What's New for Python 3.12" ...
MonadChains [Thu, 14 Jul 2022 06:50:31 +0000 (08:50 +0200)] 
gh-94309: Add typing.Hashable and typing.Sized for "What's New for Python 3.12" (GH-94729)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agoidlelib: replace 'while 1' with 'while True' (#94827)
Terry Jan Reedy [Thu, 14 Jul 2022 01:09:07 +0000 (21:09 -0400)] 
idlelib: replace 'while 1' with 'while True' (#94827)

3 years agogh-90359: Unify documentation style for datetime.rst (gh-94836)
Dong-hee Na [Thu, 14 Jul 2022 00:40:10 +0000 (09:40 +0900)] 
gh-90359: Unify documentation style for datetime.rst (gh-94836)

3 years agogh-90359: Update documentation to follow PEP 495. (gh-94800)
Dong-hee Na [Thu, 14 Jul 2022 00:04:52 +0000 (09:04 +0900)] 
gh-90359: Update documentation to follow PEP 495. (gh-94800)

3 years agogh-94499 Add test for private name mangling in class pattern matching (#94500)
da-woods [Wed, 13 Jul 2022 16:13:10 +0000 (17:13 +0100)] 
gh-94499 Add test for private name mangling in class pattern matching (#94500)

The current status quo is that private attribute names are not
mangled when a class is matched. I've added a test to
document/legimize this behaviour.

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
3 years agogh-90815: Fix test_embed for Windows PGO build with mimalloc (GH-94790)
neonene [Wed, 13 Jul 2022 16:08:12 +0000 (01:08 +0900)] 
gh-90815: Fix test_embed for Windows PGO build with mimalloc (GH-94790)

Fixes the failure of PGO building with `mimalloc` on Windows, ensuring that `test_bpo20891` does not break profiling data (`python31*.pgc`).

3 years agoGH-81620: Add random.binomialvariate() (GH-94719)
Raymond Hettinger [Wed, 13 Jul 2022 14:46:04 +0000 (09:46 -0500)] 
GH-81620: Add random.binomialvariate() (GH-94719)

3 years agogh-94759: Create LCOV report with branch coverage (GH-94793)
Christian Heimes [Wed, 13 Jul 2022 14:35:28 +0000 (16:35 +0200)] 
gh-94759: Create LCOV report with branch coverage (GH-94793)

3 years agogh-93649: Fix linkage of _PyTestCapi_Init_Vectorcall (#94702)
Oleg Iarygin [Wed, 13 Jul 2022 11:22:45 +0000 (14:22 +0300)] 
gh-93649: Fix linkage of _PyTestCapi_Init_Vectorcall (#94702)

3 years agogh-94713 - Replacing while 1 with while True (#94714)
Itay [Wed, 13 Jul 2022 03:53:14 +0000 (06:53 +0300)] 
gh-94713 - Replacing while 1 with while True (#94714)

3 years agoFix typo in _exact_ratio comment. (GH-94789)
Benjamin Peterson [Tue, 12 Jul 2022 21:34:23 +0000 (14:34 -0700)] 
Fix typo in _exact_ratio comment. (GH-94789)

3 years agoFix heading levels for "Deprecated" section in What's New for 3.12 (GH-94762)
Pradyun Gedam [Tue, 12 Jul 2022 19:55:32 +0000 (20:55 +0100)] 
Fix heading levels for "Deprecated" section in What's New for 3.12 (GH-94762)

These headings were at the same level as the "Deprecated" heading, but
likely intended to be a subheading within that section.

Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
3 years agodocs: typing.Self, fix typo (GH-94771)
Max Zhenzhera [Tue, 12 Jul 2022 17:45:52 +0000 (20:45 +0300)] 
docs: typing.Self, fix typo (GH-94771)

* fix typo - double spelled word 'use'

* change methods names to the infinitive form

3 years agogh-94773: deepfreeze: support frozensets with unsortable types (GH-94775)
Christian Heimes [Tue, 12 Jul 2022 16:09:47 +0000 (18:09 +0200)] 
gh-94773: deepfreeze: support frozensets with unsortable types (GH-94775)

3 years agogh-94751: Install, import and run the test C++ extension (MVP) (GH-94754)
Petr Viktorin [Tue, 12 Jul 2022 15:06:05 +0000 (17:06 +0200)] 
gh-94751: Install, import and run the test C++ extension (MVP) (GH-94754)

This is a quick-and-dirty way to run the C++ tests.
It can definitely be improved in the future, but it should fail when things go wrong.

- Run test functions on import (yes, this can definitely be improved)
- Fudge setuptools metadata (name & version) to make the extension installable
- Install and import the extension in test_cppext

3 years agoGH-94736: mark SemLock test as linux only (GH-94750)
Kumar Aditya [Mon, 11 Jul 2022 14:35:47 +0000 (20:05 +0530)] 
GH-94736: mark SemLock test as linux only (GH-94750)

See https://buildbot.python.org/all/#/builders/172/builds/2522
The PR skips the test on non-linux platforms.

Automerge-Triggered-By: GH:pablogsal
3 years agobpo-45924: Fix asyncio incorrect traceback when future's exception is raised multiple...
Kumar Aditya [Mon, 11 Jul 2022 12:32:11 +0000 (18:02 +0530)] 
bpo-45924: Fix asyncio incorrect traceback when future's exception is raised multiple times (GH-30274)

3 years agoGH-94736: Fix _multiprocessing.SemLock subclassing (#94738)
Kumar Aditya [Mon, 11 Jul 2022 12:12:36 +0000 (17:42 +0530)] 
GH-94736: Fix _multiprocessing.SemLock subclassing (#94738)

* fix allocator and deallocator

* 📜🤖 Added by blurb_it.

* code review

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agogh-93883: Fix some tests involving traceback formatting (#94737)
John Belmonte [Mon, 11 Jul 2022 09:22:41 +0000 (18:22 +0900)] 
gh-93883: Fix some tests involving traceback formatting (#94737)

PR #93994 was merged without being rebased in a few weeks, and
some new test code using the old scheme passed through automatic merge.

3 years agogh-87822: Make traceback module robust to exceptions from repr() of local values...
Simon-Martin Schröder [Mon, 11 Jul 2022 09:14:15 +0000 (11:14 +0200)] 
gh-87822: Make traceback module robust to exceptions from repr() of local values (GH-94691)

3 years agogh-93883: elide traceback indicators when possible (#93994)
John Belmonte [Mon, 11 Jul 2022 06:40:53 +0000 (15:40 +0900)] 
gh-93883: elide traceback indicators when possible (#93994)

* gh-93883: elide traceback indicators when possible

Elide traceback column indicators when the entire line of the
frame is implicated.  This reduces traceback length and draws
even more attention to the remaining (very relevant) indicators.

Example:
```
Traceback (most recent call last):
  File "query.py", line 99, in <module>
    bar()
  File "query.py", line 66, in bar
    foo()
  File "query.py", line 37, in foo
    magic_arithmetic('foo')
  File "query.py", line 18, in magic_arithmetic
    return add_counts(x) / 25
           ^^^^^^^^^^^^^
  File "query.py", line 24, in add_counts
    return 25 + query_user(user1) + query_user(user2)
                ^^^^^^^^^^^^^^^^^
  File "query.py", line 32, in query_user
    return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)
                               ~~~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
```

Rather than going out of our way to provide indicator coverage
in every traceback test suite, the indicator test suite should
be responible for sufficient coverage (e.g. by adding a basic
exception group test to ensure that margin strings are covered).

3 years agoSmall speed-up for NormalDist.samples (GH-94730)
Raymond Hettinger [Mon, 11 Jul 2022 03:34:53 +0000 (22:34 -0500)] 
Small speed-up for NormalDist.samples (GH-94730)

3 years agogh-94309: Deprecate typing.Hashable/Sized (GH-94626)
MonadChains [Sun, 10 Jul 2022 18:04:01 +0000 (20:04 +0200)] 
gh-94309: Deprecate typing.Hashable/Sized (GH-94626)

Deprecate typing.Hashable/Sized. Use the collections.abc counterparts directly instead.

To be consistent with PEP 585, deprecated aliases will not raise any DeprecationWarning.

3 years agoGH-77265: Document NaN handling in statistics functions that sort or count (#94676)
Raymond Hettinger [Sun, 10 Jul 2022 07:40:27 +0000 (02:40 -0500)] 
GH-77265: Document NaN handling in statistics functions that sort or count (#94676)

* Document NaN handling in functions that sort or count

* Update Doc/library/statistics.rst

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* Update Doc/library/statistics.rst

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* Fix trailing whitespace and rewrap text

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
3 years agoGH-94694: Fix column offsets for multi-line method lookups (GH-94697)
Brandt Bucher [Sun, 10 Jul 2022 00:22:23 +0000 (17:22 -0700)] 
GH-94694: Fix column offsets for multi-line method lookups (GH-94697)

3 years agoImprove dataclass docstring (gh-94686)
Tom Fryers [Sat, 9 Jul 2022 18:26:24 +0000 (19:26 +0100)] 
Improve dataclass docstring (gh-94686)

3 years agogh-94637: Release GIL in SSLContext.set_default_verify_paths (GH-94658)
Christian Heimes [Sat, 9 Jul 2022 16:11:15 +0000 (18:11 +0200)] 
gh-94637: Release GIL in SSLContext.set_default_verify_paths (GH-94658)

3 years agopycore_interp.h: Fix comment about pytypedefs.h (#93188)
Itamar Ostricher [Sat, 9 Jul 2022 13:58:30 +0000 (06:58 -0700)] 
pycore_interp.h: Fix comment about pytypedefs.h (#93188)

GH-31527 moved this typedef to `Include/pytypedefs.h`, so this comment
should point at the correct location

3 years agogh-93649: Fix dependencies of _testcapi (#94695)
Christian Heimes [Sat, 9 Jul 2022 11:01:23 +0000 (13:01 +0200)] 
gh-93649: Fix dependencies of _testcapi (#94695)

- header files are located in $(srcdir)
- dependencies must not list C files that are also in a makesetup Setup file
- generate SRCDIRS for OOT builds

3 years agogh-94700: Rewrite the logging.Formatter API ref in structured form (GH-94701)
CAM Gerlach [Sat, 9 Jul 2022 05:03:47 +0000 (00:03 -0500)] 
gh-94700: Rewrite the logging.Formatter API ref in structured form (GH-94701)