]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-44530: Add co_qualname field to PyCodeObject (GH-26941) 27050/head
Gabriele N. Tornetta [Wed, 7 Jul 2021 11:21:51 +0000 (12:21 +0100)] 
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)

4 years agoDoc: Fix link in multiprocessing.starmap pointing to builtin map. (GH-26560)
Julien Palard [Wed, 7 Jul 2021 08:25:01 +0000 (10:25 +0200)] 
Doc: Fix link in multiprocessing.starmap pointing to builtin map. (GH-26560)

4 years agobpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980)
Yurii Karabas [Tue, 6 Jul 2021 18:04:33 +0000 (21:04 +0300)] 
bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
4 years agobpo-38291: Fix a spurious warning when using help(object) (#27039)
Sebastian Rittau [Tue, 6 Jul 2021 15:01:15 +0000 (17:01 +0200)] 
bpo-38291: Fix a spurious warning when using help(object) (#27039)

help(object) via pydoc.TextDoc.docclass(object) iterates over the
subclasses of object, which includes typing.io and typing.re if typing
is imported. It tries to access cls.__module__ for each of those
sub-classes. This change suppresses warnings when accessing
cls.__module__.

4 years agobpo-44563: Fix error handling in tee.fromiterable() (GH-27020)
Serhiy Storchaka [Mon, 5 Jul 2021 22:19:35 +0000 (01:19 +0300)] 
bpo-44563: Fix error handling in tee.fromiterable() (GH-27020)

In debug build failed tee.fromiterable() corrupted the linked list of all GC objects.

4 years agobpo-43453: Update and re-add example to typing runtime_checkable (#27013)
andrei kulakov [Mon, 5 Jul 2021 16:23:42 +0000 (12:23 -0400)] 
bpo-43453: Update and re-add example to typing runtime_checkable (#27013)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on Windows...
Steve Dower [Mon, 5 Jul 2021 15:18:14 +0000 (16:18 +0100)] 
bpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on Windows (GH-26984)

4 years agobpo-44022: Fix Sphinx role in NEWS entry (GH-27033)
Sergey Fedoseev [Mon, 5 Jul 2021 14:44:06 +0000 (19:44 +0500)] 
bpo-44022: Fix Sphinx role in NEWS entry (GH-27033)

4 years agobpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021)
Pablo Galindo [Mon, 5 Jul 2021 11:10:53 +0000 (12:10 +0100)] 
bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021)

* bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias

* Update Objects/genericaliasobject.c

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
Dong-hee Na [Mon, 5 Jul 2021 09:04:36 +0000 (18:04 +0900)] 
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)

4 years agobpo-44534: fix wording and docstring sync in unittest.Mock GH27000
Jack DeVries [Mon, 5 Jul 2021 06:52:32 +0000 (02:52 -0400)] 
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000

4 years agobpo-41486: zlib uses an UINT32_MAX sliding window for the output buffer (GH-26143)
Ma Lin [Mon, 5 Jul 2021 01:10:44 +0000 (09:10 +0800)] 
bpo-41486: zlib uses an UINT32_MAX sliding window for the output buffer (GH-26143)

* zlib uses an UINT32_MAX sliding window for the output buffer

These funtions have an initial output buffer size parameter:
- zlib.decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
- zlib.Decompress.flush([length])

If the initial size > UINT32_MAX, use an UINT32_MAX sliding window, instead of clamping to UINT32_MAX.
Speed up when (the initial size == the actual size).

This fixes a memory consumption and copying performance regression in earlier 3.10 beta releases if someone used an output buffer larger than 4GiB with zlib.decompress.

Reviewed-by: Gregory P. Smith
4 years agobpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)
Ammar Askar [Sun, 4 Jul 2021 23:14:33 +0000 (19:14 -0400)] 
bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)

The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location
to print carets on the specific expressions involved in a traceback.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
4 years agobpo-43950: include position in dis.Instruction (GH-27015)
Batuhan Taskaya [Sun, 4 Jul 2021 19:05:05 +0000 (22:05 +0300)] 
bpo-43950: include position in dis.Instruction (GH-27015)

Automerge-Triggered-By: GH:isidentical
4 years agobpo-43950: use 0-indexed column offsets for bytecode positions (GH-27011)
Batuhan Taskaya [Sun, 4 Jul 2021 18:02:16 +0000 (21:02 +0300)] 
bpo-43950: use 0-indexed column offsets for bytecode positions (GH-27011)

