]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agoFix incorrect double indent in ast doc (#94976)
Terry Jan Reedy [Mon, 18 Jul 2022 17:24:18 +0000 (13:24 -0400)] 
Fix incorrect double indent in ast doc (#94976)

Warning directive indent was 4 rather than 3 spaces.

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

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

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

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

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

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

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

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

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

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

* oops, commit the parser

* 📜🤖 Added by blurb_it.

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

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

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

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

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

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

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

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

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

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

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

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

### Summary

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

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

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

* bpo-14916: interactive fd is not always stdin

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

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

* 📜🤖 Added by blurb_it.

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

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

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

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

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

* Update Doc/library/pathlib.rst

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

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

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

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

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

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

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

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

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

And trying to bind multiple sockets will fail with:

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

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

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

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

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

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

`bool_new` had no coverage.

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

Colum -> Column

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* fix typo - double spelled word 'use'

* change methods names to the infinitive form

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

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

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

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

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

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

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

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

* fix allocator and deallocator

* 📜🤖 Added by blurb_it.

* code review

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

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

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

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

* gh-93883: elide traceback indicators when possible

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

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

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

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

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

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

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

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

* Document NaN handling in functions that sort or count

* Update Doc/library/statistics.rst

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

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

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

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

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

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

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

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

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

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

3 years agogh-94607: Fix subclassing generics (GH-94610)
Ken Jin [Sat, 9 Jul 2022 04:18:01 +0000 (12:18 +0800)] 
gh-94607: Fix subclassing generics (GH-94610)

Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
3 years agoGH-93252: Fix error handling for failed Python calls (GH-94693)
Brandt Bucher [Sat, 9 Jul 2022 01:52:26 +0000 (18:52 -0700)] 
GH-93252: Fix error handling for failed Python calls (GH-94693)

3 years agoIncrease test coverage of Objects/exceptions.c (GH-94674)
Irit Katriel [Fri, 8 Jul 2022 18:01:47 +0000 (19:01 +0100)] 
Increase test coverage of Objects/exceptions.c (GH-94674)

3 years agoGH-90699: Intern statically allocated strings (GH-93597)
Kumar Aditya [Fri, 8 Jul 2022 17:47:37 +0000 (23:17 +0530)] 
GH-90699: Intern statically allocated strings (GH-93597)

This is similar to how strings are interned for deepfreeze.

3 years agogh-93649: Split vectorcall testing from _testcapimodule.c (GH-94549)
Petr Viktorin [Fri, 8 Jul 2022 15:56:26 +0000 (17:56 +0200)] 
gh-93649: Split vectorcall testing from _testcapimodule.c (GH-94549)

The `_testcapimodule.c` file is getting too large to work with effectively.
This PR lays out a general structure of how tests can be split up, with more splitting to come later if the structure is OK.

Vectorcall tests aren't the biggest issue -- it's just an area I want to work on next, so I'm starting here.
An issue specific to vectorcall tests is that it wasn't clear that e.g. `MethodDescriptor2` is related to testing vectorcall: the `/* Test PEP 590 */` section had an ambiguous end. Separate file should make things like this much clearer.
OTOH, for some pieces it might not be clear where they should be -- I left `meth_fastcall` with tests of the other calling conventions. IMO, even with the ambiguity it's still worth it to split the huge file up.

I'm not sure about the buildsystem changes, hopefully CI will tell me what's wrong.

@vstinner, @markshannon: Do you think this is a good idea?

Automerge-Triggered-By: GH:encukou
3 years agoUse mdash-es consistently in the library docs index (#92762)
Oleg Iarygin [Fri, 8 Jul 2022 14:44:15 +0000 (17:44 +0300)] 
Use mdash-es consistently in the library docs index (#92762)

3 years agogh-94199: Remove the ssl.wrap_socket() function (#94203)
Victor Stinner [Fri, 8 Jul 2022 13:20:15 +0000 (15:20 +0200)] 
gh-94199: Remove the ssl.wrap_socket() function (#94203)

Remove the ssl.wrap_socket() function, deprecated in Python 3.7:
instead, create a ssl.SSLContext object and call its
sl.SSLContext.wrap_socket() method. Any package that still uses
ssl.wrap_socket() is broken and insecure. The function neither sends
a SNI TLS extension nor validates server hostname. Code is subject to
CWE-295 : Improper Certificate Validation.

3 years agogh-94215: Fix error handling for line-tracing events (GH-94681)
Brandt Bucher [Fri, 8 Jul 2022 12:40:35 +0000 (05:40 -0700)] 
gh-94215: Fix error handling for line-tracing events (GH-94681)

* Re-enable crasher
* Fix error handling for line-tracing events
* blurb add

3 years agogh-94622: Add more references to the sqlite3 types anchor (#94623)
Erlend Egeberg Aasland [Fri, 8 Jul 2022 00:38:38 +0000 (02:38 +0200)] 
gh-94622: Add more references to the sqlite3 types anchor (#94623)

3 years agogh-94321: Document sqlite3.PrepareProtocol (#94620)
Erlend Egeberg Aasland [Thu, 7 Jul 2022 22:33:17 +0000 (00:33 +0200)] 
gh-94321: Document sqlite3.PrepareProtocol (#94620)

3 years agoGH-90699: Move generated static initializer to pycore_runtime_generated.h (GH-94051)
Kumar Aditya [Thu, 7 Jul 2022 20:04:05 +0000 (01:34 +0530)] 
GH-90699: Move generated static initializer to pycore_runtime_generated.h (GH-94051)

3 years agogh-93654: Add module docstring to pathlib (GH-94611)
Samuel Sloniker [Thu, 7 Jul 2022 19:59:29 +0000 (12:59 -0700)] 
gh-93654: Add module docstring to pathlib (GH-94611)

Issue: gh-93654

3 years agogh-94343: Ease initialization of reprlib.Repr attributes (GH-94581)
finefoot [Thu, 7 Jul 2022 14:55:33 +0000 (16:55 +0200)] 
gh-94343: Ease initialization of reprlib.Repr attributes (GH-94581)

3 years agogh-94642: Remove -D_XOPEN_SOURCE from more pkg-config CFLAGS (#94657)
Christian Heimes [Thu, 7 Jul 2022 12:47:32 +0000 (14:47 +0200)] 
gh-94642: Remove -D_XOPEN_SOURCE from more pkg-config CFLAGS (#94657)

Some pkg-config pc files define CFLAGS with -D_XOPEN_SOURCE=600. We always want _XOPEN_SOURCE=700.

3 years agogh-93910: Fix enum performance regression (GH-94614)
Michael Droettboom [Thu, 7 Jul 2022 11:26:56 +0000 (07:26 -0400)] 
gh-93910: Fix enum performance regression (GH-94614)

This removes the performance regression in 3.11, **at the expense of not fixing
the "bug" that allows accessing values from values** (e.g. `Color.RED.BLUE`).

Using the benchmark @markshannon [presented](https://github.com/python/cpython/issues/93910#issuecomment-1165503032), the results are:

| Version | Enum | Fast enum | Normal class |
| --- | --- | --- | --- |
| 3.10 | 2.04 | 0.59 | 0.56 |
| 3.11 | 2.78 | 0.31 | 0.15 |
| This PR | 1.30 | 0.32 | 0.16 |

I share this mostly as information about the source of the regression, as this may be useful. It may be that the lower-risk approach for the beta is just to revert to a previously-known working state.

3 years agoGH-94644: fix test_curses ref leak (GH-94647)
Kumar Aditya [Thu, 7 Jul 2022 10:57:45 +0000 (16:27 +0530)] 
GH-94644: fix test_curses ref leak (GH-94647)

3 years agogh-94644: Define HAVE_NCURSESW in pkg-config branch (#94651)
Christian Heimes [Thu, 7 Jul 2022 10:57:12 +0000 (12:57 +0200)] 
gh-94644: Define HAVE_NCURSESW in pkg-config branch (#94651)

3 years agogh-94215: Add reproducer for segfault in frame_setlineno() (GH-94563)
Christian Heimes [Thu, 7 Jul 2022 10:53:57 +0000 (12:53 +0200)] 
gh-94215: Add reproducer for segfault in frame_setlineno() (GH-94563)

3 years agogh-94430: Allow params named `module` or `self` with custom C names in Argument Clini...
Erlend Egeberg Aasland [Thu, 7 Jul 2022 09:29:34 +0000 (11:29 +0200)] 
gh-94430: Allow params named `module` or `self` with custom C names in Argument Clinic (#94431)

3 years agogh-94628: Add explicit parameter list to sqlite3.connect docs (#94629)
Erlend Egeberg Aasland [Thu, 7 Jul 2022 07:00:20 +0000 (09:00 +0200)] 
gh-94628: Add explicit parameter list to sqlite3.connect docs (#94629)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-92228: disable the compiler's 'small exit block inlining' optimization for blocks...
Irit Katriel [Thu, 7 Jul 2022 06:38:36 +0000 (07:38 +0100)] 
gh-92228: disable the compiler's 'small exit block inlining' optimization for blocks that have a line number (GH-94592)

Inlining of code that corresponds to source code lines, can make it hard to distinguish later between code which is only reachable from except handlers, and that which is reachable in normal control flow. This caused problems with the debugger's jump feature.

This PR turns off the inlining optimisation for code which has line numbers. We still inline things like the implicit "return None".

3 years agogh-94630: Update sqlite3 docs with positional-only and keyword-only symbols (#94631)
Erlend Egeberg Aasland [Wed, 6 Jul 2022 23:13:30 +0000 (01:13 +0200)] 
gh-94630: Update sqlite3 docs with positional-only and keyword-only symbols (#94631)

3 years agogh-94017: Improve clarity of sqlite3 transaction handling docs (#94320)
Erlend Egeberg Aasland [Wed, 6 Jul 2022 20:59:07 +0000 (22:59 +0200)] 
gh-94017: Improve clarity of sqlite3 transaction handling docs (#94320)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agoGH-93896: AAlways set event loop in asyncio.run and IsolatedAsyncioTestCase (#94593)
Kumar Aditya [Wed, 6 Jul 2022 15:18:21 +0000 (20:48 +0530)] 
GH-93896: AAlways set event loop in asyncio.run and IsolatedAsyncioTestCase (#94593)

3 years agogh-90005: Port readline and curses to PY_STDLIB_MOD (GH-94452)
Christian Heimes [Wed, 6 Jul 2022 09:56:25 +0000 (11:56 +0200)] 
gh-90005: Port readline and curses to PY_STDLIB_MOD (GH-94452)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
3 years agogh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_INFO and POP_EXCEPT cases...
Irit Katriel [Wed, 6 Jul 2022 06:15:59 +0000 (07:15 +0100)] 
gh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_INFO and POP_EXCEPT cases are no longer reachable (GH-94582)

3 years agogh-94510: Raise on re-entrant calls to sys.setprofile and sys.settrace (GH-94511)
Pablo Galindo Salgado [Tue, 5 Jul 2022 18:18:47 +0000 (19:18 +0100)] 
gh-94510: Raise on re-entrant calls to sys.setprofile and sys.settrace (GH-94511)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-91330: Tests and docs for dataclass descriptor-typed fields (GH-94424)
Erik De Bonte [Tue, 5 Jul 2022 18:09:41 +0000 (11:09 -0700)] 
gh-91330: Tests and docs for dataclass descriptor-typed fields (GH-94424)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-94360: Fix a tokenizer crash when reading encoded files with syntax errors from...
Pablo Galindo Salgado [Tue, 5 Jul 2022 16:39:21 +0000 (17:39 +0100)] 
gh-94360: Fix a tokenizer crash when reading encoded files with syntax errors from stdin (#94386)

* gh-94360: Fix a tokenizer crash when reading encoded files with syntax errors from stdin

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* nitty nit

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-90355: Add isolated flag if currently isolated (GH-92857)
Carter Dodd [Tue, 5 Jul 2022 15:23:44 +0000 (10:23 -0500)] 
gh-90355: Add isolated flag if currently isolated (GH-92857)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-92897: Ensure `venv --copies` respects source build property of the creating inter...
Jeremy Kloth [Tue, 5 Jul 2022 15:08:20 +0000 (10:08 -0500)] 
gh-92897: Ensure `venv --copies` respects source build property of the creating interpreter (GH-92899)

3 years agoDocs: Convert PEP 630 (Isolating Extension Modules) to a HOWTO (GH-94489)
Petr Viktorin [Tue, 5 Jul 2022 14:37:28 +0000 (16:37 +0200)] 
Docs: Convert PEP 630 (Isolating Extension Modules) to a HOWTO (GH-94489)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agobpo-46755: Don't log stack info twice in QueueHandler (GH-31355)
Erik Montnemery [Tue, 5 Jul 2022 14:23:12 +0000 (16:23 +0200)] 
bpo-46755: Don't log stack info twice in QueueHandler (GH-31355)

3 years agogh-94485: Set line number of module's RESUME instruction to 0, as specified by PEP...
Irit Katriel [Tue, 5 Jul 2022 12:38:44 +0000 (13:38 +0100)] 
gh-94485: Set line number of module's RESUME instruction to 0, as specified by PEP 626 (GH-94552)

Co-authored-by: Mark Shannon <mark@hotpy.org>