]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
21 months agogh-112087: Make __sizeof__ and listiter_{len, next} to be threadsafe (gh-114843)
Donghee Na [Wed, 14 Feb 2024 17:00:50 +0000 (02:00 +0900)] 
gh-112087: Make __sizeof__ and listiter_{len, next} to be threadsafe (gh-114843)

21 months agogh-115399: Upgrade bundled libexpat to 2.6.0 (#115431)
Seth Michael Larson [Wed, 14 Feb 2024 16:29:06 +0000 (10:29 -0600)] 
gh-115399: Upgrade bundled libexpat to 2.6.0 (#115431)

21 months agogh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH...
kcatss [Wed, 14 Feb 2024 16:08:26 +0000 (01:08 +0900)] 
gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247)

21 months agoDocs: reword sentences about dbm submodule traits (#114609)
Erlend E. Aasland [Wed, 14 Feb 2024 15:36:13 +0000 (16:36 +0100)] 
Docs: reword sentences about dbm submodule traits (#114609)

Don't repeatedly say that keys and values are coerced into bytes.

21 months agogh-115392: Fix doctest reporting incorrect line numbers for decorated functions ...
Brian Schubert [Wed, 14 Feb 2024 15:01:27 +0000 (10:01 -0500)] 
gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (#115440)

21 months agogh-115403: Remove extra colon after "Examples" in datetime documentation (#115452)
Stanislav Lyu [Wed, 14 Feb 2024 13:52:42 +0000 (16:52 +0300)] 
gh-115403: Remove extra colon after "Examples" in datetime documentation (#115452)

21 months agogh-100414: Make dbm.sqlite3 the preferred dbm backend (#115447)
Erlend E. Aasland [Wed, 14 Feb 2024 13:47:19 +0000 (14:47 +0100)] 
gh-100414: Make dbm.sqlite3 the preferred dbm backend (#115447)

21 months agogh-115450: Fix direct invocation of `test_desctut` (#115451)
Nikita Sobolev [Wed, 14 Feb 2024 13:31:28 +0000 (16:31 +0300)] 
gh-115450: Fix direct invocation of `test_desctut` (#115451)

21 months agogh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable (#115449)
Erlend E. Aasland [Wed, 14 Feb 2024 13:16:09 +0000 (14:16 +0100)] 
gh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable (#115449)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
21 months agogh-100414: Add SQLite backend to dbm (#114481)
Erlend E. Aasland [Wed, 14 Feb 2024 11:14:56 +0000 (12:14 +0100)] 
gh-100414: Add SQLite backend to dbm (#114481)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
21 months agogh-114058: Fix flaky globals to constant test (#115423)
Ken Jin [Wed, 14 Feb 2024 11:12:52 +0000 (19:12 +0800)] 
gh-114058: Fix flaky globals to constant test (#115423)

Co-authored-by: Victor Stinner <vstinner@python.org>
21 months agoftplib docs: `timeout` doesn't have to be a whole number (#115443)
Alex Waygood [Wed, 14 Feb 2024 10:41:17 +0000 (10:41 +0000)] 
ftplib docs: `timeout` doesn't have to be a whole number (#115443)

21 months agoDocs: Use substitutions instead of manual version updates (#115416)
Hugo van Kemenade [Wed, 14 Feb 2024 06:55:00 +0000 (08:55 +0200)] 
Docs: Use substitutions instead of manual version updates (#115416)

21 months agogh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329)
Donghee Na [Wed, 14 Feb 2024 00:32:51 +0000 (09:32 +0900)] 
gh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329)

21 months agogh-115421: Update the list of installed test subdirectories. (#115422)
T. Wouters [Tue, 13 Feb 2024 23:58:49 +0000 (00:58 +0100)] 
gh-115421: Update the list of installed test subdirectories. (#115422)

Update the list of installed test subdirectories with all newly added
subdirectories of Lib/test, so that the tests in those directories are
properly installed.

21 months agogh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424)
Eric Snow [Tue, 13 Feb 2024 21:56:49 +0000 (14:56 -0700)] 
gh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424)

For the most part, these changes make is substantially easier to backport subinterpreter-related code to 3.12, especially the related modules (e.g. _xxsubinterpreters). The main motivation is to support releasing a PyPI package with the 3.13 capabilities compiled for 3.12.

A lot of the changes here involve either hiding details behind macros/functions or splitting up some files.

21 months agogh-115391: Fix compiler warning in `Objects/longobject.c` (GH-115368)
Kirill Podoprigora [Tue, 13 Feb 2024 20:49:13 +0000 (23:49 +0300)] 
gh-115391: Fix compiler warning in `Objects/longobject.c` (GH-115368)

21 months agogh-115383: Use runner version to compute config.cache key (#115409)
Sam Gross [Tue, 13 Feb 2024 19:35:06 +0000 (14:35 -0500)] 
gh-115383: Use runner version to compute config.cache key (#115409)

21 months agogh-115417: Remove accidentally left debugging print (#115418)
Kirill Podoprigora [Tue, 13 Feb 2024 17:45:37 +0000 (20:45 +0300)] 
gh-115417: Remove accidentally left debugging print (#115418)

gh-115417: Remove debugging print

21 months agoRemove more stray backticks from NEWS files (#115374)
Ezio Melotti [Tue, 13 Feb 2024 17:07:16 +0000 (18:07 +0100)] 
Remove more stray backticks from NEWS files (#115374)

* Remove stray backtick from NEWS file

* Remove more stray backticks from 3.12.0a1.rst

* Remove another stray backtick in 3.13.0a1.rst

21 months agoGH-113710: Improve `_SET_IP` and `_CHECK_VALIDITY` (GH-115248)
Mark Shannon [Tue, 13 Feb 2024 16:28:19 +0000 (16:28 +0000)] 
GH-113710: Improve `_SET_IP` and `_CHECK_VALIDITY` (GH-115248)

21 months agogh-115405: add versionadded tag for co_qualname in code objects documentation (#115411)
Christophe Papazian [Tue, 13 Feb 2024 16:10:00 +0000 (17:10 +0100)] 
gh-115405: add versionadded tag for co_qualname in code objects documentation (#115411)

21 months agogh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455)
qqwqqw689 [Tue, 13 Feb 2024 14:23:10 +0000 (22:23 +0800)] 
gh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455)

21 months agoGH-113710: Backedge counter improvements. (GH-115166)
Mark Shannon [Tue, 13 Feb 2024 14:16:37 +0000 (14:16 +0000)] 
GH-113710: Backedge counter improvements. (GH-115166)

21 months agogh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)
Ken Jin [Tue, 13 Feb 2024 13:24:48 +0000 (21:24 +0800)] 
gh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)

---------

Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
21 months agogh-108303: Move all `pydoc` related test files to new `test.test_pydoc` package ...
Nikita Sobolev [Tue, 13 Feb 2024 10:40:40 +0000 (13:40 +0300)] 
gh-108303: Move all `pydoc` related test files to new `test.test_pydoc` package (#114506)

21 months agogh-115252: Fix test_enum with -OO mode again (GH-115334)
Serhiy Storchaka [Tue, 13 Feb 2024 10:21:20 +0000 (12:21 +0200)] 
gh-115252: Fix test_enum with -OO mode again (GH-115334)

21 months agogh-115032: Update DictConfigurator.configure_formatter() comment about `fmt` retry...
Mariusz Felisiak [Tue, 13 Feb 2024 08:47:40 +0000 (09:47 +0100)] 
gh-115032: Update DictConfigurator.configure_formatter() comment about `fmt` retry. (GH-115303)

21 months agoUpdate "Using Python on a Mac" (#115024)
Hugo van Kemenade [Tue, 13 Feb 2024 06:31:49 +0000 (08:31 +0200)] 
Update "Using Python on a Mac" (#115024)

21 months agogh-89240: Enable multiprocessing on Windows to use large process pools (GH-107873)
Steve Dower [Tue, 13 Feb 2024 00:28:35 +0000 (00:28 +0000)] 
gh-89240: Enable multiprocessing on Windows to use large process pools (GH-107873)

We add _winapi.BatchedWaitForMultipleObjects to wait for larger numbers of handles.
This is an internal module, hence undocumented, and should be used with caution.
Check the docstring for info before using BatchedWaitForMultipleObjects.

21 months agogh-114099: Refactor configure and Makefile to accomodate non-macOS frameworks (#115120)
Russell Keith-Magee [Mon, 12 Feb 2024 23:10:24 +0000 (07:10 +0800)] 
gh-114099: Refactor configure and Makefile to accomodate non-macOS frameworks (#115120)

Part of the PEP 730 work to add iOS support.

This change lays the groundwork for introducing iOS/tvOS/watchOS
frameworks; it includes the structural refactoring needed so that iOS
branches can be added into in a subsequent PR.

Summary of changes:
* Updates config.sub to the 2024-01-01 release. This is the "as
  released" version of config.sub.
* Adds a RESSRCDIR variable to allow sharing of macOS and iOS Makefile
  steps.
* Adds an INSTALLTARGETS variable so platforms can customise which
  targets are actually installed. This will be used to exclude certain
  targets (e.g., binaries, manfiles) from iOS framework installs.
* Adds a PYTHONFRAMEWORKINSTALLNAMEPREFIX variable; this is used as
  the install name for the library. This is needed to allow for iOS
  frameworks to specify an @rpath-based install name.
* Evaluates MACHDEP earlier in the configure process so that
  ac_sys_system is available.
* Modifies _PYTHON_HOST_PLATFORM evaluation for cross-platform builds
  so that the CPU architecture is differentiated from the host
  identifier. This will be used to generate a _PYTHON_HOST_PLATFORM
  definition that includes ABI information, not just CPU architecture.
* Differentiates between SOABI_PLATFORM and PLATFORM_TRIPLET.
  SOABI_PLATFORM is used in binary module names, and includes the ABI,
  but not the OS or CPU architecture (e.g.,
  math.cpython-313-iphonesimulator.dylib). PLATFORM_TRIPLET is used
  as the sys._multiarch value, and on iOS will contains the ABI and
  architecture (e.g., iphoneos-arm64). This differentiation hasn't
  historically been needed because while macOS is a multiarch platform,
  it uses a bare darwin as PLATFORM_TRIPLE.
* Removes the use of the deprecated -Wl,-single_module flag when
  compiling macOS frameworks.
* Some whitespace normalisation where there was a mix of spaces and tabs
  in a single block.

21 months agogh-111140: Minor doc fixes for PyLong_AsNativeBytes (GH-115375)
Steve Dower [Mon, 12 Feb 2024 22:28:36 +0000 (22:28 +0000)] 
gh-111140: Minor doc fixes for PyLong_AsNativeBytes (GH-115375)

21 months agogh-115317: Rewrite changelog filter to use vanilla JavaScript (#115324)
Hugo van Kemenade [Mon, 12 Feb 2024 22:17:33 +0000 (00:17 +0200)] 
gh-115317: Rewrite changelog filter to use vanilla JavaScript (#115324)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
21 months agogh-115258: Temporarily skip some `queue` tests on all platforms (#115361)
Kirill Podoprigora [Mon, 12 Feb 2024 20:52:25 +0000 (23:52 +0300)] 
gh-115258: Temporarily skip some `queue` tests on all platforms (#115361)

21 months agogh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions...
Steve Dower [Mon, 12 Feb 2024 20:13:13 +0000 (20:13 +0000)] 
gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886)

21 months agoRemove stray backtick in NEWS entry (#115356)
Ezio Melotti [Mon, 12 Feb 2024 19:23:45 +0000 (20:23 +0100)] 
Remove stray backtick in NEWS entry (#115356)

21 months agogh-115285: Fix `test_dataclasses` with `-OO` mode (#115286)
Nikita Sobolev [Mon, 12 Feb 2024 18:31:07 +0000 (21:31 +0300)] 
gh-115285: Fix `test_dataclasses` with `-OO` mode (#115286)

21 months agogh-114271: Make `PyInterpreterState.threads.count` thread-safe in free-threaded build...
mpage [Mon, 12 Feb 2024 17:44:00 +0000 (09:44 -0800)] 
gh-114271: Make `PyInterpreterState.threads.count` thread-safe in free-threaded builds (gh-115093)

Use atomics to mutate PyInterpreterState.threads.count.

21 months agogh-110850: Add PyTime_t C API (GH-115215)
Petr Viktorin [Mon, 12 Feb 2024 17:13:10 +0000 (18:13 +0100)] 
gh-110850: Add PyTime_t C API (GH-115215)

* gh-110850: Add PyTime_t C API

Add PyTime_t API:

* PyTime_t type.
* PyTime_MIN and PyTime_MAX constants.
* PyTime_AsSecondsDouble(), PyTime_Monotonic(),
  PyTime_PerfCounter() and PyTime_GetSystemClock() functions.

Co-authored-by: Victor Stinner <vstinner@python.org>
21 months agogh-115049: Fix py.exe failing when user has no LocalAppData. (GH-115185)
Steve Dower [Mon, 12 Feb 2024 17:05:38 +0000 (17:05 +0000)] 
gh-115049: Fix py.exe failing when user has no LocalAppData. (GH-115185)

Also ensure we always display a debug message or error for RC_INTERNAL_ERROR

21 months agogh-87804: Fix the refleak in error handling of `_pystatvfs_fromstructstatfs` (#115335)
Nikita Sobolev [Mon, 12 Feb 2024 16:27:27 +0000 (19:27 +0300)] 
gh-87804: Fix the refleak in error handling of `_pystatvfs_fromstructstatfs` (#115335)

It was the macro expansion! Sorry!

21 months agogh-115233: Fix an example in the Logging Cookbook (GH-115325)
Serhiy Storchaka [Mon, 12 Feb 2024 16:24:45 +0000 (18:24 +0200)] 
gh-115233: Fix an example in the Logging Cookbook (GH-115325)

Also add more tests for LoggerAdapter.

Also support stacklevel in LoggerAdapter._log().

21 months agoGH-113710: Fix updating of dict version tag and add watched dict stats (GH-115221)
Mark Shannon [Mon, 12 Feb 2024 16:07:38 +0000 (16:07 +0000)] 
GH-113710: Fix updating of dict version tag and add watched dict stats (GH-115221)

21 months agogh-115058: Add ``reset_rare_event_counters`` function in `_testinternalcapi` (GH...
Kirill Podoprigora [Mon, 12 Feb 2024 16:05:30 +0000 (19:05 +0300)] 
gh-115058: Add ``reset_rare_event_counters`` function in `_testinternalcapi` (GH-115128)

21 months agoRemove outdated comment about py3.6 in `test_typing` (#115318)
Nikita Sobolev [Mon, 12 Feb 2024 14:23:54 +0000 (17:23 +0300)] 
Remove outdated comment about py3.6 in `test_typing` (#115318)

21 months agoAdd missing sections to blurbs (#114553)
Hugo van Kemenade [Mon, 12 Feb 2024 14:16:16 +0000 (16:16 +0200)] 
Add missing sections to blurbs (#114553)

21 months agogh-89039: Call subclass constructors in datetime.*.replace (GH-114780)
Eugene Toder [Mon, 12 Feb 2024 12:44:56 +0000 (07:44 -0500)] 
gh-89039: Call subclass constructors in datetime.*.replace (GH-114780)

When replace() method is called on a subclass of datetime, date or time,
properly call derived constructor. Previously, only the base class's
constructor was called.

Also, make sure to pass non-zero fold values when creating subclasses in
various methods. Previously, fold was silently ignored.

21 months agogh-101100: Fix Sphinx warnings in `whatsnew/2.7.rst` and related (#115319)
Hugo van Kemenade [Mon, 12 Feb 2024 12:40:41 +0000 (14:40 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/2.7.rst` and related (#115319)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
21 months agogh-114785: Remove content from `Porting from Python2` how-to (#114805)
Nikita Sobolev [Mon, 12 Feb 2024 11:59:58 +0000 (14:59 +0300)] 
gh-114785: Remove content from `Porting from Python2` how-to (#114805)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agogh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879)
John Belmonte [Mon, 12 Feb 2024 11:17:51 +0000 (20:17 +0900)] 
gh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879)

Immediate merits:
* eliminate complex workarounds for 'z' format support
  (NOTE: mpdecimal recently added 'z' support, so this becomes
  efficient in the long term.)
* fix 'z' format memory leak
* fix 'z' format applied to 'F'
* fix missing '#' format support

Suggested and prototyped by Stefan Krah.

Fixes gh-114563, gh-91060

Co-authored-by: Stefan Krah <skrah@bytereef.org>
21 months agoGH-114695: Add `sys._clear_internal_caches` (GH-115152)
Brandt Bucher [Mon, 12 Feb 2024 09:04:36 +0000 (01:04 -0800)] 
GH-114695: Add `sys._clear_internal_caches` (GH-115152)

21 months agogh-87804: Fix error handling and style in `_pystatvfs_fromstructstatfs` (#115236)
Nikita Sobolev [Mon, 12 Feb 2024 07:27:12 +0000 (10:27 +0300)] 
gh-87804: Fix error handling and style in `_pystatvfs_fromstructstatfs` (#115236)

21 months agogh-101100: Clean up Doc/c-api/exceptions.rst and Doc/c-api/sys.rst (GH-114825)
Skip Montanaro [Sun, 11 Feb 2024 18:51:07 +0000 (12:51 -0600)] 
gh-101100: Clean up Doc/c-api/exceptions.rst and Doc/c-api/sys.rst (GH-114825)

21 months agogh-115282: Fix direct invocation of `test_traceback.py` (#115283)
Nikita Sobolev [Sun, 11 Feb 2024 16:07:08 +0000 (19:07 +0300)] 
gh-115282: Fix direct invocation of `test_traceback.py` (#115283)

21 months agogh-97959: Fix rendering of routines in pydoc (GH-113941)
Serhiy Storchaka [Sun, 11 Feb 2024 13:19:44 +0000 (15:19 +0200)] 
gh-97959: Fix rendering of routines in pydoc (GH-113941)

* Class methods no longer have "method of builtins.type instance" note.
* Corresponding notes are now added for class and unbound methods.
* Method and function aliases now have references to the module or the
  class where the origin was defined if it differs from the current.
* Bound methods are now listed in the static methods section.
* Methods of builtin classes are now supported as well as methods of
  Python classes.

21 months agogh-49766: Make date-datetime comparison more symmetric and flexible (GH-114760)
Serhiy Storchaka [Sun, 11 Feb 2024 11:06:43 +0000 (13:06 +0200)] 
gh-49766: Make date-datetime comparison more symmetric and flexible (GH-114760)

Now the special comparison methods like `__eq__` and `__lt__` return
NotImplemented if one of comparands is date and other is datetime
instead of ignoring the time part and the time zone or forcefully
return "not equal" or raise TypeError.

It makes comparison of date and datetime subclasses more symmetric
and allows to change the default behavior by overriding
the special comparison methods in subclasses.

It is now the same as if date and datetime was independent classes.

21 months agogh-115011: Improve support of __index__() in setters of members with unsigned integer...
Serhiy Storchaka [Sun, 11 Feb 2024 10:45:58 +0000 (12:45 +0200)] 
gh-115011: Improve support of __index__() in setters of members with unsigned integer type (GH-115029)

Setters for members with an unsigned integer type now support
the same range of valid values for objects that has a __index__()
method as for int.

Previously, Py_T_UINT, Py_T_ULONG and Py_T_ULLONG did not support
objects that has a __index__() method larger than LONG_MAX.

Py_T_ULLONG did not support negative ints. Now it supports them and
emits a RuntimeWarning.

21 months agogh-97928: Partially restore the behavior of tkinter.Text.count() by default (GH-115031)
Serhiy Storchaka [Sun, 11 Feb 2024 10:43:14 +0000 (12:43 +0200)] 
gh-97928: Partially restore the behavior of tkinter.Text.count() by default (GH-115031)

By default, it preserves an inconsistent behavior of older Python
versions: packs the count into a 1-tuple if only one or none
options are specified (including 'update'), returns None instead of 0.
Except that setting wantobjects to 0 no longer affects the result.

Add a new parameter return_ints: specifying return_ints=True makes
Text.count() always returning the single count as an integer
instead of a 1-tuple or None.

21 months agogh-67837, gh-112998: Fix dirs creation in concurrent extraction (GH-115082)
Serhiy Storchaka [Sun, 11 Feb 2024 10:38:07 +0000 (12:38 +0200)] 
gh-67837, gh-112998: Fix dirs creation in concurrent extraction (GH-115082)

Avoid race conditions in the creation of directories during concurrent
extraction in tarfile and zipfile.

Co-authored-by: Samantha Hughes <shughes-uk@users.noreply.github.com>
Co-authored-by: Peder Bergebakken Sundt <pbsds@hotmail.com>
21 months agogh-85984: Add _POSIX_VDISABLE from unistd.h to termios module. (#114985)
Soumendra Ganguly [Sun, 11 Feb 2024 10:29:44 +0000 (11:29 +0100)] 
gh-85984: Add _POSIX_VDISABLE from unistd.h to termios module. (#114985)

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
21 months agogh-79382: Fix recursive glob() with trailing "**" (GH-115134)
Serhiy Storchaka [Sun, 11 Feb 2024 10:24:13 +0000 (12:24 +0200)] 
gh-79382: Fix recursive glob() with trailing "**" (GH-115134)

Trailing "**" no longer allows to match files and non-existing paths in
recursive glob().

21 months agogh-115172: Fix explicit index extries for the C API (GH-115173)
Serhiy Storchaka [Sun, 11 Feb 2024 10:23:30 +0000 (12:23 +0200)] 
gh-115172: Fix explicit index extries for the C API (GH-115173)

21 months agogh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164)
Serhiy Storchaka [Sun, 11 Feb 2024 10:08:39 +0000 (12:08 +0200)] 
gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164)

Feeding the parser by too small chunks defers parsing to prevent
CVE-2023-52425. Future versions of Expat may be more reactive.

21 months agogh-114807: multiprocessing: don't raise ImportError if _multiprocessing is missing...
Hood Chatham [Sun, 11 Feb 2024 09:59:50 +0000 (01:59 -0800)] 
gh-114807: multiprocessing: don't raise ImportError if _multiprocessing is missing (#114808)

`_multiprocessing` is only used under the `if _winapi:` block, this moves the import to be within the `_winapi` ImportError handling try/except for equivalent treatment.

21 months agogh-101100: Fix dangling refs in bdb.rst (#114983)
Skip Montanaro [Sun, 11 Feb 2024 09:21:10 +0000 (03:21 -0600)] 
gh-101100: Fix dangling refs in bdb.rst (#114983)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
21 months agogh-115274: Fix direct invocation of `testmock/testpatch.py` (#115275)
Nikita Sobolev [Sun, 11 Feb 2024 08:51:25 +0000 (11:51 +0300)] 
gh-115274: Fix direct invocation of `testmock/testpatch.py` (#115275)

21 months agogh-115249: Fix `test_descr` with `-OO` mode (#115250)
Nikita Sobolev [Sun, 11 Feb 2024 08:00:44 +0000 (11:00 +0300)] 
gh-115249: Fix `test_descr` with `-OO` mode (#115250)

21 months agogh-115258: Temporarily disable test on Windows (#115269)
Sam Gross [Sun, 11 Feb 2024 03:14:25 +0000 (22:14 -0500)] 
gh-115258: Temporarily disable test on Windows (#115269)

The "test_shutdown_all_methods_in_many_threads" test times out on the Windows CI.
This skips the test on Windows until we figure out the root cause.

21 months agogh-101100: Fix sphinx warnings in `c-api/gcsupport.rst` (#114786)
Nikita Sobolev [Sat, 10 Feb 2024 22:59:23 +0000 (01:59 +0300)] 
gh-101100: Fix sphinx warnings in `c-api/gcsupport.rst` (#114786)

21 months agogh-115254: Fix `test_property` with `-00` mode (#115255)
Nikita Sobolev [Sat, 10 Feb 2024 21:51:05 +0000 (00:51 +0300)] 
gh-115254: Fix `test_property` with `-00` mode (#115255)

21 months agogh-114670: Fix `_testbuffer` module initialization (#114672)
Nikita Sobolev [Sat, 10 Feb 2024 21:48:28 +0000 (00:48 +0300)] 
gh-114670: Fix `_testbuffer` module initialization (#114672)

21 months agogh-115252: Fix `test_enum` with `-OO` mode (GH-115253)
Nikita Sobolev [Sat, 10 Feb 2024 18:34:22 +0000 (21:34 +0300)] 
gh-115252: Fix `test_enum` with `-OO` mode (GH-115253)

21 months agoGH-115060: Speed up `pathlib.Path.glob()` by removing redundant regex matching (...
Barney Gale [Sat, 10 Feb 2024 18:12:34 +0000 (18:12 +0000)] 
GH-115060: Speed up `pathlib.Path.glob()` by removing redundant regex matching (#115061)

When expanding and filtering paths for a `**` wildcard segment, build an `re.Pattern` object from the subsequent pattern parts, rather than the entire pattern, and match against the `os.DirEntry` object prior to instantiating a path object. Also skip compiling a pattern when expanding a `*` wildcard segment.

21 months agogh-114894: add array.array.clear() method (#114919)
Mike Zimin [Sat, 10 Feb 2024 15:59:46 +0000 (19:59 +0400)] 
gh-114894: add array.array.clear() method (#114919)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
21 months agogh-102840: Fix confused traceback when floordiv or mod operations happens between... 105789/head
Kirill Podoprigora [Sat, 10 Feb 2024 14:37:19 +0000 (17:37 +0300)] 
gh-102840: Fix confused traceback when floordiv or mod operations happens between Fraction and complex objects (GH-102842)

21 months agogh-115059: Remove debugging code in test_io (GH-115240)
Serhiy Storchaka [Sat, 10 Feb 2024 13:17:33 +0000 (15:17 +0200)] 
gh-115059: Remove debugging code in test_io (GH-115240)

21 months agogh-76763: Make chr() always raising ValueError for out-of-range values (GH-114882)
Serhiy Storchaka [Sat, 10 Feb 2024 10:21:35 +0000 (12:21 +0200)] 
gh-76763: Make chr() always raising ValueError for out-of-range values (GH-114882)

Previously it raised OverflowError for very large or very small values.

21 months agoGH-87804: Fix counter overflow in statvfs on macOS (#99570)
Ronald Oussoren [Sat, 10 Feb 2024 10:16:45 +0000 (11:16 +0100)] 
GH-87804: Fix counter overflow in statvfs on macOS (#99570)

On macOS the statvfs interface returns block counts as
32-bit integers, and that results in bad reporting for
larger disks.

Therefore reimplement statvfs in terms of statfs, which
does use 64-bit integers for block counts.

Tested using a sparse filesystem image of 100TB.

21 months agogh-114552: Update `__dir__` method docs: it allows returning an iterable (#114662)
Nikita Sobolev [Sat, 10 Feb 2024 08:34:23 +0000 (11:34 +0300)] 
gh-114552: Update `__dir__` method docs: it allows returning an iterable (#114662)

21 months agogh-96471: Add shutdown() method to queue.Queue (#104750)
Laurie O [Sat, 10 Feb 2024 04:58:30 +0000 (14:58 +1000)] 
gh-96471: Add shutdown() method to queue.Queue (#104750)

Co-authored-by: Duprat <yduprat@gmail.com>
21 months agogh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists (gh-114899)
Donghee Na [Sat, 10 Feb 2024 00:57:04 +0000 (09:57 +0900)] 
gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists (gh-114899)

21 months agogh-115165: Fix `typing.Annotated` for immutable types (#115213)
dave-shawley [Fri, 9 Feb 2024 22:11:37 +0000 (17:11 -0500)] 
gh-115165: Fix `typing.Annotated` for immutable types (#115213)

The return value from an annotated callable can raise any exception from
__setattr__ for the `__orig_class__` property.

21 months agogh-110481: Implement inter-thread queue for biased reference counting (#114824)
Sam Gross [Fri, 9 Feb 2024 22:08:32 +0000 (17:08 -0500)] 
gh-110481: Implement inter-thread queue for biased reference counting (#114824)

Biased reference counting maintains two refcount fields in each object:
`ob_ref_local` and `ob_ref_shared`. The true refcount is the sum of these two
fields. In some cases, when refcounting operations are split across threads,
the ob_ref_shared field can be negative (although the total refcount must be
at least zero). In this case, the thread that decremented the refcount
requests that the owning thread give up ownership and merge the refcount
fields.

21 months agogh-112903: Handle non-types in _BaseGenericAlias.__mro_entries__() (#115191)
Carl Meyer [Fri, 9 Feb 2024 19:19:09 +0000 (12:19 -0700)] 
gh-112903: Handle non-types in _BaseGenericAlias.__mro_entries__() (#115191)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
21 months agoAdd Peter L to ACKS (GH-115222)
Peter Lazorchak [Fri, 9 Feb 2024 17:06:14 +0000 (09:06 -0800)] 
Add Peter L to ACKS (GH-115222)

21 months agogh-115142: Skip test_optimizer if _testinternalcapi module is not available (GH-115175)
Kirill Podoprigora [Fri, 9 Feb 2024 16:59:41 +0000 (19:59 +0300)] 
gh-115142: Skip test_optimizer if _testinternalcapi module is not available (GH-115175)

21 months agogh-115184: Fix refleak tracking issues in free-threaded build (#115188)
Sam Gross [Fri, 9 Feb 2024 14:23:12 +0000 (09:23 -0500)] 
gh-115184: Fix refleak tracking issues in free-threaded build (#115188)

Fixes a few issues related to refleak tracking in the free-threaded build:

- Count blocks in abandoned segments
- Call `_mi_page_free_collect` earlier during heap traversal in order to get an accurate count of blocks in use.
- Add missing refcount tracking in `_Py_DecRefSharedDebug` and `_Py_ExplicitMergeRefcount`.
- Pause threads in  `get_num_global_allocated_blocks` to ensure that traversing the mimalloc heaps is safe.

21 months agoDocs: correctly link to code objects (#115214)
Erlend E. Aasland [Fri, 9 Feb 2024 14:11:36 +0000 (15:11 +0100)] 
Docs: correctly link to code objects (#115214)

21 months agogh-115059: Flush the underlying write buffer in io.BufferedRandom.read1() (GH-115163)
Serhiy Storchaka [Fri, 9 Feb 2024 10:36:12 +0000 (12:36 +0200)] 
gh-115059: Flush the underlying write buffer in io.BufferedRandom.read1() (GH-115163)

21 months agoGH-113632: update configure.ac for WebAssembly support tiers (#115192)
Brett Cannon [Fri, 9 Feb 2024 08:21:49 +0000 (00:21 -0800)] 
GH-113632: update configure.ac for WebAssembly support tiers (#115192)

Move WASI to tier 2 and drop Emscripten.

21 months agogh-101100: Fix sphinx warnings in `library/enum.rst` (#114696)
Nikita Sobolev [Fri, 9 Feb 2024 06:40:28 +0000 (09:40 +0300)] 
gh-101100: Fix sphinx warnings in `library/enum.rst` (#114696)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
21 months agogh-115167: Exclude vcruntime140_threads.dll from Windows build output (GH-115176)
adang1345 [Thu, 8 Feb 2024 21:42:45 +0000 (16:42 -0500)] 
gh-115167: Exclude vcruntime140_threads.dll from Windows build output (GH-115176)

21 months agogh-112069: Adapt set/frozenset methods to Argument Clinic (#115112)
Tomas R [Thu, 8 Feb 2024 16:47:27 +0000 (17:47 +0100)] 
gh-112069: Adapt set/frozenset methods to Argument Clinic (#115112)

21 months agogh-107944: Improve error message for getargs with bad keyword arguments (#114792)
Shantanu [Thu, 8 Feb 2024 09:04:41 +0000 (01:04 -0800)] 
gh-107944: Improve error message for getargs with bad keyword arguments (#114792)

21 months agogh-115136: Fix possible NULL deref in getpath_joinpath() (GH-115137)
Artem Chernyshev [Thu, 8 Feb 2024 08:40:38 +0000 (11:40 +0300)] 
gh-115136: Fix possible NULL deref in getpath_joinpath() (GH-115137)

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
21 months agogh-115146: Fix typo in pickletools.py documentation (GH-115148)
Justin Applegate [Thu, 8 Feb 2024 08:12:58 +0000 (01:12 -0700)] 
gh-115146: Fix typo in pickletools.py documentation (GH-115148)

21 months agoWhen the Py_CompileStringExFlags fuzzer encounters a SystemError, abort (#115147)
Alex Gaynor [Wed, 7 Feb 2024 22:21:33 +0000 (17:21 -0500)] 
When the Py_CompileStringExFlags fuzzer encounters a SystemError, abort (#115147)

This allows us to catch bugs beyond memory corruption and assertions.

21 months agogh-114828: parenthesize non-atomic macro definitions in pycore_symtable.h (#115143)
Carl Meyer [Wed, 7 Feb 2024 20:19:47 +0000 (15:19 -0500)] 
gh-114828: parenthesize non-atomic macro definitions in pycore_symtable.h (#115143)

21 months agogh-112066: Use `PyDict_SetDefaultRef` in place of `PyDict_SetDefault`. (#112211)
Sam Gross [Wed, 7 Feb 2024 18:43:18 +0000 (13:43 -0500)] 
gh-112066: Use `PyDict_SetDefaultRef` in place of `PyDict_SetDefault`. (#112211)

This changes a number of internal usages of `PyDict_SetDefault` to use `PyDict_SetDefaultRef`.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
21 months agogh-114828: Fix __class__ in class-scope inlined comprehensions (#115139)
Carl Meyer [Wed, 7 Feb 2024 16:56:16 +0000 (11:56 -0500)] 
gh-114828: Fix __class__ in class-scope inlined comprehensions (#115139)