4 years agobpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ...
Ken Jin [Sun, 4 Jul 2021 16:47:38 +0000 (00:47 +0800)] 
bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias … (GH-27016)

4 years agobpo-44553: Correct failure in tp_new for the union object (GH-27008)
Pablo Galindo [Sat, 3 Jul 2021 20:00:28 +0000 (21:00 +0100)] 
bpo-44553: Correct failure in tp_new for the union object (GH-27008)

4 years agobpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656)
Irit Katriel [Sat, 3 Jul 2021 15:33:35 +0000 (16:33 +0100)] 
bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656)

4 years agobpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118)
Daniel Hillier [Sat, 3 Jul 2021 14:37:57 +0000 (00:37 +1000)] 
bpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118)

Replace hex flag masks with named global variables to improve
readability.

eg.
    if flags & 0x800
becomes:
    if flags & _MASK_UTF_FILENAME

4 years agoFix a small typo in the docs (GH-26991)
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Sat, 3 Jul 2021 14:04:57 +0000 (19:34 +0530)] 
Fix  a small typo in the docs (GH-26991)

4 years agobpo-44553 : Implement GC methods for types.Union (GH-26993)
Ken Jin [Sat, 3 Jul 2021 12:12:11 +0000 (20:12 +0800)] 
bpo-44553 : Implement GC methods for types.Union (GH-26993)

4 years agobpo-42238: rstlint: Add two new checks. (GH-26966)
Julien Palard [Sat, 3 Jul 2021 08:35:02 +0000 (10:35 +0200)] 
bpo-42238: rstlint: Add two new checks. (GH-26966)

4 years agobpo-44388: Update venv EnvBuilder.ensure_directories() docs. (GH-26663)
Matthew Clapp [Fri, 2 Jul 2021 20:48:15 +0000 (13:48 -0700)] 
bpo-44388: Update venv EnvBuilder.ensure_directories() docs. (GH-26663)

Ref:

This changes the documentation for `EnvBuilder.ensure_directories(env_dir)` to match the actual behavior of that API call.

In particular, `ensure_directories()` is not affected by the state of the `upgrade` attribute, and will not cause an error to have existing directories whether or not the `clear` attribute is set.

This documentation change I believe should be valid to all python versions back to 3.6.

Automerge-Triggered-By: GH:vsajip
4 years agobpo-43950: optimize column table assembling with pre-sizing object (GH-26997)
Batuhan Taskaya [Fri, 2 Jul 2021 19:03:58 +0000 (22:03 +0300)] 
bpo-43950: optimize column table assembling with pre-sizing object (GH-26997)

The new resizing system works like this;
```
$ cat t.py
a + a + a + b + c + a + a + a + b + c + a + a + a + b + c + a + a + a + b + c
[repeated 99 more times]
$ ./python t.py
RESIZE: prev len = 32, new len = 66
FINAL SIZE: 56
-----------------------------------------------------
RESIZE: prev len = 32, new len = 66
RESIZE: prev len = 66, new len = 134
RESIZE: prev len = 134, new len = 270
RESIZE: prev len = 270, new len = 542
RESIZE: prev len = 542, new len = 1086
RESIZE: prev len = 1086, new len = 2174
RESIZE: prev len = 2174, new len = 4350
RESIZE: prev len = 4350, new len = 8702
FINAL SIZE: 8004
```

So now we do considerably lower number of `_PyBytes_Resize` calls.

Automerge-Triggered-By: GH:isidentical
4 years agobpo-30256: [doc] Fix formatting error in news (GH-26994)
Ken Jin [Fri, 2 Jul 2021 16:53:11 +0000 (00:53 +0800)] 
bpo-30256: [doc] Fix formatting error in news (GH-26994)

4 years agobpo-43950: Add code.co_positions (PEP 657) (GH-26955)
Pablo Galindo [Fri, 2 Jul 2021 14:10:11 +0000 (15:10 +0100)] 
bpo-43950: Add code.co_positions (PEP 657) (GH-26955)

This PR is part of PEP 657 and augments the compiler to emit ending
line numbers as well as starting and ending columns from the AST
into compiled code objects. This allows bytecodes to be correlated
to the exact source code ranges that generated them.

This information is made available through the following public APIs:

