Commit Graph

29563 Commits

Author SHA1 Message Date
Jelle Zijlstra 45614ecb2b
gh-119180: Use type descriptors to access annotations (PEP 749) (#122074) 2024-07-27 16:36:06 +00:00
Bénédikt Tran 7a6d4ccf0e
gh-122170: Handle ValueError raised by os.stat() in linecache (GH-122176) 2024-07-27 10:10:42 +00:00
Nate Ohlson 8ac5565be2
gh-112301: Compiler warning management tooling (#121730)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-07-27 09:57:44 +00:00
Peter Bierma c08696286f
gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (#122338) 2024-07-27 11:57:48 +05:30
Irit Katriel d791b9815a
gh-122245: Add test case of generic type with __debug__ (#122322) 2024-07-26 18:40:36 +00:00
Pablo Galindo Salgado db2d8b6db1
gh-122300: Preserve AST nodes for format specifiers with single elements (#122308) 2024-07-26 16:29:41 +00:00
WilliamRoyNelson dcafb362f7
gh-121999: Change default tarfile filter to 'data' (GH-122002)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Scott Odle <scott@sjodle.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-26 16:34:13 +02:00
Irit Katriel bc94cf7e25
gh-122245: move checks for writes and shadowing of __debug__ to symtable (#122246) 2024-07-26 14:39:56 +01:00
Marc Mueller aef95eb107
gh-121489: Export private _PyBytes_Join() again (#122267) 2024-07-25 17:31:30 +02:00
Mark Shannon 2e14a52cce
GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164) 2024-07-25 16:24:29 +01:00
Serhiy Storchaka dc07f65a53
gh-82951: Fix serializing by name in pickle protocols < 4 (GH-122149)
Serializing objects with complex __qualname__ (such as unbound methods and
nested classes) by name no longer involves serializing parent objects by value
in pickle protocols < 4.
2024-07-25 08:45:19 +00:00
Mikołaj Kuranowski a3327dbfd4
gh-113785: csv: fields starting with escapechar are not quoted (GH-122110) 2024-07-25 10:04:47 +03:00
Dino Viehland 5592399313
gh-122208: Don't delivery PyDict_EVENT_ADDED until it can't fail (#122207)
Don't delivery PyDict_EVENT_ADDED until it can't fail
2024-07-24 10:58:28 -07:00
Xie Yanbo f067efa643
Fix typo in news document (GH-122209) 2024-07-24 06:49:58 +00:00
Tian Gao e91ef13861
gh-122029: Log call events in sys.setprofile when it's a method with c function (GH-122072)
Log call events in sys.setprofile when it is a method with a C function.
2024-07-23 15:25:26 -07:00
Jelle Zijlstra 7b7b90d1ce
gh-119180: Add `annotationlib` module to support PEP 649 (#119891)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-23 21:16:50 +00:00
Serhiy Storchaka 4606eff0aa
gh-122129: Improve support of method descriptors and wrappers in the help title (GH-122157) 2024-07-23 20:45:21 +03:00
Serhiy Storchaka e6b25e9a09
gh-122163: Add notes for JSON serialization errors (GH-122165)
This allows to identify the source of the error.
2024-07-23 20:02:54 +03:00
Sebastian Rittau 375c9f6dfb
gh-122088: Copy the coroutine status of the underlying callable in `@warnings.deprecated` (#122086)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-23 10:59:28 +01:00
Donghee Na a9bb3c7b3b
gh-121996: Introduce --disable-safety and --enable-slower-safety options (#122054)
* gh-121996: Introduce --disable-safty and --enable-slower-safty

* Update GA

* fix

* Address code review

* Update CI
2024-07-23 09:22:04 +09:00
Jelle Zijlstra 2762c6cc5e
gh-121637: Syntax error for optimized-away incorrect await (#121656)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 14:12:43 -07:00
HarryLHW 2408a8a22b
gh-121795: Improve performance of set membership testing from set arguments (#121796) 2024-07-22 10:05:23 -05:00
Bénédikt Tran c09d4c4a26
gh-119698: deprecate ``symtable.Class.get_methods`` (#121902) 2024-07-22 07:04:17 -07:00
Łukasz Langa dc93d1125f
gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958)
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
2024-07-22 13:04:08 +02:00
Russell Keith-Magee 728432c804
gh-120522: Apply App Store compliance patch during installation (#121947)
Adds a --with-app-store-compliance configuration option that patches out code known to be an issue with App Store review processes. This option is applied automatically on iOS, and optionally on macOS.
2024-07-22 07:36:08 +08:00
Barney Gale 094375b9b7
GH-73991: Add `pathlib.Path.rmtree()` (#119060)
Add a `Path.rmtree()` method that removes an entire directory tree, like
`shutil.rmtree()`. The signature of the optional *on_error* argument
matches the `Path.walk()` argument of the same name, but differs from the
*onexc* and *onerror* arguments to `shutil.rmtree()`. Consistency within
pathlib is probably more important.

In the private pathlib ABCs, we add an implementation based on `walk()`.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-20 20:14:13 +00:00
Pablo Galindo Salgado 2009e25e26
gh-122026: Fix identification of mismatched parentheses inside f-strings (#122028) 2024-07-19 19:08:08 +02:00
Rodrigo Oliveira d66b06107b
gh-118830: Bump pickle.DEFAULT_PROTOCOL to 5 (GH-119340) 2024-07-19 16:47:10 +02:00
Serhiy Storchaka 1a0c7b9ba4
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
Serhiy Storchaka c8d2630995
gh-82017: Support as_integer_ratio() in the Fraction constructor (GH-120271)
Any objects that have the as_integer_ratio() method (e.g. numpy.float128)
can now be converted to a fraction.
2024-07-19 08:06:53 +03:00
Tian Gao 1ab1778283
gh-120289: Disallow disable() and clear() in external timer to prevent use-after-free (#120297) 2024-07-18 12:47:22 -07:00
Nate Ohlson bdab67e1c7
gh-112301: Add fortify source level 3 to default compiler options (gh-121520) 2024-07-19 01:06:51 +09:00
Matthieu Caneill cecaceea31
gh-120930: Remove extra blank occuring in wrapped encoded words in email headers (GH-121747) 2024-07-18 14:48:05 +02:00
Jelle Zijlstra 63ddd28cf3
gh-121921: Make bogus_code_obj.py crash the interpreter (#121922) 2024-07-18 04:02:08 -04:00
Alex Waygood ac07451116
gh-120678: pyrepl: Include globals from modules passed with `-i` (GH-120904)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-17 16:18:42 +02:00
Terry Jan Reedy 58753f33e4
gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (#121876)
Problem occurred when attribute xyz could not be pickled.
Since this is not trivial to selectively fix, block all
attributes (other than 'width').  IDLE does not access them
and they are private implementation details.
2024-07-17 09:33:33 -04:00
Brett Cannon f589f263bc
GH-120371: Add WASI SDK 22 support (GH-121870)
Required disabling stub functions now provided by wasi-libc.
2024-07-16 20:00:39 +00:00
Tian Gao e65cb4c6f0
gh-118934: Make PyEval_GetLocals return borrowed reference (#119769)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-07-16 12:17:47 -07:00
Sam Gross 162b41f577
gh-121860: Fix crash when materializing managed dict (#121866)
The object's inline values may be marked invalid if the materialized
dict was already initialized and then deleted.
2024-07-16 14:58:36 -04:00
Pablo Galindo Salgado c46d64e0ef
gh-121130: Fix f-string format specifiers with debug expressions (#121150) 2024-07-16 19:57:22 +01:00
Andreas Stocker 8f2532168b
gh-59022: Added tests for `pkgutil.extend_path` (#59022) (GH-121673)
This adds tests for the documented behaviour of `pkgutil.extend_path`
regarding different argument types as well as for `*.pkg` files.
2024-07-16 17:14:26 +02:00
Petr Viktorin 263c7e611b
gh-121160: Add some tests for readline.set_history_length (GH-121326) 2024-07-16 16:09:08 +02:00
Petr Viktorin b4aedb23ae
gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other API (#121364)
* Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs

* Document immortality in some functions that take `const char *`

This is PyUnicode_InternFromString;
PyDict_SetItemString, PyObject_SetAttrString;
PyObject_DelAttrString; PyUnicode_InternFromString;
and the PyModule_Add convenience functions.

Always point out a non-immortalizing alternative.

* Don't immortalize user-provided attr names in _ctypes
2024-07-16 15:36:21 +02:00
Petr Viktorin 956270d08d
gh-113993: For string interning, do not rely on (or assert) _Py_IsImmortal (GH-121358)
Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
2024-07-16 15:17:29 +02:00
Ned Deily f27593a87c
gh-120522: Revert "Add a `--with-app-store-compliance` configure option to patch out problematic code" (gh-120984) (#121844)
This reverts commit 48cd104b0c prior
to the release of 3.13.0b4 to allow for additional review time.
2024-07-16 06:49:36 -04:00
Russell Keith-Magee 7e91e0dcfe
gh-120831: Increase the default minimum supported iOS version to 13.0 (#121250)
Increases the default minimum iOS version to 13.0.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-07-16 12:23:35 +08:00
Marta Gómez Macías 498a94c198
gh-121295: Fix blocked console after interrupting a long paste (GH-121815) 2024-07-16 01:38:54 +02:00
Tian Gao 2b1b68939b
gh-121814: Only check f_trace_opcodes if Python frame exists (#121818)
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
2024-07-15 16:11:02 -07:00
Sam Gross d23be3947c
gh-121794: Don't set `ob_tid` to zero in fast-path dealloc (#121799)
We should maintain the invariant that a zero `ob_tid` implies the
refcount fields are merged.

* Move the assignment in `_Py_MergeZeroLocalRefcount` to immediately
  before the refcount merge.
* Update `_PyTrash_thread_destroy_chain` to set `ob_ref_shared` to
  `_Py_REF_MERGED` when setting `ob_tid` to zero.

Also check this invariant with assertions in the GC in debug builds.
That uncovered a bug when running out of memory during GC.
2024-07-15 17:50:10 -04:00
Sergey B Kirpichev 05d413764c
gh-121245: Refactor site.register_readline() (GH-121659)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-15 22:12:41 +02:00