Commit graph

113785 commits

Author SHA1 Message Date
Miss Islington (bot)
9487e8d250
GH-91153: Handle mutating __index__ methods in bytearray item assignment (GH-94891)
(cherry picked from commit f36589510b)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-07-19 10:12:39 -07:00
Miss Islington (bot)
d2be44230e
Remove out of date reference to YIELD_FROM from docs. (GH-94966) (GH-94975)
(cherry picked from commit c41d4d0917)

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

Co-authored-by: Mark Shannon <mark@hotpy.org>
2022-07-19 12:58:44 +01:00
Miss Islington (bot)
fbd24068c2
test_concurrent_futures: Fix unneeded/confusing format call (GH-93119)
Added in 339fd46cb7 - but as noted in a comment, the test only tests ThreadPoolExecutor.
(cherry picked from commit 3f2dd0a7c0)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-07-18 19:42:19 -07:00
Miss Islington (bot)
7733aa048e
gh-94949: Disallow parsing parenthesised ctx mgr with old feature_version (GH-94950)
* gh-94949: Disallow parsing parenthesised ctx manager with old feature_version

* 📜🤖 Added by blurb_it.

* Allow it with feature_version=(3, 9) as well

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0daba82221)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-18 14:57:45 -07:00
Ethan Furman
be84daf52a
Revert "gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)" (#94981)
This reverts commit 30f28ac296.
2022-07-18 13:56:21 -07:00
Brandt Bucher
eda2f90094
[3.11] GH-94822: Don't specialize when metaclasses are involved (GH-94892) (GH-94980)
(cherry picked from commit daf68ba92f)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-07-18 11:55:07 -07:00
Miss Islington (bot)
a5c8cecf29
Fix incorrect double indent in ast doc (GH-94976)
Warning directive indent was 4 rather than 3 spaces.
(cherry picked from commit a25a803c4c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-07-18 10:34:09 -07:00
Miss Islington (bot)
37ec0bdf16
In ast doc, update 'below' to 'above' (GH-94967)
The included asdl file was moved from 'below' to 'above' in 3.9.
(cherry picked from commit 7b617be4ab)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-07-18 09:46:26 -07:00
Miss Islington (bot)
ec6ed6681d
gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)
(cherry picked from commit 067f0da335)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-07-18 08:41:22 -07:00
Miss Islington (bot)
a914fa979e
GH-94857: fix test_io refleak (GH-94858)
(cherry picked from commit 631160c262)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-18 07:17:55 -07:00
Miss Islington (bot)
4607e884e5
[3.11] gh-94847: Don't force inlining in debug builds of libmpdec (GH-94848) (GH-94951)
Co-authored-by: Christian Heimes <christian@python.org>
2022-07-18 14:42:42 +02:00
Miss Islington (bot)
7dc236d116
gh-94947: Disallow parsing walrus with feature_version < (3, 8) (GH-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>
(cherry picked from commit ae0be5a53b)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-18 02:46:21 -07:00
Christian Heimes
30412d91b6
[3.11] gh-94801: Use custom flags to check for headers and libs (GH-94802) (GH-94881)
Co-authored-by: Christian Heimes <christian@python.org>
2022-07-18 08:46:49 +02:00
Miss Islington (bot)
e747562345
gh-94601: [Enum] fix inheritance for __str__ and friends (GH-94942)
(cherry picked from commit c961d14f85)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-07-17 19:18:41 -07:00
Miss Islington (bot)
8d0249e345
gh-72889: Remove redundant mock.Mock()._is_coroutine = False workarounds (GH-94926)
(cherry picked from commit 07aeb7405e)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-07-17 10:49:01 -07:00
Miss Islington (bot)
1c63734217
gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)
(cherry picked from commit 044a593cbb)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-07-17 08:49:57 -07:00
Miss Islington (bot)
65d87a2cb8
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 f6b3a07b7d (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
(cherry picked from commit c22f134211)

Co-authored-by: Nir Soffer <nsoffer@redhat.com>
2022-07-17 08:39:22 -07:00
Miss Islington (bot)
7bca87d384
gh-92348: Add quotes to support building on Windows with spaces in directory name (GH-94925)
(cherry picked from commit 5c19ddab65)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-07-17 07:46:43 -07:00
Serhiy Storchaka
107c21c5d5
gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (GH-94902)
It returned 1 (success) when warnings are turned into exceptions.
2022-07-17 08:23:37 +03:00
Miss Islington (bot)
30f28ac296
gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)
(cherry picked from commit c20186c397)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-07-16 21:53:41 -07:00
Miss Islington (bot)
5a34287b5d
gh-91181: Add a What's New entry for dropping bytes support for sys.path (GH-94918)
(cherry picked from commit ec4745b5f2)

Co-authored-by: Brett Cannon <brett@python.org>
2022-07-16 19:23:57 -07:00
Miss Islington (bot)
ccbf85382c
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>
(cherry picked from commit 6da988a46c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-07-16 18:31:25 -07:00
Miss Islington (bot)
e121cb5814
gh-94869: Fix the location in some expressions for multi-line f-string ast nodes (GH-94895)
(cherry picked from commit 2e9da8e352)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-07-16 12:16:51 -07:00
Miss Islington (bot)
8c08e86d8d
gh-90844: Allow virtual environments to correctly launch when they have spaces in the path (GH-94903)
(cherry picked from commit 4b4439daed)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-07-16 10:11:34 -07:00
Miss Islington (bot)
b040617195
gh-94772: Fix off-by-one error in Windows launcher (GH-94779)
(cherry picked from commit 407ff6556c)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2022-07-16 10:42:08 +01:00
Miss Islington (bot)
734c8b7e55
Add additional pointers to pathlib's mapping to os.path functions (GH-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>
(cherry picked from commit 3789c63577)

Co-authored-by: Chris Adams <chris@improbable.org>
2022-07-15 15:21:34 -07:00
Miss Islington (bot)
8dc4de3aaf
gh-94808: Add coverage for boolobject.c:bool_new (GH-94859) (GH-94883)
`bool_new` had no coverage.

Automerge-Triggered-By: GH:brandtbucher
(cherry picked from commit df4d53a09a)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-07-15 10:37:13 -07:00
Miss Islington (bot)
e55f60db8f
[3.11] GH-94808: Cover handling non-finite numbers from round when ndigits is provided (GH-94860) (GH-94882)
(cherry picked from commit 625ba9bdff)


Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Automerge-Triggered-By: GH:brandtbucher
2022-07-15 10:34:18 -07:00
Miss Islington (bot)
8f92ebbde7
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
(cherry picked from commit 582ae86b3f)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-07-15 10:28:47 -07:00
Miss Islington (bot)
d9107aa015
gh-94731: Revert to C-style casts for _Py_CAST (GH-94782) (#94849)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
(cherry picked from commit 6cbb57f62d)
2022-07-15 09:35:23 +02:00
Miss Islington (bot)
a6c4ca9b7c
[3.11] [doc] Update cookbook example and add information about queue types. (GH-94854) (GH-94871)
(cherry picked from commit dc54193095)
2022-07-15 08:19:02 +01:00
Miss Islington (bot)
3b6cb56dc9
GH-46771: docs for asyncio.timeout and task cancellation (GH-94794)
(cherry picked from commit 08f68975ab)

Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
2022-07-14 19:48:03 -07:00
Miss Islington (bot)
016fd7b57f
Docs: fix typo in sqlite3.rst (GH-94798)
Colum -> Column
(cherry picked from commit 9ea72e9d8d)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2022-07-14 14:56:30 -07:00
Miss Islington (bot)
498c649080
gh-94841: Ensure arena_map_get() is inlined in PyObject_Free() (GH-94842)
(cherry picked from commit 9b3f779209)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2022-07-14 12:04:06 -07:00
Miss Islington (bot)
91f7914003
GH-89988: Fix memory leak in pickle.Pickler dispatch_table lookup (GH-94298)
(cherry picked from commit 01ef1f95da)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-14 09:47:17 -07:00
Miss Islington (bot)
29fc20cdc0
idlelib: replace 'while 1' with 'while True' (GH-94827)
(cherry picked from commit 6a15f918b5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-07-13 18:33:29 -07:00
Dong-hee Na
0a51204cd0
[3.11] gh-90359: Unify documentation style for datetime.rst (gh-94836) (gh-94838)
(cherry picked from commit 967da5febb)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-07-14 09:52:53 +09:00
Miss Islington (bot)
c473627c73
gh-90359: Update documentation to follow PEP 495. (gh-94800)
(cherry picked from commit 07374cce52)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-07-13 17:16:09 -07:00
Miss Islington (bot)
11cdde85c3
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`).
(cherry picked from commit 4a6bb30eb6)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2022-07-13 09:40:46 -07:00
Miss Islington (bot)
f44a9dc430
gh-94759: Create LCOV report with branch coverage (GH-94793)
(cherry picked from commit f5c02afaff)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-13 08:01:15 -07:00
Miss Islington (bot)
ffbd6ae37c
gh-94751: Install, import and run the test C++ extension (MVP) (GH-94754) (#94780)
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
(cherry picked from commit ec5db539b9)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-07-13 11:09:06 +02:00
Miss Islington (bot)
3c91f42918
Fix typo in _exact_ratio comment. (GH-94789)
(cherry picked from commit e39ce7d487)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2022-07-12 14:57:39 -07:00
Miss Islington (bot)
7c185017a9
docs: typing.Self, fix typo (GH-94771)
* fix typo - double spelled word 'use'

* change methods names to the infinitive form
(cherry picked from commit 90a6e56e56)

Co-authored-by: Max Zhenzhera <59729293+maxzhenzhera@users.noreply.github.com>
2022-07-12 11:17:06 -07:00
Miss Islington (bot)
cdd0cabf92
gh-94773: deepfreeze: support frozensets with unsortable types (GH-94775)
(cherry picked from commit 0c66074e9f)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-12 09:35:43 -07:00
Pablo Galindo
a4b98a792f
Post 3.11.0b4 2022-07-11 18:31:05 +01:00
Pablo Galindo
5a7e1e0a92
Python 3.11.0b4 2022-07-11 16:25:22 +01:00
Miss Islington (bot)
a276833a7d
[3.11] GH-94736: mark SemLock test as linux only (GH-94750) (#94752)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-11 16:24:12 +01:00
Miss Islington (bot)
91176d3883
[3.11] bpo-45924: Fix asyncio incorrect traceback when future's exception is raised multiple times (GH-30274) (#94747)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-11 14:17:32 +01:00
Miss Islington (bot)
8464e4ae83
GH-94736: Fix _multiprocessing.SemLock subclassing (GH-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>
(cherry picked from commit f5b76330cf)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-11 05:40:02 -07:00
John Belmonte
45896f2a02
[3.11] gh-93883: elide traceback indicators when possible (GH-93994) (GH-94740)
Elide traceback column indicators when the entire line of the
frame is implicated.  This reduces traceback length and draws
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
```

Automerge-Triggered-By: GH:pablogsal
2022-07-11 04:27:29 -07:00