Commit Graph

122558 Commits

Author SHA1 Message Date
Miss Islington (bot) e7008d78f3
[3.13] gh-118714: Make the pdb post-mortem restart/quit behavior more reasonable (GH-118725) (#121346)
gh-118714: Make the pdb post-mortem restart/quit behavior more reasonable (GH-118725)
(cherry picked from commit e245ed7d1e)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-07-03 12:15:53 -07:00
Miss Islington (bot) 3d4e533be5
[3.13] gh-112136: Restore removed _PyArg_Parser (GH-121262) (#121344)
gh-112136: Restore removed _PyArg_Parser (GH-121262)

Restore the private _PyArg_Parser structure and the private
_PyArg_ParseTupleAndKeywordsFast() function, previously removed
in Python 3.13 alpha 1.

Recreate Include/cpython/modsupport.h header file.
(cherry picked from commit f8373db153)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-03 18:29:00 +00:00
Miss Islington (bot) 8799f0537b
[3.13] gh-121300: Add `replace` to `copy.__all__` (GH-121302) (#121337)
(cherry picked from commit 7c66906802)

Co-authored-by: Max Muoto <maxmuoto@gmail.com>
2024-07-03 15:28:57 +00:00
Vinay Sajip 253c033251
[3.13] gh-121035: Update PNG image for logging flow diagram. (GH-121323) (GH-121324)
(cherry picked from commit 26d24eeb90)
2024-07-03 13:01:34 +01:00
Victor Stinner ec0f801a72
[3.13] gh-121279: Fix importlib DeprecatedAttrsTests (#121319)
Delete attributes after getting them, so the warning is emitted again
when the test is run multiple times (ex: when checking for reference
leaks).
2024-07-03 13:57:05 +02:00
Miss Islington (bot) 251667340e
[3.13] gh-121245: a regression test for site.register_readline() (GH-121259) (#121322) 2024-07-03 11:11:41 +00:00
Vinay Sajip 3302c5f155
[3.13] gh-121035: Further improve logging flow diagram with respect to dark/light modes. (GH-121265) (GH-121320)
[3.13] gh-121035: Further improve logging flow diagram with respect to dark/light modes. (GH-121265)
(cherry picked from commit 089835469d)
2024-07-03 11:41:18 +01:00
Vinay Sajip b62605d50f
[3.13] gh-121035: Improve logging flow diagram for dark/light modes. (GH-121254) (GH-121317)
(cherry picked from commit bfe0e4d769)
2024-07-03 11:01:50 +01:00
Miss Islington (bot) d3e586e652
[3.13] gh-106597: Add more offsets to _Py_DebugOffsets (GH-121311) (#121312)
gh-106597: Add more offsets to _Py_DebugOffsets (GH-121311)

Add more offsets to _Py_DebugOffsets

We add a few more offsets that are required by some out-of-process
tools, such as [Austin](https://github.com/p403n1x87/austin).
(cherry picked from commit c9bdfbe868)

Co-authored-by: Gabriele N. Tornetta <P403n1x87@users.noreply.github.com>
2024-07-03 09:18:15 +00:00
Miro Hrončok dacf4ffa79
[3.13] gh-121279: Re-add prematurely removed import warnings to importlib.abc (#121281)
Fixup for 51724620e8

Fixes https://github.com/python/cpython/issues/121279
2024-07-03 11:06:20 +02:00
Miss Islington (bot) ee1db25bc0
[3.13] docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (GH-112237) (#121309)
docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (GH-112237)
(cherry picked from commit 4232976b02)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2024-07-03 08:23:51 +00:00
neonene 2c3aa527fd
[3.13] gh-120782: Update internal type cache when reloading datetime (GH-120829) (#120855)
* [3.13] gh-120782: Update internal type cache when reloading datetime

When reloading _datetime module, the single-phase version did not invoke the PyInit__datetime function, whereas the current multi-phase version updates the static types through the module init. The outdated static type cache in the interpreter state needs to be invalidated at the end of reloading the multi-phase module.
2024-07-03 13:52:51 +05:30
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