* The `co_positions` method on code objects.
* The C API function `PyCode_Addr2Location`.

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
4 years agobpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru… (GH-26967)
Irit Katriel [Fri, 2 Jul 2021 09:42:08 +0000 (10:42 +0100)] 
bpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru… (GH-26967)

4 years agobpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341)
finefoot [Fri, 2 Jul 2021 03:45:02 +0000 (05:45 +0200)] 
bpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341)

Co-authored-by: Jordan Speicher <jordan@jspeicher.com>
4 years agobpo-43425: Update setup.py not to use distutils.log (GH-26969)
Dong-hee Na [Fri, 2 Jul 2021 01:41:54 +0000 (10:41 +0900)] 
bpo-43425: Update setup.py not to use distutils.log (GH-26969)

4 years agobpo-44313: bump up magic (#26983)
Batuhan Taskaya [Thu, 1 Jul 2021 19:25:10 +0000 (22:25 +0300)] 
bpo-44313: bump up magic (#26983)

4 years agobpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540)
Illia Volochii [Thu, 1 Jul 2021 14:46:49 +0000 (17:46 +0300)] 
bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540)

4 years agobpo-43216: Remove @asyncio.coroutine (GH-26369)
Illia Volochii [Thu, 1 Jul 2021 13:13:59 +0000 (16:13 +0300)] 
bpo-43216: Remove @asyncio.coroutine (GH-26369)

Remove the @asyncio.coroutine decorator
enabling legacy generator-based coroutines to be compatible with async/await
code; remove asyncio.coroutines.CoroWrapper used for wrapping
legacy coroutine objects in the debug mode.

The decorator has been deprecated
since Python 3.8 and the removal was initially scheduled for Python 3.10.

4 years agoAdd file describing how to add or modify specialized families of instructions. (GH...
Mark Shannon [Thu, 1 Jul 2021 12:13:05 +0000 (13:13 +0100)] 
Add file describing how to add or modify specialized families of instructions. (GH-26954)

4 years agobpo-43770: Cleanup _PyObject_GetMethod() (GH-26946)
Victor Stinner [Thu, 1 Jul 2021 01:11:59 +0000 (03:11 +0200)] 
bpo-43770: Cleanup _PyObject_GetMethod() (GH-26946)

_PyObject_GetMethod() now uses _PyType_IsReady() to decide if
PyType_Ready() must be called or not, rather than testing if
tp->tp_dict is NULL.

Move also variable declarations closer to where they are used, and
use Py_NewRef().

4 years agobpo-43425: Update _osx_support not to use distutils.log (GH-26968)
Dong-hee Na [Thu, 1 Jul 2021 00:35:10 +0000 (09:35 +0900)] 
bpo-43425: Update _osx_support not to use distutils.log (GH-26968)

4 years agobpo-44531: Add _PyType_AllocNoTrack() function (GH-26947)
Victor Stinner [Thu, 1 Jul 2021 00:30:46 +0000 (02:30 +0200)] 
bpo-44531: Add _PyType_AllocNoTrack() function (GH-26947)

Add an internal _PyType_AllocNoTrack() function to allocate an object
without tracking it in the GC.

Modify dict_new() to use _PyType_AllocNoTrack(): dict subclasses are
now only tracked once all PyDictObject members are initialized.
Calling _PyObject_GC_UNTRACK() is no longer needed for the dict type.

Similar change in tuple_subtype_new() for tuple subclasses.

Replace tuple_gc_track() with _PyObject_GC_TRACK().

4 years agobpo-44313: generate LOAD_ATTR/CALL_FUNCTION for top-level imported objects (GH-26677)
Batuhan Taskaya [Wed, 30 Jun 2021 22:53:36 +0000 (01:53 +0300)] 
bpo-44313: generate LOAD_ATTR/CALL_FUNCTION for top-level imported objects (GH-26677)

4 years agoFix compiler errors for unused variables in marshal.c (GH-26977)
Pablo Galindo [Wed, 30 Jun 2021 20:55:57 +0000 (21:55 +0100)] 
Fix compiler errors for unused variables in marshal.c (GH-26977)

4 years agobpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962)
Steve Dower [Wed, 30 Jun 2021 19:06:06 +0000 (20:06 +0100)] 
bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962)

