]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
16 months agogh-106597: Add more offsets to _Py_DebugOffsets (#121311)
Gabriele N. Tornetta [Wed, 3 Jul 2024 08:53:44 +0000 (09:53 +0100)] 
gh-106597: Add more offsets to _Py_DebugOffsets (#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).

16 months agoDocs: Add `os.splice` flags argument (#109847)
Amin Alaee [Wed, 3 Jul 2024 08:10:57 +0000 (10:10 +0200)] 
Docs: Add `os.splice` flags argument (#109847)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
16 months agodocs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (#112237)
da-woods [Wed, 3 Jul 2024 08:05:02 +0000 (09:05 +0100)] 
docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (#112237)

16 months agobuild(deps): bump hypothesis from 6.100.2 to 6.104.2 in /Tools (#121218)
dependabot[bot] [Wed, 3 Jul 2024 07:52:59 +0000 (13:22 +0530)] 
build(deps): bump hypothesis from 6.100.2 to 6.104.2 in /Tools (#121218)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.100.2 to 6.104.2.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.100.2...hypothesis-python-6.104.2)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16 months agoupdated tp_flags initialization to use inplace or (#120625)
byundojin [Wed, 3 Jul 2024 07:51:25 +0000 (16:51 +0900)] 
updated tp_flags initialization to use inplace or (#120625)

16 months agogh-111872: Document the max_children attribute for `socketserver.ForkingMixIn` (...
AN Long [Wed, 3 Jul 2024 07:46:57 +0000 (15:46 +0800)] 
gh-111872: Document the max_children attribute for `socketserver.ForkingMixIn` (#118134)

16 months agogh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree...
AN Long [Wed, 3 Jul 2024 07:35:05 +0000 (15:35 +0800)] 
gh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree.c (#121260)

16 months agogh-121027: Make the functools.partial object a method descriptor (GH-121089)
Serhiy Storchaka [Wed, 3 Jul 2024 06:02:15 +0000 (09:02 +0300)] 
gh-121027: Make the functools.partial object a method descriptor (GH-121089)

Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
16 months agoGH-73991: Support copying directory symlinks on older Windows (#120807)
Barney Gale [Wed, 3 Jul 2024 03:30:29 +0000 (04:30 +0100)] 
GH-73991: Support copying directory symlinks on older Windows (#120807)

Check for `ERROR_INVALID_PARAMETER` when calling `_winapi.CopyFile2()` and
raise `UnsupportedOperation`. In `Path.copy()`, handle this exception and
fall back to the `PathBase.copy()` implementation.

16 months agogh-121035: Further improve logging flow diagram with respect to dark/light modes...
Vinay Sajip [Tue, 2 Jul 2024 17:57:34 +0000 (18:57 +0100)] 
gh-121035: Further improve logging flow diagram with respect to dark/light modes. (GH-121265)

16 months agogh-115773: Add sizes to debug offset structure (#120112)
Pablo Galindo Salgado [Tue, 2 Jul 2024 17:54:33 +0000 (18:54 +0100)] 
gh-115773: Add sizes to debug offset structure (#120112)

16 months agogh-117139: Add _PyTuple_FromStackRefSteal and use it (#121244)
Sam Gross [Tue, 2 Jul 2024 16:30:14 +0000 (12:30 -0400)] 
gh-117139: Add _PyTuple_FromStackRefSteal and use it (#121244)

Avoids the extra conversion from stack refs to PyObjects.

16 months agogh-121272: move __future__ import validation from compiler to symtable (#121273)
Irit Katriel [Tue, 2 Jul 2024 16:22:08 +0000 (17:22 +0100)] 
gh-121272: move __future__ import validation from compiler to symtable (#121273)

16 months agogh-121165: protect macro expansion of `ADJUST_INDICES` with do-while(0) (#121166)
Bénédikt Tran [Tue, 2 Jul 2024 10:57:51 +0000 (12:57 +0200)] 
gh-121165: protect macro expansion of `ADJUST_INDICES` with do-while(0) (#121166)

16 months agogh-121210: handle nodes with missing attributes/fields in `ast.compare` (#121211)
Bénédikt Tran [Tue, 2 Jul 2024 10:53:17 +0000 (12:53 +0200)] 
gh-121210: handle nodes with missing attributes/fields in `ast.compare` (#121211)

16 months agogh-121245: Amend d611c4c8e9 (correct import) (#121255)
Sergey B Kirpichev [Tue, 2 Jul 2024 09:40:01 +0000 (12:40 +0300)] 
gh-121245: Amend d611c4c8e9 (correct import) (#121255)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
16 months agoMove get_signal_name() to test.support (#121251)
Victor Stinner [Tue, 2 Jul 2024 08:34:13 +0000 (10:34 +0200)] 
Move get_signal_name() to test.support (#121251)

* Move get_signal_name() from test.libregrtest to test.support.
* Use get_signal_name() in support.script_helper.
* support.script_helper now decodes stdout and stderr from UTF-8,
  instead of ASCII, if a command failed.

16 months agogh-121035: Improve logging flow diagram for dark/light modes. (GH-121254)
Vinay Sajip [Tue, 2 Jul 2024 08:13:37 +0000 (09:13 +0100)] 
gh-121035: Improve logging flow diagram for dark/light modes. (GH-121254)

16 months agoFix phrasing in paragraphs with leading "similar" (#121135)
Rafael Fontenelle [Tue, 2 Jul 2024 00:36:27 +0000 (21:36 -0300)] 
Fix phrasing in paragraphs with leading "similar" (#121135)

16 months agoGH-119726: Use LDR for AArch64 trampolines (GH-121001)
Diego Russo [Mon, 1 Jul 2024 22:52:33 +0000 (23:52 +0100)] 
GH-119726: Use LDR for AArch64 trampolines (GH-121001)

16 months agogh-121196: Document `dict.fromkeys` params as pos-only (#121197)
sobolevn [Mon, 1 Jul 2024 20:27:04 +0000 (23:27 +0300)] 
gh-121196: Document `dict.fromkeys` params as pos-only (#121197)

16 months agoGH-116017: Get rid of _COLD_EXITs (GH-120960)
Brandt Bucher [Mon, 1 Jul 2024 20:17:40 +0000 (13:17 -0700)] 
GH-116017: Get rid of _COLD_EXITs (GH-120960)

16 months agogh-117657: Fix data races reported by TSAN in some set methods (#120914)
AN Long [Mon, 1 Jul 2024 19:11:39 +0000 (03:11 +0800)] 
gh-117657: Fix data races reported by TSAN in some set methods (#120914)

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.

16 months agogh-121110: Temporarily Skip test_basic_multiple_interpreters_reset_each (gh-121236)
Eric Snow [Mon, 1 Jul 2024 17:58:25 +0000 (11:58 -0600)] 
gh-121110: Temporarily Skip test_basic_multiple_interpreters_reset_each (gh-121236)

This will allow Py_TRACE_REFS builds to pass the test suite, until the underlying issue can be resolved.

16 months agogh-114104: clarify asynchronous comprehension docs to match runtime behavior (#121175)
Danny Yang [Mon, 1 Jul 2024 16:34:39 +0000 (12:34 -0400)] 
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (#121175)

16 months agogh-120743: Soft deprecate os.popen() function (#120744)
Victor Stinner [Mon, 1 Jul 2024 16:27:50 +0000 (18:27 +0200)] 
gh-120743: Soft deprecate os.popen() function (#120744)

Soft deprecate os.popen() and os.spawn*() functions.

16 months agogh-121200: Fix test_expanduser_pwd2() of test_posixpath (#121228)
Victor Stinner [Mon, 1 Jul 2024 15:49:03 +0000 (17:49 +0200)] 
gh-121200: Fix test_expanduser_pwd2() of test_posixpath (#121228)

Call getpwnam() to get pw_dir, since it can be different than
getpwall() pw_dir.

16 months agogh-117657: Use critical section to make _socket.socket.close thread safe (GH-120490)
AN Long [Mon, 1 Jul 2024 14:38:30 +0000 (22:38 +0800)] 
gh-117657: Use critical section to make _socket.socket.close thread safe (GH-120490)

16 months agogh-121220: Mark test_threaded_weak_value_dict_copy() as CPU-heavy (#121221)
Kirill Podoprigora [Mon, 1 Jul 2024 13:33:02 +0000 (16:33 +0300)] 
gh-121220: Mark test_threaded_weak_value_dict_copy() as CPU-heavy (#121221)

Mark test_threaded_weak_value_dict_copy() and
test_threaded_weak_key_dict_copy() of test_weakref as
CPU-heavy tests

16 months agogh-117784: Only reference PHA functions ifndef SSL_VERIFY_POST_HANDSHAKE (GH-117785)
Will Childs-Klein [Mon, 1 Jul 2024 13:28:35 +0000 (09:28 -0400)] 
gh-117784: Only reference PHA functions ifndef SSL_VERIFY_POST_HANDSHAKE (GH-117785)

With this change, builds with OpenSSL forks that don't have this functionalty
(like AWS-LC or BoringSSL) will require less patching.

16 months agobuild(deps-dev): bump types-setuptools from 70.0.0.20240524 to 70.1.0.20240627 in...
dependabot[bot] [Mon, 1 Jul 2024 10:42:46 +0000 (10:42 +0000)] 
build(deps-dev): bump types-setuptools from 70.0.0.20240524 to 70.1.0.20240627 in /Tools (#121217)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16 months agobuild(deps-dev): bump mypy from 1.10.0 to 1.10.1 in /Tools (#121216)
dependabot[bot] [Mon, 1 Jul 2024 10:15:53 +0000 (10:15 +0000)] 
build(deps-dev): bump mypy from 1.10.0 to 1.10.1 in /Tools (#121216)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16 months agobuild(deps-dev): bump types-psutil from 5.9.5.20240516 to 6.0.0.20240621 in /Tools...
dependabot[bot] [Mon, 1 Jul 2024 10:15:25 +0000 (10:15 +0000)] 
build(deps-dev): bump types-psutil from 5.9.5.20240516 to 6.0.0.20240621 in /Tools (#121215)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16 months agogh-121200: Log pwd entry in test_expanduser_pwd2() (#121207)
Victor Stinner [Mon, 1 Jul 2024 09:43:59 +0000 (11:43 +0200)] 
gh-121200: Log pwd entry in test_expanduser_pwd2() (#121207)

Use subTest() to log the pwd entry in test_expanduser_pwd2() of
test_posixpath to help debugging.

16 months agogh-121084: Call _abc_registry_clear() when checking refleaks (#121191)
Victor Stinner [Mon, 1 Jul 2024 09:03:33 +0000 (11:03 +0200)] 
gh-121084: Call _abc_registry_clear() when checking refleaks (#121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().

16 months agogh-61103: Support double complex (_Complex) type in ctypes (#120894)
Sergey B Kirpichev [Mon, 1 Jul 2024 08:54:33 +0000 (11:54 +0300)] 
gh-61103: Support double complex (_Complex) type in ctypes (#120894)

Example:

```pycon
>>> import ctypes
>>> ctypes.__STDC_IEC_559_COMPLEX__
1
>>> libm = ctypes.CDLL('libm.so.6')
>>> libm.clog.argtypes = [ctypes.c_double_complex]
>>> libm.clog.restype = ctypes.c_double_complex
>>> libm.clog(1+1j)
(0.34657359027997264+0.7853981633974483j)
```

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
16 months agogh-121199: Use _Py__has_attribute() in timemodule.c (#121203)
Victor Stinner [Mon, 1 Jul 2024 08:49:33 +0000 (10:49 +0200)] 
gh-121199: Use _Py__has_attribute() in timemodule.c (#121203)

Use the _Py__has_attribute() macro in timemodule.c and
bootstrap_hash.c to fix a build error on old GCC versions (GCC 4.8.5
on s390x).

16 months agogh-121188: Sanitize invalid XML characters in regrtest (#121195)
Victor Stinner [Mon, 1 Jul 2024 08:30:33 +0000 (10:30 +0200)] 
gh-121188: Sanitize invalid XML characters in regrtest (#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.

16 months agogh-113565: Improve and harden detection of curses dependencies (#119816)
Erlend E. Aasland [Mon, 1 Jul 2024 08:10:03 +0000 (10:10 +0200)] 
gh-113565: Improve and harden detection of curses dependencies (#119816)

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.

16 months agogh-87744: fix waitpid race while calling send_signal in asyncio (#121126)
Kumar Aditya [Mon, 1 Jul 2024 04:47:36 +0000 (10:17 +0530)] 
gh-87744: fix waitpid race while calling send_signal in asyncio (#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.

16 months agogh-121163: Add "all" as an valid alias for "always" in warnings.simplefilter() (...
Kirill Podoprigora [Sun, 30 Jun 2024 17:48:00 +0000 (20:48 +0300)] 
gh-121163: Add "all" as an valid alias for "always" in warnings.simplefilter() (#121164)

Add support for ``all`` as an valid alias for ``always`` in ``warnings.simplefilter()``
and ``warnings.filterswarnings()``.

16 months ago[doc] Update element positions and styles in logging flow diagram. (GH-121182)
Vinay Sajip [Sun, 30 Jun 2024 13:38:49 +0000 (14:38 +0100)] 
[doc] Update element positions and styles in logging flow diagram. (GH-121182)

Update element positions and styles.

16 months agogh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (#121178)
Yureka [Sun, 30 Jun 2024 09:40:40 +0000 (11:40 +0200)] 
gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (#121178)

16 months agogh-120522: Add a `--with-app-store-compliance` configure option to patch out problema...
Russell Keith-Magee [Sun, 30 Jun 2024 00:34:35 +0000 (08:34 +0800)] 
gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (#120984)

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

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Regenerate configure script.

* Silence the patch echo output.

---------

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>
16 months agoGH-119054: Add alt text to pathlib inheritance diagram (#121158)
Barney Gale [Sat, 29 Jun 2024 17:46:53 +0000 (18:46 +0100)] 
GH-119054: Add alt text to pathlib inheritance diagram (#121158)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agoGH-119054: Add "Expanding and resolving paths" section to pathlib docs. (#120970)
Barney Gale [Sat, 29 Jun 2024 15:09:47 +0000 (16:09 +0100)] 
GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (#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.

16 months agogh-119372: Recover inf's and zeros in _Py_c_quot (GH-119457)
Sergey B Kirpichev [Sat, 29 Jun 2024 08:00:48 +0000 (11:00 +0300)] 
gh-119372: Recover inf's and zeros in _Py_c_quot (GH-119457)

In some cases, previously computed as (nan+nanj), we could
recover meaningful component values in the result, see
e.g. the C11, Annex G.5.2, routine _Cdivd().

16 months agogh-121101: Document -Wall option (an alias for -Walways) (#121102)
Wim Jeantine-Glenn [Sat, 29 Jun 2024 06:40:13 +0000 (01:40 -0500)] 
gh-121101: Document -Wall option (an alias for -Walways) (#121102)

16 months agogh-120713: Normalize year with century for datetime.strftime (GH-120820)
blhsing [Sat, 29 Jun 2024 06:32:42 +0000 (14:32 +0800)] 
gh-120713: Normalize year with century for datetime.strftime (GH-120820)

16 months agogh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (#121136)
Justin Applegate [Fri, 28 Jun 2024 21:43:45 +0000 (15:43 -0600)] 
gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (#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

16 months agogh-117139: Fix a few wrong steals in bytecodes.c (GH-121127)
Ken Jin [Fri, 28 Jun 2024 18:14:48 +0000 (02:14 +0800)] 
gh-117139: Fix a few wrong steals in bytecodes.c (GH-121127)

Fix a few wrong steals in bytecodes.c

16 months agogh-121115: Skip __index__ in PyLong_AsNativeBytes by default (GH-121118)
Steve Dower [Fri, 28 Jun 2024 15:26:21 +0000 (16:26 +0100)] 
gh-121115: Skip __index__ in PyLong_AsNativeBytes by default (GH-121118)

16 months agogh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056)
Serhiy Storchaka [Fri, 28 Jun 2024 14:21:59 +0000 (17:21 +0300)] 
gh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056)

* 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.

16 months agoCheck for compiler warnings in test_cext on Windows (#121088)
Victor Stinner [Fri, 28 Jun 2024 12:41:37 +0000 (14:41 +0200)] 
Check for compiler warnings in test_cext on Windows (#121088)

On Windows, test_cext and test_cppext now pass /WX flag to the MSC
compiler to treat all compiler warnings as errors. In verbose mode,
these tests now log the compiler commands to help debugging.

Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a
compiler warning about an unnamed structure.

16 months agogh-120804: remove `is_active` method from internal child watchers implementation...
Kumar Aditya [Fri, 28 Jun 2024 11:53:56 +0000 (17:23 +0530)] 
gh-120804: remove `is_active` method from internal child watchers implementation in asyncio (#121124)

16 months agogh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097)
Victor Stinner [Fri, 28 Jun 2024 11:10:11 +0000 (13:10 +0200)] 
gh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097)

16 months agogh-107803: add whatsnew for asyncio double linked list implementation (#120995)
Kumar Aditya [Fri, 28 Jun 2024 09:03:31 +0000 (14:33 +0530)] 
gh-107803: add whatsnew for asyncio double linked list implementation (#120995)

16 months agogh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)
Donghee Na [Thu, 27 Jun 2024 21:46:46 +0000 (06:46 +0900)] 
gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)

16 months agogh-121035: Update logging flow chart to include the lastResort handler. (GH-121036)
Alexander Bessman [Thu, 27 Jun 2024 21:11:40 +0000 (23:11 +0200)] 
gh-121035: Update logging flow chart to include the lastResort handler. (GH-121036)

16 months agogh-121065: Temporarily skip flaky test on free-threaded build (#121100)
Sam Gross [Thu, 27 Jun 2024 18:03:09 +0000 (14:03 -0400)] 
gh-121065: Temporarily skip flaky test on free-threaded build (#121100)

16 months agogh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)
Craig Robson [Thu, 27 Jun 2024 16:44:40 +0000 (09:44 -0700)] 
gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)

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.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
16 months agogh-115986 Improve pprint docs formatting (GH-117401)
Kerim Kabirov [Thu, 27 Jun 2024 14:32:50 +0000 (16:32 +0200)] 
gh-115986 Improve pprint docs formatting (GH-117401)

* Move pprinter parameters description to the table

The change improves readability.
Suggested in the GH#116085 PR discussion.

* Make pprint doc with params markup

* Fix formatting
Indentation of code blocks made them nested
"Version changed" is better placed after the code block

* Fix formatting for tests

* fix code indentation for autotests

* Fix identation for autotests

* Remove duplication of the parameters' description

* Rearrange parameters description in a correct order

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agogh-121027: Add a future warning in functools.partial.__get__ (#121086)
Serhiy Storchaka [Thu, 27 Jun 2024 11:47:20 +0000 (14:47 +0300)] 
gh-121027: Add a future warning in functools.partial.__get__ (#121086)

16 months agogh-121082: Fix build failure when the developer use `--enable-pystats` arguments...
Nadeshiko Manju [Thu, 27 Jun 2024 11:35:25 +0000 (19:35 +0800)] 
gh-121082: Fix build failure when the developer use `--enable-pystats` arguments in configuration command after #118450 (#121083)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
16 months agogh-120593: Check -Wcast-qual flag in test_cext (#121081)
Victor Stinner [Thu, 27 Jun 2024 10:22:48 +0000 (12:22 +0200)] 
gh-120593: Check -Wcast-qual flag in test_cext (#121081)

Check the usage of the 'const' qualifier in the Python C API in
test_cext.

16 months agogh-120686: remove unused internal c api functions (#120687)
Irit Katriel [Thu, 27 Jun 2024 10:09:30 +0000 (11:09 +0100)] 
gh-120686: remove unused internal c api functions (#120687)

16 months agogh-121040: Use __attribute__((fallthrough)) (#121044)
Victor Stinner [Thu, 27 Jun 2024 09:58:44 +0000 (11:58 +0200)] 
gh-121040: Use __attribute__((fallthrough)) (#121044)

Fix warnings when using -Wimplicit-fallthrough compiler flag.

Annotate explicitly "fall through" switch cases with a new
_Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if
available. Replace "fall through" comments with _Py_FALLTHROUGH.

Add _Py__has_attribute() macro. No longer define __has_attribute()
macro if it's not defined. Move also _Py__has_builtin() at the top
of pyport.h.

Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
16 months agogh-120888: Bump bundled pip to 24.1.1 (#120889)
Pradyun Gedam [Thu, 27 Jun 2024 09:09:54 +0000 (10:09 +0100)] 
gh-120888: Bump bundled pip to 24.1.1 (#120889)

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>
Co-authored-by: T. Wouters <thomas@python.org>
16 months agogh-119521: Remove _IncompleteInputError from the docs (GH-120993)
Petr Viktorin [Thu, 27 Jun 2024 07:09:22 +0000 (09:09 +0200)] 
gh-119521: Remove _IncompleteInputError from the docs (GH-120993)

16 months agogh-120868: Fix breaking change in `logging.config` when using `QueueHandler` (GH...
Janek Nouvertné [Thu, 27 Jun 2024 07:09:01 +0000 (09:09 +0200)] 
gh-120868: Fix breaking change in `logging.config` when using `QueueHandler` (GH-120872)

16 months agogh-113433: Automatically Clean Up Subinterpreters in Py_Finalize() (gh-121060)
Eric Snow [Wed, 26 Jun 2024 21:17:26 +0000 (15:17 -0600)] 
gh-113433: Automatically Clean Up Subinterpreters in Py_Finalize() (gh-121060)

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.

16 months agogh-120937: Reference weakref from the `__del__` documentation (#120940)
chaen [Wed, 26 Jun 2024 20:07:09 +0000 (22:07 +0200)] 
gh-120937: Reference weakref from the `__del__` documentation (#120940)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agogh-117139: Convert the evaluation stack to stack refs (#118450)
Ken Jin [Wed, 26 Jun 2024 19:10:43 +0000 (03:10 +0800)] 
gh-117139: Convert the evaluation stack to stack refs (#118450)

This PR sets up tagged pointers for CPython.

The general idea is to create a separate struct _PyStackRef for everything on the evaluation stack to store the bits. This forces the C compiler to warn us if we try to cast things or pull things out of the struct directly.

Only for free threading: We tag the low bit if something is deferred - that means we skip incref and decref operations on it. This behavior may change in the future if Mark's plans to defer all objects in the interpreter loop pans out.

This implies a strict stack reference discipline is required. ALL incref and decref operations on stackrefs must use the stackref variants. It is unsafe to untag something then do normal incref/decref ops on it.

The new incref and decref variants are called dup and close. They mimic a "handle" API operating on these stackrefs.

Please read Include/internal/pycore_stackref.h for more information!

---------

Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
16 months agogh-118908: Use __main__ for the default PyREPL namespace (#121054)
Łukasz Langa [Wed, 26 Jun 2024 19:01:10 +0000 (15:01 -0400)] 
gh-118908: Use __main__ for the default PyREPL namespace (#121054)

16 months agogh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)
Victor Stinner [Wed, 26 Jun 2024 18:11:21 +0000 (20:11 +0200)] 
gh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)

Remove the const qualifier of the argument of functions:

* _PyLong_IsCompact()
* _PyLong_CompactValue()

Py_TYPE() argument is not const.

Fix the compiler warning:

  Include/cpython/longintrepr.h: In function ‘_PyLong_CompactValue’:
  Include/pyport.h:19:31: error: cast discards ‘const’ qualifier from
  pointer target type [-Werror=cast-qual]
    (...)
  Include/cpython/longintrepr.h:133:30: note: in expansion of macro
  ‘Py_TYPE’
    assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS));

16 months agogh-120593: Fix const qualifier in pyatomic.h (#121055)
Victor Stinner [Wed, 26 Jun 2024 18:10:47 +0000 (20:10 +0200)] 
gh-120593: Fix const qualifier in pyatomic.h (#121055)

16 months agogh-121008: Fix idlelib.run tests (#121046)
Victor Stinner [Wed, 26 Jun 2024 13:41:16 +0000 (15:41 +0200)] 
gh-121008: Fix idlelib.run tests (#121046)

When testing IDLE, don't create a Tk to avoid side effects such as
installing a PyOS_InputHook hook.

16 months agogh-119786: move frames documentation to InternalDocs and add details (#121009)
Irit Katriel [Wed, 26 Jun 2024 12:18:20 +0000 (13:18 +0100)] 
gh-119786: move frames documentation to InternalDocs and add details (#121009)

16 months agogh-120642: Move private PyCode APIs to the internal C API (#120643)
Victor Stinner [Wed, 26 Jun 2024 11:54:03 +0000 (13:54 +0200)] 
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()

16 months agogh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)
devdanzin [Wed, 26 Jun 2024 10:39:07 +0000 (07:39 -0300)] 
gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)

16 months agogh-121040: Remove fallthrough warnings compiler option (gh-121041)
Nate Ohlson [Wed, 26 Jun 2024 10:21:21 +0000 (05:21 -0500)] 
gh-121040: Remove fallthrough warnings compiler option (gh-121041)

Remove fallthrough warnings

16 months agogh-73991: Skip permission test if running as *nix superuser (GH-120994)
Petr Viktorin [Wed, 26 Jun 2024 09:36:09 +0000 (11:36 +0200)] 
gh-73991: Skip permission test if running as *nix superuser (GH-120994)

16 months agogh-121025: Improve partialmethod.__repr__ (GH-121033)
Bénédikt Tran [Wed, 26 Jun 2024 09:08:27 +0000 (11:08 +0200)] 
gh-121025: Improve partialmethod.__repr__ (GH-121033)

It no longer contains redundant commas and spaces.

16 months agogh-121026: Include -Werror with new compiler flag checks to ensure compatibility...
Nate Ohlson [Wed, 26 Jun 2024 08:45:55 +0000 (03:45 -0500)] 
gh-121026: Include -Werror with new compiler flag checks to ensure compatibility (gh-121030)

16 months agogh-121018: Ensure ArgumentParser.parse_args with exit_on_error=False raises instead...
blhsing [Wed, 26 Jun 2024 07:41:51 +0000 (15:41 +0800)] 
gh-121018: Ensure ArgumentParser.parse_args with exit_on_error=False raises instead of exiting when given unrecognized arguments (GH-121019)

16 months agogh-107803: fix thread safety issue in double linked list implementation (#121007)
Kumar Aditya [Wed, 26 Jun 2024 05:11:32 +0000 (10:41 +0530)] 
gh-107803: fix thread safety issue in double linked list implementation  (#121007)

16 months agogh-112301: Enable compiler flags with low performance impact and no warnings (gh...
Nate Ohlson [Wed, 26 Jun 2024 03:11:05 +0000 (22:11 -0500)] 
gh-112301: Enable compiler flags with low performance impact and no warnings (gh-120975)

16 months agogh-120838: Add _PyThreadState_WHENCE_FINI (gh-121010)
Eric Snow [Tue, 25 Jun 2024 20:35:12 +0000 (14:35 -0600)] 
gh-120838: Add _PyThreadState_WHENCE_FINI (gh-121010)

We also add _PyThreadState_NewBound() and drop _PyThreadState_SetWhence().

This change only affects internal API.

16 months agogh-120155: Fix Coverity issue in parse_string() (#120997)
Victor Stinner [Tue, 25 Jun 2024 16:53:24 +0000 (18:53 +0200)] 
gh-120155: Fix Coverity issue in parse_string() (#120997)

16 months agogh-114053: Fix another edge case involving `get_type_hints`, PEP 695 and PEP 563...
Alex Waygood [Tue, 25 Jun 2024 15:53:18 +0000 (16:53 +0100)] 
gh-114053: Fix another edge case involving `get_type_hints`, PEP 695 and PEP 563 (#120272)

16 months agoGH-120982: Add stack check assertions to generated interpreter code (GH-120992)
Mark Shannon [Tue, 25 Jun 2024 15:42:29 +0000 (16:42 +0100)] 
GH-120982: Add stack check assertions to generated interpreter code (GH-120992)

16 months agogh-120108: Fix deepcopying of AST trees with .parent attributes (#120114)
Jelle Zijlstra [Tue, 25 Jun 2024 15:12:11 +0000 (08:12 -0700)] 
gh-120108: Fix deepcopying of AST trees with .parent attributes (#120114)

16 months agoDoc/README: Document 'make htmllive' (#120692)
Hugo van Kemenade [Tue, 25 Jun 2024 09:08:55 +0000 (03:08 -0600)] 
Doc/README: Document 'make htmllive' (#120692)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
16 months agoAdd fast path in count_elements (gh-120983)
Raymond Hettinger [Tue, 25 Jun 2024 08:10:00 +0000 (03:10 -0500)] 
Add fast path in count_elements (gh-120983)

16 months agogh-120661: improve example for basic type hints (#120934)
Bénédikt Tran [Tue, 25 Jun 2024 07:59:56 +0000 (09:59 +0200)] 
gh-120661: improve example for basic type hints (#120934)

16 months agogh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (#120822)
Michael Allwright [Tue, 25 Jun 2024 07:48:48 +0000 (09:48 +0200)] 
gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (#120822)

Add missing space in AS_VAR_APPEND() on CFLAGS.

16 months agoAdd --with-lto back to Linux JIT CI (GH-120921)
Savannah Ostrowski [Mon, 24 Jun 2024 20:16:22 +0000 (13:16 -0700)] 
Add --with-lto back to Linux JIT CI (GH-120921)

16 months agoGH-119054: Add "Permissions and ownership" section to pathlib docs. (#120505)
Barney Gale [Mon, 24 Jun 2024 19:05:24 +0000 (20:05 +0100)] 
GH-119054: Add "Permissions and ownership" section to pathlib docs. (#120505)

Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 months agogh-120858: PyDict_Next should not lock the dict (#120859)
Sam Gross [Mon, 24 Jun 2024 18:15:15 +0000 (14:15 -0400)] 
gh-120858: PyDict_Next should not lock the dict (#120859)

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.

16 months agogh-120860: Fix a few bugs in `type_setattro` error paths. (#120861)
Sam Gross [Mon, 24 Jun 2024 18:08:23 +0000 (14:08 -0400)] 
gh-120860: Fix a few bugs in `type_setattro` error paths. (#120861)

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.