]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-100585: Fixed a bug where importlib.resources.as_file was leaving file pointers...
Samet YASLAN [Wed, 28 Dec 2022 21:31:43 +0000 (22:31 +0100)] 
gh-100585: Fixed a bug where importlib.resources.as_file was leaving file pointers open (GH-100586)

* gh-100585: Fixed open fp bug in the imporlib module

* Added news for gh-100585

2 years agoGH-100101: Clarify documentation of zip's strict option (GH-100103)
JustAnotherArchivist [Wed, 28 Dec 2022 21:24:50 +0000 (21:24 +0000)] 
GH-100101: Clarify documentation of zip's strict option (GH-100103)

2 years agoRestore early-out to factor(). Strengthen tests. (GH-100591)
Raymond Hettinger [Wed, 28 Dec 2022 20:29:27 +0000 (12:29 -0800)] 
Restore early-out to factor().  Strengthen tests. (GH-100591)

2 years agogh-94172: Update docs for params removed in 3.12 (#100431)
Hugo van Kemenade [Wed, 28 Dec 2022 19:43:19 +0000 (21:43 +0200)] 
gh-94172: Update docs for params removed in 3.12 (#100431)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2 years agogh-100540: Remove unused Modules/_ctypes/libffi_osx/ (GH-100543)
Zachary Ware [Wed, 28 Dec 2022 19:38:52 +0000 (13:38 -0600)] 
gh-100540: Remove unused Modules/_ctypes/libffi_osx/ (GH-100543)

It was an ancient, modified copy of libffi that has not been in use
since GH-22855.

2 years agogh-100540: Remove obsolete '--with-system-ffi' configure option (GH-100544)
Zachary Ware [Wed, 28 Dec 2022 19:36:03 +0000 (13:36 -0600)] 
gh-100540: Remove obsolete '--with-system-ffi' configure option (GH-100544)

It has had no effect on non-macOS platforms for a long time, and has had
the non-obvious effect of invoking `pkg_config` and not setting
`-DUSING_APPLE_OS_LIBFFI` on macOS since GH-22855.

2 years agogh-100540: Remove unnecessary '-DMACOSX' for ctypes on macOS (GH-100542)
Zachary Ware [Wed, 28 Dec 2022 18:06:58 +0000 (12:06 -0600)] 
gh-100540: Remove unnecessary '-DMACOSX' for ctypes on macOS (GH-100542)

The define was only used to protect a `#pragma clang diagnostic`
setting, which is already better guarded by `__clang__` anwyay.

2 years agogh-100577: Replace `assert(0)` with `Py_UNREACHABLE` in `symtable.c` (#100579)
Nikita Sobolev [Wed, 28 Dec 2022 15:31:53 +0000 (18:31 +0300)] 
gh-100577: Replace `assert(0)` with `Py_UNREACHABLE` in `symtable.c` (#100579)

2 years agoFix mock code coverage. (#100580)
Chris Withers [Wed, 28 Dec 2022 12:36:26 +0000 (12:36 +0000)] 
Fix mock code coverage. (#100580)

2 years agoImprove factor() recipe and fix its tests (GH-100576)
Raymond Hettinger [Wed, 28 Dec 2022 11:13:58 +0000 (03:13 -0800)] 
Improve factor() recipe and fix its tests (GH-100576)

2 years agoRemove skipped test in test for async mocks. (#100559)
Chris Withers [Wed, 28 Dec 2022 10:55:50 +0000 (10:55 +0000)] 
Remove skipped test in test for async mocks. (#100559)

Remove skipped test.

See discussion on https://github.com/python/cpython/pull/25326.
Fix is apparently here, but no-one is confident to review and land: https://github.com/python/cpython/pull/25347.

2 years agoGH-100192: fix `asyncio` subprocess tests to pass env vars to subprocess (#100569)
Kumar Aditya [Wed, 28 Dec 2022 05:46:04 +0000 (11:16 +0530)] 
GH-100192: fix `asyncio` subprocess tests to pass env vars to subprocess (#100569)

2 years agogh-55688: Add note about ending backslashes for raw strings (#94768)
Stanley [Wed, 28 Dec 2022 05:30:42 +0000 (21:30 -0800)] 
gh-55688: Add note about ending backslashes for raw strings (#94768)

Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2 years agoadd tests for `asyncio` transport sockets (#100263)
Kumar Aditya [Wed, 28 Dec 2022 04:37:55 +0000 (10:07 +0530)] 
add tests for `asyncio` transport sockets (#100263)

2 years agoFix copy-paste error in `Tools/clinic.py` (#100560)
Nikita Sobolev [Wed, 28 Dec 2022 04:27:57 +0000 (07:27 +0300)] 
Fix copy-paste error in `Tools/clinic.py` (#100560)

2 years agoGH-100342: check for allocation failure in AC `*args` parsing (#100343)
Kumar Aditya [Wed, 28 Dec 2022 04:16:28 +0000 (09:46 +0530)] 
GH-100342: check for allocation failure in AC `*args` parsing (#100343)

2 years agoGH-100192: add more `asyncio` subprocess tests (#100194)
Kumar Aditya [Wed, 28 Dec 2022 04:12:16 +0000 (09:42 +0530)] 
GH-100192: add more `asyncio` subprocess tests (#100194)

2 years agoGH-98831: Modernize a ton of simpler instructions (#100545)
Guido van Rossum [Wed, 28 Dec 2022 01:11:03 +0000 (17:11 -0800)] 
GH-98831: Modernize a ton of simpler instructions (#100545)

* load_const and load_fast aren't families for now
* Don't decref unmoved names
* Modernize GET_ANEXT
* Modernize GET_AWAITABLE
* Modernize ASYNC_GEN_WRAP
* Modernize YIELD_VALUE
* Modernize POP_EXCEPT (in more than one way)
* Modernize PREP_RERAISE_STAR
* Modernize LOAD_ASSERTION_ERROR
* Modernize LOAD_BUILD_CLASS
* Modernize STORE_NAME
* Modernize LOAD_NAME
* Modernize LOAD_CLASSDEREF
* Modernize LOAD_DEREF
* Modernize STORE_DEREF
* Modernize COPY_FREE_VARS (mark it as done)
* Modernize LIST_TO_TUPLE
* Modernize LIST_EXTEND
* Modernize SET_UPDATE
* Modernize SETUP_ANNOTATIONS
* Modernize DICT_UPDATE
* Modernize DICT_MERGE
* Modernize MAP_ADD
* Modernize IS_OP
* Modernize CONTAINS_OP
* Modernize CHECK_EXC_MATCH
* Modernize IMPORT_NAME
* Modernize IMPORT_STAR
* Modernize IMPORT_FROM
* Modernize JUMP_FORWARD (mark it as done)
* Modernize JUMP_BACKWARD (mark it as done)

2 years agogh-100553: Improve accuracy of sqlite3.Row iter test (#100555)
Nikita Sobolev [Wed, 28 Dec 2022 00:58:05 +0000 (03:58 +0300)] 
gh-100553: Improve accuracy of sqlite3.Row iter test (#100555)

2 years agoRemove `NoneType` redefinition from `clinic.py` (#100551)
Nikita Sobolev [Tue, 27 Dec 2022 16:11:39 +0000 (19:11 +0300)] 
Remove `NoneType` redefinition from `clinic.py` (#100551)

2 years agogh-94603: micro optimize list.pop (gh-94604)
Pieter Eendebak [Tue, 27 Dec 2022 10:55:54 +0000 (11:55 +0100)] 
gh-94603: micro optimize list.pop (gh-94604)

2 years agogh-99509: Add `__class_getitem__` to `multiprocessing.queues.Queue` (#99511)
Nikita Sobolev [Tue, 27 Dec 2022 04:50:55 +0000 (07:50 +0300)] 
gh-99509: Add `__class_getitem__` to `multiprocessing.queues.Queue` (#99511)

2 years agogh-100520: Fix `rst` markup in `configparser` docstrings (#100524)
Nikita Sobolev [Mon, 26 Dec 2022 11:38:49 +0000 (14:38 +0300)] 
gh-100520: Fix `rst` markup in `configparser`  docstrings (#100524)

2 years agoFix name of removed `inspect.Signature.from_builtin` method in 3.11.0a2 changelog...
Jakub Kuczys [Mon, 26 Dec 2022 11:34:18 +0000 (12:34 +0100)] 
Fix name of removed `inspect.Signature.from_builtin` method in 3.11.0a2 changelog (#100525)

2 years agogh-92446: Improve argparse choices docs; revert bad change to lzma docs (#94627)
Guy Yagev [Mon, 26 Dec 2022 06:22:53 +0000 (08:22 +0200)] 
gh-92446: Improve argparse choices docs; revert bad change to lzma docs (#94627)

Based on the definition of the collections.abc classes, it is more accurate to use "sequence" instead of "container" when describing argparse choices.

A previous attempt at fixing this in #92450 was mistaken; this PR reverts that change.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-99308: Clarify re docs for byte pattern group names (#99311)
Ilya Kulakov [Sun, 25 Dec 2022 06:55:27 +0000 (22:55 -0800)] 
gh-99308: Clarify re docs for byte pattern group names (#99311)

2 years agogh-100519: simplification to `eff_request_host` in cookiejar.py (#99588)
Glyph [Sun, 25 Dec 2022 00:14:51 +0000 (16:14 -0800)] 
gh-100519: simplification to `eff_request_host` in cookiejar.py (#99588)

`IPV4_RE` includes a `.`, and the `.find(".") == -1` included here is already testing to make sure there's no dot, so this part of the expression is tautological. Instead use more modern `in` syntax to make it clear what the check is doing here. The simplified implementation more clearly matches the wording in RFC 2965.

Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2 years agogh-100472: Fix docs claim that compileall parameters could be bytes (#100473)
Shantanu [Sat, 24 Dec 2022 20:22:49 +0000 (14:22 -0600)] 
gh-100472: Fix docs claim that compileall parameters could be bytes (#100473)

2 years ago[Minor PR] Quotes in documentation changed into code blocks (#99536)
Bart Broere [Sat, 24 Dec 2022 20:17:39 +0000 (21:17 +0100)] 
[Minor PR] Quotes in documentation changed into code blocks (#99536)

Minor formatting fix in documentation

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-100428: Make float documentation more accurate (#100437)
Shantanu [Sat, 24 Dec 2022 20:09:31 +0000 (14:09 -0600)] 
gh-100428: Make float documentation more accurate (#100437)

Previously, the grammar did not accept `float("10")`.
Also implement mdickinson's suggestion of removing the indirection.

2 years agogh-99535: Add test for inheritance of annotations and update documentation (#99990)
MonadChains [Sat, 24 Dec 2022 20:07:14 +0000 (21:07 +0100)] 
gh-99535: Add test for inheritance of annotations and update documentation (#99990)

2 years agogh-100287: Fix unittest.mock.seal with AsyncMock (#100496)
Shantanu [Sat, 24 Dec 2022 19:39:39 +0000 (13:39 -0600)] 
gh-100287: Fix unittest.mock.seal with AsyncMock (#100496)

2 years agogh-100474: Fix handling of dirs named index.html in http.server (GH-100475)
James Frost [Sat, 24 Dec 2022 18:28:59 +0000 (18:28 +0000)] 
gh-100474: Fix handling of dirs named index.html in http.server (GH-100475)

If you had a directory called index.html or index.htm within a directory, it would cause http.server to return a 404 Not Found error instead of the directory listing. This came about due to not checking that the index was a regular file.

I have also added a test case for this situation.

Automerge-Triggered-By: GH:merwok
2 years agogh-99908: Tutorial: Modernize the 'data-record class' example (#100499)
JosephSBoyle [Sat, 24 Dec 2022 15:23:24 +0000 (15:23 +0000)] 
gh-99908: Tutorial: Modernize the 'data-record class' example (#100499)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoRemove wrong comment about `repr` in `test_unicode` (#100495)
Nikita Sobolev [Sat, 24 Dec 2022 14:48:43 +0000 (17:48 +0300)] 
Remove wrong comment about `repr` in `test_unicode` (#100495)

2 years agogh-100357: Convert several functions in `bltinsmodule` to AC (#100358)
Nikita Sobolev [Sat, 24 Dec 2022 14:45:47 +0000 (17:45 +0300)] 
gh-100357: Convert several functions in `bltinsmodule` to AC (#100358)

2 years agoMisc Itertools recipe tweaks (GH-100493)
Raymond Hettinger [Sat, 24 Dec 2022 08:21:30 +0000 (00:21 -0800)] 
Misc Itertools recipe tweaks (GH-100493)

2 years agoGH-91166: Implement zero copy writes for `SelectorSocketTransport` in asyncio (#31871)
Kumar Aditya [Sat, 24 Dec 2022 05:51:48 +0000 (11:21 +0530)] 
GH-91166: Implement zero copy writes for `SelectorSocketTransport` in asyncio (#31871)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2 years agoGH-91166: Implement zero copy writes for `SelectorSocketTransport` in asyncio (#31871)
Kumar Aditya [Sat, 24 Dec 2022 05:51:11 +0000 (11:21 +0530)] 
GH-91166: Implement zero copy writes for `SelectorSocketTransport` in asyncio (#31871)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2 years agogh-77771: Add enterabs example in sched (#92716)
Stanley [Sat, 24 Dec 2022 05:21:52 +0000 (21:21 -0800)] 
gh-77771: Add enterabs example in sched (#92716)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-100268: Add is_integer method to int (#100439)
Shantanu [Sat, 24 Dec 2022 02:30:27 +0000 (20:30 -0600)] 
gh-100268: Add is_integer method to int (#100439)

This improves the lives of type annotation users of `float` - which type checkers implicitly treat as `int|float` because that is what most code actually wants. Before this change a `.is_integer()` method could not be assumed to exist on things annotated as `: float` due to the method not existing on both types.

2 years agogh-100454: Start running SSL tests with OpenSSL 3.1.0-beta1 (#100456)
Illia Volochii [Sat, 24 Dec 2022 02:04:20 +0000 (04:04 +0200)] 
gh-100454: Start running SSL tests with OpenSSL 3.1.0-beta1 (#100456)

2 years agogh-94808: improve test coverage of number formatting (#99472)
Nikita Sobolev [Sat, 24 Dec 2022 00:03:31 +0000 (03:03 +0300)] 
gh-94808: improve test coverage of number formatting (#99472)

2 years agoAdd "strict" to dotproduct(). Add docstring. Factor-out common code. (GH-100480)
Raymond Hettinger [Fri, 23 Dec 2022 23:52:16 +0000 (15:52 -0800)] 
Add "strict" to dotproduct(). Add docstring. Factor-out common code. (GH-100480)

2 years agogh-99947: Ensure unreported errors are chained for SystemError during import (GH...
Sebastian Berg [Fri, 23 Dec 2022 23:43:19 +0000 (00:43 +0100)] 
gh-99947: Ensure unreported errors are chained for SystemError during import (GH-99946)

2 years agogh-68320, gh-88302 - Allow for private `pathlib.Path` subclassing (GH-31691)
Barney Gale [Fri, 23 Dec 2022 22:52:23 +0000 (22:52 +0000)] 
gh-68320, gh-88302 - Allow for private `pathlib.Path` subclassing (GH-31691)

Users may wish to define subclasses of `pathlib.Path` to add or modify
existing methods. Before this change, attempting to instantiate a subclass
raised an exception like:

    AttributeError: type object 'PPath' has no attribute '_flavour'

Previously the `_flavour` attribute was assigned as follows:

    PurePath._flavour        = xxx not set!! xxx
    PurePosixPath._flavour   = _PosixFlavour()
    PureWindowsPath._flavour = _WindowsFlavour()

This change replaces it with a `_pathmod` attribute, set as follows:

    PurePath._pathmod        = os.path
    PurePosixPath._pathmod   = posixpath
    PureWindowsPath._pathmod = ntpath

Functionality from `_PosixFlavour` and `_WindowsFlavour` is moved into
`PurePath` as underscored-prefixed classmethods. Flavours are removed.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
2 years agoGH-100425: Improve accuracy of builtin sum() for float inputs (GH-100426)
Raymond Hettinger [Fri, 23 Dec 2022 22:35:58 +0000 (14:35 -0800)] 
GH-100425: Improve accuracy of builtin sum() for float inputs (GH-100426)

2 years agobpo-40447: accept all path-like objects in compileall.compile_file (#19883)
Filipe Laíns [Fri, 23 Dec 2022 20:19:16 +0000 (20:19 +0000)] 
bpo-40447: accept all path-like objects in compileall.compile_file (#19883)

Signed-off-by: Filipe Laíns <lains@archlinux.org>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-99482: remove `jython` compatibility parts from stdlib and tests (#99484)
Nikita Sobolev [Fri, 23 Dec 2022 20:17:24 +0000 (23:17 +0300)] 
gh-99482: remove `jython` compatibility parts from stdlib and tests (#99484)

2 years agogh-83076: 3.8x speed improvement in (Async)Mock instantiation (#100252)
Carl Meyer [Fri, 23 Dec 2022 19:41:37 +0000 (12:41 -0700)] 
gh-83076: 3.8x speed improvement in (Async)Mock instantiation (#100252)

2 years agogh-94155: Reduce hash collisions for code objects (#100183)
Dennis Sweeney [Fri, 23 Dec 2022 18:15:47 +0000 (13:15 -0500)] 
gh-94155: Reduce hash collisions for code objects (#100183)

* Uses a better hashing algorithm to get better dispersion and remove commutativity.

* Incorporates `co_firstlineno`, `Py_SIZE(co)`, and bytecode instructions.

* This is now the entire set of criteria used in `code_richcompare`, except for `_PyCode_ConstantKey` (which would incorporate the types of `co_consts` rather than just their values).

2 years agoRevert "gh-100288: Specialise LOAD_ATTR_METHOD for managed dictionaries (GH-100289...
Ken Jin [Fri, 23 Dec 2022 17:48:43 +0000 (01:48 +0800)] 
Revert "gh-100288: Specialise LOAD_ATTR_METHOD for managed dictionaries (GH-100289)" (#100468)

This reverts commit c3c7848a48b74a321632202e4bdcf2f465fb1cc6.

2 years agogh-100288: Specialise LOAD_ATTR_METHOD for managed dictionaries (GH-100289)
Ken Jin [Fri, 23 Dec 2022 16:26:42 +0000 (00:26 +0800)] 
gh-100288: Specialise LOAD_ATTR_METHOD for managed dictionaries (GH-100289)

2 years agogh-92216: improve performance of `hasattr` for type objects (GH-99979)
Pieter Eendebak [Fri, 23 Dec 2022 15:23:36 +0000 (16:23 +0100)] 
gh-92216: improve performance of `hasattr` for type objects (GH-99979)

2 years agogh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing docs (...
Petr Viktorin [Fri, 23 Dec 2022 15:00:21 +0000 (16:00 +0100)] 
gh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing docs (#98710)

2 years agogh-99110: Initialize `frame->previous` in init_frame to fix segmentation fault when...
Bill Fisher [Fri, 23 Dec 2022 14:45:53 +0000 (07:45 -0700)] 
gh-99110: Initialize `frame->previous` in init_frame to fix segmentation fault when accessing `frame.f_back` (#100182)

2 years agoGH-100459: fix copy-paste errors in specialization stats (GH-100460)
Irit Katriel [Fri, 23 Dec 2022 14:42:24 +0000 (14:42 +0000)] 
GH-100459: fix copy-paste errors in specialization stats (GH-100460)

2 years agogh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)
Eric Wieser [Fri, 23 Dec 2022 08:23:19 +0000 (08:23 +0000)] 
gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)

The itemsize returned in a memoryview of a ctypes array is now computed from the item type, instead of dividing the total size by the length and assuming that the length is not zero.

2 years agoFix typo in 3.12 What's New (#100449)
Shantanu [Fri, 23 Dec 2022 06:22:31 +0000 (00:22 -0600)] 
Fix typo in 3.12 What's New (#100449)

2 years agogh-48496: Added example and link to faq for UnboundLocalError in reference (#93068)
Stanley [Thu, 22 Dec 2022 23:23:25 +0000 (15:23 -0800)] 
gh-48496: Added example and link to faq for UnboundLocalError in reference (#93068)

2 years agogh-57762: fix misleading tkinter.Tk docstring (#98837)
Shantanu [Thu, 22 Dec 2022 22:35:32 +0000 (16:35 -0600)] 
gh-57762: fix misleading tkinter.Tk docstring (#98837)

Mentioned as a desired change by terryjreedy on the corresponding issue,
since Tk is not a subclass of Toplevel.

2 years agogh-85432: Harmonise parameter names between C and pure-Python implementations of...
Alex Waygood [Thu, 22 Dec 2022 21:57:18 +0000 (21:57 +0000)] 
gh-85432: Harmonise parameter names between C and pure-Python implementations of `datetime.time.strftime`, `datetime.datetime.fromtimestamp` (#99993)

2 years agoGH-99554: Trim trailing whitespace (GH-100435)
Brandt Bucher [Thu, 22 Dec 2022 20:13:51 +0000 (12:13 -0800)] 
GH-99554: Trim trailing whitespace (GH-100435)

Automerge-Triggered-By: GH:brandtbucher
2 years agogh-100344: Add C implementation for `asyncio.current_task` (#100345)
Itamar Ostricher [Thu, 22 Dec 2022 13:38:12 +0000 (15:38 +0200)] 
gh-100344: Add C implementation for `asyncio.current_task` (#100345)

Co-authored-by: pranavtbhat
2 years agogh-78997: fix bad rebase of moved test file (#100424)
Eli Schwartz [Thu, 22 Dec 2022 13:28:25 +0000 (08:28 -0500)] 
gh-78997: fix bad rebase of moved test file (#100424)

2 years agoGH-99770: Make the correct call specialization fail kind show up in the stats (GH...
penguin_wwy [Thu, 22 Dec 2022 12:44:59 +0000 (20:44 +0800)] 
GH-99770: Make the correct call specialization fail kind show up in the stats (GH-99771)

2 years agogh-99761: Add `_PyLong_IsPositiveSingleDigit` function to check for single digit...
Pieter Eendebak [Thu, 22 Dec 2022 11:30:18 +0000 (12:30 +0100)] 
gh-99761: Add `_PyLong_IsPositiveSingleDigit` function to check for single digit integers  (#100064)

2 years agoCorrect typo in typing.py (#100423)
david-why [Thu, 22 Dec 2022 11:20:52 +0000 (19:20 +0800)] 
Correct typo in typing.py (#100423)

In the docstring of `ParamSpec`, the name of `P = ParamSpec('P')` was
mistakenly written as `'T'`.

2 years agoGH-99554: Pack location tables more effectively (GH-99556)
Brandt Bucher [Thu, 22 Dec 2022 00:41:18 +0000 (16:41 -0800)] 
GH-99554: Pack location tables more effectively (GH-99556)

2 years agoGH-69564: Clarify use of octal format of mode argument in help(os.chmod) (#20621)
amaajemyfren [Wed, 21 Dec 2022 17:48:25 +0000 (20:48 +0300)] 
GH-69564: Clarify use of octal format of mode argument in help(os.chmod) (#20621)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-78878: Fix crash when creating an instance of `_ctypes.CField` (#14837)
Hai Shi [Wed, 21 Dec 2022 17:31:17 +0000 (01:31 +0800)] 
gh-78878: Fix crash when creating an instance of `_ctypes.CField` (#14837)

2 years agoRemove unused variable from `dis._find_imports` (#100396)
Nikita Sobolev [Wed, 21 Dec 2022 16:55:02 +0000 (19:55 +0300)] 
Remove unused variable from `dis._find_imports` (#100396)

2 years agogh-100129: Add tests for pickling all builtin types and functions (GH-100142)
Serhiy Storchaka [Wed, 21 Dec 2022 14:31:22 +0000 (16:31 +0200)] 
gh-100129: Add tests for pickling all builtin types and functions (GH-100142)

2 years agogh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
Dominic Socular [Wed, 21 Dec 2022 13:25:04 +0000 (21:25 +0800)] 
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)

2 years agoGH-100133: fix `asyncio` subprocess losing `stderr` and `stdout` output (#100154)
Kumar Aditya [Wed, 21 Dec 2022 09:50:26 +0000 (15:20 +0530)] 
GH-100133: fix `asyncio` subprocess losing `stderr` and `stdout` output (#100154)

2 years agoGH-100363: Speed up `asyncio.get_running_loop` (#100364)
Kumar Aditya [Wed, 21 Dec 2022 09:49:44 +0000 (15:19 +0530)] 
GH-100363: Speed up `asyncio.get_running_loop` (#100364)

2 years agogh-85267: Improvements to inspect.signature __text_signature__ handling (#98796)
Shantanu [Wed, 21 Dec 2022 03:29:02 +0000 (21:29 -0600)] 
gh-85267: Improvements to inspect.signature __text_signature__ handling (#98796)

This makes a couple related changes to inspect.signature's behaviour
when parsing a signature from `__text_signature__`.

First, `inspect.signature` is documented as only raising ValueError or
TypeError. However, in some cases, we could raise RuntimeError.  This PR
changes that, thereby fixing #83685.

(Note that the new ValueErrors in RewriteSymbolics are caught and then
reraised with a message)

Second, `inspect.signature` could randomly drop parameters that it
didn't understand (corresponding to `return None` in the `p` function).
This is the core issue in #85267. I think this is very surprising
behaviour and it seems better to fail outright.

Third, adding this new failure broke a couple tests. To fix them (and to
e.g. allow `inspect.signature(select.epoll.register)` as in #85267), I
add constant folding of a couple binary operations to RewriteSymbolics.

(There's some discussion of making signature expression evaluation
arbitrary powerful in #68155. I think that's out of scope. The
additional constant folding here is pretty straightforward, useful, and
not much of a slippery slope)

Fourth, while #85267 is incorrect about the cause of the issue, it turns
out if you had consecutive newlines in __text_signature__, you'd get
`tokenize.TokenError`.

Finally, the `if name is invalid:` code path was dead, since
`parse_name` never returned `invalid`.

2 years agogh-91081: Add note on WeakKeyDictionary behavior when deleting a replaced entry ...
Stanley [Wed, 21 Dec 2022 03:27:02 +0000 (19:27 -0800)] 
gh-91081: Add note on WeakKeyDictionary behavior when deleting a replaced entry (#91499)

Co-authored-by: Pieter Eendebak <P.T.eendebak@tudelft.nl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-99991: improve docs on str.encode and bytes.decode (#100198)
Bisola Olasehinde [Wed, 21 Dec 2022 02:02:14 +0000 (02:02 +0000)] 
gh-99991: improve docs on str.encode and bytes.decode (#100198)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-100188: Reduce misses in BINARY_SUBSCR_(LIST/TUPLE)_INT (#100189)
Dennis Sweeney [Tue, 20 Dec 2022 20:46:16 +0000 (15:46 -0500)] 
gh-100188: Reduce misses in BINARY_SUBSCR_(LIST/TUPLE)_INT (#100189)

Don't specialize if the index is negative.

2 years agogh-99576: Fix cookiejar file that was not truncated for some classes (GH-99616)
Nikita Sobolev [Tue, 20 Dec 2022 16:51:26 +0000 (19:51 +0300)] 
gh-99576: Fix cookiejar file that was not truncated for some classes (GH-99616)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agoClarify that every thread has its own default context in contextvars (#99246)
Pablo Galindo Salgado [Tue, 20 Dec 2022 11:35:48 +0000 (11:35 +0000)] 
Clarify that every thread has its own default context in contextvars (#99246)

2 years agogh-99925: Fix inconsistency in `json.dumps()` error messages (GH-99926)
František Nesveda [Tue, 20 Dec 2022 10:54:56 +0000 (10:54 +0000)] 
gh-99925: Fix inconsistency in `json.dumps()` error messages (GH-99926)

2 years agogh-100348: Fix ref cycle in `asyncio._SelectorSocketTransport` with `_read_ready_cb...
Richard Kojedzinszky [Tue, 20 Dec 2022 10:40:56 +0000 (11:40 +0100)] 
gh-100348: Fix ref cycle in `asyncio._SelectorSocketTransport` with `_read_ready_cb` (#100349)

2 years agogh-88211: Change lower-case and upper-case to match recommendations in imaplib docs...
Brad Wolfe [Tue, 20 Dec 2022 10:10:31 +0000 (11:10 +0100)] 
gh-88211: Change lower-case and upper-case to match recommendations in imaplib docs (#99625)

2 years agogh-89051: Add ssl.OP_LEGACY_SERVER_CONNECT (#93927)
Thomas Grainger [Tue, 20 Dec 2022 07:10:30 +0000 (07:10 +0000)] 
gh-89051: Add ssl.OP_LEGACY_SERVER_CONNECT (#93927)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Fixes https://github.com/python/cpython/issues/89051

2 years agogh-69929: re docs: Add more specific definition of \w (#92015)
Stanley [Tue, 20 Dec 2022 03:07:31 +0000 (19:07 -0800)] 
gh-69929: re docs: Add more specific definition of \w (#92015)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-89727: Fix os.walk RecursionError on deep trees (#99803)
Jon Burdo [Mon, 19 Dec 2022 18:59:01 +0000 (13:59 -0500)] 
gh-89727: Fix os.walk RecursionError on deep trees (#99803)

Use a stack to implement os.walk iteratively instead of recursively to
avoid hitting recursion limits on deeply nested trees.

2 years agoDocs: Don't upload CI artifacts (#100330)
Hugo van Kemenade [Mon, 19 Dec 2022 08:40:11 +0000 (10:40 +0200)] 
Docs: Don't upload CI artifacts (#100330)

2 years agogh-94912: Added marker for non-standard coroutine function detection (#99247)
Carlton Gibson [Sun, 18 Dec 2022 19:13:24 +0000 (20:13 +0100)] 
gh-94912: Added marker for non-standard coroutine function detection (#99247)

This introduces a new decorator `@inspect.markcoroutinefunction`,
which, applied to a sync function, makes it appear async to
`inspect.iscoroutinefunction()`.

2 years agoCorrect CVE-2020-10735 documentation (#100306)
Jeremy Paige [Sun, 18 Dec 2022 07:11:21 +0000 (23:11 -0800)] 
Correct CVE-2020-10735 documentation (#100306)

2 years agogh-100272: Fix JSON serialization of OrderedDict (GH-100273)
Serhiy Storchaka [Sat, 17 Dec 2022 12:32:48 +0000 (14:32 +0200)] 
gh-100272: Fix JSON serialization of OrderedDict (GH-100273)

It now preserves the order of keys.

2 years agogh-93649: Split tracemalloc tests from _testcapimodule.c (#99551)
Erlend E. Aasland [Sat, 17 Dec 2022 08:53:36 +0000 (09:53 +0100)] 
gh-93649: Split tracemalloc tests from _testcapimodule.c (#99551)

2 years agoDocs: Use `PY_VERSION_HEX` for version comparison (#100179)
Hugo van Kemenade [Sat, 17 Dec 2022 07:42:18 +0000 (09:42 +0200)] 
Docs: Use `PY_VERSION_HEX` for version comparison (#100179)

2 years agogh-97909: Fix markup for `PyMethodDef` members (#100089)
ram vikram singh [Sat, 17 Dec 2022 07:12:39 +0000 (12:42 +0530)] 
gh-97909: Fix markup for `PyMethodDef` members (#100089)

2 years agogh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing...
colorfulappl [Sat, 17 Dec 2022 06:40:51 +0000 (14:40 +0800)] 
gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (#99890)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing...
colorfulappl [Sat, 17 Dec 2022 06:37:44 +0000 (14:37 +0800)] 
gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (#99890)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agoGH-98831: Add DECREF_INPUTS(), expanding to DECREF() each stack input (#100205)
Guido van Rossum [Sat, 17 Dec 2022 04:45:55 +0000 (20:45 -0800)] 
GH-98831: Add DECREF_INPUTS(), expanding to DECREF() each stack input (#100205)

The presence of this macro indicates that a particular instruction
may be considered for conversion to a register-based format
(see https://github.com/faster-cpython/ideas/issues/485).

An invariant (currently unchecked) is that `DEOPT_IF()` may only
occur *before* `DECREF_INPUTS()`, and `ERROR_IF()` may only occur
*after* it. One reason not to check this is that there are a few
places where we insert *two* `DECREF_INPUTS()` calls, in different
branches of the code. The invariant checking would have to be able
to do some flow control analysis to understand this.

Note that many instructions, especially specialized ones,
can't be converted to use this macro straightforwardly.
This is because the generator currently only generates plain
`Py_DECREF(variable)` statements, and cannot generate
things like `_Py_DECREF_SPECIALIZED()` let alone deal with
`_PyList_AppendTakeRef()`.

2 years agogh-78707: deprecate passing >1 argument to `PurePath.[is_]relative_to()` (GH-94469)
Barney Gale [Sat, 17 Dec 2022 00:14:27 +0000 (00:14 +0000)] 
gh-78707: deprecate passing >1 argument to `PurePath.[is_]relative_to()` (GH-94469)

This brings `relative_to()` and `is_relative_to()` more in line with other pathlib methods like `rename()` and `symlink_to()`.

Resolves #78707.

2 years agogh-99540: Constant hash for _PyNone_Type to aid reproducibility (GH-99541)
yonillasky [Fri, 16 Dec 2022 20:36:13 +0000 (22:36 +0200)] 
gh-99540: Constant hash for _PyNone_Type to aid reproducibility (GH-99541)

Needed for ASLR builds of Python.