4 years agobpo-41180: Fixes documentation to specify correct event name and add versionchanged...
Steve Dower [Wed, 30 Jun 2021 17:53:13 +0000 (18:53 +0100)] 
bpo-41180: Fixes documentation to specify correct event name and add versionchanged (GH-26972)

4 years agobpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal...
Steve Dower [Wed, 30 Jun 2021 16:21:37 +0000 (17:21 +0100)] 
bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26961)

4 years agoDoc: fix a rst tag. (GH-26965)
Julien Palard [Wed, 30 Jun 2021 09:31:04 +0000 (11:31 +0200)] 
Doc: fix a rst tag. (GH-26965)

4 years agobpo-43232: Remove previously deprecated methods on TransportSocket (GH-24538)
Illia Volochii [Wed, 30 Jun 2021 06:19:09 +0000 (09:19 +0300)] 
bpo-43232: Remove previously deprecated methods on TransportSocket (GH-24538)

4 years agobpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950)
Pablo Galindo [Tue, 29 Jun 2021 22:58:45 +0000 (23:58 +0100)] 
bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950)

4 years agobpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935)
Jack DeVries [Tue, 29 Jun 2021 17:28:03 +0000 (13:28 -0400)] 
bpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935)

4 years agobpo-44531: Fix type_repr() if tp_name is NULL (GH-26948)
Victor Stinner [Tue, 29 Jun 2021 14:39:29 +0000 (16:39 +0200)] 
bpo-44531: Fix type_repr() if tp_name is NULL (GH-26948)

Allow to call type_repr() on a type which is not fully initialized
yet. This fix helps debugging crashes occurring early at Python
initialization.

4 years agoDoc: Remove trailing whitespaces. (GH-26953)
Julien Palard [Tue, 29 Jun 2021 11:16:53 +0000 (13:16 +0200)] 
Doc: Remove trailing whitespaces. (GH-26953)

4 years agobpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834)
andrei kulakov [Tue, 29 Jun 2021 10:54:28 +0000 (06:54 -0400)] 
bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834)

4 years agobpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820)
Serhiy Storchaka [Tue, 29 Jun 2021 08:28:15 +0000 (11:28 +0300)] 
bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820)

A TypeError is now raised instead of an AttributeError in
ExitStack.enter_context() and AsyncExitStack.enter_async_context()
for objects which do not support the context manager or
asynchronous context manager protocols correspondingly.

4 years agobpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809)
Serhiy Storchaka [Tue, 29 Jun 2021 08:27:04 +0000 (11:27 +0300)] 
bpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809)

A TypeError is now raised instead of an AttributeError in
"with" and "async with" statements for objects which do not
support the context manager or asynchronous context manager
protocols correspondingly.

4 years agobpo-44434: Remove useless calls to PyThread_exit_thread() (GH-26943)
Victor Stinner [Tue, 29 Jun 2021 00:03:30 +0000 (02:03 +0200)] 
bpo-44434: Remove useless calls to PyThread_exit_thread() (GH-26943)

Remove useless calls to PyThread_exit_thread() in two unit tests of
_testcapi and _testembed modules.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
4 years ago[doc] Fix typo in what's new in 3.10 (GH-26911)
Rodrigo Girão Serrão [Mon, 28 Jun 2021 22:02:18 +0000 (23:02 +0100)] 
[doc] Fix typo in what's new in 3.10 (GH-26911)

The `try` statement was missing a colon and therefore was not exemplifying the correct `SyntaxError`.

4 years agobpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807)
Jason R. Coombs [Sun, 27 Jun 2021 21:59:18 +0000 (17:59 -0400)] 
bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807)

Sync with importlib_metadata 4.6.

4 years agobpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919)
jdevries3133 [Sun, 27 Jun 2021 19:27:20 +0000 (15:27 -0400)] 
bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919)

4 years agoClarify the order of a stacked `abstractmethod` (GH-26892)
Ram Rachum [Sun, 27 Jun 2021 18:02:23 +0000 (21:02 +0300)] 
Clarify the order of a stacked `abstractmethod` (GH-26892)

Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
4 years agobpo-40528: fix is_simple(sum)s behavior for attributes (GH-26918)
Batuhan Taskaya [Sun, 27 Jun 2021 14:58:32 +0000 (17:58 +0300)] 
bpo-40528: fix is_simple(sum)s behavior for attributes (GH-26918)

