summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-120782: Update internal type cache when reloading datetime (#120829)neonene2024-06-213-0/+24
|
* gh-113993: Allow interned strings to be mortal, and fix related issues ↵Petr Viktorin2024-06-2142-1136/+2460
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-120520) * Add an InternalDocs file describing how interning should work and how to use it. * Add internal functions to *explicitly* request what kind of interning is done: - `_PyUnicode_InternMortal` - `_PyUnicode_InternImmortal` - `_PyUnicode_InternStatic` * Switch uses of `PyUnicode_InternInPlace` to those. * Disallow using `_Py_SetImmortal` on strings directly. You should use `_PyUnicode_InternImmortal` instead: - Strings should be interned before immortalization, otherwise you're possibly interning a immortalizing copy. - `_Py_SetImmortal` doesn't handle the `SSTATE_INTERNED_MORTAL` to `SSTATE_INTERNED_IMMORTAL` update, and those flags can't be changed in backports, as they are now part of public API and version-specific ABI. * Add private `_only_immortal` argument for `sys.getunicodeinternedsize`, used in refleak test machinery. * Make sure the statically allocated string singletons are unique. This means these sets are now disjoint: - `_Py_ID` - `_Py_STR` (including the empty string) - one-character latin-1 singletons Now, when you intern a singleton, that exact singleton will be interned. * Add a `_Py_LATIN1_CHR` macro, use it instead of `_Py_ID`/`_Py_STR` for one-character latin-1 singletons everywhere (including Clinic). * Intern `_Py_STR` singletons at startup. * For free-threaded builds, intern `_Py_LATIN1_CHR` singletons at startup. * Beef up the tests. Cover internal details (marked with `@cpython_only`). * Add lots of assertions Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
* gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and ↵Bénédikt Tran2024-06-213-21/+81
| | | | `bytearray` objects in protocol version 5. (GH-120422)
* gh-120773: document introspective attributes of an async generator object in ↵blhsing2024-06-211-214/+227
| | | | the inspect module (#120778)
* gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (#120442)Nikita Sobolev2024-06-214-12/+58
|
* GH-120804: Remove SafeChildWatcher, FastChildWatcher and ↵Kumar Aditya2024-06-215-1041/+4
| | | | | MultiLoopChildWatcher from asyncio (#120805) Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio. These child watchers have been deprecated since Python 3.12. The tests are also removed and some more tests will be added after the rewrite of child watchers.
* gh-111259: Document idiomatic RE pattern (?s:.) that matches any character ↵Serhiy Storchaka2024-06-201-1/+1
| | | | (GH-120745)
* gh-119182: Use public PyUnicodeWriter in contextvar_tp_repr() (#120809)Victor Stinner2024-06-201-32/+15
| | | | The public PyUnicodeWriter API enables overallocation by default and so is more efficient. It also makes the code simpler and shorter.
* gh-119182: Optimize PyUnicode_FromFormat() (#120796)Victor Stinner2024-06-201-26/+26
| | | | Use strchr() and ucs1lib_find_max_char() to optimize the code path formatting sub-strings between '%' formats.
* gh-120801: Refactor importlib.metadata fixtures. (#120803)Jason R. Coombs2024-06-204-28/+11
| | | | These changes released with importlib_metadata 7.2.0.
* gh-119182: Use public PyUnicodeWriter API in union_repr() (#120797)Victor Stinner2024-06-201-24/+30
| | | | | | | | | | | | | | | The public PyUnicodeWriter API enables overallocation by default and so is more efficient. Benchmark: python -m pyperf timeit \ -s 't = int | float | complex | str | bytes | bytearray' \ ' | memoryview | list | dict' \ 'str(t)' Result: 1.29 us +- 0.02 us -> 1.00 us +- 0.02 us: 1.29x faster
* gh-119182: Use public PyUnicodeWriter API in ga_repr() (#120799)Victor Stinner2024-06-201-33/+35
| | | | | | | | | | | | | | | The public PyUnicodeWriter API enables overallocation by default and so is more efficient. Benchmark: python -m pyperf timeit \ -s 't = list[int, float, complex, str, bytes, bytearray, ' \ 'memoryview, list, dict]' \ 'str(t)' Result: 1.49 us +- 0.03 us -> 1.10 us +- 0.02 us: 1.35x faster
* gh-120769: Add pdb meta command to print frame status. (#120770)Tian Gao2024-06-203-9/+49
|
* gh-117511: Make PyMutex public in the non-limited API (#117731)Sam Gross2024-06-2018-110/+185
|
* gh-120780: Show attribute name for LOAD_SPECIAL in dis output (#120781)Jelle Zijlstra2024-06-206-7/+59
|
* gh-98442: fix locations of with statement's cleanup instructions (#120763)Irit Katriel2024-06-203-1/+38
| | | gh-98442: fix location of with statement's cleanup instructions
* gh-111259: Optimize complementary character sets in RE (GH-120742)Serhiy Storchaka2024-06-204-13/+50
| | | | | Patterns like "[\s\S]" or "\s|\S" which match any character are now compiled to the same effective code as a dot with the DOTALL modifier ("(?s:.)").
* gh-119698: symtable: Fix merge race (#120779)Jelle Zijlstra2024-06-201-1/+1
|
* gh-119698: fix `symtable.Class.get_methods` and document its behaviour ↵Bénédikt Tran2024-06-204-6/+187
| | | | | | | correctly (#120151) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Fix typos in comments (#120481)Xie Yanbo2024-06-204-5/+5
|
* GH-120602: Support LLVM_VERSION_SUFFIX for JIT builds (GH-120604)Xarblu2024-06-202-1/+3
|
* gh-120606: Allow EOF to exit pdb commands definition (#120607)Tian Gao2024-06-193-0/+9
|
* gh-120732: Fix `name` passing to `Mock`, when using kwargs to ↵Nikita Sobolev2024-06-193-7/+13
| | | | `create_autospec` (#120737)
* gh-118820: Zero-valued flag enum has no name (GH-118848)Nice Zombies2024-06-191-0/+8
| | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Regen ``Doc/requirements-oldest-sphinx.txt`` (#120753)Kirill Podoprigora2024-06-191-4/+4
|
* gh-120521: clarify except* documentation to allow tuples (#120523)Danny Yang2024-06-191-9/+10
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-119786: move locations doc to InternalDocs (#120445)Irit Katriel2024-06-192-6/+8
|
* GH-120097: Make FrameLocalsProxy a mapping (#120101)Mark Shannon2024-06-194-1/+20
| | | | | * Register FrameLocalsProxy as a subclass of collections.abc.Mapping * Allow FrameLocalsProxy to matching mapping patterns
* GH-119462: Enforce invariants of type versioning (GH-120731)Mark Shannon2024-06-197-103/+87
| | | | * Remove uses of Py_TPFLAGS_VALID_VERSION_TAG
* gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in ↵Nadeshiko Manju2024-06-193-2/+1
| | | | | | gh-118322 (GH-120712) Co-authored-by: Ken Jin <kenjin4096@gmail.com>
* Fix types in pegen parser generator (GH-120720)yf-yang2024-06-193-6/+6
|
* gh-120733: rename internal compiler functions according to naming convention ↵Irit Katriel2024-06-191-30/+23
| | | | (#120734)
* gh-120635: Avoid leaking processes in test_pyrepl (#120676)Victor Stinner2024-06-191-1/+1
| | | | | If the child process takes longer than SHORT_TIMEOUT seconds to complete, kill the process but then wait until it completes with no timeout to not leak child processes.
* gh-120722: Set position on RETURN_VALUE in lambda (#120724)Jelle Zijlstra2024-06-193-2/+31
|
* gh-119960: Add information about regex flags in re module functions (#119978)Awbert2024-06-191-0/+32
|
* gh-102797: Add more code snippets in test_ast (#102798)Kirill Podoprigora2024-06-191-8/+196
| | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Nineteendo <nineteendo19d0@gmail.com>
* gh-120726: Fix compiler warnings on is_core_module() (#120727)Kirill Podoprigora2024-06-192-4/+5
| | | | | Fix compiler warnings on is_core_module() and check_interpreter_whence(): only define them when assertions are built.
* Add a link to free-threading HOWTO to the index (follow-up to GH-119366) ↵Petr Viktorin2024-06-191-0/+1
| | | | (GH-120703)
* gh-120633: Move scrollbar and remove tear-off menus in turtledemo (#120634)Wulian2332024-06-192-4/+5
| | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* GH-119726: Deduplicate JIT trampolines for out-of-range jumps (GH-120250)Diego Russo2024-06-192-4/+17
|
* Ignore some failing tests in emulated JIT CI (GH-120375)Diego Russo2024-06-191-1/+4
|
* GH-73991: Add follow_symlinks argument to `pathlib.Path.copy()` (#120519)Barney Gale2024-06-196-11/+86
| | | | | | | Add support for not following symlinks in `pathlib.Path.copy()`. On Windows we add the `COPY_FILE_COPY_SYMLINK` flag is following symlinks is disabled. If the source is symlink to a directory, this call will fail with `ERROR_ACCESS_DENIED`. In this case we add `COPY_FILE_DIRECTORY` to the flags and retry. This can fail on old Windowses, which we note in the docs. No news as `copy()` was only just added.
* GH-73991: pathlib ABC tests: add `DummyPath.unlink()` and `rmdir()` (#120715)Barney Gale2024-06-182-20/+51
| | | | | In preparation for the addition of `PathBase.rmtree()`, implement `DummyPath.unlink()` and `rmdir()`, and move corresponding tests into `test_pathlib_abc` so they're run against `DummyPath`.
* gh-120367: fix bug where compiler detects redundant jump after pseudo op ↵Irit Katriel2024-06-183-2/+28
| | | | replacement (#120714)
* GH-73991: Use same signature for `shutil._rmtree_[un]safe()`. (#120517)Barney Gale2024-06-182-45/+44
| | | | | | | | | | | | | | Preparatory work for moving `_rmtree_unsafe()` and `_rmtree_safe_fd()` to `pathlib._os` so that they can be used from both `shutil` and `pathlib`. Move implementation-specific setup from `rmtree()` into the safe/unsafe functions, and give them the same signature `(path, dir_fd, onexc)`. In the tests, mock `os.open` rather than `_rmtree_safe_fd()` to ensure the FD-based walk is used, and replace a couple references to `shutil._use_fd_functions` with `shutil.rmtree.avoids_symlink_attacks` (which has the same value). No change of behaviour.
* gh-120688: Build WASI with -O3 in debug mode (#120691)Victor Stinner2024-06-183-0/+13
| | | | On WASI in debug mode, Python is now built with compiler flag -O3 instead of -Og, to support more recursive calls.
* gh-119574: Add some missing environment variables to '--help-env'. (GH-120006)devdanzin2024-06-183-0/+88
|
* gh-120417: Add #noqa: F401 to tests (#120627)Victor Stinner2024-06-1824-41/+43
| | | | Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
* gh-120496: Add a note about iterator thread-safe (gh-120685)Donghee Na2024-06-181-0/+3
|
* gh-117953: Skip `test_interpreters` properly without GIL (#120689)Nice Zombies2024-06-181-3/+6
|