]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102980: Add tests for pdf's display, alias and where commands (#102981)
gaogaotiantian [Fri, 24 Mar 2023 20:50:06 +0000 (13:50 -0700)] 
gh-102980: Add tests for pdf's display, alias and where commands (#102981)

2 years agogh-102873: logging.LogRecord docs: improve description of `msg` parameter (#102875)
Amin Alaee [Fri, 24 Mar 2023 15:00:32 +0000 (16:00 +0100)] 
gh-102873: logging.LogRecord docs: improve description of `msg` parameter (#102875)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-100372: Use BIO_eof to detect EOF for SSL_FILETYPE_ASN1 (GH-100373)
David Benjamin [Fri, 24 Mar 2023 13:04:30 +0000 (09:04 -0400)] 
gh-100372: Use BIO_eof to detect EOF for SSL_FILETYPE_ASN1 (GH-100373)

In PEM, we need to parse until error and then suppress `PEM_R_NO_START_LINE`, because PEM allows arbitrary leading and trailing data. DER, however, does not. Parsing until error and suppressing `ASN1_R_HEADER_TOO_LONG` doesn't quite work because that error also covers some cases that should be rejected.

Instead, check `BIO_eof` early and stop the loop that way.

Automerge-Triggered-By: GH:Yhg1s
2 years agogh-101100: Test docs in nit-picky mode (#102513)
Hugo van Kemenade [Fri, 24 Mar 2023 11:23:35 +0000 (13:23 +0200)] 
gh-101100: Test docs in nit-picky mode (#102513)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 years agoGH-100989: remove annotation from docstring (GH-102991)
Raymond Hettinger [Fri, 24 Mar 2023 05:39:12 +0000 (00:39 -0500)] 
GH-100989: remove annotation from docstring (GH-102991)

2 years agoGH-100989: Revert Improve the accuracy of collections.deque docstrings (GH-102979)
Raymond Hettinger [Fri, 24 Mar 2023 00:50:17 +0000 (19:50 -0500)] 
GH-100989: Revert Improve the accuracy of collections.deque docstrings (GH-102979)

2 years agogh-94684: uuid: support bytes in the name argument to uuid3/5 (#94709)
MonadChains [Thu, 23 Mar 2023 23:42:43 +0000 (00:42 +0100)] 
gh-94684: uuid: support bytes in the name argument to uuid3/5 (#94709)

RFC 4122 does not specify that name should be a string, so for completness the functions should also support a name given as a raw byte sequence.

2 years agogh-99726: Fix order of recently added fields for FILE_STAT_BASIC_INFORMATION (GH...
Steve Dower [Thu, 23 Mar 2023 23:27:46 +0000 (23:27 +0000)] 
gh-99726: Fix order of recently added fields for FILE_STAT_BASIC_INFORMATION (GH-102976)

2 years agoGH-100982: Break up COMPARE_AND_BRANCH (GH-102801)
Brandt Bucher [Thu, 23 Mar 2023 22:25:09 +0000 (15:25 -0700)] 
GH-100982: Break up COMPARE_AND_BRANCH (GH-102801)

2 years agogh-102558: [Enum] fix AttributeError during member repr() (GH-102601)
Dong-hee Na [Thu, 23 Mar 2023 20:30:18 +0000 (05:30 +0900)] 
gh-102558: [Enum] fix AttributeError during member repr() (GH-102601)

2 years agoMinor readability improvement to the factor() recipe (GH-102971)
Raymond Hettinger [Thu, 23 Mar 2023 19:46:15 +0000 (14:46 -0500)] 
Minor readability improvement to the factor() recipe (GH-102971)

2 years agogh-98239: Document that `inspect.getsource()` can raise `TypeError` (#101689)
Nikita Sobolev [Thu, 23 Mar 2023 19:35:02 +0000 (22:35 +0300)] 
gh-98239: Document that `inspect.getsource()` can raise `TypeError` (#101689)

2 years agogh-102936: typing: document performance pitfalls of protocols decorated with `@runtim...
Alex Waygood [Thu, 23 Mar 2023 18:18:53 +0000 (18:18 +0000)] 
gh-102936: typing: document performance pitfalls of protocols decorated with `@runtime_checkable` (#102937)

2 years agoMove binomialvariate() to a section for discrete distributions (GH-102955)
Raymond Hettinger [Thu, 23 Mar 2023 17:10:12 +0000 (12:10 -0500)] 
Move binomialvariate() to a section for discrete distributions (GH-102955)

2 years agogh-102810 Improve the sphinx docs for `asyncio.Timeout` (#102934)
JosephSBoyle [Thu, 23 Mar 2023 16:43:13 +0000 (16:43 +0000)] 
gh-102810 Improve the sphinx docs for `asyncio.Timeout` (#102934)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102943: Stop checking localized error text in socket tests on Windows (GH-102944)
AN Long [Thu, 23 Mar 2023 16:34:48 +0000 (00:34 +0800)] 
gh-102943: Stop checking localized error text in socket tests on Windows (GH-102944)

2 years agogh-88965: typing: fix type substitution of a list of types after initial `ParamSpec...
Nikita Sobolev [Thu, 23 Mar 2023 16:26:11 +0000 (19:26 +0300)] 
gh-88965: typing: fix type substitution of a list of types  after initial `ParamSpec` substitution (#102808)

Previously, this used to fail:

```py
from typing import *
T = TypeVar("T")
P = ParamSpec("P")

class X(Generic[P]):
    f: Callable[P, int]

Y = X[[int, T]]
Z = Y[str]
```

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102947: Improve traceback when calling `fields()` on a non-dataclass (#102948)
Alex Waygood [Thu, 23 Mar 2023 14:17:54 +0000 (14:17 +0000)] 
gh-102947: Improve traceback when calling `fields()` on a non-dataclass (#102948)

2 years agoDocs: fixup incorrect escape char in sqlite3 docs (#102945)
Erlend E. Aasland [Thu, 23 Mar 2023 13:21:32 +0000 (14:21 +0100)] 
Docs: fixup incorrect escape char in sqlite3 docs (#102945)

2 years agogh-102939: Fix "conversion from Py_ssize_t to long" warning in builtins (GH-102940)
Nikita Sobolev [Thu, 23 Mar 2023 10:37:04 +0000 (13:37 +0300)] 
gh-102939: Fix "conversion from Py_ssize_t to long" warning in builtins (GH-102940)

2 years agogh-100227: Make the Global Interned Dict Safe for Isolated Interpreters (gh-102925)
Eric Snow [Thu, 23 Mar 2023 00:30:04 +0000 (18:30 -0600)] 
gh-100227: Make the Global Interned Dict Safe for Isolated Interpreters (gh-102925)

This is effectively two changes.  The first (the bulk of the change) is where we add _Py_AddToGlobalDict() (and _PyRuntime.cached_objects.main_tstate, etc.).  The second (much smaller) change is where we update PyUnicode_InternInPlace() to use _Py_AddToGlobalDict() instead of calling PyDict_SetDefault() directly.

Basically, _Py_AddToGlobalDict() is a wrapper around PyDict_SetDefault() that should be used whenever we need to add a value to a runtime-global dict object (in the few cases where we are leaving the container global rather than moving it to PyInterpreterState, e.g. the interned strings dict).  _Py_AddToGlobalDict() does all the necessary work to make sure the target global dict is shared safely between isolated interpreters.  This is especially important as we move the obmalloc state to each interpreter (gh-101660), as well as, potentially, the GIL (PEP 684).

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

2 years ago[doc] Fix error in tutorial example: type(exc) is the type rather than the instance...
Jens-Hilmar Bradt [Wed, 22 Mar 2023 18:43:41 +0000 (19:43 +0100)] 
[doc] Fix error in tutorial example: type(exc) is the type rather than the instance (#102751)

2 years agogh-102921: [doc] Clarify `exc` argument name in `BaseExceptionGroup` is plural (...
Kevin Kirsche [Wed, 22 Mar 2023 18:14:05 +0000 (14:14 -0400)] 
gh-102921: [doc] Clarify `exc` argument name in `BaseExceptionGroup` is plural (#102922)

2 years agogh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)
Irit Katriel [Wed, 22 Mar 2023 18:10:48 +0000 (18:10 +0000)] 
gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)

2 years agogh-102780: Fix uncancel() call in asyncio timeouts (#102815)
Kristján Valur Jónsson [Wed, 22 Mar 2023 17:52:10 +0000 (17:52 +0000)] 
gh-102780: Fix uncancel() call in asyncio timeouts (#102815)

Also use `raise TimeOut from <CancelledError instance>` so that the CancelledError is set
in the `__cause__` field rather than in the `__context__` field.

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102033: Fix syntax error in `Tools/c-analyzer` (GH-102066)
Nikita Sobolev [Wed, 22 Mar 2023 14:59:32 +0000 (17:59 +0300)] 
gh-102033: Fix syntax error in `Tools/c-analyzer` (GH-102066)

The easiest way to format strings with `{}` meaningful chars is via `%`.

2 years agoGH-101291: Rearrange the size bits in PyLongObject (GH-102464)
Mark Shannon [Wed, 22 Mar 2023 14:49:51 +0000 (14:49 +0000)] 
GH-101291: Rearrange the size bits in PyLongObject (GH-102464)

* Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts.

* Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints.

* Add functions to hide some internals of long object, and for setting sign and digit count.

* Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().

2 years agoGH-89727: Fix pathlib.Path.walk RecursionError on deep trees (GH-100282)
Stanislav Zmiev [Wed, 22 Mar 2023 14:45:25 +0000 (18:45 +0400)] 
GH-89727: Fix pathlib.Path.walk RecursionError on deep trees (GH-100282)

Use a stack to implement `pathlib.Path.walk()` iteratively instead of recursively to avoid hitting recursion limits on deeply nested trees.

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2 years agogh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (#96932)
Benjamin Fogle [Wed, 22 Mar 2023 14:08:41 +0000 (10:08 -0400)] 
gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (#96932)

2 years agogh-102027: Fix macro name (#102124)
Max Bachmann [Wed, 22 Mar 2023 13:44:28 +0000 (14:44 +0100)] 
gh-102027: Fix macro name (#102124)

This fixes the ssse3 / sse2 detection when sse4 is available.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-101947: Remove size check from sqlite3 serialize test (#102914)
Erlend E. Aasland [Wed, 22 Mar 2023 13:05:08 +0000 (14:05 +0100)] 
gh-101947: Remove size check from sqlite3 serialize test (#102914)

The size of the returned data is too implementation specific.

2 years agogh-101313: Add -h and --help arguments to the webbrowser module (gh-101374)
Icelain [Wed, 22 Mar 2023 12:19:52 +0000 (17:49 +0530)] 
gh-101313: Add -h and --help arguments to the webbrowser module (gh-101374)

2 years agoGH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495)
David Benjamin [Wed, 22 Mar 2023 12:16:26 +0000 (08:16 -0400)] 
GH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495)

GH-25309 enabled SSL_OP_IGNORE_UNEXPECTED_EOF by default, with a comment
that it restores OpenSSL 1.1.1 behavior, but this wasn't quite right.
That option causes OpenSSL to treat transport EOF as the same as
close_notify (i.e. SSL_ERROR_ZERO_RETURN), whereas Python actually has
distinct SSLEOFError and SSLZeroReturnError exceptions. (The latter is
usually mapped to a zero return from read.) In OpenSSL 1.1.1, the ssl
module would raise them for transport EOF and close_notify,
respectively. In OpenSSL 3.0, both act like close_notify.

Fix this by, instead, just detecting SSL_R_UNEXPECTED_EOF_WHILE_READING
and mapping that to the other exception type.

There doesn't seem to have been any unit test of this error, so fill in
the missing one. This had to be done with the BIO path because it's
actually slightly tricky to simulate a transport EOF with Python's fd
based APIs. (If you instruct the server to close the socket, it gets
confused, probably because the server's SSL object is still referencing
the now dead fd?)

2 years agoDocs: improve accuracy of sqlite3.Connection.interrupt() (#102904)
Erlend E. Aasland [Wed, 22 Mar 2023 11:50:00 +0000 (12:50 +0100)] 
Docs: improve accuracy of sqlite3.Connection.interrupt() (#102904)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-100989: Improve the accuracy of collections.deque docstrings (#100990)
Timo Ludwig [Wed, 22 Mar 2023 11:46:58 +0000 (12:46 +0100)] 
gh-100989: Improve the accuracy of collections.deque docstrings (#100990)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoDocs: improve the accuracy of the sqlite3.connect() timeout param (#102900)
Erlend E. Aasland [Wed, 22 Mar 2023 11:37:13 +0000 (12:37 +0100)] 
Docs: improve the accuracy of the sqlite3.connect() timeout param (#102900)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoGH-94808: Cover `PyOS_mystrnicmp` and `PyOS_mystricmp` (gh-102469)
Artem Mukhin [Wed, 22 Mar 2023 11:35:27 +0000 (12:35 +0100)] 
GH-94808: Cover `PyOS_mystrnicmp` and `PyOS_mystricmp` (gh-102469)

2 years agoDocs: improve accuracy of pdb alias example (#102892)
gaogaotiantian [Wed, 22 Mar 2023 11:34:52 +0000 (04:34 -0700)] 
Docs: improve accuracy of pdb alias example (#102892)

2 years agogh-102839: remove AC for math.log (GH-102863) 102894/head
Sergey B Kirpichev [Tue, 21 Mar 2023 23:48:19 +0000 (02:48 +0300)] 
gh-102839: remove AC for math.log (GH-102863)

2 years agoAdd link to `sys.exit` function documentation (#102805)
David Poirier [Tue, 21 Mar 2023 21:58:31 +0000 (08:58 +1100)] 
Add link to `sys.exit` function documentation (#102805)

* Add link to `sys.exit` function documentation

* Update Doc/library/os.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Update Doc/library/os.rst

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
---------

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-102406: replace exception chaining by PEP-678 notes in codecs (#102407)
Irit Katriel [Tue, 21 Mar 2023 21:36:31 +0000 (21:36 +0000)] 
gh-102406: replace exception chaining by PEP-678 notes in codecs (#102407)

2 years agogh-94673: Isolate the _io module to Each Interpreter (gh-102663)
Eric Snow [Tue, 21 Mar 2023 20:01:38 +0000 (14:01 -0600)] 
gh-94673: Isolate the _io module to Each Interpreter (gh-102663)

Aside from sys and builtins, _io is the only core builtin module that hasn't been ported to multi-phase init.  We may do so later (e.g. gh-101948), but in the meantime we must at least take care of the module's static types properly.  (This came up while working on gh-101660.)

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

2 years agogh-102860: improve performance of compiler's instr_sequence_to_cfg (#102861)
Irit Katriel [Tue, 21 Mar 2023 19:13:49 +0000 (19:13 +0000)] 
gh-102860: improve performance of compiler's instr_sequence_to_cfg (#102861)

2 years agogh-98608: Fix Failure-handling in new_interpreter() (gh-102658)
Eric Snow [Tue, 21 Mar 2023 18:47:55 +0000 (12:47 -0600)] 
gh-98608: Fix Failure-handling in new_interpreter() (gh-102658)

The error-handling code in new_interpreter() has been broken for a while.  We hadn't noticed because those code mostly doesn't fail.  (I noticed while working on gh-101660.)  The problem is that we try to clear/delete the newly-created thread/interpreter using itself, which just failed.  The solution is to switch back to the calling thread state first.

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

2 years agoTweak polynomial itertool recipes (GH-102880)
Raymond Hettinger [Tue, 21 Mar 2023 18:21:57 +0000 (13:21 -0500)] 
Tweak polynomial itertool recipes (GH-102880)

2 years agogh-102304: Move the Total Refcount to PyInterpreterState (gh-102545)
Eric Snow [Tue, 21 Mar 2023 17:46:09 +0000 (11:46 -0600)] 
gh-102304: Move the Total Refcount to PyInterpreterState (gh-102545)

Moving it valuable with a per-interpreter GIL.  However, it is also useful without one, since it allows us to identify refleaks within a single interpreter or where references are escaping an interpreter.  This becomes more important as we move the obmalloc state to PyInterpreterState.

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

2 years agogh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)
wim glenn [Tue, 21 Mar 2023 17:06:18 +0000 (12:06 -0500)] 
gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)

remove superfluous parens from itertools.batched recipe

2 years agogh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig() as Fatal ...
Eric Snow [Tue, 21 Mar 2023 16:49:12 +0000 (10:49 -0600)] 
gh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig() as Fatal (gh-102657)

Prior to this change, errors in _Py_NewInterpreterFromConfig() were always fatal.  Instead, callers should be able to handle such errors and keep going.  That's what this change supports.  (This was an oversight in the original implementation of _Py_NewInterpreterFromConfig().)  Note that the existing [fatal] behavior of the public Py_NewInterpreter() is preserved.

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

2 years agogh-102595: Document `PyObject_Format` c-api function (GH-102596)
Nikita Sobolev [Tue, 21 Mar 2023 16:46:24 +0000 (19:46 +0300)] 
gh-102595: Document `PyObject_Format` c-api function (GH-102596)

Def: https://github.com/python/cpython/blame/5ffdaf748d98da6065158534720f1996a45a0072/Include/abstract.h#L389

2 years agogh-102828: emit deprecation warning for onerror arg to shutil.rmtree (#102850)
Irit Katriel [Tue, 21 Mar 2023 11:08:46 +0000 (11:08 +0000)] 
gh-102828: emit deprecation warning for onerror arg to shutil.rmtree (#102850)

2 years agogh-102799: Let pydoc use the exception instead of sys.exc_info (#102830)
Irit Katriel [Tue, 21 Mar 2023 11:07:03 +0000 (11:07 +0000)] 
gh-102799: Let pydoc use the exception instead of sys.exc_info (#102830)

2 years agogh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover PyErr_Display...
Irit Katriel [Tue, 21 Mar 2023 09:36:18 +0000 (09:36 +0000)] 
gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover PyErr_Display as well (GH-102849)

2 years agogh-102598: Remove obsolete optimization from `FORMAT_VALUE` opcode (#102599)
Nikita Sobolev [Tue, 21 Mar 2023 07:47:15 +0000 (10:47 +0300)] 
gh-102598: Remove obsolete optimization from `FORMAT_VALUE` opcode (#102599)

2 years agoThe pow() variant further improves accuracy (GH-102866)
Raymond Hettinger [Tue, 21 Mar 2023 05:02:14 +0000 (00:02 -0500)] 
The pow() variant further improves accuracy (GH-102866)

2 years agoRemove itermediate list. Expand docstring. (GH-102862)
Raymond Hettinger [Tue, 21 Mar 2023 01:40:04 +0000 (20:40 -0500)] 
Remove itermediate list. Expand docstring. (GH-102862)

2 years agogh-102809: Remove `Misc/gdbinit` (#102854)
Nikita Sobolev [Mon, 20 Mar 2023 23:30:46 +0000 (02:30 +0300)] 
gh-102809: Remove `Misc/gdbinit` (#102854)

Looks like the consensus is that we don't need this file anymore.
Old version can be always found here: https://github.com/python/cpython/blob/094cf392f49d3c16fe798863717f6c8e0f3734bb/Misc/gdbinit

2 years agoAdd itertool recipe for polynomial evaluation. (GH-102852)
Raymond Hettinger [Mon, 20 Mar 2023 22:14:29 +0000 (17:14 -0500)] 
Add itertool recipe for polynomial evaluation. (GH-102852)

2 years agogh-102304: Fix Non-Debug Builds (gh-102846)
Eric Snow [Mon, 20 Mar 2023 17:28:13 +0000 (11:28 -0600)] 
gh-102304: Fix Non-Debug Builds (gh-102846)

Some debug-only code slipped in with gh-102543.

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

2 years agogh-102304: Add a What's New Entry About _Py_RefTotal (gh-102845)
Eric Snow [Mon, 20 Mar 2023 16:35:49 +0000 (10:35 -0600)] 
gh-102304: Add a What's New Entry About _Py_RefTotal (gh-102845)

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

2 years agogh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)
Eric Snow [Mon, 20 Mar 2023 16:03:04 +0000 (10:03 -0600)] 
gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)

The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState.

Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead.

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

2 years agogh-102255: Use GetVersionEx instead of GetVersionExW to match argument type (GH-102583)
Max Bachmann [Mon, 20 Mar 2023 15:47:17 +0000 (16:47 +0100)] 
gh-102255: Use GetVersionEx instead of GetVersionExW to match argument type (GH-102583)

Since we pass a structure of type `OSVERSIONINFOEX`, we need to call
`GetVersionEx` instead of `GetVersionExW`.

2 years agogh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450) 102822/head
Alan Williams [Mon, 20 Mar 2023 00:20:20 +0000 (19:20 -0500)] 
gh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450)

2 years agogh-102828: fix test failure (add missing skip instructions) (#102835)
Irit Katriel [Mon, 20 Mar 2023 00:03:55 +0000 (00:03 +0000)] 
gh-102828: fix test failure (add missing skip instructions) (#102835)

2 years agogh-102491: Remove IronPython version check in sys_version (#102492)
Pieter Eendebak [Sun, 19 Mar 2023 22:52:47 +0000 (23:52 +0100)] 
gh-102491: Remove IronPython version check in sys_version (#102492)

2 years agogh-102810: Add docstrings to the public-facing methods of `asyncio.Timeout` (#102811)
JosephSBoyle [Sun, 19 Mar 2023 20:06:09 +0000 (20:06 +0000)] 
gh-102810: Add docstrings to the public-facing methods of `asyncio.Timeout` (#102811)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102828: add onexc arg to shutil.rmtree. Deprecate onerror. (#102829)
Irit Katriel [Sun, 19 Mar 2023 18:33:51 +0000 (18:33 +0000)] 
gh-102828: add onexc arg to shutil.rmtree. Deprecate onerror. (#102829)

2 years agogh-102778: revert changes to idlelib (#102825)
Irit Katriel [Sun, 19 Mar 2023 16:19:59 +0000 (16:19 +0000)] 
gh-102778: revert changes to idlelib (#102825)

2 years agogh-102755: fix refleak (#102826)
Irit Katriel [Sun, 19 Mar 2023 15:18:24 +0000 (15:18 +0000)] 
gh-102755: fix refleak (#102826)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102816)
Irit Katriel [Sun, 19 Mar 2023 15:17:59 +0000 (15:17 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102816)

2 years agoAdd more comments to hypot() (GH-102817)
Raymond Hettinger [Sat, 18 Mar 2023 17:21:48 +0000 (12:21 -0500)] 
Add more comments to hypot() (GH-102817)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102769)
Irit Katriel [Sat, 18 Mar 2023 13:44:47 +0000 (13:44 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102769)

2 years agogh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceba...
Irit Katriel [Sat, 18 Mar 2023 11:47:11 +0000 (11:47 +0000)] 
gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback (#102779)

2 years agogh-101975: Fixed a potential SegFault on garbage collection (GH-102803)
gaogaotiantian [Sat, 18 Mar 2023 10:59:21 +0000 (03:59 -0700)] 
gh-101975: Fixed a potential SegFault on garbage collection (GH-102803)

2 years agogh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)
Irit Katriel [Sat, 18 Mar 2023 07:19:38 +0000 (07:19 +0000)] 
gh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)

2 years agoSimplify and improve accuracy for subnormals in hypot() (GH-102785)
Raymond Hettinger [Fri, 17 Mar 2023 19:06:52 +0000 (14:06 -0500)] 
Simplify and improve accuracy for subnormals in hypot() (GH-102785)

2 years agogh-102781: fix cwd dependence in cases generator (#102782)
Carl Meyer [Fri, 17 Mar 2023 17:01:10 +0000 (11:01 -0600)] 
gh-102781: fix cwd dependence in cases generator (#102782)

2 years agogh-102701: Fix overflow in dictobject.c (GH-102750)
Inada Naoki [Fri, 17 Mar 2023 13:39:09 +0000 (22:39 +0900)] 
gh-102701: Fix overflow in dictobject.c (GH-102750)

2 years agoGH-78530: add support for generators in `asyncio.wait` (#102761)
Kumar Aditya [Fri, 17 Mar 2023 01:28:43 +0000 (06:58 +0530)] 
GH-78530: add support for generators in `asyncio.wait` (#102761)

2 years agoIncrease stack reserve size for Windows debug builds to avoid test crashes (GH-102764)
Steve Dower [Fri, 17 Mar 2023 01:07:07 +0000 (01:07 +0000)] 
Increase stack reserve size for Windows debug builds to avoid test crashes (GH-102764)

2 years agogh-102755: Add PyErr_DisplayException(exc) (#102756)
Irit Katriel [Thu, 16 Mar 2023 22:18:04 +0000 (22:18 +0000)] 
gh-102755: Add PyErr_DisplayException(exc) (#102756)

2 years agoFix outdated note about 'int' rounding or truncating (#102736)
Mark Dickinson [Thu, 16 Mar 2023 20:34:42 +0000 (20:34 +0000)] 
Fix outdated note about 'int' rounding or truncating (#102736)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102760)
Irit Katriel [Thu, 16 Mar 2023 19:03:52 +0000 (19:03 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102760)

2 years agogh-99726: Improves correctness of stat results for Windows, and uses faster API when...
Steve Dower [Thu, 16 Mar 2023 17:27:21 +0000 (17:27 +0000)] 
gh-99726: Improves correctness of stat results for Windows, and uses faster API when available (GH-102149)

This deprecates `st_ctime` fields on Windows, with the intent to change them to contain the correct value in 3.14. For now, they should keep returning the creation time as they always have.

2 years agogh-102192: remove redundant exception fields from ssl module socket (#102466)
Irit Katriel [Thu, 16 Mar 2023 16:41:10 +0000 (16:41 +0000)] 
gh-102192: remove redundant exception fields from ssl module socket (#102466)

2 years agogh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102743)
Irit Katriel [Thu, 16 Mar 2023 16:21:49 +0000 (16:21 +0000)] 
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102743)

2 years agogh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)
Eric Snow [Thu, 16 Mar 2023 15:26:42 +0000 (09:26 -0600)] 
gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)

The tool now allows user-added #LINE preprocessor directives.

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

2 years agoGH-102748: remove legacy support for generator based coroutines from `asyncio.iscorou...
Kumar Aditya [Thu, 16 Mar 2023 14:58:10 +0000 (20:28 +0530)] 
GH-102748: remove legacy support for generator based coroutines from `asyncio.iscoroutine` (#102749)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-102721: Improve coverage of `_collections_abc._CallableGenericAlias` (#102722)
Nikita Sobolev [Thu, 16 Mar 2023 14:47:30 +0000 (17:47 +0300)] 
gh-102721: Improve coverage of `_collections_abc._CallableGenericAlias` (#102722)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-102653: Make recipe docstring show the correct distribution (#102742)
Raymond Hettinger [Thu, 16 Mar 2023 14:32:18 +0000 (09:32 -0500)] 
GH-102653: Make recipe docstring show the correct distribution (#102742)

2 years agoAdd comments to `{typing,_collections_abc}._type_repr` about each other (#102752)
Nikita Sobolev [Thu, 16 Mar 2023 13:05:38 +0000 (16:05 +0300)] 
Add comments to `{typing,_collections_abc}._type_repr` about each other (#102752)

Remove `if` condition in `_collections_abc._type_repr` that's no longer needed, bringing it in sync with `typing._type_repr`.

2 years agogh-102594: PyErr_SetObject adds note to exception raised on normalization error ...
Irit Katriel [Thu, 16 Mar 2023 10:16:01 +0000 (10:16 +0000)] 
gh-102594: PyErr_SetObject adds note to exception raised on normalization error (#102675)

2 years agogh-94440: Fix issue of ProcessPoolExecutor shutdown hanging (#94468)
yonatanp [Thu, 16 Mar 2023 04:44:52 +0000 (00:44 -0400)] 
gh-94440: Fix issue of ProcessPoolExecutor shutdown hanging (#94468)

Fix an issue of concurrent.futures ProcessPoolExecutor shutdown hanging.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-100112: avoid using iterable coroutines in asyncio internally (#100128)
Kumar Aditya [Thu, 16 Mar 2023 03:50:43 +0000 (09:20 +0530)] 
GH-100112:  avoid using iterable coroutines in asyncio internally (#100128)

2 years agogh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)
Jamoo721 [Thu, 16 Mar 2023 02:52:11 +0000 (13:52 +1100)] 
gh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)

2 years agogh-102660: Fix Refleaks in import.c (#102744)
Eric Snow [Thu, 16 Mar 2023 00:43:54 +0000 (18:43 -0600)] 
gh-102660: Fix Refleaks in import.c (#102744)

gh-102661 introduced some leaks. This fixes them.

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

2 years agogh-102738: remove from cases generator the code related to register instructions...
Irit Katriel [Wed, 15 Mar 2023 21:25:31 +0000 (21:25 +0000)] 
gh-102738: remove from cases generator the code related to register instructions (#102739)

2 years agoSimplify and speed-up math.hypot() and math.dist() (GH-102734)
Raymond Hettinger [Wed, 15 Mar 2023 20:15:23 +0000 (15:15 -0500)] 
Simplify and speed-up math.hypot() and math.dist() (GH-102734)

2 years agoFix typo in code comment (#102726)
Martin Breuss [Wed, 15 Mar 2023 19:18:18 +0000 (20:18 +0100)] 
Fix typo in code comment (#102726)

2 years agoExclude `ceval.c` from the C-analyzer tool (#102735)
Alex Waygood [Wed, 15 Mar 2023 18:19:07 +0000 (18:19 +0000)] 
Exclude `ceval.c` from the C-analyzer tool (#102735)

The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main)

See, for example:
- https://github.com/python/cpython/pull/94468
- https://github.com/python/cpython/pull/94468
- https://github.com/python/cpython/pull/102731

This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in https://github.com/python/cpython/commit/70185de1abfe428049a5c43d58fcb656b46db96c. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!

2 years agogh-102654: Insert #line directives in generated_cases.c.h (#102669)
Guido van Rossum [Wed, 15 Mar 2023 15:37:36 +0000 (08:37 -0700)] 
gh-102654: Insert #line directives in generated_cases.c.h (#102669)

This behavior is optional, because in some extreme cases it
may just make debugging harder. The tool defaults it to off,
but it is on in Makefile.pre.in.

Also note that this makes diffs to generated_cases.c.h noisier,
since whenever you insert or delete a line in bytecodes.c,
all subsequent #line directives will change.