Commit Graph

122596 Commits

Author SHA1 Message Date
Miss Islington (bot) 85971492b7
[3.13] gh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree.c (GH-121260) (#121307)
gh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree.c (GH-121260)
(cherry picked from commit 705a123898)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-07-03 07:59:26 +00:00
Miss Islington (bot) 89bf33732f
[3.13] gh-115773: Add sizes to debug offset structure (GH-120112) (#121283)
gh-115773: Add sizes to debug offset structure (GH-120112)
(cherry picked from commit b180788d4a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-07-02 18:19:26 +00:00
Miss Islington (bot) 78e96bdf24
[3.13] gh-121245: Correct pyrepl import in site.py (GH-121255) (#121261)
(cherry picked from commit 7a807c3efa)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2024-07-02 13:40:05 +02:00
Miss Islington (bot) 78c77327a9
[3.13] gh-121196: Document `dict.fromkeys` params as pos-only (GH-121197) (#121242)
gh-121196: Document `dict.fromkeys` params as pos-only (GH-121197)
(cherry picked from commit 1dc9a4f6b2)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-07-01 20:43:34 +00:00
Miss Islington (bot) 06fd745dd9
[3.13] gh-117657: Fix data races reported by TSAN in some set methods (GH-120914) (#121240)
Refactor the fast Unicode hash check into `_PyObject_HashFast` and use relaxed
atomic loads in the free-threaded build.

After this change, the TSAN doesn't report data races for this method.
(cherry picked from commit 294e724964)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-07-01 19:40:28 +00:00
Miss Islington (bot) fc0b1cbdfe
[3.13] gh-121110: Temporarily Skip test_basic_multiple_interpreters_reset_each (gh-121238)
This will allow Py_TRACE_REFS builds to pass the test suite, until the underlying issue can be resolved.

(cherry picked from commit 9bcb7d8c6f, AKA gh-121236)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-07-01 18:23:35 +00:00
Miss Islington (bot) 931c168219
[3.13] gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175) (#121234)
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175)
(cherry picked from commit 91313afdb3)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
2024-07-01 16:51:43 +00:00
Miss Islington (bot) 010bf92779
[3.13] gh-121200: Fix test_expanduser_pwd2() of test_posixpath (GH-121228) (#121232)
gh-121200: Fix test_expanduser_pwd2() of test_posixpath (GH-121228)

Call getpwnam() to get pw_dir, since it can be different than
getpwall() pw_dir.
(cherry picked from commit 02cb5fdee3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-01 16:13:41 +00:00
Miss Islington (bot) 7bd67d56c4
[3.13] gh-121200: Log pwd entry in test_expanduser_pwd2() (GH-121207) (#121213)
gh-121200: Log pwd entry in test_expanduser_pwd2() (GH-121207)

Use subTest() to log the pwd entry in test_expanduser_pwd2() of
test_posixpath to help debugging.
(cherry picked from commit 05a6f8da60)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-01 10:09:01 +00:00
Miss Islington (bot) 178b5b16d3
[3.13] gh-121084: Call _abc_registry_clear() when checking refleaks (GH-121191) (#121208)
gh-121084: Call _abc_registry_clear() when checking refleaks (GH-121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
(cherry picked from commit c766ad206e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-01 09:34:53 +00:00
Miss Islington (bot) 1f2f9c4ff5
[3.13] gh-121188: Sanitize invalid XML characters in regrtest (GH-121195) (#121204)
gh-121188: Sanitize invalid XML characters in regrtest (GH-121195)

When creating the JUnit XML file, regrtest now escapes characters
which are invalid in XML, such as the chr(27) control character used
in ANSI escape sequences.
(cherry picked from commit af8c3d7a26)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-01 08:55:38 +00:00
Miss Islington (bot) 82777cd024
[3.13] gh-113565: Improve and harden detection of curses dependencies (GH-119816) (#121202)
1. Use pkg-config to check for ncursesw/panelw. If that fails, use
   pkg-config to check for ncurses/panel.
2. Regardless of pkg-config output, search for curses/panel headers, so
   we're sure we have all defines in pyconfig.h.
3. Regardless of pkg-config output, check if libncurses or libncursesw
   contains the 'initscr' symbol; if it does _and_ pkg-config failed
   earlier, add the resulting -llib linker option to CURSES_LIBS.
   Ditto for 'update_panels' and PANEL_LIBS.
4. Wrap the rest of the checks with WITH_SAVE_ENV and make sure we're
   using updated LIBS and CPPFLAGS for those.

Add the PY_CHECK_CURSES convenience macro.
(cherry picked from commit f80376b129)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-07-01 08:35:38 +00:00
Miss Islington (bot) d481d4b767
[3.13] gh-87744: fix waitpid race while calling send_signal in asyncio (GH-121126) (#121194)
gh-87744: fix waitpid race while calling send_signal in asyncio (GH-121126)

asyncio earlier relied on subprocess module to send signals to the process, this has some drawbacks one being that subprocess module unnecessarily calls waitpid on child processes and hence it races with asyncio implementation which internally uses child watchers. To mitigate this, now asyncio sends signals directly to the process without going through the subprocess on non windows systems. On Windows it fallbacks to subprocess module handling but on windows there are no child watchers so this issue doesn't exists altogether.

(cherry picked from commit bd473aa598)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-07-01 05:11:47 +00:00
Miss Islington (bot) af89237c9c
[3.13] [doc] Update element positions and styles in logging flow diagram. (GH-121182) (GH-121183)
(cherry picked from commit 2a455bbe8f)
2024-06-30 15:06:27 +01:00
Miss Islington (bot) 7776179ec4
[3.13] gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (GH-121178) (#121179)
gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (GH-121178)
(cherry picked from commit c3677befbe)

Co-authored-by: Yureka <yuka@yuka.dev>
2024-06-30 10:04:39 +00:00
Miss Islington (bot) 0dfb437a32
[3.13] gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (GH-120984) (#121173)
gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (GH-120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.



* Correct source code reference in Mac docs



* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review



* Documentation and configure.ac syntax improvements



* Regenerate configure script.

* Silence the patch echo output.

---------

(cherry picked from commit 48cd104b0c)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-06-30 09:10:34 +08:00
Miss Islington (bot) 00b071137b
[3.13] GH-119054: Add alt text to pathlib inheritance diagram (GH-121158) (#121168)
GH-119054: Add alt text to pathlib inheritance diagram (GH-121158)
(cherry picked from commit 6b280a8498)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-29 18:02:53 +00:00
Miss Islington (bot) c70f1122b4
[3.13] GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH-120970) (#121155)
GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH-120970)

Add dedicated subsection for `home()`, `expanduser()`, `cwd()`,
`absolute()`, `resolve()` and `readlink()`. The position of this section
keeps all the `Path` constructors (`Path()`, `Path.from_uri()`,
`Path.home()` and `Path.cwd()`) near the top. Within the section, closely
related methods are kept adjacent. Specifically:

- `home()` and `expanduser()` (the former calls the latter)
- `cwd()` and `absolute()` (the former calls the latter)
- `absolute()` and `resolve()` (both make paths absolute)
- `resolve()` and `readlink()` (both read symlink targets)
- Ditto `cwd()` and `absolute()`
- Ditto `absolute()` and `resolve()`

The "Other methods" section is removed.

(cherry picked from commit d6d8707ff2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-06-29 16:37:55 +01:00
Miss Islington (bot) d96a52e136
[3.13] gh-121101: Document -Wall option (an alias for -Walways) (GH-121102) (#121146)
gh-121101: Document -Wall option (an alias for -Walways) (GH-121102)
(cherry picked from commit 0a1e8ff9c1)

Co-authored-by: Wim Jeantine-Glenn <jump@wimglenn.com>
2024-06-29 13:57:11 +05:30
Miss Islington (bot) 009618f112
[3.13] gh-120713: Normalize year with century for datetime.strftime (GH-120820) (GH-121144)
(cherry picked from commit 6d34938dc8)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-29 06:57:33 +00:00
Miss Islington (bot) cbbd95328d
[3.13] doc: Mention the missing reflected special methods for all binary operations (GH-119931) (#120063)
doc: Mention the missing reflected special methods for all binary operations (GH-119931)
(cherry picked from commit bf5e1065f4)

Co-authored-by: Paulo Freitas <me@paulofreitas.me>
2024-06-29 12:12:35 +05:30
Miss Islington (bot) 50ea6408b8
[3.13] gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136) (#121139)
gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
(cherry picked from commit 92893fd8dc)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
2024-06-28 16:17:34 -07:00
Miss Islington (bot) 58a3c3c0ad
gh-121115: Skip __index__ in PyLong_AsNativeBytes by default (GH-121118)
(cherry picked from commit 2894aa14f2)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-06-28 15:52:26 +00:00
Serhiy Storchaka 99de20d729
[3.13] gh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056) (GH-121128)
* parse_intermixed_args() now raises ArgumentError instead of calling
  error() if exit_on_error is false.
* Internal code now always raises ArgumentError instead of calling
  error(). It is then caught at the higher level and error() is called if
  exit_on_error is true.
(cherry picked from commit 81a654a342)
2024-06-28 15:04:44 +00:00
Miss Islington (bot) 394dc93bf9
[3.13] gh-115986 Improve pprint docs formatting (GH-117401) (GH-121098)
* Move pprinter parameter descriptions to a table

* Make pprint doc with params markup

* Remove duplication of the parameters' description

---------

(cherry picked from commit 0890ad7c02)

Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-28 16:23:08 +02:00
Miss Islington (bot) 497047606d
[3.13] gh-121096: Ignore dlopen() leaks in Valgrind suppression file (GH-121097) (#121122)
gh-121096: Ignore dlopen() leaks in Valgrind suppression file (GH-121097)
(cherry picked from commit 6e63d84e43)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-28 11:26:37 +00:00
Miss Islington (bot) e310d2bd71
[3.13] gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887) (GH-121117)
The check for whether the log file is a real file is expensive on NFS
filesystems.  This commit reorders the rollover condition checking to
not do the file type check if the expected file size is less than the
rotation threshold.

(cherry picked from commit e9b4ec614b)

Co-authored-by: Craig Robson <craig@zhatt.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2024-06-28 09:23:38 +00:00
Miss Islington (bot) d5441f6aac
[3.13] gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051) (gh-121107)
gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)
(cherry picked from commit 1a2e7a7475)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-06-27 22:12:12 +00:00
Miss Islington (bot) 49a01d6290
[3.13] gh-121035: Update logging flow chart to include the lastResort handler. (GH-121036) (GH-121106)
(cherry picked from commit 237baf4d7a)
2024-06-27 22:59:19 +01:00
Thomas Wouters 065febe6a5 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2024-06-27 20:36:45 +02:00
Thomas Wouters 71d41f4e7d Post 3.13.0b3 2024-06-27 20:34:22 +02:00
Miss Islington (bot) 312a32a742
[3.13] gh-119521: Remove _IncompleteInputError from the docs (GH-120993) (GH-121076)
gh-119521: Remove _IncompleteInputError from the docs (GH-120993)
(cherry picked from commit 1167a9a30b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-27 15:19:20 +02:00
Thomas Wouters 7b413952e8 Python 3.13.0b3 2024-06-27 15:06:51 +02:00
Miss Islington (bot) 49e5740135
[3.13] gh-121027: Add a future warning in functools.partial.__get__ (GH-121086) (#121092)
gh-121027: Add a future warning in functools.partial.__get__ (GH-121086)
(cherry picked from commit db96edd6d1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-27 12:13:01 +00:00
Miss Islington (bot) c7d2b2b646
[3.13] gh-120888: Bump bundled pip to 24.1.1 (GH-120889) (#121080)
gh-120888: Bump bundled pip to 24.1.1 (GH-120889)
(cherry picked from commit 4999e0bda0)

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
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>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-27 12:53:01 +02:00
Miss Islington (bot) 9df7392eba
[3.13] gh-120868: Fix breaking change in `logging.config` when using `QueueHandler` (GH-120872) (GH-121078)
(cherry picked from commit 7d9c68513d)
2024-06-27 10:09:17 +01:00
Miss Islington (bot) c83997476f
[3.13] gh-113433: Automatically Clean Up Subinterpreters in Py_Finalize() (gh-121067)
This change makes things a little less painful for some users.  It also fixes a failing assert (gh-120765), by making sure all subinterpreters are destroyed before the main interpreter.  As part of that, we make sure Py_Finalize() always runs with the main interpreter active.

(cherry picked from commit 4be1f37b20, AKA gh-121060)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-26 21:56:13 +00:00
Miss Islington (bot) c052b192aa
[3.13] gh-120838: Add _PyThreadState_WHENCE_FINI (gh-121013)
We also add _PyThreadState_NewBound() and drop _PyThreadState_SetWhence().

This change only affects internal API.

(cherry picked from commit a905721b9c, AKA gh-121010)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-26 15:32:00 -06:00
devdanzin bc515b332b
[3.13] gh-121016: Add test for PYTHON_BASIC_REPL envioronment variable (GH-121017) (#121064)
* gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)

(cherry picked from commit 9e45fd9858)

* [3.13] gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (GH-121017)
(cherry picked from commit 9e45fd9858)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-06-26 22:17:14 +01:00
Miss Islington (bot) d7cd71c72a
[3.13] gh-120937: Reference weakref from the `__del__` documentation (GH-120940) (#121061)
gh-120937: Reference weakref from the `__del__` documentation (GH-120940)
(cherry picked from commit 1c13b29d54)

Co-authored-by: chaen <christophe.haen@cern.ch>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-26 20:24:25 +00:00
Miss Islington (bot) 38cfa92880
[3.13] gh-118908: Use __main__ for the default PyREPL namespace (GH-121054) (#121059) 2024-06-26 19:25:38 +00:00
Miss Islington (bot) 64c4139f61
[3.13] gh-120593: Fix const qualifier in pyatomic.h (GH-121055) (#121057)
gh-120593: Fix const qualifier in pyatomic.h (GH-121055)
(cherry picked from commit 9cd2dcbb87)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-26 18:37:28 +00:00
Miss Islington (bot) bdcc738fec
[3.13] gh-121008: Fix idlelib.run tests (GH-121046) (#121049)
gh-121008: Fix idlelib.run tests (GH-121046)

When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.
(cherry picked from commit 44eafd6688)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-26 14:08:31 +00:00
Miss Islington (bot) 7db14f1eba
[3.13] Ignore some failing tests in emulated JIT CI (GH-120977)
(cherry picked from commit 07daaf1ce1)
Co-authored-by: Diego Russo <diego.russo@arm.com>
2024-06-26 06:56:15 -07:00
Victor Stinner e26e0985d9
[3.13] gh-120642: Move private PyCode APIs to the internal C API (#120643) (#121043)
gh-120642: Move private PyCode APIs to the internal C API (#120643)

* Move _Py_CODEUNIT and related functions to pycore_code.h.
* Move _Py_BackoffCounter to pycore_backoff.h.
* Move Include/cpython/optimizer.h content to pycore_optimizer.h.
* Remove Include/cpython/optimizer.h.
* Remove PyUnstable_Replace_Executor().

Rename functions:

* PyUnstable_GetExecutor() => _Py_GetExecutor()
* PyUnstable_GetOptimizer() => _Py_GetOptimizer()
* PyUnstable_SetOptimizer() => _Py_SetTier2Optimizer()
* PyUnstable_Optimizer_NewCounter() => _PyOptimizer_NewCounter()
* PyUnstable_Optimizer_NewUOpOptimizer() => _PyOptimizer_NewUOpOptimizer()

(cherry picked from commit 9e4a81f00f)
2024-06-26 15:35:19 +02:00
Miss Islington (bot) 6bc7e2cca5
[3.13] gh-121018: Ensure ArgumentParser.parse_args with exit_on_error=False raises instead of exiting when given unrecognized arguments (GH-121019) (GH-121032)
(cherry picked from commit 0654336dd5)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-26 10:16:19 +00:00
Miss Islington (bot) f2b4f517b9
[3.13] gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422) (GH-120832)
gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422)
(cherry picked from commit 7595e6743a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-26 12:11:28 +02:00
Miss Islington (bot) 84634254fe
[3.13] gh-121025: Improve partialmethod.__repr__ (GH-121033) (#121037)
gh-121025: Improve partialmethod.__repr__ (GH-121033)

It no longer contains redundant commas and spaces.
(cherry picked from commit d2646e3f45)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-26 09:49:42 +00:00
Miss Islington (bot) 571cefd8c7
[3.13] gh-120155: Fix Coverity issue in parse_string() (GH-120997) (#121005)
gh-120155: Fix Coverity issue in parse_string() (GH-120997)
(cherry picked from commit 769aea3329)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-25 19:40:05 +02:00
Miss Islington (bot) f4f8a714b5
[3.13] gh-114053: Fix another edge case involving `get_type_hints`, PEP 695 and PEP 563 (GH-120272) (#121003)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-25 16:30:08 +00:00