Commit Graph

113600 Commits

Author SHA1 Message Date
Christian Heimes 1073184918
[3.11] gh-84461: Fix Emscripten umask and permission issues (GH-94002) (GH-94006)
Co-authored-by: Christian Heimes <christian@python.org>
2022-06-19 20:18:34 +02:00
Miss Islington (bot) 15c8838273
GH-93990: fix refcounting bug in `add_subclass` in `typeobject.c` (GH-93989)
(cherry picked from commit 726448ebe1)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-06-19 02:51:22 -07:00
Miss Islington (bot) 0c826d3623
What's new in 3.10: fix link to issue (GH-93968)
* What's new in 3.10: fix link to issue

* What's new in 3.10: fix link to GH issue

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 59c1b33805)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-06-19 02:12:06 -07:00
Miss Islington (bot) 579e985e75
gh-89828: Do not relay the __class__ attribute in GenericAlias (GH-93754)
list[int].__class__ returned type, and isinstance(list[int], type)
returned True. It caused numerous problems in code that checks
isinstance(x, type).
(cherry picked from commit f9433fff47)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-18 07:41:25 -07:00
Miss Islington (bot) 2eff55cd46
gh-92888: Fix memoryview bad `__index__` use after free (GH-92946)
Co-authored-by: chilaxan <35645806+chilaxan@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
(cherry picked from commit 11190c4ad0)

