Commit Graph

122531 Commits

Author SHA1 Message Date
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
Jelle Zijlstra 899dfbaf0e
[3.13] gh-120108: Fix deepcopying of AST trees with .parent attributes (GH-120114) (#121000)
(cherry picked from commit 42b2c9d78d)
2024-06-25 15:39:29 +00:00
Miss Islington (bot) 1764a310e8
[3.13] Doc/README: Document 'make htmllive' (GH-120692) (#120990)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-06-25 09:25:54 +00:00
Miss Islington (bot) 6cddf1a611
[3.13] gh-120661: improve example for basic type hints (GH-120934) (#120987)
gh-120661: improve example for basic type hints (GH-120934)
(cherry picked from commit bb057ea107)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-25 09:25:29 +01:00
Miss Islington (bot) d26ce50f7b
[3.13] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822) (#120985)
gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)

Add missing space in AS_VAR_APPEND() on CFLAGS.
(cherry picked from commit 2106c9bef0)

Co-authored-by: Michael Allwright <allsey87@gmail.com>
2024-06-25 08:17:53 +00:00
Miss Islington (bot) 6bfcf98ff6
[3.13] Add --with-lto back to Linux JIT CI (GH-120972)
(cherry picked from commit fd0f814ade)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-06-24 20:44:46 +00:00
Barney Gale 4619f89296
[3.13] GH-119054: Add "Permissions and ownership" section to pathlib docs. (GH-120505) (#120967)
Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

(cherry picked from commit e4a97a7fb1)
2024-06-24 20:32:08 +01:00
Miss Islington (bot) 0a77058b79
[3.13] gh-120858: PyDict_Next should not lock the dict (GH-120859) (#120964)
PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.

The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.
(cherry picked from commit 375b723d58)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-24 18:41:19 +00:00
Miss Islington (bot) 6aee5edb84
[3.13] gh-120860: Fix a few bugs in `type_setattro` error paths. (GH-120861) (#120963)
Moves the logic to update the type's dictionary to its own function in order
to make the lock scoping more clear.

Also, ensure that `name` is decref'd on the error path.
(cherry picked from commit dee63cb359)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-24 18:33:39 +00:00
Petr Viktorin 9769b7ae06
[3.13] gh-113993: Allow interned strings to be mortal, and fix related issues (GH-120520) (GH-120945)
* 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>
2024-06-24 20:24:19 +02:00
Miss Islington (bot) 447e07ab3d
[3.13] gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680, GH-120955) (GH-120944)
- gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680)
  (cherry picked from commit ce1064e4c9)

- gh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH-120955)
  (cherry picked from commit ac61d58db0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-24 20:23:30 +02:00
Miss Islington (bot) a19a5895b5
[3.13] docs: puremagic.what() as replacement for imghdr.what() (GH-120871) (#120951)
docs: puremagic.what() as replacement for imghdr.what() (GH-120871)
(cherry picked from commit 22b8a35d6e)

Co-authored-by: Christian Clauss <cclauss@me.com>
2024-06-24 13:49:13 +00:00
Miss Islington (bot) 502a99a7e6
[3.13] gh-120373: Mark test_audit.test_http as requiring the network resource (GH-120374) (#120948)
gh-120373: Mark test_audit.test_http as requiring the network resource (GH-120374)
(cherry picked from commit b0e1c51882)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-06-24 13:44:06 +00:00
Miss Islington (bot) 732c00550f
[3.13] gh-119614: Fix truncation of strings with embedded null characters in Tkinter (GH-120909) (GH-120938)
Now the null character is always represented as \xc0\x80 for
Tcl_NewStringObj().
(cherry picked from commit c38e2f64d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-24 09:45:45 +00:00
Miss Islington (bot) 206028dba9
[3.13] gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (GH-112191) (#120935)
gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (GH-112191)
(cherry picked from commit fc297b4ba4)

Co-authored-by: Alek Kowalczyk <alek.kowalczyk@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-06-24 08:55:28 +00:00
Miss Islington (bot) 544a47212b
[3.13] gh-120683: Fix an error in logging.LogRecord timestamp (GH-120709) (GH-120933)
The integer part of the timestamp can be rounded up, while the millisecond
calculation truncates, causing the log timestamp to be wrong by up to 999 ms
(affected roughly 1 in 8 million timestamps).
(cherry picked from commit 1500a23f33)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-24 07:14:26 +00:00