This is something I noticed while (now discontinued) experimenting
with the idea of annotating operators with location information. Unfortunately
without this addition, adding any `attributes` to stuff like `unaryop`
doesn't change anything since the code assumes they are singletons and
caches all instances. This patch fixes this assumption with including
the attributes as well as constructor fields.

4 years agoFIX rst issue in NEWS.d (GH-26923)
Julien Palard [Sun, 27 Jun 2021 13:48:51 +0000 (15:48 +0200)] 
FIX rst issue in NEWS.d (GH-26923)

4 years agoAdd missing arg to DICT_MERGE opcode (GH-26859)
andrei kulakov [Sun, 27 Jun 2021 12:19:14 +0000 (08:19 -0400)] 
Add missing arg to DICT_MERGE opcode (GH-26859)

4 years agobpo-44110: Improve string's __getitem__ error message (GH-26042)
Miguel Brito [Sun, 27 Jun 2021 12:04:57 +0000 (13:04 +0100)] 
bpo-44110: Improve string's __getitem__ error message (GH-26042)

4 years agobpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid...
will-ca [Sat, 26 Jun 2021 23:31:32 +0000 (23:31 +0000)] 
bpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid `.__module__`. (GH-26862)

4 years agoUpdate vendored pip to 21.1.3 (GH-26912)
Stéphane Bidoul [Sat, 26 Jun 2021 16:22:48 +0000 (18:22 +0200)] 
Update vendored pip to 21.1.3 (GH-26912)

4 years agobpo-43977: Properly update the tp_flags of existing subclasses when their parents...
Brandt Bucher [Fri, 25 Jun 2021 15:20:43 +0000 (08:20 -0700)] 
bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864)

4 years agobpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests...
Irit Katriel [Thu, 24 Jun 2021 23:20:40 +0000 (00:20 +0100)] 
bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905)

4 years agobpo-44498: Issue a deprecation warning on asynchat, asyncore and smtpd import (#26882)
Barry Warsaw [Thu, 24 Jun 2021 19:37:26 +0000 (12:37 -0700)] 
bpo-44498: Issue a deprecation warning on asynchat, asyncore and smtpd import (#26882)

* Issue a deprecation warning on smtpd import

* Also issue DeprecationWarnings for asynchat and asyncore

* Fix some tests

* test___all__ requires the word 'module' or 'package' in the deprecation
  warning text, so add those to smtpd, asynchat, and asyncore.
* In test_support, use pprint now instead of asyncore as the landmark.

* Add What's New

* Use ..deprecated::

* Use ..deprecated::

* Update Lib/smtpd.py

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* Update Doc/library/smtpd.rst

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* Import async{hat,ore} after the DeprecationWarning for this module

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
4 years agobpo-44321: Adds `os.EX_OK` for Windows (GH-26559)
Samuel Marks [Thu, 24 Jun 2021 16:45:18 +0000 (02:45 +1000)] 
bpo-44321: Adds `os.EX_OK` for Windows (GH-26559)

4 years agobpo-44456: Improve the syntax error when mixing keyword and positional patterns ...
Pablo Galindo [Thu, 24 Jun 2021 15:09:57 +0000 (16:09 +0100)] 
bpo-44456: Improve the syntax error when mixing keyword and positional patterns (GH-26793)

4 years agobpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863)
Erlend Egeberg Aasland [Thu, 24 Jun 2021 14:35:57 +0000 (16:35 +0200)] 
bpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863)

4 years agoMake sure that line number is set correctly for call to __exit__ when handling except...
Mark Shannon [Thu, 24 Jun 2021 14:12:48 +0000 (15:12 +0100)] 
Make sure that line number is set correctly for call to __exit__ when handling exception in body of a with statement. (GH-26890)

4 years agoFix typo in whatsnew 3.10.rst (GH-26854)
Arnon Yaari [Thu, 24 Jun 2021 13:01:42 +0000 (16:01 +0300)] 
Fix typo in whatsnew 3.10.rst (GH-26854)

Thanks for the fix @wiggin15 .

4 years agobpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855)
Petr Viktorin [Thu, 24 Jun 2021 12:57:28 +0000 (14:57 +0200)] 
bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855)

I tried to be relatively thorough and give lots of links.
One reason is that this wasn't deprecated very long; also it seems people running into this tend to not be familiar with similar APIs.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-40528: move asdl identifier collection to the new metadata system (GH-26858)
Batuhan Taskaya [Thu, 24 Jun 2021 12:16:00 +0000 (15:16 +0300)] 
bpo-40528: move asdl identifier collection to the new metadata system (GH-26858)

