]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-44632: Fix support of TypeVar in the union type (GH-27139)
Serhiy Storchaka [Wed, 14 Jul 2021 17:09:15 +0000 (20:09 +0300)] 
bpo-44632: Fix support of TypeVar in the union type (GH-27139)

int | TypeVar('T') returns now an instance of types.Union
instead of typing.Union.

4 years agobpo-44635: Convert None to NoneType in the union type constructor (GH-27136)
Serhiy Storchaka [Wed, 14 Jul 2021 16:54:54 +0000 (19:54 +0300)] 
bpo-44635: Convert None to NoneType in the union type constructor (GH-27136)

4 years agobpo-42064: Move `sqlite3` exceptions to global state, part 2 of 2 (GH-26884)
Erlend Egeberg Aasland [Wed, 14 Jul 2021 11:26:44 +0000 (13:26 +0200)] 
bpo-42064: Move `sqlite3` exceptions to global state, part 2 of 2 (GH-26884)

Automerge-Triggered-By: GH:encukou
4 years agobpo-44616: Mark all clean up instructions at end of named exception block as artifici...
Mark Shannon [Wed, 14 Jul 2021 09:08:38 +0000 (10:08 +0100)] 
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109)

4 years agobpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
Serhiy Storchaka [Wed, 14 Jul 2021 05:19:18 +0000 (08:19 +0300)] 
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)

if it is called with a sequence or set, but not list or tuple.

4 years agobpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)
Serhiy Storchaka [Wed, 14 Jul 2021 04:35:39 +0000 (07:35 +0300)] 
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)

* Fix issubclass() for None.
  E.g. issubclass(type(None), int | None) returns now True.
* Fix issubclass() for virtual subclasses.
  E.g. issubclass(dict, int | collections.abc.Mapping) returns now True.
* Fix crash in isinstance() if the check for one of items raises exception.

4 years agobpo-44630: Fix assertion errors in csv module (GH-27127)
T. Wouters [Tue, 13 Jul 2021 22:56:45 +0000 (00:56 +0200)] 
bpo-44630: Fix assertion errors in csv module (GH-27127)

Fix incorrect handling of exceptions when interpreting dialect objects in
the csv module. Not clearing exceptions between calls to
PyObject_GetAttrString() causes assertion failures in pydebug mode (or with
assertions enabled).

Add a minimal test that would've caught this (passing None as dialect, or
any object that isn't a csv.Dialect subclass, which the csv module allows
and caters to, even though it is not documented.) In pydebug mode, the test
triggers the assertion failure in the old code.

Contributed-By: T. Wouters [Google]
4 years agobpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)
Serhiy Storchaka [Tue, 13 Jul 2021 21:27:50 +0000 (00:27 +0300)] 
bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
4 years agobpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneou...
Konstantin-Glukhov [Tue, 13 Jul 2021 19:21:48 +0000 (04:21 +0900)] 
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092)

