Ethan Furman
de6bca9564
gh-112328: [Enum] Make some private attributes public. (GH-112514)
...
* [Enum] Make some private attributes public.
- ``_EnumDict`` --> ``EnumDict``
- ``EnumDict._member_names`` --> ``EnumDict.member_names``
- ``Enum._add_alias_``
- ``Enum._add_value_alias_``
---------
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-05 08:27:36 -08:00
Serhiy Storchaka
563ccded6e
gh-94692: Only catch OSError in shutil.rmtree() ( #112756 )
...
Previously a symlink attack resistant version of shutil.rmtree() could ignore
or pass to the error handler arbitrary exception when invalid arguments
were provided.
2023-12-05 16:40:49 +01:00
Diego Russo
bc68f4a4ab
gh-110190: Fix ctypes structs with array on Arm ( #112604 )
...
Set MAX_STRUCT_SIZE to 32 in stgdict.c when on Arm platforms.
This because on Arm platforms structs with at most 4 elements of any
floating point type values can be passed through registers. If the type
is double the maximum size of the struct is 32 bytes.
On x86-64 Linux, it's maximum 16 bytes hence we need to differentiate.
2023-12-05 16:07:50 +01:00
Ken Jin
8cdfee1bb9
bpo-43153: Don't mask PermissionError with NotADirectoryError during tempdirectory cleanup (GH-29940)
...
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 15:30:59 +02:00
Jeffrey Kintscher
268415bbb3
gh-81441: shutil.rmtree() FileNotFoundError race condition (GH-14064)
...
Ignore missing files and directories while enumerating
directory entries in shutil.rmtree().
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 09:33:51 +00:00
pan324
81ee026091
gh-82300: Add track parameter to multiprocessing.shared_memory ( #110778 )
...
Add a track parameter to shared memory to allow resource tracking via the side-launched resource tracker process to be disabled on platforms that use it (POSIX).
This allows people who do not want automated cleanup at process exit because they are using the shared memory with processes not participating in Python's resource tracking to use the shared_memory API.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-12-05 00:11:44 -08:00
Constantin Hong
aa5bee30ab
gh-102130: Support tab completion in cmd for Libedit. (GH-107748)
...
---
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-12-05 08:24:56 +01:00
Russell Keith-Magee
dc824c5dc1
gh-112736: Refactor del-safe symbol handling in subprocess ( #112738 )
...
Refactor delete-safe symbol handling in subprocess.
Only module globals are force-cleared during interpreter finalization, using a class reference instead of individually listing the constants everywhere is simpler.
2023-12-04 20:23:17 -08:00
Barney Gale
304a1b3f3a
GH-112727: Speed up pathlib.Path.absolute() ( #112728 )
...
Use `_from_parsed_parts()` to create a pre-joined/pre-parsed path, rather
than passing multiple arguments to `with_segments()`
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-04 23:21:39 +00:00
Gregory P. Smith
9fe7655c6c
gh-112334: Restore subprocess's use of vfork() & fix extra_groups=[] behavior ( #112617 )
...
Restore `subprocess`'s intended use of `vfork()` by default for performance on Linux;
also fixes the behavior of `extra_groups=[]` which was unintentionally broken in 3.12.0:
Fixed a performance regression in 3.12's :mod:`subprocess` on Linux where it
would no longer use the fast-path ``vfork()`` system call when it could have
due to a logic bug, instead falling back to the safe but slower ``fork()``.
Also fixed a security bug introduced in 3.12.0. If a value of ``extra_groups=[]``
was passed to :mod:`subprocess.Popen` or related APIs, the underlying
``setgroups(0, NULL)`` system call to clear the groups list would not be made
in the child process prior to ``exec()``.
The security issue was identified via code inspection in the process of
fixing the first bug. Thanks to @vain for the detailed report and
analysis in the initial bug on Github.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-04 15:08:19 -08:00
Victor Stinner
c5fa8a54db
gh-112535: Add test on _Py_ThreadId() ( #112709 )
...
Add also test.support.Py_GIL_DISABLED constant.
2023-12-04 22:40:06 +00:00
Kamil Turek
a1551b48ee
gh-103363: Add follow_symlinks argument to pathlib.Path.owner() and group() ( #107962 )
2023-12-04 19:42:01 +00:00
Alex Waygood
2ed20d3bd8
gh-74690: Avoid a costly type check where possible in _ProtocolMeta.__subclasscheck__ ( #112717 )
2023-12-04 19:35:46 +00:00
Thomas Bininda
1e4680ce52
gh-112516: Update bundled pip version to 23.3.1 (gh-112517)
2023-12-04 18:27:57 +01:00
Serhiy Storchaka
e08b70fab1
gh-108927: Fix removing testing modules from sys.modules (GH-108952)
...
It breaks import machinery if the test module has submodules used in
other tests.
2023-12-04 15:43:27 +00:00
Alex Waygood
c718ab92a5
gh-74690: Optimise isinstance() and issubclass() calls against runtime-checkable protocols by avoiding costly super() calls ( #112708 )
2023-12-04 15:41:41 +00:00
Serhiy Storchaka
6ca9d3e017
gh-109786: Fix leaks and crash when re-enter itertools.pairwise.__next__() (GH-109788)
2023-12-04 11:47:55 +00:00
Serhiy Storchaka
c74e9fb189
gh-110275: Named tuple's __replace__() now raises TypeError for invalid arguments (GH-110299)
2023-12-04 13:30:32 +02:00
Serhiy Storchaka
dee7beeb4f
bpo-34392: Add sys. _is_interned() (GH-8755)
2023-12-04 11:09:06 +02:00
chilaxan
0e732d0997
gh-112625: Protect bytearray from being freed by misbehaving iterator inside bytearray.join (GH-112626)
2023-12-04 08:15:43 +00:00
Terry Jan Reedy
e5b0db0315
gh-66819: More IDLE htest updates(4) ( #112686 )
...
Mostly double spacing before 'if __name__...'.
2023-12-04 06:36:40 +00:00
Terry Jan Reedy
5a1b5316af
gh-66819: More IDLE htest updates(3) ( #112683 )
...
Revise spec-callable pairs from percolator to end.
2023-12-03 23:45:56 -05:00
Barney Gale
09505c5c26
GH-106747: Improve Path.glob() expectations in pathlib tests ( #112365 )
...
Add trailing slashes to expected `Path.glob()` results wherever a pattern
has a trailing slash. This matches what `glob.glob()` produces.
Due to another bug (GH-65238) pathlib strips all trailing slashes, so this
change is academic for now.
2023-12-03 20:35:10 +00:00
Irit Katriel
97857ac058
gh-112645: remove deprecation warning for use of onerror in shutil.rmtree ( #112659 )
2023-12-03 14:02:37 +00:00
Irit Katriel
162d3d428a
gh-112620: Fix dis error on show_cache with labels ( #112621 )
2023-12-03 12:12:49 +00:00
Shantanu
29e6c7b68a
gh-112578: Fix RuntimeWarning when running zipfile (GH-112579)
2023-12-03 13:09:29 +02:00
Alex Waygood
fc9e24b01f
gh-112316: improve docs for inspect.signature and inspect.Signature ( #112631 )
2023-12-03 01:37:34 -08:00
Terry Jan Reedy
3855b45874
gh-66819: More IDLE htest updates(2) ( #112642 )
...
Examine and update spec -- callable pairs.
Revise run method.
2023-12-03 09:28:37 +00:00
Nikita Sobolev
a9574c68f0
gh-112139: Add inspect.Signature.format and use it in pydoc ( #112143 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-12-02 15:39:43 -08:00
Nikita Sobolev
a35a305098
gh-112618: Make Annotated cache typed ( #112619 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-02 16:10:19 +00:00
William Wen
939fc6d6ea
gh-106922: Support multi-line error locations in traceback (attempt 2) ( #112097 )
2023-12-01 22:18:16 +00:00
Zackery Spytz
0daf555c6f
bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503)
...
* Fix a crash when pass UINT_MAX.
* Fix an integer overflow on 64-bit non-Windows platforms.
2023-12-01 15:16:49 +00:00
Alex Waygood
70a38ffb3d
gh-109413: libregrtest: enable mypy's --strict-optional check on most files ( #112586 )
...
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-01 14:54:33 +00:00
Tian Gao
c2982380f8
gh-112510: Add readline.backend for the backend readline uses (GH-112511)
...
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Donghee Na <donghee.na92@gmail.com>
2023-12-01 14:05:55 +00:00
Victor Stinner
f8ff80f635
gh-109413: regrtest: add WorkerRunTests class ( #112588 )
2023-12-01 13:46:50 +00:00
Zackery Spytz
058444308a
gh-82565: Add tests for pickle and unpickle with bad files (GH-16606)
2023-12-01 13:36:37 +00:00
Irit Katriel
bfb576ee23
gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/generator. ( #112428 )
2023-12-01 12:57:31 +00:00
Rémi Lapeyre
a65a3d4806
bpo-39912: Raise appropriate exceptions in filterwarnings() and simplefilter() (GH-18878)
2023-12-01 11:17:47 +00:00
Yang Hau
707c37e373
Fix typos in variable names, function names, and comments (GH-101868)
2023-12-01 09:37:40 +00:00
Terry Jan Reedy
e44f1940bd
gh-66819: More IDLE htest updates ( #112574 )
...
Revise htest.py docstring and move 2 specs to alphabetical position.
2023-12-01 07:02:31 +00:00
Alex Waygood
674c288b1c
gh-109413: Run mypy on libregrtest in CI ( #112558 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-30 23:00:14 +00:00
Brett Cannon
6d5e0dc0e3
Clarify a comment for test.support.Py_C_RECURSION_LIMIT to point out where a value came from but that it doesn't need to stay in sync ( #112224 )
2023-11-30 13:38:10 -08:00
Serhiy Storchaka
2223899adc
gh-104231: Add more tests for str(), repr(), ascii(), and bytes() (GH-112551)
2023-11-30 17:22:04 +02:00
Irit Katriel
07ebd46f9e
gh-112519: Make it possible to specify instruction flags for pseudo instructions in bytecodes.c ( #112520 )
2023-11-30 11:03:30 +00:00
Donghee Na
7eeea13403
gh-112205: Support @getter annotation from AC (gh-112396)
2023-11-30 19:40:53 +09:00
Terry Jan Reedy
81261fa67f
IDLE: fix config_key htest ( #112545 )
...
Change 'Dialog' to 'Window' in two places to match the name of the config_key class being tested.
2023-11-30 07:08:44 +00:00
Jelle Zijlstra
d4a6229afe
gh-104003: Implement PEP 702 ( #104004 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-29 09:38:29 -08:00
Jelle Zijlstra
4038869423
gh-112509: Fix keys being present in both required_keys and optional_keys in TypedDict ( #112512 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-29 09:36:48 -08:00
Serhiy Storchaka
e0449b9a7f
Add more C API tests (GH-112522)
...
Add tests for PyObject_Str(), PyObject_Repr(), PyObject_ASCII() and
PyObject_Bytes().
2023-11-29 17:37:05 +02:00
Ethan Furman
f9e6ce0395
[Enum] update class creation for RuntimeError changes (GH-111815)
2023-11-28 20:40:12 -08:00