4 years agobpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
Erlend Egeberg Aasland [Thu, 24 Jun 2021 12:05:42 +0000 (14:05 +0200)] 
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)

4 years agobpo-43553: Improve `sqlite3` test coverage (GH-26886)
Erlend Egeberg Aasland [Thu, 24 Jun 2021 11:56:56 +0000 (13:56 +0200)] 
bpo-43553: Improve `sqlite3` test coverage (GH-26886)

4 years agobpo-43988: Fix test.support.check_disallow_instantiation version added (GH-26889)
Erlend Egeberg Aasland [Thu, 24 Jun 2021 07:57:14 +0000 (09:57 +0200)] 
bpo-43988: Fix test.support.check_disallow_instantiation version added (GH-26889)

Automerge-Triggered-By: GH:vstinner
4 years agobpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839)
Guido van Rossum [Wed, 23 Jun 2021 16:51:44 +0000 (09:51 -0700)] 
bpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839)

All uses of this flag are either setting it
or in doc or tests for it. So we should be
able to get rid of it completely.

4 years agobpo-42862: Strip stale sqlite3 cache ignores from c-analyzer (GH-26876)
Erlend Egeberg Aasland [Wed, 23 Jun 2021 14:04:26 +0000 (16:04 +0200)] 
bpo-42862: Strip stale sqlite3 cache ignores from c-analyzer (GH-26876)

4 years agobpo-39947: Remove old private trashcan C API functions (GH-26869)
Victor Stinner [Wed, 23 Jun 2021 13:51:47 +0000 (15:51 +0200)] 
bpo-39947: Remove old private trashcan C API functions (GH-26869)

Remove 4 C API private trashcan functions which were only kept for
the backward compatibility of the stable ABI with Python 3.8 and
older, since the trashcan API was not usable with the limited C API
on Python 3.8 and older. The trashcan API was excluded from the
limited C API in Python 3.9.

Removed functions:

* _PyTrash_deposit_object()
* _PyTrash_destroy_chain()
* _PyTrash_thread_deposit_object()
* _PyTrash_thread_destroy_chain()

The trashcan C API was never usable with the limited C API, since old
trashcan macros accessed directly PyThreadState members like
"_tstate->trash_delete_nesting", whereas the PyThreadState structure
is opaque in the limited C API.

Exclude also the PyTrash_UNWIND_LEVEL constant from the C API.

The trashcan C API was modified in Python 3.9 by commit
38965ec5411da60d312b59be281f3510d58e0cf1 and in Python 3.10 by commit
ed1a5a5baca8f61e9a99c5be3adc16b1801514fe to hide implementation
details.

4 years agobpo-43770: Cleanup PyModuleDef_Init() (GH-26879)
Victor Stinner [Wed, 23 Jun 2021 13:40:27 +0000 (15:40 +0200)] 
bpo-43770:  Cleanup PyModuleDef_Init() (GH-26879)

PyModuleDef_Init() no longer tries to make PyModule_Type type: it's
already done by _PyTypes_Init() at Python startup. Replace
PyType_Ready() call with an assertion.

4 years agobpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745)
Erlend Egeberg Aasland [Wed, 23 Jun 2021 12:56:40 +0000 (14:56 +0200)] 
bpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745)

Also adds a test to verify the (borrowed) exceptions in `sqlite3.Connection`.

4 years agobpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)
Victor Stinner [Wed, 23 Jun 2021 12:13:27 +0000 (14:13 +0200)] 
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)

Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.

4 years agobpo-42064: Remove stale extern declarations in `sqlite3` headers (GH-26840)
Erlend Egeberg Aasland [Wed, 23 Jun 2021 12:06:53 +0000 (14:06 +0200)] 
bpo-42064: Remove stale extern declarations in `sqlite3` headers (GH-26840)

4 years agobpo-44404: tkinter `after` support callable classes (GH-26812)
E-Paine [Wed, 23 Jun 2021 10:30:24 +0000 (11:30 +0100)] 
bpo-44404: tkinter `after` support callable classes (GH-26812)

4 years agobpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations...
Serhiy Storchaka [Wed, 23 Jun 2021 09:53:37 +0000 (12:53 +0300)] 
bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843)

