]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
23 months agoGH-69695: Update ``PyImport_ImportModule`` description (GH-103836)
patenaud [Fri, 2 Feb 2024 16:31:55 +0000 (11:31 -0500)] 
GH-69695: Update ``PyImport_ImportModule`` description (GH-103836)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
23 months agogh-114909: Add --first-weekday option to usage message (#114910)
Steven Ward [Fri, 2 Feb 2024 15:13:00 +0000 (10:13 -0500)] 
gh-114909: Add --first-weekday option to usage message (#114910)

23 months agogh-104530: Enable native Win32 condition variables by default (GH-104531)
Andrew Rogers [Fri, 2 Feb 2024 13:50:51 +0000 (13:50 +0000)] 
gh-104530: Enable native Win32 condition variables by default (GH-104531)

23 months agogh-103360: Add link in stdtypes.rst to escape sequences in lexical_analysis.rst ...
Justin Williams [Fri, 2 Feb 2024 13:32:46 +0000 (08:32 -0500)] 
gh-103360: Add link in stdtypes.rst to escape sequences in lexical_analysis.rst (GH-103638)

23 months agogh-114329: Add `PyList_GetItemRef` function (GH-114504)
Sam Gross [Fri, 2 Feb 2024 13:03:15 +0000 (08:03 -0500)] 
gh-114329: Add `PyList_GetItemRef` function (GH-114504)

The new `PyList_GetItemRef` is similar to `PyList_GetItem`, but returns
a strong reference instead of a borrowed reference. Additionally, if the
passed "list" object is not a list, the function sets a `TypeError`
instead of calling `PyErr_BadInternalCall()`.

23 months agoGH-113710: Add a "globals to constants" pass (GH-114592)
Mark Shannon [Fri, 2 Feb 2024 12:14:34 +0000 (12:14 +0000)] 
GH-113710: Add a "globals to constants" pass (GH-114592)

Converts specializations of `LOAD_GLOBAL` into constants during tier 2 optimization.

23 months agogh-107901: make compiler inline basic blocks with no line number and no fallthrough...
Irit Katriel [Fri, 2 Feb 2024 11:26:31 +0000 (11:26 +0000)] 
gh-107901: make compiler inline basic blocks with no line number and no fallthrough (#114750)

23 months agoGH-113655 Lower C recursion limit from 4000 to 3000 on Windows. (GH-114896)
Mark Shannon [Fri, 2 Feb 2024 10:41:28 +0000 (10:41 +0000)] 
GH-113655 Lower C recursion limit from 4000 to 3000 on Windows. (GH-114896)

23 months agogh-103820: IDLE: Do not interpret buttons 4/5 as scrolling on non-X11 (GH-103821)
Christopher Chavez [Fri, 2 Feb 2024 10:38:43 +0000 (04:38 -0600)] 
gh-103820: IDLE: Do not interpret buttons 4/5 as scrolling on non-X11 (GH-103821)

Also fix test_mousewheel: do not skip a check which was broken due to incorrect
delta on Aqua and XQuartz, and probably not because of `.update_idletasks()`.

23 months agoMove "format" param doc of shutil.make_archive() on its own paragraph (GH-103829)
Michal Kaptur [Fri, 2 Feb 2024 10:00:18 +0000 (11:00 +0100)] 
Move "format" param doc of shutil.make_archive() on its own paragraph (GH-103829)

23 months agoGH-114849: Set a 60-minute timeout for JIT CI jobs (GH-114850)
Nikita Sobolev [Fri, 2 Feb 2024 01:44:01 +0000 (04:44 +0300)] 
GH-114849: Set a 60-minute timeout for JIT CI jobs (GH-114850)

23 months agogh-111239: Update Windows build to use zlib 1.3.1 (GH-114877)
Zachary Ware [Thu, 1 Feb 2024 23:54:02 +0000 (17:54 -0600)] 
gh-111239: Update Windows build to use zlib 1.3.1 (GH-114877)

23 months agogh-111968: Use per-thread freelists for dict in free-threading (gh-114323)
Donghee Na [Thu, 1 Feb 2024 20:53:53 +0000 (05:53 +0900)] 
gh-111968: Use per-thread freelists for dict in free-threading (gh-114323)

23 months agogh-112529: Remove PyGC_Head from object pre-header in free-threaded build (#114564)
Sam Gross [Thu, 1 Feb 2024 20:29:19 +0000 (15:29 -0500)] 
gh-112529: Remove PyGC_Head from object pre-header in free-threaded build (#114564)

* gh-112529: Remove PyGC_Head from object pre-header in free-threaded build

This avoids allocating space for PyGC_Head in the free-threaded build.
The GC implementation for free-threaded CPython does not use the
PyGC_Head structure.

 * The trashcan mechanism uses the `ob_tid` field instead of `_gc_prev`
   in the free-threaded build.
 * The GDB libpython.py file now determines the offset of the managed
   dict field based on whether the running process is a free-threaded
   build. Those are identified by the `ob_ref_local` field in PyObject.
 * Fixes `_PySys_GetSizeOf()` which incorrectly incorrectly included the
   size of `PyGC_Head` in the size of static `PyTypeObject`.

23 months agogh-89891: Refer SharedMemory implementation as POSIX (GH-104678)
Oleg Iarygin [Thu, 1 Feb 2024 19:57:36 +0000 (22:57 +0300)] 
gh-89891: Refer SharedMemory implementation as POSIX (GH-104678)

It only uses POSIX API.

23 months agoGH-114806. Don't specialize calls to classes with metaclasses. (GH-114870)
Mark Shannon [Thu, 1 Feb 2024 19:39:32 +0000 (19:39 +0000)] 
GH-114806. Don't specialize calls to classes with metaclasses. (GH-114870)

23 months agoFix comment in pycore_runtime.h (GH-110540)
He Weidong [Thu, 1 Feb 2024 19:27:53 +0000 (03:27 +0800)] 
Fix comment in pycore_runtime.h (GH-110540)

23 months agogh-101100: Fix sphinx warnings in `howto/logging.rst` (#114846)
Nikita Sobolev [Thu, 1 Feb 2024 18:37:55 +0000 (21:37 +0300)] 
gh-101100: Fix sphinx warnings in `howto/logging.rst` (#114846)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
23 months agoCorrect description of inheriting from another class (#114660)
Skip Montanaro [Thu, 1 Feb 2024 18:07:16 +0000 (12:07 -0600)] 
Correct description of inheriting from another class (#114660)

"inherits <someclass>" grates to this reader. I think it should be "inherits from <someclass>".

23 months agogh-105031: Clarify datetime documentation for ISO8601 (GH-105049)
Nicholas Hollander [Thu, 1 Feb 2024 17:24:15 +0000 (12:24 -0500)] 
gh-105031: Clarify datetime documentation for ISO8601 (GH-105049)

23 months agoUpdate outdated info in ``Tools/cases_generator/README.md`` (#114844)
Kirill Podoprigora [Thu, 1 Feb 2024 16:56:24 +0000 (19:56 +0300)] 
Update outdated info in ``Tools/cases_generator/README.md`` (#114844)

23 months agoWrite about Tier 2 and JIT in "what's new 3.13" (#114826)
Guido van Rossum [Thu, 1 Feb 2024 16:54:44 +0000 (08:54 -0800)] 
Write about Tier 2 and JIT in "what's new 3.13" (#114826)

(This will soon be superseded by Ken Jin's much more detailed version.)

23 months agoRemove unused Py_XDECREF from _PyFrame_ClearExceptCode (GH-106158)
Anders Kaseorg [Thu, 1 Feb 2024 16:26:22 +0000 (11:26 -0500)] 
Remove unused Py_XDECREF from _PyFrame_ClearExceptCode (GH-106158)

frame->frame_obj was set to NULL a few lines earlier.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
23 months agogh-105089: Fix test_create_directory_with_write test failure in AIX (GH-105228)
Ayappan Perumal [Thu, 1 Feb 2024 11:52:54 +0000 (17:22 +0530)] 
gh-105089: Fix test_create_directory_with_write test failure in AIX (GH-105228)

23 months agogh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462)
Tomas R [Thu, 1 Feb 2024 11:49:01 +0000 (12:49 +0100)] 
gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462)

23 months agobuild(deps-dev): bump types-psutil from 5.9.5.17 to 5.9.5.20240106 in /Tools (#114852)
dependabot[bot] [Thu, 1 Feb 2024 10:50:08 +0000 (10:50 +0000)] 
build(deps-dev): bump types-psutil from 5.9.5.17 to 5.9.5.20240106 in /Tools (#114852)

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

Bumps [types-psutil](https://github.com/python/typeshed) from 5.9.5.17 to 5.9.5.20240106.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-psutil
  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 agobuild(deps): bump actions/cache from 3 to 4 (#114856)
dependabot[bot] [Thu, 1 Feb 2024 10:49:07 +0000 (12:49 +0200)] 
build(deps): bump actions/cache from 3 to 4 (#114856)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
23 months agobuild(deps): bump hypothesis from 6.92.2 to 6.97.4 in /Tools (#114851)
dependabot[bot] [Thu, 1 Feb 2024 10:42:35 +0000 (10:42 +0000)] 
build(deps): bump hypothesis from 6.92.2 to 6.97.4 in /Tools (#114851)

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

---
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-dev): bump types-setuptools from 69.0.0.0 to 69.0.0.20240125 in /Tools...
dependabot[bot] [Thu, 1 Feb 2024 09:52:05 +0000 (09:52 +0000)] 
build(deps-dev): bump types-setuptools from 69.0.0.0 to 69.0.0.20240125 in /Tools (#114853)

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

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

---
updated-dependencies:
- dependency-name: types-setuptools
  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 agoFix typos in ElementTree documentation (GH-108848)
Christophe Nanteuil [Thu, 1 Feb 2024 09:34:04 +0000 (10:34 +0100)] 
Fix typos in ElementTree documentation (GH-108848)

PI objects instead of comment objects.

23 months agogh-114746: Avoid quadratic behavior in free-threaded GC (GH-114817)
Sam Gross [Thu, 1 Feb 2024 09:26:23 +0000 (04:26 -0500)] 
gh-114746: Avoid quadratic behavior in free-threaded GC (GH-114817)

The free-threaded build's GC implementation is non-generational, but was
scheduled as if it were collecting a young generation leading to
quadratic behavior. This increases the minimum threshold and scales it
to the number of live objects as we do for the old generation in the
default build.

Note that the scheduling is still not thread-safe without the GIL. Those
changes will come in later PRs.

A few tests, like "test_sneaky_frame_object" rely on prompt scheduling
of the GC. For now, to keep that test passing, we disable the scaled
threshold after calls like `gc.set_threshold(1, 0, 0)`.

23 months agogh-114364: Fix awkward wording about mmap.mmap.seekable (#114374)
technillogue [Thu, 1 Feb 2024 06:03:58 +0000 (01:03 -0500)] 
gh-114364: Fix awkward wording about mmap.mmap.seekable (#114374)

---------
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-114648: Add IndexError exception to tutorial datastructures list.pop entry (#114681)
srinivasan [Thu, 1 Feb 2024 03:46:49 +0000 (09:16 +0530)] 
gh-114648: Add IndexError exception to tutorial datastructures list.pop entry (#114681)

Remove redundant explanation of optional argument.

2 years agogh-67230: Add versionadded notes for QUOTE_NOTNULL and QUOTE_STRINGS (#114816)
Skip Montanaro [Thu, 1 Feb 2024 03:11:16 +0000 (21:11 -0600)] 
gh-67230: Add versionadded notes for QUOTE_NOTNULL and QUOTE_STRINGS (#114816)

As @GPHemsley pointed out, #29469 omitted `versionadded` notes for the 2 new items.

2 years agogh-114811: Change '\*' to '*' in warnings.rst (#114819)
Pradyot Ranjan [Thu, 1 Feb 2024 01:48:39 +0000 (07:18 +0530)] 
gh-114811: Change  '\*' to '*' in warnings.rst (#114819)

Regression in 3.12.

2 years agoCI: Test on macOS M1 (#114766)
Hugo van Kemenade [Thu, 1 Feb 2024 01:35:48 +0000 (03:35 +0200)] 
CI: Test on macOS M1 (#114766)

Test on macOS M1

2 years agogh-111112: Avoid potential confusion in TCP server example. (#111113)
Aidan Holm [Thu, 1 Feb 2024 00:42:38 +0000 (08:42 +0800)] 
gh-111112: Avoid potential confusion in TCP server example. (#111113)

Improve misleading TCP server docs and example.

socket.recv(), as documented by the Python reference documentation,
returns at most `bufsize` bytes, and the underlying TCP protocol means
there is no guaranteed correspondence between what is sent by the client
and what is received by the server.

This conflation could mislead readers into thinking that TCP is
datagram-based or has similar semantics, which will likely appear to
work for simple cases, but introduce difficult to reproduce bugs.

2 years agogh-109534: fix reference leak when SSL handshake fails (#114074)
Jamie Phan [Thu, 1 Feb 2024 00:42:17 +0000 (07:42 +0700)] 
gh-109534: fix reference leak when SSL handshake fails (#114074)

2 years agogh-112087: Make PyList_{Append,Size,GetSlice} to be thread-safe (gh-114651)
Donghee Na [Wed, 31 Jan 2024 23:58:08 +0000 (08:58 +0900)] 
gh-112087: Make PyList_{Append,Size,GetSlice} to be thread-safe (gh-114651)

2 years agoAdd note to `sys.orig_argv` clarifying the difference from `sys.argv` (#114630)
Bradley Reynolds [Wed, 31 Jan 2024 21:33:28 +0000 (15:33 -0600)] 
Add note to `sys.orig_argv` clarifying the difference from `sys.argv` (#114630)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2 years agogh-114788: Do not run JIT workflow on unrelated changes (#114789)
Nikita Sobolev [Wed, 31 Jan 2024 19:51:18 +0000 (22:51 +0300)] 
gh-114788: Do not run JIT workflow on unrelated changes (#114789)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agogh-113939: Frame clear, clear locals (#113940)
Albert Zeyer [Wed, 31 Jan 2024 19:14:44 +0000 (20:14 +0100)] 
gh-113939: Frame clear, clear locals (#113940)

2 years agogh-111741: Recognise image/webp as a standard format in the mimetypes module (GH...
Nachtalb [Wed, 31 Jan 2024 15:33:46 +0000 (16:33 +0100)] 
gh-111741: Recognise image/webp as a standard format in the mimetypes module (GH-111742)

Previously it was supported as a non-standard type.

2 years agogh-59013: Set breakpoint on the first executable line of function when using `break...
Tian Gao [Wed, 31 Jan 2024 13:03:05 +0000 (05:03 -0800)] 
gh-59013: Set breakpoint on the first executable line of function when using `break func` in pdb (#112470)

2 years agogh-114790: Do not execute `workflows/require-pr-label.yml` on forks (#114791)
Nikita Sobolev [Wed, 31 Jan 2024 11:32:27 +0000 (14:32 +0300)] 
gh-114790: Do not execute `workflows/require-pr-label.yml` on forks (#114791)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agoRemove Alex Waygood as an Argument Clinic CODEOWNER (#114796)
Alex Waygood [Wed, 31 Jan 2024 11:28:23 +0000 (11:28 +0000)] 
Remove Alex Waygood as an Argument Clinic CODEOWNER (#114796)

2 years agogh-114737: Revert change to ElementTree.iterparse "root" attribute (GH-114755)
Sam Gross [Wed, 31 Jan 2024 11:22:24 +0000 (06:22 -0500)] 
gh-114737: Revert change to ElementTree.iterparse "root" attribute (GH-114755)

Prior to gh-114269, the iterator returned by ElementTree.iterparse was
initialized with the root attribute as None. This restores the previous
behavior.

2 years agogh-114685: Check flags in PyObject_GetBuffer() (GH-114707)
Serhiy Storchaka [Wed, 31 Jan 2024 11:11:35 +0000 (13:11 +0200)] 
gh-114685: Check flags in PyObject_GetBuffer() (GH-114707)

PyObject_GetBuffer() now raises a SystemError if called with
PyBUF_READ or PyBUF_WRITE as flags. These flags should
only be used with the PyMemoryView_* C API.

2 years agogh-101100: Fix class reference in library/test.rst (GH-114769)
Skip Montanaro [Wed, 31 Jan 2024 09:33:10 +0000 (03:33 -0600)] 
gh-101100: Fix class reference in library/test.rst (GH-114769)

The text clearly seems to be referencing `TestFuncAcceptsSequencesMixin`,
for which no target is available. Name the class properly and suppress
the dangling reference.

2 years agogh-109653: Speedup import of threading module (#114509)
Daniel Hollas [Wed, 31 Jan 2024 09:29:44 +0000 (09:29 +0000)] 
gh-109653: Speedup import of threading module (#114509)

Avoiding an import of functools leads to 50% speedup of import time.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoDocs: mark up dbm.gnu.open() and dbm.ndbm.open() using param list (#114762)
Erlend E. Aasland [Wed, 31 Jan 2024 06:59:34 +0000 (07:59 +0100)] 
Docs: mark up dbm.gnu.open() and dbm.ndbm.open() using param list (#114762)

2 years agoGH-114743: Set a low recursion limit for `test_main_recursion_error()` in `test_runpy...
Brett Cannon [Wed, 31 Jan 2024 01:49:27 +0000 (17:49 -0800)] 
GH-114743: Set a low recursion limit for `test_main_recursion_error()` in `test_runpy` (GH-114772)

This can fail under a debug build of WASI when directly executing test.test_runpy.

2 years agopathlib ABCs: drop partial, broken, untested support for `bytes` paths. (#114777)
Barney Gale [Wed, 31 Jan 2024 00:59:33 +0000 (00:59 +0000)] 
pathlib ABCs: drop partial, broken, untested support for `bytes` paths. (#114777)

Methods like `full_match()`, `glob()`, etc, are difficult to make work with
byte paths, and it's not worth the effort. This patch makes `PurePathBase`
raise `TypeError` when given non-`str` path segments.

2 years agopathlib ABCs: raise `UnsupportedOperation` directly. (#114776)
Barney Gale [Wed, 31 Jan 2024 00:38:01 +0000 (00:38 +0000)] 
pathlib ABCs: raise `UnsupportedOperation` directly. (#114776)

Raise `UnsupportedOperation` directly, rather than via an `_unsupported()`
helper, to give human readers and IDEs/typecheckers/etc a bigger hint that
these methods are abstract.

2 years agogh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)
Diego Russo [Tue, 30 Jan 2024 23:53:04 +0000 (23:53 +0000)] 
gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)

2 years agogh-106392: Fix inconsistency in deprecation warnings in datetime module (GH-114761)
Serhiy Storchaka [Tue, 30 Jan 2024 22:15:33 +0000 (00:15 +0200)] 
gh-106392: Fix inconsistency in deprecation warnings in datetime module (GH-114761)

2 years agoGH-113464: Add aarch64-apple-darwin/clang to JIT CI (GH-114759)
Brandt Bucher [Tue, 30 Jan 2024 22:08:53 +0000 (14:08 -0800)] 
GH-113464: Add aarch64-apple-darwin/clang to JIT CI (GH-114759)

2 years agogh-101100: Fix references in csv docs (GH-114658)
Skip Montanaro [Tue, 30 Jan 2024 21:54:37 +0000 (15:54 -0600)] 
gh-101100: Fix references in csv docs (GH-114658)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agogh-112606: Use pthread_cond_timedwait_relative_np() in parking_lot.c when available...
Matt Prodani [Tue, 30 Jan 2024 21:22:17 +0000 (16:22 -0500)] 
gh-112606: Use pthread_cond_timedwait_relative_np() in parking_lot.c when available (#112616)

Add a configure define for HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP and
replaces pthread_cond_timedwait() with pthread_cond_timedwait_relative_np()
for relative time when supported in semaphore waiting logic.

2 years agoGH-70303: Make `pathlib.Path.glob('**')` return both files and directories (#114684)
Barney Gale [Tue, 30 Jan 2024 19:52:53 +0000 (19:52 +0000)] 
GH-70303: Make `pathlib.Path.glob('**')` return both files and directories (#114684)

Return files and directories from `pathlib.Path.glob()` if the pattern ends
with `**`. This is more compatible with `PurePath.full_match()` and with
other glob implementations such as bash and `glob.glob()`. Users can add a
trailing slash to match only directories.

In my previous patch I added a `FutureWarning` with the intention of fixing
this in Python 3.15. Upon further reflection I think this was an
unnecessarily cautious remedy to a clear bug.

2 years ago``importlib/_bootstrap.py``: Reduce size of ``_List`` instances (GH-114747)
Kirill Podoprigora [Tue, 30 Jan 2024 18:44:09 +0000 (21:44 +0300)] 
``importlib/_bootstrap.py``: Reduce size of ``_List`` instances (GH-114747)

Reduce size of _List instances

2 years agoClarify one-item tuple (#114745)
Terry Jan Reedy [Tue, 30 Jan 2024 18:40:54 +0000 (13:40 -0500)] 
Clarify one-item tuple (#114745)

A 'single tuple' means 'one typle, of whatever length.
Remove the unneeded and slight distracting parenthetical 'singleton' comment.

2 years agogh-112075: refactor dictionary lookup functions for better re-usability (#114629)
Dino Viehland [Tue, 30 Jan 2024 17:33:36 +0000 (09:33 -0800)] 
gh-112075: refactor dictionary lookup functions for better re-usability (#114629)

Refactor dict lookup functions to use force inline helpers

2 years agogh-113744: Add a new IncompleteInputError exception to improve incomplete input detec...
Pablo Galindo Salgado [Tue, 30 Jan 2024 16:21:30 +0000 (16:21 +0000)] 
gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module (#113745)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2 years agogh-112919: Speed-up datetime, date and time.replace() (GH-112921)
Eugene Toder [Tue, 30 Jan 2024 15:19:46 +0000 (10:19 -0500)] 
gh-112919: Speed-up datetime, date and time.replace() (GH-112921)

Use argument clinic and call new_* functions directly. This speeds up
these functions 6x to 7.5x when calling with keyword arguments.

2 years agogh-109975: Copyedit "What's New in Python 3.13" (#114401)
Hugo van Kemenade [Tue, 30 Jan 2024 15:12:11 +0000 (17:12 +0200)] 
gh-109975: Copyedit "What's New in Python 3.13" (#114401)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agoGH-114610: Fix `pathlib._abc.PurePathBase.with_suffix('.ext')` handling of stems...
Barney Gale [Tue, 30 Jan 2024 14:25:16 +0000 (14:25 +0000)] 
GH-114610: Fix `pathlib._abc.PurePathBase.with_suffix('.ext')` handling of stems (#114613)

Raise `ValueError` if `with_suffix('.ext')` is called on a path without a
stem. Paths may only have a non-empty suffix if they also have a non-empty
stem.

ABC-only bugfix; no effect on public classes.

2 years agogh-114706: Allow QueueListener.stop() to be called more than once. (GH-114748)
Vinay Sajip [Tue, 30 Jan 2024 12:34:18 +0000 (12:34 +0000)] 
gh-114706: Allow QueueListener.stop() to be called more than once. (GH-114748)

2 years agogh-113732: Fix support of QUOTE_NOTNULL and QUOTE_STRINGS in csv.reader (GH-113738)
Serhiy Storchaka [Tue, 30 Jan 2024 12:21:12 +0000 (14:21 +0200)] 
gh-113732: Fix support of QUOTE_NOTNULL and QUOTE_STRINGS in csv.reader (GH-113738)

2 years agogh-103323: Remove current_fast_get() unused parameter (#114593)
Victor Stinner [Tue, 30 Jan 2024 10:47:58 +0000 (11:47 +0100)] 
gh-103323: Remove current_fast_get() unused parameter (#114593)

The current_fast_get() static inline function doesn't use its
'runtime' parameter, so just remove it.

2 years agoGH-80789: Get rid of the ``ensurepip`` infra for many wheels (#109245)
Sviatoslav Sydorenko (Святослав Сидоренко) [Tue, 30 Jan 2024 01:25:31 +0000 (02:25 +0100)] 
GH-80789: Get rid of the ``ensurepip`` infra for many wheels (#109245)

Co-authored-by: vstinner@python.org
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2 years agoGH-113464: Make Brandt a codeowner for JIT stuff (GH-114739)
Brandt Bucher [Tue, 30 Jan 2024 00:29:54 +0000 (16:29 -0800)] 
GH-113464: Make Brandt a codeowner for JIT stuff (GH-114739)

2 years agogh-114569: Use PyMem_* APIs for non-PyObjects in compiler (#114587)
Erlend E. Aasland [Mon, 29 Jan 2024 23:04:34 +0000 (00:04 +0100)] 
gh-114569: Use PyMem_* APIs for non-PyObjects in compiler (#114587)

2 years agoSet `hosted_on` for Read the Docs builds (#114697)
Hugo van Kemenade [Mon, 29 Jan 2024 21:24:21 +0000 (23:24 +0200)] 
Set `hosted_on` for Read the Docs builds (#114697)

2 years agogh-114569: Use PyMem_* APIs for non-PyObjects in unicodeobject.c (#114690)
Erlend E. Aasland [Mon, 29 Jan 2024 20:48:49 +0000 (21:48 +0100)] 
gh-114569: Use PyMem_* APIs for non-PyObjects in unicodeobject.c (#114690)

2 years agoTaskGroup: Use explicit None check for cancellation error (#114708)
Matan Perelman [Mon, 29 Jan 2024 19:12:33 +0000 (21:12 +0200)] 
TaskGroup: Use explicit None check for cancellation error (#114708)

2 years agogh-114678: Fix incorrect deprecation warning for 'N' specifier in Decimal format...
Serhiy Storchaka [Mon, 29 Jan 2024 17:58:31 +0000 (19:58 +0200)] 
gh-114678: Fix incorrect deprecation warning for 'N' specifier in Decimal format (GH-114683)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2 years agogh-112075: Dictionary global version counter should use atomic increments (#114568)
Dino Viehland [Mon, 29 Jan 2024 17:47:54 +0000 (09:47 -0800)] 
gh-112075: Dictionary global version counter should use atomic increments (#114568)

Dictionary global version counter should use atomic increments

2 years agogh-112075: Use PyMem_* for allocating dict keys objects (#114543)
Dino Viehland [Mon, 29 Jan 2024 17:38:03 +0000 (09:38 -0800)] 
gh-112075: Use PyMem_* for allocating dict keys objects (#114543)

Use PyMem_* for keys allocation

2 years agogh-112240: Add option to calendar module CLI to specify the weekday to start each...
Steven Ward [Mon, 29 Jan 2024 16:58:21 +0000 (11:58 -0500)] 
gh-112240: Add option to calendar module CLI to specify the weekday to start each week (GH-112241)

2 years agoFix more references to datetime and time classes (GH-114717)
Serhiy Storchaka [Mon, 29 Jan 2024 16:20:13 +0000 (18:20 +0200)] 
Fix more references to datetime and time classes (GH-114717)

They could be confused with references to datetime and time modules.

2 years agogh-85984: Add POSIX pseudo-terminal functions. (GH-102413)
Soumendra Ganguly [Mon, 29 Jan 2024 16:10:28 +0000 (17:10 +0100)] 
gh-85984: Add POSIX pseudo-terminal functions. (GH-102413)

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 years agoRemove limit in calendar CLI help message for year arg (GH-114719)
Steven Ward [Mon, 29 Jan 2024 16:00:15 +0000 (11:00 -0500)] 
Remove limit in calendar CLI help message for year arg (GH-114719)

The limit was removed in 66c88ce30ca2b23daa37038e1a3c0de98f241f50 (GH-4109).

2 years agogh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046)
Petr Viktorin [Mon, 29 Jan 2024 15:45:31 +0000 (16:45 +0100)] 
gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046)

Skip Stable ABI checks with Py_TRACE_REFS special build

This build is not compatible with Py_LIMITED_API nor with
the stable ABI.

2 years agogh-112050: Adapt collections.deque to Argument Clinic (#113963)
mpage [Mon, 29 Jan 2024 15:08:23 +0000 (07:08 -0800)] 
gh-112050: Adapt collections.deque to Argument Clinic (#113963)

2 years agogh-101100: Fix datetime reference warnings (GH-114661)
Skip Montanaro [Mon, 29 Jan 2024 14:43:44 +0000 (08:43 -0600)] 
gh-101100: Fix datetime reference warnings (GH-114661)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-101100: Fix Sphinx warnings in `whatsnew/2.2.rst` (#112366)
Hugo van Kemenade [Mon, 29 Jan 2024 13:12:19 +0000 (15:12 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/2.2.rst` (#112366)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` (GH-114669)
Nikita Sobolev [Mon, 29 Jan 2024 09:56:11 +0000 (12:56 +0300)] 
gh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` (GH-114669)

2 years agogh-110893: Improve the documentation for __future__ module (#114642)
Shantanu [Mon, 29 Jan 2024 09:37:28 +0000 (01:37 -0800)] 
gh-110893: Improve the documentation for __future__ module (#114642)

nedbat took issue with the phrasing "real module". I'm actually fine
with that phrasing, but I do think the `__future__` page should be clear
about the way in which the `__future__` module is special. (Yes, there
was a footnote linking to the future statements part of the reference,
but there should be upfront discussion).

I'm sympathetic to nedbat's claim that no one really cares about
`__future__._Feature`, so I've moved the interesting table up to the
top.

2 years agogh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686)
Nikita Sobolev [Mon, 29 Jan 2024 09:37:06 +0000 (12:37 +0300)] 
gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686)

2 years agogh-109653: Improve import time of importlib.metadata / email.utils (#114664)
Shantanu [Mon, 29 Jan 2024 09:30:22 +0000 (01:30 -0800)] 
gh-109653: Improve import time of importlib.metadata / email.utils (#114664)

My criterion for delayed imports is that they're only worth it if the
majority of users of the module would benefit from it, otherwise you're
just moving latency around unpredictably.

mktime_tz is not used anywhere in the standard library and grep.app
indicates it's not got much use in the ecosystem either.

Distribution.files is not nearly as widely used as other
importlib.metadata APIs, so we defer the csv import.

Before:
```
λ hyperfine -w 8 './python -c "import importlib.metadata"'
Benchmark 1: ./python -c "import importlib.metadata"
  Time (mean ± σ):      65.1 ms ±   0.5 ms    [User: 55.3 ms, System: 9.8 ms]
  Range (min … max):    64.4 ms …  66.4 ms    44 runs
```

After:
```
λ hyperfine -w 8 './python -c "import importlib.metadata"'
Benchmark 1: ./python -c "import importlib.metadata"
  Time (mean ± σ):      62.0 ms ±   0.3 ms    [User: 52.5 ms, System: 9.6 ms]
  Range (min … max):    61.3 ms …  62.8 ms    46 runs
```

for about a 3ms saving with warm disk cache, maybe 7-11ms with cold disk
cache.

2 years agogh-89159: Add some TarFile attribute types (GH-114520)
Stanley [Mon, 29 Jan 2024 09:19:22 +0000 (01:19 -0800)] 
gh-89159: Add some TarFile attribute types  (GH-114520)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2 years agoGH-113464: A JIT backend for tier 2 (GH-113465)
Brandt Bucher [Mon, 29 Jan 2024 02:52:58 +0000 (18:52 -0800)] 
GH-113464: A JIT backend for tier 2 (GH-113465)

Add an option (--enable-experimental-jit for configure-based builds
or --experimental-jit for PCbuild-based ones) to build an
*experimental* just-in-time compiler, based on copy-and-patch
(https://fredrikbk.com/publications/copy-and-patch.pdf).

See Tools/jit/README.md for more information, including how to install the required build-time tooling. Merry JIT-mas! ;)

2 years agoGH-113464: Add a JIT backend for tier 2 (GH-113465)
Brandt Bucher [Mon, 29 Jan 2024 02:48:48 +0000 (18:48 -0800)] 
GH-113464: Add a JIT backend for tier 2 (GH-113465)

Add an option (--enable-experimental-jit for configure-based builds
or --experimental-jit for PCbuild-based ones) to build an
*experimental* just-in-time compiler, based on copy-and-patch (https://fredrikbk.com/publications/copy-and-patch.pdf).

See Tools/jit/README.md for more information on how to install the required build-time tooling.

2 years agogh-55664: Add warning when creating a type using a namespace dictionary with non...
Furkan Onder [Sun, 28 Jan 2024 23:05:29 +0000 (02:05 +0300)] 
gh-55664: Add warning when creating a type using a namespace dictionary with non-string keys. (GH-105338)

Co-authored-by: Daniel Urban <durban@users.noreply.github.com>
2 years agogh-100734: Add 'Notable change in 3.11.x' to `whatsnew/3.11.rst` (#114657)
Hugo van Kemenade [Sun, 28 Jan 2024 20:28:25 +0000 (22:28 +0200)] 
gh-100734: Add 'Notable change in 3.11.x' to `whatsnew/3.11.rst` (#114657)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agoFix indentation in `__post_init__` documentation. (gh-114666)
Bhushan Mohanraj [Sun, 28 Jan 2024 20:10:32 +0000 (15:10 -0500)] 
Fix indentation in `__post_init__` documentation. (gh-114666)

2 years agoCorrection Skip Montanaro's email address (#114677)
Skip Montanaro [Sun, 28 Jan 2024 14:51:25 +0000 (08:51 -0600)] 
Correction Skip Montanaro's email address (#114677)

2 years agoUse bool in fileinput.input() docstring and tests for the inplace argument (GH-111998)
Ville Skyttä [Sat, 27 Jan 2024 21:47:55 +0000 (23:47 +0200)] 
Use bool in fileinput.input() docstring and tests for the inplace argument (GH-111998)

The `.rst` docs, most tests, and typeshed already use bool for it.

2 years agoGH-79634: Speed up pathlib globbing by removing `joinpath()` call. (#114623)
Barney Gale [Sat, 27 Jan 2024 19:59:51 +0000 (19:59 +0000)] 
GH-79634: Speed up pathlib globbing by removing `joinpath()` call. (#114623)

Remove `self.joinpath('')` call that should have been removed in 6313cdde.

This makes `PathBase.glob('')` yield itself *without* adding a trailing slash. It's hard to say whether this is more or less correct, but at least everything else is faster, and there's no behaviour change in the public classes where empty glob patterns are disallowed.