Commit graph

113771 commits

Author SHA1 Message Date
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
Miss Islington (bot)
f3212b1ec7
GH-77265: Document NaN handling in statistics functions that sort or count (GH-94676) (#94726) 2022-07-10 12:35:33 -05:00
Brandt Bucher
e5c8ad3e15
[3.11] GH-94694: Fix column offsets for multi-line method lookups (GH-94721)
(cherry picked from commit 264b3ddfd5)
2022-07-09 22:12:45 -07:00
Miss Islington (bot)
7b5737a51a
Improve dataclass docstring (gh-94686)
(cherry picked from commit a10cf2f6b3)

Co-authored-by: Tom Fryers <61272761+TomFryers@users.noreply.github.com>
2022-07-09 11:51:35 -07:00
Miss Islington (bot)
a61870e196
gh-94637: Release GIL in SSLContext.set_default_verify_paths (GH-94658)
(cherry picked from commit 78307c7dc2)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-09 09:33:15 -07:00
Kumar Aditya
7a341724e4
[3.11] GH-93252: Fix error handling for failed Python calls (GH-94693) (GH-94708)
Automerge-Triggered-By: GH:tiran
2022-07-09 05:09:15 -07:00
Miss Islington (bot)
b4e232c4b5
gh-94607: Fix subclassing generics (GH-94610)
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
(cherry picked from commit 6442a9dd21)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2022-07-08 22:20:43 -07:00
Miss Islington (bot)
cb4359ccfc
Use mdash-es consistently in the library docs index (GH-92762)
(cherry picked from commit efb20a97c4)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-07-08 07:52:02 -07:00
Christian Heimes
36a3372d51
[3.11] gh-94215: Fix error handling for line-tracing events (GH-94681) (GH-94688)
* Re-enable crasher
* Fix error handling for line-tracing events
* blurb add
(cherry picked from commit 23ee4a8067)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-07-08 15:25:53 +02:00
Erlend Egeberg Aasland
73a1800b55
[3.11] gh-94622: Add more references to the sqlite3 types anchor (GH-94623) (#94678)
(cherry picked from commit e5b841a403)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-08 02:50:01 +02:00
Miss Islington (bot)
c72001e5bd
gh-94321: Document sqlite3.PrepareProtocol (GH-94620)
(cherry picked from commit fb6dccae34)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-07 16:09:05 -07:00
Miss Islington (bot)
77a015387b
GH-94644: fix test_curses ref leak (GH-94647)
(cherry picked from commit 277f55cb04)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-07 05:03:00 -07:00
Miss Islington (bot)
65c431685b
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/93910GH-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.
(cherry picked from commit ed136b9673)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-07-07 05:01:09 -07:00
Miss Islington (bot)
421c4b0255
gh-94215: Add reproducer for segfault in frame_setlineno() (GH-94563)
(cherry picked from commit de5884295e)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-07 04:17:47 -07:00
Erlend Egeberg Aasland
c0b7868db2
[3.11] gh-94430: Allow params named module or self with custom C names in AC (GH-94431) (#94649)
(cherry picked from commit 8bbd70b4d1)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-07 12:12:47 +02:00