Co-authored-by: Ken Jin <kenjin@python.org>
2022-06-18 07:40:39 -07:00
Miss Islington (bot) 6c8eb9503c
gh-84461: Fix pydebug Emscripten browser builds (GH-93982)
wasm_assets script did not take the ABIFLAG flag of sysconfigdata into
account.
(cherry picked from commit 7a2cc35e1c)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-18 06:17:09 -07:00
Miss Islington (bot) 753fe41418
gh-84461: Fix circulare dependency on BUILDPYTHON (GH-93977)
(cherry picked from commit 084023ccbe)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-18 01:56:25 -07:00
Miss Islington (bot) 79d22694f2
GH-89858: Fix test_embed for out-of-tree builds (GH-93465)
(cherry picked from commit 96464e5401)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-06-17 22:11:59 -07:00
Miss Islington (bot) 2b7fc1bfe6
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364) (GH-93923) 2022-06-17 23:31:42 +01:00
Brandt Bucher 05d83a706c
GH-91389: Fix dis position information for CACHEs (GH-93663) (GH-93921)
(cherry picked from commit f8e576be0a)
2022-06-17 10:26:20 -07:00
Miss Islington (bot) 1353b8a4bc
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (GH-93941)
Set timeout, don't create a local variable with the same name.
(cherry picked from commit f64557f480)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-17 07:39:27 -07:00
Miss Islington (bot) e6cca2e00b
gh-89745: Avoid exact match when comparing program_name in test_embed on Windows (GH-93888)
(cherry picked from commit ffc228dd4e)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2022-06-17 03:31:03 -07:00
Miss Islington (bot) 123e3be33b
test_logging: Fix BytesWarning in SysLogHandlerTest (GH-93920)
(cherry picked from commit 538f28921f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-17 02:53:35 -07:00
Miss Islington (bot) 029835d9d4
gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (GH-93882)
Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure (GH-32283)"

This reverts commit 6e3eee5c11.

Manual fixups to increase the MAGIC number and to handle conflicts with
a couple of changes that landed after that.

Thanks for reviews by Ma Lin and Serhiy Storchaka.
(cherry picked from commit 4beee0c7b0)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-06-17 01:43:56 -07:00
Kumar Aditya 5ee86d4306
gh-91877: Fix WriteTransport.get_write_buffer_{limits,size} docs (#92338) (#93806)
- Amend docs for WriteTransport.get_write_buffer_limits
- Add docs for WriteTransport.get_write_buffer_size

Co-authored-by: Sanket Shanbhag <TechieBoy@users.noreply.github.com>
2022-06-17 10:18:00 +02:00
Miss Islington (bot) 0319052090
gh-93847: Fix repr of enum of generic aliases (GH-93885)
(cherry picked from commit 138db8e48b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-16 22:00:22 -07:00
Miss Islington (bot) 3fbf5c6427
gh-93820: Fix copy() regression in enum.Flag (GH-93876) (#93886)
GH-26658 introduced a regression in copy / pickle protocol for combined
`enum.Flag`s. `copy.copy(re.A | re.I)` would fail with
`AttributeError: ASCII|IGNORECASE`.

`enum.Flag` now has a `__reduce_ex__()` method that reduces flags by
combined value, not by combined name.
(cherry picked from commit 05b32c1c79)

Co-authored-by: Christian Heimes <christian@python.org>

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-17 06:56:20 +03:00
Miss Islington (bot) 74561095d9
gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid UB (GH-93700)
(cherry picked from commit 65ff27c7d3)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-06-16 07:50:15 -07:00
Miss Islington (bot) 0c49a09e67
gh-91577: SharedMemory move imports out of methods (GH-91579)
SharedMemory.unlink() uses the unregister() function from resource_tracker. Previously it was imported in the method, but this can fail if the method is called during interpreter shutdown, for example when unlink is part of a __del__() method.

Moving the import to the top of the file, means that the unregister() method is available during interpreter shutdown.

The register call in SharedMemory.__init__() can also use this imported resource_tracker.
(cherry picked from commit 9a458befdd)

Co-authored-by: samtygier <samtygier@yahoo.co.uk>
2022-06-16 07:07:32 -07:00
Miss Islington (bot) 62f72e4811
gh-91321: Fix test_cppext for C++03 (GH-93902) (#93904)
Don't build _testcppext.cpp with -Wzero-as-null-pointer-constant when
testing C++03: only use this compiler flag with C++11.
(cherry picked from commit a38c2a61d5)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-16 15:17:35 +02:00
Irit Katriel df091e14d8
[3.11] GH-93662: Make sure that column offsets are correct in multi-line method calls. (GH-93673) (#93895)
Co-authored-by: Mark Shannon <mark@hotpy.org>
2022-06-16 11:56:35 +01:00
Miss Islington (bot) 6e28032662
gh-84461: Document how to install SDKs manually (GH-93844)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit 8ba1c7f720)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-15 12:53:51 -07:00
Miss Islington (bot) 87864077de
gh-93824: Reenable installation of shell extension on Windows ARM64 (GH-93825)
(cherry picked from commit 99be1cbeb3)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-06-15 09:34:32 -07:00
Miss Islington (bot) d1fd7393a2
GH-93850: Fix test_asyncio exception ignored tracebacks (GH-93854)
(cherry picked from commit b415c5f1aa)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-06-15 08:10:40 -07:00
Miss Islington (bot) 40c257d64f
gh-93857: Fix broken audit-event targets in sqlite3 docs (GH-93859)
Corrected targets for the following audit-events:

- sqlite3.enable_load_extension => sqlite3.Connection.enable_load_extension
- sqlite3.load_extension => sqlite3.Connection.load_extension
(cherry picked from commit ce4d11f98b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 07:09:37 -07:00
Miss Islington (bot) 528569319f
gh-87260: Update sqlite3 signature docs to reflect actual implementation (GH-93840)
Align the docs for the following methods with the actual implementation:

- sqlite3.complete_statement()
- sqlite3.Connection.create_function()
- sqlite3.Connection.create_aggregate()
- sqlite3.Connection.set_progress_handler()
(cherry picked from commit d31834688b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 03:35:48 -07:00
Erlend Egeberg Aasland 9775ac3f07
[3.11] gh-89018: Improve documentation of `sqlite3` exceptions (GH-27645) (#93836)
- Order exceptions as in PEP 249
- Reword descriptions, so they match the current behaviour

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit bb0b768946)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 11:36:55 +02:00
Miss Islington (bot) cde0dadd34
gh-93183: Adjust wording in socket docs (GH-93832)
package => packet

Co-authored-by: Victor Norman
(cherry picked from commit cdd3984307)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 01:44:14 -07:00
Miss Islington (bot) 7db66d8816
gh-93735: Split Docs CI to speed-up the build (GH-93736)
(cherry picked from commit 4f26963526)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-15 01:23:08 -07:00
Miss Islington (bot) 73c8f3ff54
gh-92914: Round the allocated size for lists up to the even number (GH-92915)
(cherry picked from commit 8a6af5a346)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-14 12:16:21 -07:00
Miss Islington (bot) cbfbe248e3
gh-90300: split --help output into separate options (GH-30331)
Make --help output shorter and add new help options.

--help-env, --help-xoptions and --help-all command-line options are
added to complement --help.
(cherry picked from commit 8aa9d40b00)

Co-authored-by: Éric <earaujo@caravan.coop>
2022-06-14 12:15:42 -07:00
Miss Islington (bot) 29c7e815bc
gh-79512: Fixed names and __module__ value of weakref classes (GH-93719)
Classes ReferenceType, ProxyType and CallableProxyType have now correct
atrtributes __module__, __name__ and __qualname__.
It makes them (types, not instances) pickleable.
(cherry picked from commit 8352e322e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-14 12:12:51 -07:00
Miss Islington (bot) 8dc5df4e21
[3.11] gh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar and TypeVarTuple parameters (alt) (GH-93412) (GH-93746)
For example:

  A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
  A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
(cherry picked from commit 3473817106)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-14 21:15:56 +03:00
Erlend Egeberg Aasland 7aa4038a6e
[3.11] gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (GH-93796) (#93808) 2022-06-14 17:41:32 +02:00
Victor Stinner ef591cf8e3
gh-91321: Fix compatibility with C++ older than C++11 (#93784) (#93802)
* Fix the compatibility of the Python C API with C++ older than C++11.
* _Py_NULL is only defined as nullptr on C++11 and newer.

(cherry picked from commit 4caf5c2753)

* test_cppext now builds the C++ extension with setuptools.
* Add @test.support.requires_venv_with_pip.

(cherry picked from commit ca0cc9c433)
2022-06-14 16:05:14 +02:00
Erlend Egeberg Aasland 871b1dc469
[3.11] gh-79579: Improve DML query detection in sqlite3 (GH-93623) (#93800)
The fix involves using pysqlite_check_remaining_sql(), not only to check
for multiple statements, but now also to strip leading comments and
whitespace from SQL statements, so we can improve DML query detection.

pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more
accurately reflect its function, and hardened to handle more SQL comment
corner cases.
(cherry picked from commit 46740073ef)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-14 14:49:22 +02:00
Serhiy Storchaka d42b3689f4
[3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742) (GH-93792)
It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8ec77)
2022-06-14 08:51:39 +03:00
Miss Islington (bot) 02ff1ccfb7
gh-84461: Fix parallel testing on WebAssembly (GH-93768)
(cherry picked from commit c2007573dd)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-13 11:15:46 -07:00
Miss Islington (bot) dc6dd8ee87
gh-93353: Fix importlib.resources._tempfile() finalizer (GH-93377)
Fix the importlib.resources.as_file() context manager to remove the
temporary file if destroyed late during Python finalization: keep a
local reference to the os.remove() function. Patch by Victor Stinner.
(cherry picked from commit 443ca731d6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-13 10:49:48 -07:00
Miss Islington (bot) 3d1c080591
gh-93461: Invalidate sys.path_importer_cache entries with relative paths (GH-93653)
(cherry picked from commit 09243b898a)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-12 23:29:59 -07:00
Miss Islington (bot) 536af65e96
Change list to view object (GH-93661)
(cherry picked from commit 5d8e7a1240)

Co-authored-by: Pamela Fox <pamela.fox@gmail.com>
2022-06-11 04:20:52 -07:00
Miss Islington (bot) 2e0e3ce0a1
gh-86404: [doc] A make sucpicious false positive. (GH-93710)
(cherry picked from commit bc3b31ea77)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-06-11 04:06:44 -07:00
Miss Islington (bot) 34ef12a350
gh-90473: Skip test_queue when threading is not available (GH-93712)
(cherry picked from commit f0b7aa71c4)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-11 03:20:28 -07:00
Miss Islington (bot) 36ece2effb
gh-90153: whatsnew: "z" option in format spec (GH-93624)
Add what's new entry for PEP 682 in Python 3.11.
(cherry picked from commit 010284b46b)

Co-authored-by: John Belmonte <john@neggie.net>
2022-06-11 03:14:24 -07:00
Miss Islington (bot) 4c881049ef
gh-84461: Use HOSTRUNNER to run regression tests (GH-93694)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit dc5e02b2f4)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-11 00:04:35 -07:00
Miss Islington (bot) 54fe3d57bf
gh-92930: _pickle.c: Acquire strong references before calling save() (GH-92931)
(cherry picked from commit 4c496f1f11)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-06-10 20:52:41 -07:00
Miss Islington (bot) 0aa9ec9f5d
gh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_zipimport.py` (GH-93236)
(cherry picked from commit 484a2357c8)

Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
2022-06-10 16:25:53 -07:00
Miss Islington (bot) 3a202de3bb
gh-91317: Document that Path does not collapse initial `//` (GH-32193)
Documentation for `pathlib` says:

> Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links:

However, it omits that initial double slashes also aren't collapsed.

Later, in documentation of `PurePath.drive`, `PurePath.root`, and `PurePath.name` it mentions UNC but:

- this abbreviation says nothing to a person who is unaware about existence of UNC (Wikipedia doesn't help either by [giving a disambiguation page](https://en.wikipedia.org/wiki/UNC))
- it shows up only if a person needs to use a specific property or decides to fully learn what the module provides.

For context, see the BPO entry.
(cherry picked from commit 78f1a43694)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-06-10 16:07:19 -07:00
Miss Islington (bot) f9d0240db8
gh-93671: Avoid exponential backtracking in deeply nested sequence patterns in match statements (GH-93680)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 53a8b17895)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-06-10 09:21:04 -07:00
Steve Dower 98558a8397
bpo-42658: Allow _winapi.LCMapStringEx to handle embedded nulls (GH-93688) 2022-06-10 17:09:37 +01:00