4 years agoFix typos in Mac/README.rst (#27108)
Clemens Brunner [Tue, 13 Jul 2021 16:25:12 +0000 (18:25 +0200)] 
Fix typos in Mac/README.rst (#27108)

4 years agobpo-43126: Expand docs on io.IOBase.readlines() method (#27061)
andrei kulakov [Tue, 13 Jul 2021 14:07:56 +0000 (10:07 -0400)] 
bpo-43126: Expand docs on io.IOBase.readlines() method (#27061)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44514: Add doctest testcleanup for configparser and bz2 (#26909)
Kevin Follstad [Tue, 13 Jul 2021 13:57:05 +0000 (06:57 -0700)] 
bpo-44514: Add doctest testcleanup for configparser and bz2 (#26909)

Add testcleanup section to configparser and bz2 documentation which
removes temporary files created in the filesystem when 'make doctest'
is run.

4 years agobpo-38741: Definition of multiple ']' in header configparser (GH-17129)
jsnklln [Tue, 13 Jul 2021 13:54:06 +0000 (09:54 -0400)] 
bpo-38741: Definition of multiple ']' in header configparser (GH-17129)

Co-authored-by: Jason Killen <jason.killen@windsorcircle.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 years agobpo-35113: clean up duplicate import and comment (#27073)
andrei kulakov [Tue, 13 Jul 2021 13:42:56 +0000 (09:42 -0400)] 
bpo-35113: clean up duplicate import and comment (#27073)

4 years agoRemove unnecessary pass statements (GH-27103)
Elisha Hollander [Tue, 13 Jul 2021 13:02:30 +0000 (16:02 +0300)] 
Remove unnecessary pass statements (GH-27103)

4 years agobpo-43950: Add documentation for PEP-657 (GH-27047)
Ammar Askar [Tue, 13 Jul 2021 00:29:39 +0000 (20:29 -0400)] 
bpo-43950: Add documentation for PEP-657 (GH-27047)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
4 years agobpo-44613: Make importlib.metadata non-provisional (#27101)
Barry Warsaw [Mon, 12 Jul 2021 23:56:40 +0000 (16:56 -0700)] 
bpo-44613: Make importlib.metadata non-provisional (#27101)

* importlib.metadata is no longer provisional as of 3.10
* Add NEWS entry

4 years agobpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)
Batuhan Taskaya [Mon, 12 Jul 2021 19:32:33 +0000 (22:32 +0300)] 
bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
4 years agobpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026)
David Sanders [Mon, 12 Jul 2021 15:19:54 +0000 (01:19 +1000)] 
bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026)

4 years agobpo-26329: update os.path.normpath documentation (GH-20138)
Furkan Onder [Mon, 12 Jul 2021 12:48:01 +0000 (15:48 +0300)] 
bpo-26329: update os.path.normpath documentation (GH-20138)

* bpo-26329: update os.path.normpath documentation

* Update os.path.rst

* Update posixpath.py

* update Pathname Resolution note

4 years agobuild(deps): bump actions/upload-artifact from 2.2.3 to 2.2.4 (#26979)
dependabot[bot] [Mon, 12 Jul 2021 11:29:13 +0000 (13:29 +0200)] 
build(deps): bump actions/upload-artifact from 2.2.3 to 2.2.4 (#26979)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years agobpo-44207: Add an internal version number to function objects. (GH-27078)
Mark Shannon [Mon, 12 Jul 2021 09:01:01 +0000 (10:01 +0100)] 
bpo-44207: Add an internal version number to function objects. (GH-27078)

4 years agobpo-29753: revert 0d7ad9f (GH-19850) (GH-27085)
Filipe Laíns [Sun, 11 Jul 2021 16:43:50 +0000 (17:43 +0100)] 
bpo-29753: revert 0d7ad9f (GH-19850) (GH-27085)

This reverts commit 0d7ad9fb38c041c46094087b0cf2c8ce44916b11 as it has a regression.

See https://github.com/python/cpython/pull/19850#issuecomment-869410686

4 years agobpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryE...
andrei kulakov [Sat, 10 Jul 2021 03:47:41 +0000 (23:47 -0400)] 
bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049)

Fixes the misleading IsADirectoryError to be FileNotFoundError.

4 years agobpo-44317: Improve tokenizer errors with more informative locations (GH-26555)
Pablo Galindo Salgado [Sat, 10 Jul 2021 00:29:29 +0000 (01:29 +0100)] 
bpo-44317: Improve tokenizer errors with more informative locations (GH-26555)

4 years agoRemove irrelevant comment which was added in 2a70a3a (GH-27044)
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Fri, 9 Jul 2021 04:57:25 +0000 (10:27 +0530)] 
Remove irrelevant comment which was added in 2a70a3a (GH-27044)

4 years agobpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)
Mark Shannon [Thu, 8 Jul 2021 18:21:09 +0000 (19:21 +0100)] 
bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)

4 years agobpo-44446: support lineno being None in traceback.FrameSummary (GH-26781)
Filipe Laíns [Thu, 8 Jul 2021 16:28:01 +0000 (17:28 +0100)] 
bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781)

As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead
of -1 if there is no line number.

Signed-off-by: Filipe Laíns <lains@riseup.net>
4 years agobpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059)
Steve Dower [Thu, 8 Jul 2021 15:48:42 +0000 (16:48 +0100)] 
bpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059)

4 years agodocs: add the word 'official' (GH-26849)
Ned Batchelder [Thu, 8 Jul 2021 14:58:13 +0000 (07:58 -0700)] 
docs: add the word 'official' (GH-26849)

4 years agobpo-44581: Don't execute quickened instructions if tracing is on (GH-27064)
Mark Shannon [Thu, 8 Jul 2021 12:33:13 +0000 (13:33 +0100)] 
bpo-44581: Don't execute quickened instructions if tracing is on (GH-27064)

4 years agobpo-43908: Immutable types inherit vectorcall (GH-27001)
Erlend Egeberg Aasland [Thu, 8 Jul 2021 10:48:01 +0000 (12:48 +0200)] 
bpo-43908: Immutable types inherit vectorcall (GH-27001)

Heap types with the Py_TPFLAGS_IMMUTABLETYPE flag can now inherit the
PEP 590 vectorcall protocol.  Previously, this was only possible for static types.

Co-authored-by: Victor Stinner <vstinner@python.org>
4 years agoDoc: Fix wrong exception used in example. (GH-26572)
Julien Palard [Thu, 8 Jul 2021 07:31:28 +0000 (09:31 +0200)] 
Doc: Fix wrong exception used in example. (GH-26572)

4 years agobpo-41137: Use utf-8 encoding while reading .pdbrc files (GH-21263)
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Thu, 8 Jul 2021 07:16:08 +0000 (12:46 +0530)] 
bpo-41137: Use utf-8 encoding while reading .pdbrc files (GH-21263)

4 years agobpo-43895: Remove an unnecessary cache of shared object handles (GH-25487)
Ian Henriksen [Wed, 7 Jul 2021 23:26:06 +0000 (18:26 -0500)] 
bpo-43895: Remove an unnecessary cache of shared object handles (GH-25487)

* Remove an unnecessary cache of shared object handles.

4 years agoRemove __cleanenv from PEP-657 tests (GH-27060)
Ammar Askar [Wed, 7 Jul 2021 21:47:50 +0000 (17:47 -0400)] 
Remove __cleanenv from PEP-657 tests (GH-27060)

4 years agobpo-43950: Add option to opt-out of PEP-657 (GH-27023)
Ammar Askar [Wed, 7 Jul 2021 19:07:12 +0000 (15:07 -0400)] 
bpo-43950: Add option to opt-out of PEP-657 (GH-27023)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
4 years agobpo-44479: Simplified LICENSE.txt regeneration in Windows build (GH-27056)
Steve Dower [Wed, 7 Jul 2021 17:21:54 +0000 (18:21 +0100)] 
bpo-44479: Simplified LICENSE.txt regeneration in Windows build (GH-27056)

4 years agobpo-44558: Match countOf `is`/`==` treatment to c (GH-27007)
Rupert Tombs [Wed, 7 Jul 2021 13:28:09 +0000 (14:28 +0100)] 
bpo-44558: Match countOf `is`/`==` treatment to c (GH-27007)

4 years agobpo-44530: Document the new CodeObject.co_qualname attribute (GH-27052)
Pablo Galindo [Wed, 7 Jul 2021 13:20:49 +0000 (14:20 +0100)] 
bpo-44530: Document the new CodeObject.co_qualname attribute (GH-27052)

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)