4 years agobpo-28395: Remove unnecessary semicolons in tests (GH-26868)
Dong-hee Na [Wed, 23 Jun 2021 09:01:06 +0000 (18:01 +0900)] 
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)

4 years agobpo-44486: Make sure that modules always have a dictionary. (GH-26847)
Mark Shannon [Wed, 23 Jun 2021 09:00:43 +0000 (10:00 +0100)] 
bpo-44486: Make sure that modules always have a dictionary. (GH-26847)

* Make sure that modules always have a dictionary.

4 years agoFix typo in test_typing.py (GH-26853)
Ikko Ashimine [Tue, 22 Jun 2021 22:42:28 +0000 (07:42 +0900)] 
Fix typo in test_typing.py (GH-26853)

maximium -> maximum

4 years agobpo-43918: document signature and default argument of `anext` builtin (#25551)
Erik Welch [Tue, 22 Jun 2021 21:00:51 +0000 (16:00 -0500)] 
bpo-43918: document signature and default argument of `anext` builtin (#25551)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
4 years ago[doc] Improve punctuation atexit doc
Géry Ogam [Tue, 22 Jun 2021 16:49:12 +0000 (18:49 +0200)] 
[doc] Improve punctuation atexit doc

4 years agobpo-40528: Implement a metadata system for ASDL Generator (GH-20193)
Batuhan Taskaya [Tue, 22 Jun 2021 16:29:42 +0000 (19:29 +0300)] 
bpo-40528: Implement a metadata system for ASDL Generator (GH-20193)

ASDL Generator was lack of proper annotation related to generated
module. This patch implements a MetadataVisitor that produces a
metadata object to pass to other visitors that are visiting that
same module. For the inital patch, it dynamically retrieves int
sequences (like cmpop), that was previously hardcoded. It offers
an interface that is easy to extend.

4 years agobpo-41621: Document defaultdict's default_factory parameter (GH-21945)
Dennis Sweeney [Tue, 22 Jun 2021 14:19:24 +0000 (10:19 -0400)] 
bpo-41621: Document defaultdict's default_factory parameter (GH-21945)

It defaults to None and is positional only.

4 years agobpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848)
Ken Jin [Tue, 22 Jun 2021 13:54:44 +0000 (21:54 +0800)] 
bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848)

4 years agobpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH...
Ma Lin [Tue, 22 Jun 2021 07:04:23 +0000 (15:04 +0800)] 
bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764)

No longer use len() to get the length of the input data. For some buffer protocol objects,
the length obtained by using len() is wrong.

4 years agobpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808)
Russell Keith-Magee [Tue, 22 Jun 2021 06:36:36 +0000 (14:36 +0800)] 
bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808)

* bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated.

4 years agobpo-44287: asyncio test_popen() uses longer timeout (GH-26832)
Victor Stinner [Mon, 21 Jun 2021 23:58:19 +0000 (01:58 +0200)] 
bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)

Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.

WaitForMultipleObjects() timeout argument is in milliseconds.

4 years agobpo-13814: Explain why generators are not context managers (GH-26835)
Terry Jan Reedy [Mon, 21 Jun 2021 21:23:29 +0000 (17:23 -0400)] 
bpo-13814: Explain why generators are not context managers (GH-26835)

Put entry in Design FAQ after a question about a context manager for assignment.
Original patch by Aidan Lowe.

4 years agobpo-43693: Turn localspluskinds into an object (GH-26749)
Guido van Rossum [Mon, 21 Jun 2021 20:53:04 +0000 (13:53 -0700)] 
bpo-43693: Turn localspluskinds into an object (GH-26749)

Managing it as a bare pointer to malloc'ed bytes is just too awkward in a few places.

4 years agoReset DeprecationWarning filters in test_typing io and re (#26811)
Ken Jin [Mon, 21 Jun 2021 18:17:55 +0000 (02:17 +0800)] 
Reset DeprecationWarning filters in test_typing io and re (#26811)

4 years agobpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)
Pablo Galindo [Mon, 21 Jun 2021 15:23:53 +0000 (16:23 +0100)] 
bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)

4 years agobpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)
Dong-hee Na [Mon, 21 Jun 2021 13:59:02 +0000 (22:59 +0900)] 
bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)

4 years agobpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758)
Victor Stinner [Mon, 21 Jun 2021 11:16:18 +0000 (13:16 +0200)] 
bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758)

_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.