]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Miss Islington (bot) [Sat, 18 Jun 2022 08:56:25 +0000 (01:56 -0700)]
gh-84461: Fix circulare dependency on BUILDPYTHON (GH-93977)
(cherry picked from commit
084023ccbeb3bf54a2e19873c6a4b0bec7b617f6 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Sat, 18 Jun 2022 05:11:59 +0000 (22:11 -0700)]
GH-89858: Fix test_embed for out-of-tree builds (GH-93465)
(cherry picked from commit
96464e5401783c99f1ae24369bb2a854b8c5f46a )
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Miss Islington (bot) [Fri, 17 Jun 2022 22:31:42 +0000 (15:31 -0700)]
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364) (GH-93923)
Brandt Bucher [Fri, 17 Jun 2022 17:26:20 +0000 (10:26 -0700)]
GH-91389: Fix dis position information for CACHEs (GH-93663) (GH-93921)
(cherry picked from commit
f8e576be0a7cd38f753f31cf4178db81a602fc32 )
Miss Islington (bot) [Fri, 17 Jun 2022 14:39:27 +0000 (07:39 -0700)]
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
f64557f4803528c53bb9a1d565e3cdf92e97152f )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Fri, 17 Jun 2022 10:31:03 +0000 (03:31 -0700)]
gh-89745: Avoid exact match when comparing program_name in test_embed on Windows (GH-93888)
(cherry picked from commit
ffc228dd4e409336f2c2ad54125de384bf1a767b )
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Miss Islington (bot) [Fri, 17 Jun 2022 09:53:35 +0000 (02:53 -0700)]
test_logging: Fix BytesWarning in SysLogHandlerTest (GH-93920)
(cherry picked from commit
538f28921f67e36617272faa662375d305d9284c )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Fri, 17 Jun 2022 08:43:56 +0000 (01:43 -0700)]
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
6e3eee5c11b539e9aab39cff783acf57838c355a .
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
4beee0c7b0c2cc78a893dde88fd8e34099dcf877 )
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Kumar Aditya [Fri, 17 Jun 2022 08:18:00 +0000 (13:48 +0530)]
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>
Miss Islington (bot) [Fri, 17 Jun 2022 05:00:22 +0000 (22:00 -0700)]
gh-93847: Fix repr of enum of generic aliases (GH-93885)
(cherry picked from commit
138db8e48b0bb006b1561f8ec76ade97afc6cbd7 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Fri, 17 Jun 2022 03:56:20 +0000 (20:56 -0700)]
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
05b32c1c796d6c80479756ae898f488eac5f4f71 )
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Thu, 16 Jun 2022 14:50:15 +0000 (07:50 -0700)]
gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid UB (GH-93700)
(cherry picked from commit
65ff27c7d30b84655bf8caf6e396c65485708148 )
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Miss Islington (bot) [Thu, 16 Jun 2022 14:07:32 +0000 (07:07 -0700)]
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
9a458befdd68625d088f4fea7df135a57d147deb )
Co-authored-by: samtygier <samtygier@yahoo.co.uk>
Miss Islington (bot) [Thu, 16 Jun 2022 13:17:35 +0000 (06:17 -0700)]
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
a38c2a61d585fce0973e93dd590551ccddd947fb )
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Irit Katriel [Thu, 16 Jun 2022 10:56:35 +0000 (11:56 +0100)]
[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>
Miss Islington (bot) [Wed, 15 Jun 2022 19:53:51 +0000 (12:53 -0700)]
gh-84461: Document how to install SDKs manually (GH-93844)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit
8ba1c7f72010dedb80f0794c5f1dd1c97f81ec83 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Wed, 15 Jun 2022 16:34:32 +0000 (09:34 -0700)]
gh-93824: Reenable installation of shell extension on Windows ARM64 (GH-93825)
(cherry picked from commit
99be1cbeb3b58f0daa9108abc4075412d6212169 )
Co-authored-by: Steve Dower <steve.dower@python.org>
Miss Islington (bot) [Wed, 15 Jun 2022 15:10:40 +0000 (08:10 -0700)]
GH-93850: Fix test_asyncio exception ignored tracebacks (GH-93854)
(cherry picked from commit
b415c5f1aa29259d5d18a5d85b9365430614383a )
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Miss Islington (bot) [Wed, 15 Jun 2022 14:09:37 +0000 (07:09 -0700)]
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
ce4d11f98b30ec62f56a0653a212f0f78ca08b59 )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Miss Islington (bot) [Wed, 15 Jun 2022 10:35:48 +0000 (03:35 -0700)]
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
d31834688bccb41fc136f780db83ffa12bef8cbd )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Erlend Egeberg Aasland [Wed, 15 Jun 2022 09:36:55 +0000 (11:36 +0200)]
[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
bb0b7689465c3aac3b1d7f68c8990009462c1ae5 )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Miss Islington (bot) [Wed, 15 Jun 2022 08:44:14 +0000 (01:44 -0700)]
gh-93183: Adjust wording in socket docs (GH-93832)
package => packet
Co-authored-by: Victor Norman
(cherry picked from commit
cdd39843073fc27b8e4a887d5d3b7992cb2ced60 )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Miss Islington (bot) [Wed, 15 Jun 2022 08:23:08 +0000 (01:23 -0700)]
gh-93735: Split Docs CI to speed-up the build (GH-93736)
(cherry picked from commit
4f26963526f386bba84de8e14962163bfd5da955 )
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Miss Islington (bot) [Tue, 14 Jun 2022 19:16:21 +0000 (12:16 -0700)]
gh-92914: Round the allocated size for lists up to the even number (GH-92915)
(cherry picked from commit
8a6af5a34642f5564220eb50d72caada8f17fc78 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 14 Jun 2022 19:15:42 +0000 (12:15 -0700)]
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
8aa9d40b00741213c5a53b1ae15509998893ae31 )
Co-authored-by: Éric <earaujo@caravan.coop>
Miss Islington (bot) [Tue, 14 Jun 2022 19:12:51 +0000 (12:12 -0700)]
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
8352e322e87ba39c71e578b65ad8ae156ca3e0c7 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 14 Jun 2022 18:15:56 +0000 (11:15 -0700)]
[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
3473817106c23eca7341c931453da0341c367e1d )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Erlend Egeberg Aasland [Tue, 14 Jun 2022 15:41:32 +0000 (17:41 +0200)]
[3.11] gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (GH-93796) (#93808)
Victor Stinner [Tue, 14 Jun 2022 14:05:14 +0000 (16:05 +0200)]
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
4caf5c2753f1aa28d6f4bc1aa377975fd2a62331 )
* test_cppext now builds the C++ extension with setuptools.
* Add @test.support.requires_venv_with_pip.
(cherry picked from commit
ca0cc9c433830e14714a5cc93fb4e7254da3dd76 )
Erlend Egeberg Aasland [Tue, 14 Jun 2022 12:49:22 +0000 (14:49 +0200)]
[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
46740073ef32bf83964c39609c7a7a4772c51ce3 )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Serhiy Storchaka [Tue, 14 Jun 2022 05:51:39 +0000 (08:51 +0300)]
[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
6fd4c8ec7740523bb81191c013118d9d6959bc9d )
Miss Islington (bot) [Mon, 13 Jun 2022 18:15:46 +0000 (11:15 -0700)]
gh-84461: Fix parallel testing on WebAssembly (GH-93768)
(cherry picked from commit
c2007573dd449ae054f9fd5227e49ac9eef00ae8 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Mon, 13 Jun 2022 17:49:48 +0000 (10:49 -0700)]
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
443ca731d6b1267fe2f92985e0490460c95e44a8 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Mon, 13 Jun 2022 06:29:59 +0000 (23:29 -0700)]
gh-93461: Invalidate sys.path_importer_cache entries with relative paths (GH-93653)
(cherry picked from commit
09243b898a13f3f61e275c1031143d1225e70916 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Sat, 11 Jun 2022 11:20:52 +0000 (04:20 -0700)]
Change list to view object (GH-93661)
(cherry picked from commit
5d8e7a124098add18a17b12270a66ca26b8cc058 )
Co-authored-by: Pamela Fox <pamela.fox@gmail.com>
Miss Islington (bot) [Sat, 11 Jun 2022 11:06:44 +0000 (04:06 -0700)]
gh-86404: [doc] A make sucpicious false positive. (GH-93710)
(cherry picked from commit
bc3b31ea776ecb7088c8c2acd121499be8e8638b )
Co-authored-by: Julien Palard <julien@palard.fr>
Miss Islington (bot) [Sat, 11 Jun 2022 10:20:28 +0000 (03:20 -0700)]
gh-90473: Skip test_queue when threading is not available (GH-93712)
(cherry picked from commit
f0b7aa71c4a1330294c14b0c6f02e6c43e09c317 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Sat, 11 Jun 2022 10:14:24 +0000 (03:14 -0700)]
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
010284b46b604bb07a99775a2e51475b720da030 )
Co-authored-by: John Belmonte <john@neggie.net>
Miss Islington (bot) [Sat, 11 Jun 2022 07:04:35 +0000 (00:04 -0700)]
gh-84461: Use HOSTRUNNER to run regression tests (GH-93694)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit
dc5e02b2f44dada145a3743ef77b07dbcf3e4a4a )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Sat, 11 Jun 2022 03:52:41 +0000 (20:52 -0700)]
gh-92930: _pickle.c: Acquire strong references before calling save() (GH-92931)
(cherry picked from commit
4c496f1f115a7910d4606b4de233d14874c77bfa )
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Miss Islington (bot) [Fri, 10 Jun 2022 23:25:53 +0000 (16:25 -0700)]
gh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_zipimport.py` (GH-93236)
(cherry picked from commit
484a2357c8385694a077cf2ce0517f327fb0b172 )
Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
Miss Islington (bot) [Fri, 10 Jun 2022 23:07:19 +0000 (16:07 -0700)]
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
78f1a436949209dab1f4a9d04036a1a42b165086 )
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Miss Islington (bot) [Fri, 10 Jun 2022 16:21:04 +0000 (09:21 -0700)]
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
53a8b17895e91d08f76a2fb59a555d012cd85ab4 )
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Steve Dower [Fri, 10 Jun 2022 16:09:37 +0000 (17:09 +0100)]
bpo-42658: Allow _winapi.LCMapStringEx to handle embedded nulls (GH-93688)
Miss Islington (bot) [Fri, 10 Jun 2022 15:04:55 +0000 (08:04 -0700)]
gh-90549: Fix leak of global named resources using multiprocessing spawn (GH-30617)
Co-authored-by: XD Trol <milestonejxd@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
(cherry picked from commit
30610d28374f5a9698d456cebf3ae496ac01af51 )
Co-authored-by: Leo Trol <milestone.jxd@gmail.com>
Miss Islington (bot) [Fri, 10 Jun 2022 14:12:51 +0000 (07:12 -0700)]
gh-93391: fix typo in `array` docs (GH-93392) (GH-93394)
Fixes GH-93391
(cherry picked from commit
fc694364cc6745eefba0afc3ea2c5283bbb64a3b )
Co-authored-by: ynfle <23086821+ynfle@users.noreply.github.com>
Miss Islington (bot) [Fri, 10 Jun 2022 14:11:15 +0000 (07:11 -0700)]
📝 Make sure the phrase "constant-time compare" actually appears in the docs (GH-93396) (GH-93399)
This is purely for SEO as this is the actual generic name for this kind of method and it currently does not appear in a Google search for "python constant time compare". Not creating an issue or setting this up for backports as its trivial (I think) and not a functional change.
(cherry picked from commit
8241a6971e6051ba10040af6b50f9236faa0c892 )
Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
Miss Islington (bot) [Fri, 10 Jun 2022 14:10:14 +0000 (07:10 -0700)]
gh-93372: Fix typo in os.rename documentation (GH-93401) (GH-93403)
(cherry picked from commit
e7aab7c92a7c2e4317023c71e847d55cf5c49f5f )
Co-authored-by: Wei-Ting Yang <74453331+Yang-Wei-Ting@users.noreply.github.com>
Miss Islington (bot) [Fri, 10 Jun 2022 14:04:23 +0000 (07:04 -0700)]
gh-87961: Remove outdated notes from functions that aren't in the Limited API (GH-93581) (GH-93604)
Nowadays everything that *is* in the Limited API has a note added
automatically.
These notes could mislead people to think that these functions
could never be added to the limited API. Remove them.
(cherry picked from commit
2c3fe5eeb2b64deb2132d9259e74b521c14fd92d )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Fri, 10 Jun 2022 14:00:19 +0000 (07:00 -0700)]
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) (GH-93631)
copy.copy() and copy.deepcopy() now always raise a TypeError if
__reduce__() returns a tuple with length 6 instead of silently ignore
the 6th item or produce incorrect result.
(cherry picked from commit
a365dd64c2a1f0d142540d5031003f24986f489f )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Fri, 10 Jun 2022 13:50:26 +0000 (06:50 -0700)]
gh-93491: Add support tier detection to configure (GH-93492)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit
3124d9a5aafb64431aa9facd0ae0e12201be77fa )
Co-authored-by: Christian Heimes <christian@python.org>
Erlend Egeberg Aasland [Fri, 10 Jun 2022 11:28:48 +0000 (13:28 +0200)]
[3.11] gh-90763: Modernise xx template module initialisation (GH-93078) (#93681)
Use C APIs such as PyModule_AddType instead of PyModule_AddObject.
Also remove incorrect module decrefs if module fails to initialise.
(cherry picked from commit
a87c9b538fbfc42883417c4d5e69f1a5922690e3 )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Steve Dower [Fri, 10 Jun 2022 10:14:25 +0000 (11:14 +0100)]
bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for case-folding (GH-93591)
* bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for case-folding (GH-32010)
* Use AsWideCharString to avoid memory leaks in deprectated unicode converter
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Miss Islington (bot) [Fri, 10 Jun 2022 08:37:38 +0000 (01:37 -0700)]
gh-92434: Silence compiler warning in Modules/_sqlite/connection.c on 32-bit systems (GH-93090)
(cherry picked from commit
d8395eb38d3d05f74a7f348da81a280ad272b8c8 )
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Miss Islington (bot) [Thu, 9 Jun 2022 16:32:52 +0000 (09:32 -0700)]
gh-90473: Skip get_config_h() tests on WASI (GH-93645)
(cherry picked from commit
6099611af5b9688f015ae4796501ce101a1c2f32 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Thu, 9 Jun 2022 16:28:34 +0000 (09:28 -0700)]
[3.11] Improve logging documentation with example and additional cookbook re… (GH-93644) (GH-93647)
Miss Islington (bot) [Thu, 9 Jun 2022 16:12:51 +0000 (09:12 -0700)]
gh-90473: disable user site packages on WASI/Emscripten (GH-93633)
(cherry picked from commit
5a4af3ab030a3f3e708ee83d7d4ca3cb2d5b7360 )
Co-authored-by: Christian Heimes <christian@python.org>
Łukasz Langa [Thu, 9 Jun 2022 14:16:37 +0000 (16:16 +0200)]
[3.11] gh-79096: Protect cookie file created by {LWP,Mozilla}CookieJar.save() (GH-93463) (GH-93636)
Note: This change is not effective on Microsoft Windows.
Cookies can store sensitive information and should therefore be protected
against unauthorized third parties. This is also described in issue #79096.
The filesystem permissions are currently set to 644, everyone can read the
file. This commit changes the permissions to 600, only the creater of the file
can read and modify it. This improves security, because it reduces the attack
surface. Now the attacker needs control of the user that created the cookie or
a ways to circumvent the filesystems permissions.
This change is backwards incompatible. Systems that rely on world-readable
cookies will breake. However, one could argue that those are misconfigured in
the first place.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Pascal Wittmann <mail@pascal-wittmann.de>
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Thu, 9 Jun 2022 14:15:33 +0000 (07:15 -0700)]
Doc: Update references and examples of old, unsupported OSes and uarches (GH-92791) (GH-93638)
(cherry picked from commit
a5ba0f4ebca5020f6c77718a20663e0ac6e194ac )
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Miss Islington (bot) [Thu, 9 Jun 2022 07:02:39 +0000 (00:02 -0700)]
gh-93616: Fix env changed issue in test_modulefinder (GH-93617)
(cherry picked from commit
cffa4f7854eb11e21c25026b24e9ccd14763c8d3 )
Co-authored-by: Christian Heimes <christian@python.org>
Christian Heimes [Wed, 8 Jun 2022 20:21:20 +0000 (22:21 +0200)]
[3.11] gh-93575: Use correct way to calculate PyUnicode struct sizes (GH-93602) (GH-93613)
* gh-93575: Use correct way to calculate PyUnicode struct sizes
* Add comment to keep test_sys and test_unicode in sync
* Fix case code < 256.
(cherry picked from commit
5442561c1a094b68900198bade616da9ed509ac8 )
Co-authored-by: Christian Heimes <christian@python.org>
Christian Heimes [Wed, 8 Jun 2022 20:21:04 +0000 (22:21 +0200)]
[3.11] gh-90473: Define HOSTRUNNER for WASI (GH-93606) (GH-93612)
(cherry picked from commit
22df2e0322300d25c1255ceb73cacc0ebd96b20e )
Co-authored-by: Christian Heimes <christian@python.org>
Christian Heimes [Wed, 8 Jun 2022 15:24:30 +0000 (17:24 +0200)]
[3.11] gh-93584: Make all install+tests targets depends on all (GH-93589) (GH-93603)
All install targets use the "all" target as synchronization point to
prevent race conditions with PGO builds. PGO builds use recursive make,
which can lead to two parallel `./python setup.py build` processes that
step on each others toes.
"test" targets now correctly compile PGO build in a clean repo.
(cherry picked from commit
243ed5439c32e8517aa745bc2ca9774d99c99d0f )
Co-authored-by: Christian Heimes <christian@python.org>
Irit Katriel [Wed, 8 Jun 2022 15:16:46 +0000 (16:16 +0100)]
[3.11] GH-93481: Suppress expected deprecation warning in test_pyclbr (GH-93483) (GH-93601)
(cherry picked from commit
f8eae6f5c35e9def07a732f6bc7744aae106f9b2 )
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Miss Islington (bot) [Wed, 8 Jun 2022 11:07:15 +0000 (04:07 -0700)]
gh-93421: Update sqlite3 cursor.rowcount only after SQLITE_DONE (GH-93526)
(cherry picked from commit
875de61c296604f3a3a51e9d76355e0f1a24c6af )
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Miss Islington (bot) [Wed, 8 Jun 2022 01:17:56 +0000 (18:17 -0700)]
GH-93521: For dataclasses, filter out `__weakref__` slot if present in bases (GH-93535)
(cherry picked from commit
5849af7a80166e9e82040e082f22772bd7cf3061 )
Co-authored-by: Bluenix <bluenixdev@gmail.com>
Miss Islington (bot) [Tue, 7 Jun 2022 19:11:10 +0000 (12:11 -0700)]
Fix `PurePath.relative_to` links in the pathlib documentation. (GH-93268)
These are currently broken as they refer to :meth:`Path.relative_to` rather than :meth:`PurePath.relative_to`, and `relative_to` is a method on `PurePath`.
(cherry picked from commit
8ef7929baffd0038bcb38978a6a91ecc63bf0de2 )
Co-authored-by: jacksonriley <52106215+jacksonriley@users.noreply.github.com>
Miss Islington (bot) [Tue, 7 Jun 2022 12:28:11 +0000 (05:28 -0700)]
gh-84461: Emscripten's faccessat() does not accept flags (GHß92353)
(cherry picked from commit
70690c7233aaad4431660a64daef81b5220e2ac1 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Tue, 7 Jun 2022 10:21:04 +0000 (03:21 -0700)]
gh-57539: Increase calendar test coverage (GH-93468) (GH-93564)
(cherry picked from commit
f0d0be3493fc5855eccfe0fbb3f25bf12760041f )
Co-authored-by: Sean Fleming
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Miss Islington (bot) [Tue, 7 Jun 2022 10:14:06 +0000 (03:14 -0700)]
gh-88831: In docs for asyncio.create_task, explain why strong references to tasks are needed (GH-93258) (GH-93566)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit
75ceae05c11461beda65e6170b67b0b42fd55cd0 )
Co-authored-by: Andreas Grommek <76997441+agrommek@users.noreply.github.com>
Miss Islington (bot) [Tue, 7 Jun 2022 08:21:47 +0000 (01:21 -0700)]
gh-86986: bump min sphinx version to 3.2 (GH-93337) (GH-93561)
(cherry picked from commit
57e8ee7086bf3f5c50c901e9d5896275644bbb54 )
Co-authored-by: Davide Rizzo <sorcio@gmail.com>
Miss Islington (bot) [Tue, 7 Jun 2022 08:10:24 +0000 (01:10 -0700)]
Grammar fix to socket error string (GH-93523) (GH-93560)
(cherry picked from commit
890c3be8fb10bc329de06fa9d3b18dd8d90aa8b5 )
Co-authored-by: Evorage <owner@evorage.com>
Miss Islington (bot) [Tue, 7 Jun 2022 04:49:47 +0000 (21:49 -0700)]
Fix contributor name in WhatsNew 3.11 (GH-93556)
(cherry picked from commit
74039330f29461ac06297b6e55c91c89e649c990 )
Co-authored-by: Samodya Abeysiriwardane <379594+sransara@users.noreply.github.com>
Miss Islington (bot) [Mon, 6 Jun 2022 18:51:13 +0000 (11:51 -0700)]
[docs] fix some asyncio.Barrier.wait docs grammar (GH-93552) (GH-93553)
(cherry picked from commit
46fde1feb5fce0f8711ff8c0e1bab317b580d387 )
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Miss Islington (bot) [Mon, 6 Jun 2022 18:10:12 +0000 (11:10 -0700)]
Remove action=None kwarg from Barrier docs (GH-93538) (GH-93551)
(cherry picked from commit
71c8f96971ead9b09fa381392b2c2188d36b5f59 )
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Miss Islington (bot) [Mon, 6 Jun 2022 18:09:51 +0000 (11:09 -0700)]
gh-90473: Make chmod a dummy on WASI, skip chmod tests (GH-93534) (GH-93550)
WASI does not have the ``chmod(2)`` syscall yet.
(cherry picked from commit
22fed605e096eb74f3aa33f6d25aee76fdc2a3fa )
Co-authored-by: Christian Heimes <christian@python.org>
Christian Heimes [Mon, 6 Jun 2022 18:09:22 +0000 (20:09 +0200)]
[3.11] gh-90473: Skip POSIX tests that don't apply to WASI (GH-93536) (GH-93540)
(cherry picked from commit
80a39daecd9ea7cf5593d98221032f8b8fb1c485 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Mon, 6 Jun 2022 17:09:51 +0000 (10:09 -0700)]
gh-83728: Add hmac.new default parameter deprecation (GH-91939) (GH-93544)
(cherry picked from commit
56b5daf15970be449d44e91f08db84c698ac5506 )
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Miss Islington (bot) [Mon, 6 Jun 2022 14:54:44 +0000 (07:54 -0700)]
asyncio.Barrier docs: Fix typo (GH-93371)
taks -> tasks
(cherry picked from commit
8584981a5894ba79fbabbfe7e3ef37ba6f3c2f14 )
Co-authored-by: Omer Katz <omer.katz@omerkatz.com>
Miss Islington (bot) [Mon, 6 Jun 2022 10:32:23 +0000 (03:32 -0700)]
gh-90473: WASI requires proper open(2) flags (GH-93529)
(cherry picked from commit
4c71d22c4f9fdde6f2234e7dc6a862419cd6fd98 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Mon, 6 Jun 2022 01:47:07 +0000 (18:47 -0700)]
gh-93247: Fix assert function in asyncio locks test (GH-93248)
(cherry picked from commit
9081bbd036934ab435291db9d32d02fd42282951 )
Co-authored-by: Cyker Way <cykerway@gmail.com>
Miss Islington (bot) [Sun, 5 Jun 2022 09:39:11 +0000 (02:39 -0700)]
gh-89973: Fix re.error in the fnmatch module. (GH-93072)
Character ranges with upper bound less that lower bound (e.g. [c-a])
are now interpreted as empty ranges, for compatibility with other glob
pattern implementations. Previously it was re.error.
(cherry picked from commit
0902c3d8edf7ef67972dd95f6a21670f5d1a4251 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Sun, 5 Jun 2022 08:26:38 +0000 (01:26 -0700)]
gh-90473: wasmtime does not support absolute symlinks (GH-93490)
(cherry picked from commit
6f8367d3489eff07139bc908fdf666fc904ca445 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Sun, 5 Jun 2022 06:47:12 +0000 (23:47 -0700)]
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) (gh-93509)
(cherry picked from commit
713eb184b50f2b8b138fb01187ee32fa29a815c9 )
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Miss Islington (bot) [Sun, 5 Jun 2022 05:15:59 +0000 (22:15 -0700)]
gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (GH-93500) (gh-93507)
Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow
C++ extensions that pass 0 or NULL to macros using _Py_CAST() to
continue to compile. Without this, you get an error like:
invalid ‘static_cast’ from type ‘int’ to type ‘_object*’
The modern way to use a NULL value in C++ is to use nullptr. However,
we want to not break extensions that do things the old way.
Co-authored-by: serge-sans-paille
(cherry picked from commit
8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518 )
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Miss Islington (bot) [Sat, 4 Jun 2022 19:23:53 +0000 (12:23 -0700)]
Fix missing word in sys.float_info docstring (GH-93489) (GH-93495)
(cherry picked from commit
e12f34b6d8200508bd50cdc9c6c5637732ff56e7 )
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Miss Islington (bot) [Sat, 4 Jun 2022 03:38:16 +0000 (20:38 -0700)]
gh-92886: Fix test that fails when running with `-O` in `test_imaplib.py` (GH-93237)
(cherry picked from commit
8150b8cf7fe09d601246f5bdc6456a0e31f31bca )
Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
Miss Islington (bot) [Fri, 3 Jun 2022 21:57:54 +0000 (14:57 -0700)]
gh-93156 - fix negative indexing into absolute `pathlib.PurePath().parents` (GH-93273)
When a `_PathParents` object has a drive or a root, the length of the
object is *one less* than than the length of `self._parts`, which resulted
in an off-by-one error when `path.parents[-n]` was fed through to
`self._parts[:-n - 1]`. In particular, `path.parents[-1]` was a malformed
path object with spooky properties.
This is addressed by adding `len(self)` to negative indices.
(cherry picked from commit
f32e6b48d12834ba3bde01ec21c14da33abd26d6 )
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Miss Islington (bot) [Fri, 3 Jun 2022 20:40:20 +0000 (13:40 -0700)]
gh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473)
(cherry picked from commit
1a8a0ddb1c62ef9aff598e7e3e3a65cf35353932 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Fri, 3 Jun 2022 15:25:58 +0000 (08:25 -0700)]
[3.11] gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993) (GH-93458)
(cherry picked from commit
b9509ba7a9c668b984dab876c7926fe1dc5aa0ba )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Automerge-Triggered-By: GH:encukou
Miss Islington (bot) [Fri, 3 Jun 2022 14:18:49 +0000 (07:18 -0700)]
test.pythoninfo: Fix typo, Py_REF_DEBUG => Py_TRACE_REFS (GH-93467)
(cherry picked from commit
d8f40ead92b5a973cff3a30482a7659d3b46b1ba )
Co-authored-by: Victor Stinner <vstinner@python.org>
Ken Jin [Fri, 3 Jun 2022 13:26:43 +0000 (21:26 +0800)]
[3.11] gh-93433: Fix dis doc example output (GH-93434) (GH-93460)
(cherry picked from commit
debf4c1ec5f0bae44d50f889b8a7dc0c3ea1fc9d )
Miss Islington (bot) [Fri, 3 Jun 2022 06:50:44 +0000 (23:50 -0700)]
gh-90473: Skip and document more failing tests on WASI (GH-93436)
- Mark more ``umask()`` cases
- ``dup()`` is not supported
- ``/dev/null`` is not available
- document missing features
- mark more modules as not available
(cherry picked from commit
069c96f84ccd302436be180c8628289cc0efa977 )
Co-authored-by: Christian Heimes <christian@python.org>
Miss Islington (bot) [Fri, 3 Jun 2022 03:02:55 +0000 (20:02 -0700)]
gh-92932: dis._unpack_opargs should handle EXTENDED_ARG_QUICK (gh-92945)
(cherry picked from commit
b013804134b07894205b06744628f6b25b879d85 )
Co-authored-by: Dong-hee Na <donghee.na@python.org>
Miss Islington (bot) [Thu, 2 Jun 2022 01:04:27 +0000 (18:04 -0700)]
gh-93418: Fix an assert when an f-string expression is followed by an '=', but no closing brace. (gh-93419) (gh-93422)
(cherry picked from commit
ee70c70aa93d7a41cbe47a0b361b17f9d7ec8acd )
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Pablo Galindo [Wed, 1 Jun 2022 15:28:12 +0000 (16:28 +0100)]
Post 3.11.0b3
Pablo Galindo [Wed, 1 Jun 2022 13:06:32 +0000 (14:06 +0100)]
Python 3.11.0b3
Miss Islington (bot) [Wed, 1 Jun 2022 13:05:40 +0000 (06:05 -0700)]
gh-92597: Improve error message for AST nodes with invalid ranges (GH-93398) (GH-93414)
(cherry picked from commit
8a221a853787c18d5acaf46f5c449d28339cde21 )
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Miss Islington (bot) [Wed, 1 Jun 2022 07:35:15 +0000 (00:35 -0700)]
Remove the execution bit to some socket-related files. (GH-93368)
(cherry picked from commit
5247389369ac3da35c44f7c0d8f4facc0300883a )
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Miss Islington (bot) [Wed, 1 Jun 2022 06:43:38 +0000 (23:43 -0700)]
gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple (GH-93346)
For example: tuple[*Ts, list[T]][int, str, bool]
(cherry picked from commit
f545fc955aeb701ae4e73b07ff2283f823d857b8 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>