]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
23 months agogh-106922: Support multi-line error locations in traceback (attempt 2) (#112097)
William Wen [Fri, 1 Dec 2023 22:18:16 +0000 (14:18 -0800)] 
gh-106922: Support multi-line error locations in traceback (attempt 2) (#112097)

23 months agogh-112567: Add _PyTimeFraction C API (#112568)
Victor Stinner [Fri, 1 Dec 2023 18:50:10 +0000 (19:50 +0100)] 
gh-112567: Add _PyTimeFraction C API (#112568)

Use a fraction internally in the _PyTime API to reduce the risk of
integer overflow: simplify the fraction using Greatest Common
Divisor (GCD). The fraction API is used by time functions:
perf_counter(), monotonic() and process_time().

For example, QueryPerformanceFrequency() usually returns 10 MHz on
Windows 10 and newer. The fraction SEC_TO_NS / frequency =
1_000_000_000 / 10_000_000 can be simplified to 100 / 1.

* Add _PyTimeFraction type.
* Add functions:

  * _PyTimeFraction_Set()
  * _PyTimeFraction_Mul()
  * _PyTimeFraction_Resolution()

* No longer check "numer * denom <= _PyTime_MAX" in
  _PyTimeFraction_Set(). _PyTimeFraction_Mul() uses _PyTime_Mul()
  which handles integer overflow.

23 months agogh-112567: Add _Py_GetTicksPerSecond() function (#112587)
Victor Stinner [Fri, 1 Dec 2023 16:05:56 +0000 (17:05 +0100)] 
gh-112567: Add _Py_GetTicksPerSecond() function (#112587)

* Move _PyRuntimeState.time to _posixstate.ticks_per_second and
  time_module_state.ticks_per_second.
* Add time_module_state.clocks_per_second.
* Rename _PyTime_GetClockWithInfo() to py_clock().
* Rename _PyTime_GetProcessTimeWithInfo() to py_process_time().
* Add process_time_times() helper function, called by
  py_process_time().
* os.times() is now always built: no longer rely on HAVE_TIMES.

23 months agogh-110481: Fix typo in Py_SET_REFCNT() (#112595)
Victor Stinner [Fri, 1 Dec 2023 15:54:40 +0000 (16:54 +0100)] 
gh-110481: Fix typo in Py_SET_REFCNT() (#112595)

23 months agobpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503)
Zackery Spytz [Fri, 1 Dec 2023 15:16:49 +0000 (07:16 -0800)] 
bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503)

* Fix a crash when pass UINT_MAX.
* Fix an integer overflow on 64-bit non-Windows platforms.

23 months agogh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (#112586)
Alex Waygood [Fri, 1 Dec 2023 14:54:33 +0000 (14:54 +0000)] 
gh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (#112586)

Co-authored-by: Victor Stinner <vstinner@python.org>
23 months agogh-110481: Fix Py_SET_REFCNT() integer overflow (#112174)
Victor Stinner [Fri, 1 Dec 2023 14:50:16 +0000 (15:50 +0100)] 
gh-110481: Fix Py_SET_REFCNT() integer overflow (#112174)

If Py_NOGIL is defined and Py_SET_REFCNT() is called with a reference
count larger than UINT32_MAX, make the object immortal.

Set _Py_IMMORTAL_REFCNT constant type to Py_ssize_t to fix the
following compiler warning:

Include/internal/pycore_global_objects_fini_generated.h:14:24:
warning: comparison of integers of different signs: 'Py_ssize_t'
(aka 'long') and 'unsigned int' [-Wsign-compare]

    if (Py_REFCNT(obj) < _Py_IMMORTAL_REFCNT) {
        ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~

23 months agogh-112510: Add `readline.backend` for the backend readline uses (GH-112511)
Tian Gao [Fri, 1 Dec 2023 14:05:55 +0000 (05:05 -0900)] 
gh-112510: Add `readline.backend` for the backend readline uses (GH-112511)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Donghee Na <donghee.na92@gmail.com>
23 months agogh-109413: regrtest: add WorkerRunTests class (#112588)
Victor Stinner [Fri, 1 Dec 2023 13:46:50 +0000 (14:46 +0100)] 
gh-109413: regrtest: add WorkerRunTests class (#112588)

23 months agogh-82565: Add tests for pickle and unpickle with bad files (GH-16606)
Zackery Spytz [Fri, 1 Dec 2023 13:36:37 +0000 (05:36 -0800)] 
gh-82565: Add tests for pickle and unpickle with bad files (GH-16606)

23 months agogh-112367: Only free perf trampoline arenas at shutdown (#112368)
Pablo Galindo Salgado [Fri, 1 Dec 2023 13:20:51 +0000 (13:20 +0000)] 
gh-112367: Only free perf trampoline arenas at shutdown (#112368)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
23 months agogh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/genera...
Irit Katriel [Fri, 1 Dec 2023 12:57:31 +0000 (12:57 +0000)] 
gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/generator. (#112428)

23 months agobpo-39912: Raise appropriate exceptions in filterwarnings() and simplefilter() (GH...
Rémi Lapeyre [Fri, 1 Dec 2023 11:17:47 +0000 (12:17 +0100)] 
bpo-39912: Raise appropriate exceptions in filterwarnings() and simplefilter() (GH-18878)

23 months agobuild(deps): bump hypothesis from 6.88.1 to 6.91.0 in /Tools (#112580)
dependabot[bot] [Fri, 1 Dec 2023 11:17:24 +0000 (11:17 +0000)] 
build(deps): bump hypothesis from 6.88.1 to 6.91.0 in /Tools (#112580)

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

---
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>
23 months agobuild(deps): bump actions/github-script from 6 to 7 (#112584)
dependabot[bot] [Fri, 1 Dec 2023 10:41:09 +0000 (11:41 +0100)] 
build(deps): bump actions/github-script from 6 to 7 (#112584)

Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
23 months agoFix typos in variable names, function names, and comments (GH-101868)
Yang Hau [Fri, 1 Dec 2023 09:37:40 +0000 (17:37 +0800)] 
Fix typos in variable names, function names, and comments (GH-101868)

23 months agobuild(deps-dev): bump types-setuptools from 68.2.0.0 to 69.0.0.0 in /Tools (#112582)
dependabot[bot] [Fri, 1 Dec 2023 09:29:04 +0000 (09:29 +0000)] 
build(deps-dev): bump types-setuptools from 68.2.0.0 to 69.0.0.0 in /Tools (#112582)

build(deps-dev): bump types-setuptools in /Tools

Bumps [types-setuptools](https://github.com/python/typeshed) from 68.2.0.0 to 69.0.0.0.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-setuptools
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
23 months agobuild(deps-dev): bump mypy from 1.7.0 to 1.7.1 in /Tools (#112581)
dependabot[bot] [Fri, 1 Dec 2023 09:21:45 +0000 (09:21 +0000)] 
build(deps-dev): bump mypy from 1.7.0 to 1.7.1 in /Tools (#112581)

Bumps [mypy](https://github.com/python/mypy) from 1.7.0 to 1.7.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
23 months agoAdd links under "generator expression" in glossary (#112537)
William Andrea [Fri, 1 Dec 2023 08:41:11 +0000 (03:41 -0500)] 
Add links under "generator expression" in glossary (#112537)

23 months agogh-66819: More IDLE htest updates (#112574)
Terry Jan Reedy [Fri, 1 Dec 2023 07:02:31 +0000 (02:02 -0500)] 
gh-66819: More IDLE htest updates (#112574)

Revise htest.py docstring and move 2 specs to alphabetical position.

23 months agogh-112205: Update stringio module to use AC for the thread-safe (gh-112549)
Donghee Na [Thu, 30 Nov 2023 23:37:30 +0000 (23:37 +0000)] 
gh-112205: Update stringio module to use AC for the thread-safe (gh-112549)

23 months agogh-109413: Run mypy on `libregrtest` in CI (#112558)
Alex Waygood [Thu, 30 Nov 2023 23:00:14 +0000 (23:00 +0000)] 
gh-109413: Run mypy on `libregrtest` in CI (#112558)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
23 months agoClarify a comment for `test.support.Py_C_RECURSION_LIMIT` to point out where a value...
Brett Cannon [Thu, 30 Nov 2023 21:38:10 +0000 (13:38 -0800)] 
Clarify a comment for `test.support.Py_C_RECURSION_LIMIT` to point out where a value came from but that it doesn't need to stay in sync (#112224)

23 months agogh-112502: Docs: Improve docs for gc.collect method (#112562)
Alperen Serkan Aksöz [Thu, 30 Nov 2023 21:04:00 +0000 (00:04 +0300)] 
gh-112502: Docs: Improve docs for gc.collect method (#112562)

* Docs: Improve docs for gc.collect method

* Update gc.rst

23 months agoClarify that WASI tool requirements are included in the devcontainer (GH-112561)
Brett Cannon [Thu, 30 Nov 2023 21:01:07 +0000 (13:01 -0800)] 
Clarify that WASI tool requirements are included in the devcontainer (GH-112561)

23 months agogh-104231: Add more tests for str(), repr(), ascii(), and bytes() (GH-112551)
Serhiy Storchaka [Thu, 30 Nov 2023 15:22:04 +0000 (17:22 +0200)] 
gh-104231: Add more tests for str(), repr(), ascii(), and bytes() (GH-112551)

23 months agogh-111699: Move smtpd note to dedicated section in What's New Python 3.12 doc (GH...
Matt Prodani [Thu, 30 Nov 2023 12:53:19 +0000 (07:53 -0500)] 
gh-111699: Move smtpd note to dedicated section in What's New Python 3.12 doc (GH-112544)

Relocate smtpd deprecation notice to it's own section rather than under
'locale' in docs for What's New in Python 3.12 doc

23 months agogh-112519: Make it possible to specify instruction flags for pseudo instructions...
Irit Katriel [Thu, 30 Nov 2023 11:03:30 +0000 (11:03 +0000)] 
gh-112519: Make it possible to specify instruction flags for pseudo instructions in bytecodes.c (#112520)

23 months agogh-112205: Support @getter annotation from AC (gh-112396)
Donghee Na [Thu, 30 Nov 2023 10:40:53 +0000 (10:40 +0000)] 
gh-112205: Support @getter annotation from AC (gh-112396)

23 months agogh-111972: Make Unicode name C APIcapsule initialization thread-safe (#112249)
Kirill Podoprigora [Thu, 30 Nov 2023 10:12:49 +0000 (13:12 +0300)] 
gh-111972: Make Unicode name C APIcapsule initialization thread-safe (#112249)

23 months agoIDLE: fix config_key htest (#112545)
Terry Jan Reedy [Thu, 30 Nov 2023 07:08:44 +0000 (02:08 -0500)] 
IDLE: fix config_key htest (#112545)

Change 'Dialog' to 'Window' in two places to match the name of the config_key class being tested.

23 months agoGH-103065, GH-106704, GH-105253: Provide a `Tools/wasm/wasi.py` script to simplify...
Brett Cannon [Thu, 30 Nov 2023 00:18:25 +0000 (16:18 -0800)] 
GH-103065, GH-106704, GH-105253: Provide a `Tools/wasm/wasi.py` script to simplify doing a WASI build (GH-112473)

23 months agogh-104003: Implement PEP 702 (#104004)
Jelle Zijlstra [Wed, 29 Nov 2023 17:38:29 +0000 (09:38 -0800)] 
gh-104003: Implement PEP 702 (#104004)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agogh-112509: Fix keys being present in both required_keys and optional_keys in TypedDic...
Jelle Zijlstra [Wed, 29 Nov 2023 17:36:48 +0000 (09:36 -0800)] 
gh-112509: Fix keys being present in both required_keys and optional_keys in TypedDict (#112512)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agoAdd more C API tests (GH-112522)
Serhiy Storchaka [Wed, 29 Nov 2023 15:37:05 +0000 (17:37 +0200)] 
Add more C API tests (GH-112522)

Add tests for PyObject_Str(), PyObject_Repr(), PyObject_ASCII() and
PyObject_Bytes().

23 months ago[Enum] update class creation for RuntimeError changes (GH-111815)
Ethan Furman [Wed, 29 Nov 2023 04:40:12 +0000 (20:40 -0800)] 
[Enum] update class creation for RuntimeError changes (GH-111815)

23 months agoRename ...Uop... to ...UOp... (uppercase O) for consistency (#112327)
Guido van Rossum [Wed, 29 Nov 2023 01:10:11 +0000 (10:10 +0900)] 
Rename ...Uop... to ...UOp... (uppercase O) for consistency (#112327)

* Rename _PyUopExecute to _PyUOpExecute (uppercase O) for consistency
* Also rename _PyUopName and _PyUOp_Replacements, and some output strings

23 months agogh-112454: Disable TLS-PSK if OpenSSL was built without PSK support (#112491)
Grant Ramsay [Wed, 29 Nov 2023 00:15:39 +0000 (13:15 +1300)] 
gh-112454: Disable TLS-PSK if OpenSSL was built without PSK support (#112491)

If OpenSSL was built without PSK support, the python TLS-PSK
methods will raise "NotImplementedError" if called.

Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported

23 months agoGH-112245: Promote free threaded CI (#112246)
Itamar Oren [Tue, 28 Nov 2023 15:45:03 +0000 (07:45 -0800)] 
GH-112245: Promote free threaded CI (#112246)

23 months agogh-110930: Correct book title by Alan D. Moore (#112490)
Hugo van Kemenade [Tue, 28 Nov 2023 14:46:00 +0000 (16:46 +0200)] 
gh-110930: Correct book title by Alan D. Moore (#112490)

23 months agogh-112431: Unconditionally call `hash -r` (GH-112432)
James Morris [Tue, 28 Nov 2023 09:24:59 +0000 (04:24 -0500)] 
gh-112431: Unconditionally call `hash -r` (GH-112432)

The `activate` script calls `hash -r` in two places to make sure the shell picks
up the environment changes the script makes. Before that, it checks to
see if the shell running the script is bash or zsh.

`hash -r` is specified by POSIX and is not exclusive to bash and zsh.
This guard prevents the script from calling `hash -r` in other
`#!/bin/sh`-compatible shells like dash.

23 months agogh-109802: Increase test coverage for complexobject.c (GH-112452)
Sergey B Kirpichev [Tue, 28 Nov 2023 08:18:33 +0000 (11:18 +0300)] 
gh-109802: Increase test coverage for complexobject.c (GH-112452)

23 months agogh-112332: Deprecate TracebackException.exc_type, add exc_type_str. (#112333)
Irit Katriel [Tue, 28 Nov 2023 08:03:25 +0000 (08:03 +0000)] 
gh-112332: Deprecate TracebackException.exc_type, add exc_type_str. (#112333)

23 months agogh-112105: Make completer delims work on libedit (gh-112106)
Tian Gao [Tue, 28 Nov 2023 06:23:23 +0000 (21:23 -0900)] 
gh-112105: Make completer delims work on libedit (gh-112106)

23 months agogh-112071: Make `_random.Random` methods thread-safe in `--disable-gil` builds (gh...
Radislav Chugunov [Tue, 28 Nov 2023 03:27:39 +0000 (06:27 +0300)] 
gh-112071: Make `_random.Random` methods thread-safe in `--disable-gil` builds (gh-112128)

Co-authored-by: Donghee Na <donghee.na@python.org>
23 months agogh-112292 : Catch import error conditions with readline hooks (gh-112313)
Anthony Shaw [Tue, 28 Nov 2023 01:58:53 +0000 (12:58 +1100)] 
gh-112292 : Catch import error conditions with readline hooks (gh-112313)

Prevents a segmentation fault in registered hooks for the readline library, but only when the readline module is loaded inside an isolated sub interpreter.  The module is single-phase init so loading it fails, but not until the module init function has already run, where the readline hooks get registered.

The readlinestate_global macro was error-prone to PyImport_FindModule returning NULL and crashing in about 18 places.  I could reproduce 1 easily, but this PR replaces the macro with a function and adds error conditions to the other functions.

23 months agoDocs: fix markup for `importlib.machinery.NamespaceLoader` (#112479)
Alex Waygood [Tue, 28 Nov 2023 00:15:23 +0000 (00:15 +0000)] 
Docs: fix markup for `importlib.machinery.NamespaceLoader` (#112479)

23 months agogh-112414: Add additional unit tests for calling `repr()` on a namespace package...
Alex Waygood [Tue, 28 Nov 2023 00:09:59 +0000 (00:09 +0000)] 
gh-112414: Add additional unit tests for calling `repr()` on a namespace package (#112475)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
23 months agoCorrect documentation for AF_PACKET (#112339)
Eugene Toder [Mon, 27 Nov 2023 23:42:37 +0000 (18:42 -0500)] 
Correct documentation for AF_PACKET (#112339)

Protocol in the address tuple should *not* be in the network-byte-order, because it is converted internally[1].

[1] https://github.com/python/cpython/blob/89ddea4886942b0c27a778a0ad3f0d5ac5f518f0/Modules/socketmodule.c#L2144

network byte order doesn't make sense for a python level int anyways. It's a fixed size C serialization concept.

23 months agogh-99367: Do not mangle sys.path[0] in pdb if safe_path is set (#111762)
Tian Gao [Mon, 27 Nov 2023 23:11:40 +0000 (14:11 -0900)] 
gh-99367: Do not mangle sys.path[0] in pdb if safe_path is set (#111762)

Co-authored-by: Christian Walther <cwalther@users.noreply.github.com>
23 months agogh-112217: Add check to call result for `do_raise()` where cause is a type. (#112216)
apaz [Mon, 27 Nov 2023 21:13:27 +0000 (15:13 -0600)] 
gh-112217: Add check to call result for `do_raise()` where cause is a type. (#112216)

23 months agogh-68166: Add support of "vsapi" in ttk.Style.element_create() (GH-111393)
Serhiy Storchaka [Mon, 27 Nov 2023 18:57:33 +0000 (20:57 +0200)] 
gh-68166: Add support of "vsapi" in ttk.Style.element_create() (GH-111393)

23 months agogh-112387: Fix error positions for decoded strings with backwards tokenize errors...
Pablo Galindo Salgado [Mon, 27 Nov 2023 18:37:48 +0000 (18:37 +0000)] 
gh-112387: Fix error positions for decoded strings with backwards tokenize errors (#112409)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
23 months agogh-112388: Fix an error that was causing the parser to try to overwrite tokenizer...
Pablo Galindo Salgado [Mon, 27 Nov 2023 18:36:11 +0000 (18:36 +0000)] 
gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (#112410)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
23 months agobpo-41422: Visit the Pickler's and Unpickler's memo in tp_traverse (GH-21664)
kale-smoothie [Mon, 27 Nov 2023 18:09:41 +0000 (18:09 +0000)] 
bpo-41422: Visit the Pickler's and Unpickler's memo in tp_traverse (GH-21664)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agogh-76912: Raise OSError from any failure in getpass.getuser() (#29739)
Jacob Walls [Mon, 27 Nov 2023 18:05:55 +0000 (13:05 -0500)] 
gh-76912: Raise OSError from any failure in getpass.getuser() (#29739)

* bpo-32731: Raise OSError from any failure in getpass.getuser()
Previously, if the username was not set in certain environment variables, ImportError escaped on Windows systems, and it was possible for KeyError to escape on other systems if getpwuid() failed.

23 months agogh-111789: Use PyDict_GetItemRef() in Python/_warnings.c (gh-112080)
Serhiy Storchaka [Mon, 27 Nov 2023 17:58:43 +0000 (19:58 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Python/_warnings.c (gh-112080)

23 months agogh-111789: Use PyDict_GetItemRef() in Python/symtable.c (gh-112084)
Serhiy Storchaka [Mon, 27 Nov 2023 17:55:30 +0000 (19:55 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Python/symtable.c (gh-112084)

23 months agogh-111789: Use PyDict_GetItemRef() in Python/codecs.c (gh-112082)
Serhiy Storchaka [Mon, 27 Nov 2023 17:53:43 +0000 (19:53 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Python/codecs.c (gh-112082)

23 months agogh-111789: Use PyDict_GetItemRef() in Python/bltinmodule.c (gh-112081)
Serhiy Storchaka [Mon, 27 Nov 2023 17:52:54 +0000 (19:52 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Python/bltinmodule.c (gh-112081)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/pyexpat.c (gh-112079)
Serhiy Storchaka [Mon, 27 Nov 2023 17:51:31 +0000 (19:51 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/pyexpat.c (gh-112079)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/_threadmodule.c (gh-112077)
Serhiy Storchaka [Mon, 27 Nov 2023 17:46:43 +0000 (19:46 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_threadmodule.c (gh-112077)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/_struct.c (gh-112076)
Serhiy Storchaka [Mon, 27 Nov 2023 17:41:47 +0000 (19:41 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_struct.c (gh-112076)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/_csv.c (gh-112073)
Serhiy Storchaka [Mon, 27 Nov 2023 17:35:52 +0000 (19:35 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_csv.c (gh-112073)

23 months agogh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_...
Serhiy Storchaka [Mon, 27 Nov 2023 17:32:55 +0000 (19:32 +0200)] 
gh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_Parse (gh-112439)

23 months agogh-84443: SSLSocket.recv_into() now support buffer protocol with itemsize != 1 (GH...
Zackery Spytz [Mon, 27 Nov 2023 17:15:39 +0000 (09:15 -0800)] 
gh-84443: SSLSocket.recv_into() now support buffer protocol with itemsize != 1 (GH-20310)

It is also no longer use __len__().

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agogh-111874: Call `__set_name__` on objects that define the method inside a `typing...
Alex Waygood [Mon, 27 Nov 2023 16:34:44 +0000 (16:34 +0000)] 
gh-111874: Call `__set_name__` on objects that define the method inside a `typing.NamedTuple` class dictionary as part of the creation of that class (#111876)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
23 months agoGH-101100: Fix reference warnings for ``socket`` methods (#110114)
Adam Turner [Mon, 27 Nov 2023 14:36:54 +0000 (14:36 +0000)] 
GH-101100: Fix reference warnings for ``socket`` methods (#110114)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agoMove What's New In Python 3.12 entries to the right section (#112447)
Victor Stinner [Mon, 27 Nov 2023 11:55:52 +0000 (12:55 +0100)] 
Move What's New In Python 3.12 entries to the right section (#112447)

Jython and ctypes removals are unrelated to C API Removals.

23 months agogh-111147: Fix `test_set_of_sets_reprs` in `test_pprint` (GH-111148)
Nikita Sobolev [Mon, 27 Nov 2023 10:01:26 +0000 (13:01 +0300)] 
gh-111147: Fix `test_set_of_sets_reprs` in `test_pprint` (GH-111148)

Make it stable and not depending on implementation details.

23 months agoDocs: fix typo in doc for sqlite3.Cursor.execute (#112442)
Tom Levy [Mon, 27 Nov 2023 09:27:47 +0000 (22:27 +1300)] 
Docs: fix typo in doc for sqlite3.Cursor.execute (#112442)

23 months agogh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported...
Alex Waygood [Mon, 27 Nov 2023 08:19:29 +0000 (08:19 +0000)] 
gh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported with a custom loader (#112425)

23 months agogh-63284: Add support for TLS-PSK (pre-shared key) to the ssl module (#103181)
Grant Ramsay [Mon, 27 Nov 2023 04:01:44 +0000 (17:01 +1300)] 
gh-63284: Add support for TLS-PSK (pre-shared key) to the ssl module (#103181)

Add support for TLS-PSK (pre-shared key) to the ssl module.

---------

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
23 months agogh-99606: Make code generated for an empty f-string identical to that of a normal...
Irit Katriel [Sun, 26 Nov 2023 17:13:57 +0000 (17:13 +0000)] 
gh-99606: Make code generated for an empty f-string identical to that of a normal empty string (#112407)

23 months agogh-112405: Optimise `pathlib.Path.relative_to` (#112406)
Alex Waygood [Sun, 26 Nov 2023 15:56:03 +0000 (15:56 +0000)] 
gh-112405: Optimise `pathlib.Path.relative_to` (#112406)

23 months agogh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (#112424)
Mark Dickinson [Sun, 26 Nov 2023 14:29:52 +0000 (14:29 +0000)] 
gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (#112424)

Revert commit c8c0afc7137ab9f22bf59d591084948ca967c97c (PR #94532),
which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`.
This caused issues with code in the wild that subclasses `struct.Struct`.

23 months agogh-101100: Fix Sphinx reference warnings (GH-112416)
Hugo van Kemenade [Sat, 25 Nov 2023 23:40:19 +0000 (01:40 +0200)] 
gh-101100: Fix Sphinx reference warnings (GH-112416)

* Fix Sphinx warning in library/xml.rst

Direct use of the pyexpat module is deprecated, but this is how to check the version for security purposes

* Fix Sphinx warning in library/importlib.resources.rst

* Use italics for parameters

* Link to the exception

* Fix Sphinx warning in library/gzip.rst

* Document message and header defect base classes to fix Sphinx warning in library/email.headerregistry.rst

* Restore feed_eof() doc to fix Sphinx warning in library/asyncio-stream.rst

* Fix Sphinx warning in extending/newtypes.rst

* Fix Sphinx warning in c-api/set.rst

On stdtypes.rst, set and frozenset are documented together and the frozenset has the working refs

23 months agogh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375)
Raymond Hettinger [Sat, 25 Nov 2023 22:20:53 +0000 (16:20 -0600)] 
gh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375)

23 months agoDescriptor HowTo: Sync the error-messages with the C code. Add tests. (gh-112403)
Raymond Hettinger [Sat, 25 Nov 2023 22:18:00 +0000 (16:18 -0600)] 
Descriptor HowTo:  Sync the error-messages with the C code. Add tests. (gh-112403)

23 months agogh-101100 : Fix Sphinx warnings in `library/doctest.rst` (#112399)
Hugo van Kemenade [Sat, 25 Nov 2023 18:08:32 +0000 (20:08 +0200)] 
gh-101100 : Fix Sphinx warnings in `library/doctest.rst` (#112399)

* Fix Sphinx warnings in library/doctest.rst

* Don't link to self, and wrap a line

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Link to load_tests protocol

* Link to option flags

* Wrap line

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agoGH-77621: Delay some imports from pathlib (#112244)
Barney Gale [Sat, 25 Nov 2023 17:41:05 +0000 (17:41 +0000)] 
GH-77621: Delay some imports from pathlib (#112244)

Import `contextlib`, `glob` and `re` only as required.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agogh-94722: fix DocTest.__eq__ for case of no line number on one side (#112385)
Irit Katriel [Sat, 25 Nov 2023 17:23:43 +0000 (17:23 +0000)] 
gh-94722: fix DocTest.__eq__ for case of no line number on one side (#112385)

23 months agoGH-112361: Speed up pathlib by removing some temporary objects. (#112362)
Barney Gale [Sat, 25 Nov 2023 17:19:38 +0000 (17:19 +0000)] 
GH-112361: Speed up pathlib by removing some temporary objects. (#112362)

Construct only one new list object (using `list.copy()`) when creating a
new path object with a modified tail. This slightly speeds up
`with_name()` and `with_suffix()`

23 months agogh-101100: Define `_tkinter` module to fix references (#112382)
Hugo van Kemenade [Sat, 25 Nov 2023 06:18:02 +0000 (08:18 +0200)] 
gh-101100: Define `_tkinter` module to fix references (#112382)

Define _tkinter module to fix references

23 months agogh-101100: Define `test.regrtest` module to fix references (#112381)
Hugo van Kemenade [Sat, 25 Nov 2023 06:17:31 +0000 (08:17 +0200)] 
gh-101100: Define `test.regrtest` module to fix references (#112381)

Define test.regrtest module to fix references

23 months agogh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis (#112377)
Irit Katriel [Fri, 24 Nov 2023 18:13:25 +0000 (18:13 +0000)] 
gh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis (#112377)

23 months agogh-59254: mention in open() doc that line buffering is for writing (#112318)
Irit Katriel [Fri, 24 Nov 2023 17:59:41 +0000 (17:59 +0000)] 
gh-59254: mention in open() doc that line buffering is for writing (#112318)

23 months agogh-112213: Add missing declaration of target_critical_section (gh-112374)
Donghee Na [Fri, 24 Nov 2023 15:58:39 +0000 (15:58 +0000)] 
gh-112213: Add missing declaration of target_critical_section (gh-112374)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agogh-112345: `typing.Protocol`: Let failed subclasscheck show non-method members (...
Randolf Scholz [Fri, 24 Nov 2023 09:46:08 +0000 (10:46 +0100)] 
gh-112345: `typing.Protocol`: Let failed subclasscheck show non-method members (#112344)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
23 months agoRemove bogus annotations from the descriptor howto guide (#112349)
Raymond Hettinger [Thu, 23 Nov 2023 21:16:00 +0000 (21:16 +0000)] 
Remove bogus annotations from the descriptor howto guide (#112349)

23 months agoAdd extra tests for `random.binomialvariate` (gh-112325)
Tian Gao [Thu, 23 Nov 2023 18:31:03 +0000 (10:31 -0800)] 
Add extra tests for `random.binomialvariate` (gh-112325)

23 months agogh-112137: change dis output to show no-lineno as -- instead of None (#112335)
Irit Katriel [Thu, 23 Nov 2023 14:34:27 +0000 (14:34 +0000)] 
gh-112137: change dis output to show no-lineno as -- instead of None (#112335)

23 months agogh-76785: Return an "excinfo" Object From Interpreter.run() (gh-111573)
Eric Snow [Thu, 23 Nov 2023 00:55:00 +0000 (17:55 -0700)] 
gh-76785: Return an "excinfo" Object From Interpreter.run() (gh-111573)

23 months agogh-111809: Fix `test_deep_repr` from `test_userdict` on WASI (GH-112229)
Nikita Sobolev [Wed, 22 Nov 2023 22:55:25 +0000 (01:55 +0300)] 
gh-111809: Fix `test_deep_repr` from `test_userdict` on WASI (GH-112229)

23 months agogh-112137: change dis output to display labels instead of offsets (#112138)
Irit Katriel [Wed, 22 Nov 2023 22:36:55 +0000 (22:36 +0000)] 
gh-112137: change dis output to display labels instead of offsets (#112138)

23 months agogh-76785: Add _PyType_GetModuleName() to the Internal C-API (gh-112323)
Eric Snow [Wed, 22 Nov 2023 22:03:33 +0000 (15:03 -0700)] 
gh-76785: Add _PyType_GetModuleName() to the Internal C-API (gh-112323)

The new function corresponds to the existing (public) PyType_GetName() and PyType_GetQualName().

23 months agogh-76785: Clean up the Failure-Related _xxsubinterpreters Tests (gh-112322)
Eric Snow [Wed, 22 Nov 2023 21:48:45 +0000 (14:48 -0700)] 
gh-76785: Clean up the Failure-Related _xxsubinterpreters Tests (gh-112322)

23 months agoMerge branch 'main' of https://github.com/python/cpython
Thomas Wouters [Wed, 22 Nov 2023 21:27:46 +0000 (22:27 +0100)] 
Merge branch 'main' of https://github.com/python/cpython

23 months agoPost 3.13.0a2
Thomas Wouters [Wed, 22 Nov 2023 21:24:48 +0000 (22:24 +0100)] 
Post 3.13.0a2

23 months agoGH-111485: Sort cases in the case generator output (GH-112315)
Mark Shannon [Wed, 22 Nov 2023 15:19:50 +0000 (15:19 +0000)] 
GH-111485: Sort cases in the case generator output (GH-112315)