]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
20 months agoDoc: Clarify the return type of Event.wait when timeout is used (GH-104168)
Phil Elson [Mon, 26 Feb 2024 09:53:20 +0000 (10:53 +0100)] 
Doc: Clarify the return type of Event.wait when timeout is used (GH-104168)

20 months agogh-115091: Remove a left-over sentence that refers to Py_OptimizeFlag from ctypes...
Antti Haapala [Mon, 26 Feb 2024 09:22:54 +0000 (11:22 +0200)] 
gh-115091: Remove a left-over sentence that refers to Py_OptimizeFlag from ctypes documentation (GH-115092)

Remove a left-over sentence that refers to Py_OptimizeFlag

Remove a left-over sentence that refers to an example that was present in Python 3.10 and was using ``Py_OptimizeFlag``.

20 months agogh-115881: Ensure `ast.parse()` parses conditional context managers even with low...
Alex Waygood [Mon, 26 Feb 2024 09:22:09 +0000 (09:22 +0000)] 
gh-115881: Ensure `ast.parse()` parses conditional context managers even with low `feature_version` passed (#115920)

20 months agogh-101100: Fix Sphinx warnings in `whatsnew/2.1.rst` (#112357)
Hugo van Kemenade [Mon, 26 Feb 2024 06:49:04 +0000 (08:49 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/2.1.rst` (#112357)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
20 months agogh-115921: Change 'equation' to 'expression' in random.rst (#115927)
Terry Jan Reedy [Mon, 26 Feb 2024 03:50:49 +0000 (22:50 -0500)] 
gh-115921: Change 'equation' to 'expression' in random.rst (#115927)

In uniform function entry.

20 months agogh-114099: Add configure and Makefile targets to support iOS compilation. (GH-115390)
Russell Keith-Magee [Mon, 26 Feb 2024 01:21:10 +0000 (09:21 +0800)] 
gh-114099: Add configure and Makefile targets to support iOS compilation. (GH-115390)

20 months agoGH-101112: Add "pattern language" section to pathlib docs (#114030)
Barney Gale [Mon, 26 Feb 2024 00:19:03 +0000 (00:19 +0000)] 
GH-101112: Add "pattern language" section to pathlib docs (#114030)

Explain the `full_match()` / `glob()` / `rglob()` pattern language in its own section. Move `rglob()` documentation under `glob()` and reduce duplicated text.

20 months agogh-71052: fix test_concurrent_futures wasi regression. (#115923)
Gregory P. Smith [Mon, 26 Feb 2024 00:02:56 +0000 (16:02 -0800)] 
gh-71052: fix test_concurrent_futures wasi regression. (#115923)

Fix the WASI test_concurrent_futures regression from #115917.

20 months agogh-115532: Add kernel density estimation to the statistics module (gh-115863)
Raymond Hettinger [Sun, 25 Feb 2024 23:46:47 +0000 (17:46 -0600)] 
gh-115532: Add kernel density estimation to the statistics module (gh-115863)

20 months agogh-115799: Add missing double-quote in docs (#115884)
bssyousefi [Sun, 25 Feb 2024 22:07:08 +0000 (17:07 -0500)] 
gh-115799: Add missing double-quote in docs (#115884)

20 months agogh-72249: Include the module name in the repr of partial object (GH-101910)
Furkan Onder [Sun, 25 Feb 2024 20:55:19 +0000 (23:55 +0300)] 
gh-72249: Include the module name in the repr of partial object (GH-101910)

Co-authored-by: Anilyka Barry <vgr255@live.ca>
20 months ago gh-115914: minor cleanup: simplify filename_obj assignment in PyRun_AnyFileExFlags...
Sergii K [Sun, 25 Feb 2024 20:45:38 +0000 (23:45 +0300)] 
 gh-115914: minor cleanup: simplify filename_obj assignment in PyRun_AnyFileExFlags (gh-115916)

This simplifies the code: less lines, easier to read. Logically equivalent, as any compiler likely already determined.

20 months agogh-101100: Fix broken xrefs in fcntl module doc (#115691)
Skip Montanaro [Sun, 25 Feb 2024 20:02:18 +0000 (14:02 -0600)] 
gh-101100: Fix broken xrefs in fcntl module doc (#115691)

* clean up fcntl module doc

* simplify

* a few changes, based on suggestion by CAM-Gerlach

* nitpick ignore for a couple other C functions mentioned in the fcntl module doc

* more changes, especially related to LOCK_* constants

* :data: back to :const:

* Apply suggestions from code review

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
---------

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
20 months agogh-71052: Enable test_concurrent_futures on platforms that lack multiprocessing ...
Malcolm Smith [Sun, 25 Feb 2024 19:38:18 +0000 (19:38 +0000)] 
gh-71052: Enable test_concurrent_futures on platforms that lack multiprocessing (gh-115917)

Enable test_concurrent_futures on platforms that support threading but not multiprocessing.

20 months agobpo-31116: Add Z85 variant to base64 (GH-30598)
Matan Perelman [Sun, 25 Feb 2024 17:17:54 +0000 (19:17 +0200)] 
bpo-31116: Add Z85 variant to base64 (GH-30598)

Z85  specification: https://rfc.zeromq.org/spec/32/

20 months agogh-96471: Correct docs for queue shutdown (#115838)
Laurie O [Sun, 25 Feb 2024 16:53:21 +0000 (02:53 +1000)] 
gh-96471: Correct docs for queue shutdown (#115838)

20 months agogh-113479: Link to workaround for subtle issue with takewhile() (gh-115890)
Raymond Hettinger [Sun, 25 Feb 2024 12:32:14 +0000 (06:32 -0600)] 
gh-113479: Link to workaround for subtle issue with takewhile() (gh-115890)

20 months agogh-103417: Fix the scheduler example (GH-111497)
mauricelambert [Sun, 25 Feb 2024 11:55:57 +0000 (11:55 +0000)] 
gh-103417: Fix the scheduler example (GH-111497)

Arguments to enterabs() are specified as Unix time.
If the scheduler use the time.monotonic timer, the code will take
decades to complete.

20 months agobpo-14322: added test case for invalid update to hmac (#26636)
Arjun [Sun, 25 Feb 2024 10:33:28 +0000 (02:33 -0800)] 
bpo-14322: added test case for invalid update to hmac (#26636)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
20 months agogh-101100: Fix Sphinx warnings in `whatsnew/2.0.rst` (#112351)
Hugo van Kemenade [Sun, 25 Feb 2024 09:45:56 +0000 (11:45 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/2.0.rst` (#112351)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
20 months agogh-115886: Handle embedded null characters in shared memory name (GH-115887)
Serhiy Storchaka [Sun, 25 Feb 2024 09:31:03 +0000 (11:31 +0200)] 
gh-115886: Handle embedded null characters in shared memory name (GH-115887)

shm_open() and shm_unlink() now check for embedded null characters in
the name and raise an error instead of silently truncating it.

20 months agoAdd an example of of custom `__repr__` (#112761)
Oh seungmin [Sun, 25 Feb 2024 07:59:35 +0000 (16:59 +0900)] 
Add an example of of custom `__repr__` (#112761)

Added to repr entry in Doc/library/functions.rst.

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
20 months agoErase some unnecessary quotes on data model doc (#113521)
Adorilson Bezerra [Sun, 25 Feb 2024 00:16:19 +0000 (00:16 +0000)] 
Erase some unnecessary quotes on data model doc (#113521)

Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.

20 months agogh-115323: Add meaningful error message for using bytearray.extend with str (#115332)
Jay Ting [Sat, 24 Feb 2024 23:34:45 +0000 (07:34 +0800)] 
gh-115323: Add meaningful error message for using bytearray.extend with str (#115332)

Perform str check after TypeError is raised
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
20 months agoGH-114610: Fix `pathlib.PurePath.with_stem('')` handling of file extensions (#114612)
Barney Gale [Sat, 24 Feb 2024 19:37:03 +0000 (19:37 +0000)] 
GH-114610: Fix `pathlib.PurePath.with_stem('')` handling of file extensions (#114612)

Raise `ValueError` if `with_stem('')` is called on a path with a file
extension. Paths may only have an empty stem if they also have an empty
suffix.

20 months agogh-113202: Add whatsnew entry for the batched() strict option. (gh-115889)
Raymond Hettinger [Sat, 24 Feb 2024 18:03:11 +0000 (12:03 -0600)] 
gh-113202: Add whatsnew entry for the batched() strict option. (gh-115889)

20 months agogh-115872: Doc: remove obsolete reference to MSI packages (#115873)
partev [Sat, 24 Feb 2024 06:53:26 +0000 (01:53 -0500)] 
gh-115872: Doc: remove obsolete reference to MSI packages (#115873)

20 months agogh-114763: Protect lazy loading modules from attribute access races (GH-114781)
Chris Markiewicz [Sat, 24 Feb 2024 00:02:16 +0000 (19:02 -0500)] 
gh-114763: Protect lazy loading modules from attribute access races (GH-114781)

Setting the __class__ attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock.

20 months agoInsert missing apostrophes in ctypes documentation (#115090)
jmcb [Fri, 23 Feb 2024 22:55:47 +0000 (22:55 +0000)] 
Insert missing apostrophes in ctypes documentation (#115090)

20 months agogh-67044: Always quote or escape \r and \n in csv.writer() (GH-115741)
Serhiy Storchaka [Fri, 23 Feb 2024 20:25:09 +0000 (22:25 +0200)] 
gh-67044: Always quote or escape \r and \n in csv.writer() (GH-115741)

20 months agogh-54358: Clarify data chunking in pyexpat (GH-31629)
Stanley [Fri, 23 Feb 2024 18:57:08 +0000 (10:57 -0800)] 
gh-54358: Clarify data chunking in pyexpat (GH-31629)

Co-authored-by: Éric Araujo <merwok@netwok.org>
20 months agogh-115859: Disable the tier 2 redundancy eliminator by default (GH-115860)
Ken Jin [Fri, 23 Feb 2024 18:43:52 +0000 (02:43 +0800)] 
gh-115859: Disable the tier 2 redundancy eliminator by default (GH-115860)

20 months agogh-115778: Add `tierN` annotation for instruction definitions (#115815)
Kirill Podoprigora [Fri, 23 Feb 2024 17:31:57 +0000 (19:31 +0200)] 
gh-115778: Add `tierN` annotation for instruction definitions (#115815)

This replaces the old `TIER_{ONE,TWO}_ONLY` macros. Note that `specialized` implies `tier1`.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
20 months agogh-89480: Document the gdb helpers (GH-115657)
Pablo Galindo Salgado [Fri, 23 Feb 2024 16:13:45 +0000 (17:13 +0100)] 
gh-89480: Document the gdb helpers (GH-115657)

Content adapted from https://devguide.python.org/development-tools/gdb/#
and https://wiki.python.org/moin/DebuggingWithGdb.

The original content on the Wiki page came from gdb debug help used by
the Launchpad (https://launchpad.net/) team.
Thanks to Anatoly Techtonik and user `rmf` for substantial improvements to the Wiki page.

The history of the Devguide page follows
(with log entries expanded for major content contributions):

Hugo van Kemenade, Sat Dec 30 21:22:04 2023 +0200
Hugo van Kemenade, Fri Dec 8 12:04:32 2023 +0200
Erlend E. Aasland & Hugo van Kemenade, Tue Aug 8 22:05:34 2023 +0200
Satish Mishra, Sat Feb 11 13:54:57 2023 +0530
Hugo van Kemenade, Fri Dec 23 17:33:33 2022 +0200
Skip Montanaro, Hugo, Erlend, & Ezio, Fri Nov 4 05:04:23 2022 -0500

    Add a GDB tips section to Advanced Tools (#977)

Adam Turner, Wed Jun 15 21:19:23 2022 +0100
Adam Turner, Tue Jun 14 11:12:26 2022 +0100
Suriyaa, Fri Jun 8 19:39:23 2018 +0200
Jeff Allen, Tue Oct 24 18:12:53 2017 +0100
Jeff Allen, Fri Oct 13 13:43:43 2017 +0100
Mariatta, Wed Jan 4 09:14:55 2017 -0800
Carol Willing, Mon Sep 26 14:50:54 2016 -0700
Zachary Ware, Thu Jul 21 10:42:23 2016 -0500
Georg Brandl, Mon Nov 3 11:28:19 2014 +0100

    Add instruction how to activate python-gdb.py

Georg Brandl, Sun Mar 9 10:32:01 2014 +0100
Georg Brandl, Tue Apr 3 09:12:53 2012 +0200
Georg Brandl, Sat Mar 5 17:32:35 2011 +0100
Dave Malcolm, Fri Jan 21 12:34:09 2011 -0500

    Add documentation on the gdb extension commands provided in libpython.py

    I adapted this from documentation I wrote for the Fedora wiki:
      https://fedoraproject.org/wiki/Features/EasierPythonDebugging#New_gdb_commands
    reformatting it as rst, and making other minor changes

Brett Cannon, Thu Jan 20 15:16:52 2011 -0800
Dave Malcolm, Thu Jan 20 16:17:23 2011 -0500

    Add some notes on the gdb pretty-printer hooks

Antoine Pitrou, Thu Jan 20 21:17:49 2011 +0100

    Give an example backtrace

Antoine Pitrou, Thu Jan 20 21:03:06 2011 +0100

    Expand explanations about gdb support

Brett Cannon, Thu Jan 20 11:33:36 2011 -0800

    Tweak the gdb support title to fit in better with the devguide.

Brett Cannon, Mon Jan 17 21:12:54 2011 +0000

    Short README on gdb support.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: anatoly techtonik <techtonik@gmail.com>
Co-authored-by: Antoine Pitrou <solipsis@pitrou.net>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Dave Malcolm <dmalcolm@redhat.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Georg Brandl <georg@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Satish Mishra <7506satish@gmail.com>
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: Suriyaa <isc.suriyaa@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
20 months agogh-114058: Improve method information in redundancy eliminator (GH-115848)
Ken Jin [Fri, 23 Feb 2024 15:41:10 +0000 (23:41 +0800)] 
gh-114058: Improve method information in redundancy eliminator (GH-115848)

20 months agogh-111789: Use PyDict_GetItemRef() in Python/compile.c (GH-112083)
Serhiy Storchaka [Fri, 23 Feb 2024 11:35:27 +0000 (13:35 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Python/compile.c (GH-112083)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
20 months agogh-115806: Make configure output more readable (#115807)
Erlend E. Aasland [Fri, 23 Feb 2024 09:52:06 +0000 (10:52 +0100)] 
gh-115806: Make configure output more readable (#115807)

- make sure LDLIBRARY and HOSTRUNNER checks don't overlap
- make the ipv6 library check less subtle

20 months agogh-90300: Reformat the Python CLI help output (GH-93415)
Serhiy Storchaka [Fri, 23 Feb 2024 09:27:07 +0000 (11:27 +0200)] 
gh-90300: Reformat the Python CLI help output (GH-93415)

20 months agoRemove `ConverterKeywordDict` alias in `clinic.py` (#115843)
Nikita Sobolev [Fri, 23 Feb 2024 09:00:07 +0000 (12:00 +0300)] 
Remove `ConverterKeywordDict` alias in `clinic.py` (#115843)

20 months agogh-114058: More robust method handling in redundancy eliminator (GH-115779)
Ken Jin [Fri, 23 Feb 2024 07:42:03 +0000 (15:42 +0800)] 
gh-114058: More robust method handling in redundancy eliminator (GH-115779)

20 months agogh-115836: Don't use hardcoded line numbers in test_monitoring (#115837)
Brett Simmers [Fri, 23 Feb 2024 03:14:17 +0000 (19:14 -0800)] 
gh-115836: Don't use hardcoded line numbers in test_monitoring (#115837)

20 months agogh-88516: show file proxy icon in IDLE editor windows on macOS (#112894)
Ronald Oussoren [Fri, 23 Feb 2024 02:15:39 +0000 (03:15 +0100)] 
gh-88516: show file proxy icon in IDLE editor windows on macOS (#112894)

The platform standard on macOS is to show a proxy icon for open
files in the titlebar of Windows. Make sure IDLE matches this
behaviour.

Don't use both the long and short names in the window title.
The behaviour of other editors (such as Text Editor) is to show
only the short name with the proxy icon.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
20 months agogh-115727: Reduce confidence even on 100% predicted jumps (#115748)
Guido van Rossum [Thu, 22 Feb 2024 20:23:48 +0000 (12:23 -0800)] 
gh-115727: Reduce confidence even on 100% predicted jumps (#115748)

The theory is that even if we saw a jump go in the same direction the
last 16 times we got there, we shouldn't be overly confident that it's
still going to go the same way in the future. This PR makes it so that
in the extreme cases, the confidence is multiplied by 0.9 instead of
remaining unchanged. For unpredictable jumps, there is no difference
(still 0.5). For somewhat predictable jumps, we interpolate.

20 months agogh-112075: Iterating a dict shouldn't require locks (#115108)
Dino Viehland [Thu, 22 Feb 2024 20:02:39 +0000 (12:02 -0800)] 
gh-112075:  Iterating a dict shouldn't require locks (#115108)

Makes iteration of a dict be lock free for the forward iteration case.

20 months agoUpdate http.cookiejar document for cookie object attributes (GH-101885)
NewUserHa [Thu, 22 Feb 2024 19:08:04 +0000 (03:08 +0800)] 
Update http.cookiejar document for cookie object attributes (GH-101885)

20 months agoGH-113464: Clean up JIT stencil generation (GH-115800)
Brandt Bucher [Thu, 22 Feb 2024 18:22:23 +0000 (10:22 -0800)] 
GH-113464: Clean up JIT stencil generation (GH-115800)

20 months agogh-115827: Fix compile warning in `longobject.c` (#115828)
Nikita Sobolev [Thu, 22 Feb 2024 17:57:12 +0000 (20:57 +0300)] 
gh-115827: Fix compile warning in `longobject.c` (#115828)

Objects/longobject.c:1186:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

20 months agoGH-115651: Convert `LOAD_MODULE_ATTR` into `LOAD_INLINE_CONST` when the module is...
Mark Shannon [Thu, 22 Feb 2024 14:48:25 +0000 (14:48 +0000)] 
GH-115651: Convert `LOAD_MODULE_ATTR` into `LOAD_INLINE_CONST` when the module is itself a constant. (GH-115711)

20 months agogh-115663: Remove 'regen-sbom' from the 'regen-all' target (#115790)
Seth Michael Larson [Thu, 22 Feb 2024 13:42:26 +0000 (07:42 -0600)] 
gh-115663: Remove 'regen-sbom' from the 'regen-all' target (#115790)

20 months agogh-115796: fix exception table construction in _testinternalcapi.assemble_code_object...
Irit Katriel [Thu, 22 Feb 2024 12:36:44 +0000 (12:36 +0000)] 
gh-115796: fix exception table construction in _testinternalcapi.assemble_code_object (#115797)

20 months agogh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI (GH-115757)
Petr Viktorin [Thu, 22 Feb 2024 11:39:45 +0000 (12:39 +0100)] 
gh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI (GH-115757)

* gh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI

* Add blurb

20 months agogh-115765: Don't use deprecated AC_CHECK_TYPE macro in configure.ac (#115792)
Erlend E. Aasland [Thu, 22 Feb 2024 09:04:15 +0000 (10:04 +0100)] 
gh-115765: Don't use deprecated AC_CHECK_TYPE macro in configure.ac (#115792)

Instead use AC_CHECK_TYPES.

20 months agogh-115795: Doc: fix obsolete URL (#115749)
partev [Thu, 22 Feb 2024 06:45:26 +0000 (01:45 -0500)] 
gh-115795: Doc: fix obsolete URL (#115749)

20 months agogh-111140: Improve PyLong_AsNativeBytes API doc example & improve the test (#115380)
Gregory P. Smith [Thu, 22 Feb 2024 03:27:16 +0000 (19:27 -0800)] 
gh-111140: Improve PyLong_AsNativeBytes API doc example & improve the test (#115380)

This expands the examples to cover both realistic use cases for the API.

I noticed thing in the test that could be done better so I added those as well: We need to guarantee that all bytes of the result are overwritten and that too many are not written.  Tests now pre-fills the result with data in order to ensure that.

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
20 months agogh-111225: Link extension modules against libpython on Android (#115780)
Malcolm Smith [Wed, 21 Feb 2024 23:18:57 +0000 (23:18 +0000)] 
gh-111225: Link extension modules against libpython on Android (#115780)

Part of the work on PEP 738: Adding Android as a supported platform.

* Rename the LIBPYTHON variable to MODULE_LDFLAGS, to more accurately
  reflect its purpose.
* Edit makesetup to use MODULE_LDFLAGS when linking extension modules.
* Edit the Makefile so that extension modules depend on libpython on
  Android and Cygwin.
* Restore `-fPIC` on Android. It was removed several years ago with a
  note that the toolchain used it automatically, but this is no longer
  the case. Omitting it causes all linker commands to fail with an error
  like `relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against
  symbol '_Py_FalseStruct'; recompile with -fPIC`.

20 months agogh-93205: When rotating logs with no namer specified, match whole extension (GH-93224)
Gabriele Catania [Wed, 21 Feb 2024 21:09:06 +0000 (21:09 +0000)] 
gh-93205: When rotating logs with no namer specified, match whole extension (GH-93224)

20 months agogh-115491: Keep some fields valid across allocations in obmalloc (free-threading...
Sam Gross [Wed, 21 Feb 2024 18:00:08 +0000 (13:00 -0500)] 
gh-115491: Keep some fields valid across allocations in obmalloc (free-threading) (#115745)

20 months agogh-115304: Add doc for initializing PyMutex as a global variable (#115305)
AN Long [Wed, 21 Feb 2024 17:35:53 +0000 (01:35 +0800)] 
gh-115304: Add doc for initializing PyMutex as a global variable (#115305)

20 months agogh-96310: Fix a traceback in argparse when all options in a mutually exclusive group...
Daniel Mach [Wed, 21 Feb 2024 13:58:04 +0000 (14:58 +0100)] 
gh-96310: Fix a traceback in argparse when all options in a mutually exclusive group are suppressed (GH-96311)

Reproducer depends on terminal size - the traceback occurs when there's
an option long enough so the usage line doesn't fit the terminal width.
Option order is also important for reproducibility.

Excluding empty groups (with all options suppressed) from inserts
fixes the problem.

20 months agogh-104090: Add exit code to multiprocessing ResourceTracker (GH-115410)
Petr Viktorin [Wed, 21 Feb 2024 12:54:57 +0000 (13:54 +0100)] 
gh-104090: Add exit code to multiprocessing ResourceTracker (GH-115410)

This builds on https://github.com/python/cpython/pull/106807, which adds
a return code to ResourceTracker, to make future debugging easier.
Testing this “in situ” proved difficult, since the global ResourceTracker is
involved in test infrastructure. So, the tests here create a new instance and
feed it fake data.

---------

Co-authored-by: Yonatan Bitton <yonatan.bitton@perception-point.io>
Co-authored-by: Yonatan Bitton <bityob@gmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
20 months agoargparse: remove incoherent and redundant docstring for private method (GH-101591)
Frank Dana [Wed, 21 Feb 2024 11:32:28 +0000 (06:32 -0500)] 
argparse: remove incoherent and redundant docstring for private method (GH-101591)

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
20 months agogh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400)
Sebastian Pipping [Wed, 21 Feb 2024 11:26:16 +0000 (12:26 +0100)] 
gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400)

Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"

20 months agogh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753)
Victor Stinner [Wed, 21 Feb 2024 10:46:00 +0000 (11:46 +0100)] 
gh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753)

PyTime_t no longer uses an arbitrary unit, it's always a number of
nanoseconds (64-bit signed integer).

* Rename _PyTime_FromNanosecondsObject() to _PyTime_FromLong().
* Rename _PyTime_AsNanosecondsObject() to _PyTime_AsLong().
* Remove pytime_from_nanoseconds().
* Remove pytime_as_nanoseconds().
* Remove _PyTime_FromNanoseconds().

20 months agogh-112364: Correct unparsing of backslashes and quotes in ast.unparse (#115696)
Frank Hoffmann [Wed, 21 Feb 2024 10:24:08 +0000 (11:24 +0100)] 
gh-112364: Correct unparsing of backslashes and quotes in ast.unparse (#115696)

20 months agogh-115737: Correct libpython install name for macOS shared library builds. (gh-115750)
Russell Keith-Magee [Wed, 21 Feb 2024 09:11:04 +0000 (17:11 +0800)] 
gh-115737: Correct libpython install name for macOS shared library builds. (gh-115750)

20 months agogh-115653: Document PyCode_GetFirstFree() (#115654)
Bogdan Romanyuk [Wed, 21 Feb 2024 09:01:36 +0000 (12:01 +0300)] 
gh-115653: Document PyCode_GetFirstFree() (#115654)

Correct the return type of the PyCode_GetNumFree() documentation.

20 months agogh-110850: Replace private _PyTime_MAX with public PyTime_MAX (#115751)
Victor Stinner [Wed, 21 Feb 2024 08:11:40 +0000 (09:11 +0100)] 
gh-110850: Replace private _PyTime_MAX with public PyTime_MAX (#115751)

Remove references to the old names _PyTime_MIN
and _PyTime_MAX, now that PyTime_MIN and
PyTime_MAX are public.

Replace also _PyTime_MIN with PyTime_MIN.

20 months agoDelete unused sym_clear_flag function. (#115744)
Benjamin Peterson [Wed, 21 Feb 2024 01:40:48 +0000 (17:40 -0800)] 
Delete unused sym_clear_flag function. (#115744)

20 months agogh-112087: Make list_{concat, repeat, inplace_repeat, ass_item) to be thread-safe...
Donghee Na [Wed, 21 Feb 2024 01:38:09 +0000 (10:38 +0900)] 
gh-112087: Make list_{concat, repeat, inplace_repeat, ass_item)  to be thread-safe (gh-115605)

20 months agogh-112075: Accessing a single element should optimistically avoid locking (#115109)
Dino Viehland [Wed, 21 Feb 2024 01:08:14 +0000 (17:08 -0800)] 
gh-112075: Accessing a single element should optimistically avoid locking (#115109)

Makes accessing a single element thread safe and typically lock free

20 months agogh-112075: Make PyDictKeysObject thread-safe (#114741)
Dino Viehland [Wed, 21 Feb 2024 00:40:37 +0000 (16:40 -0800)] 
gh-112075: Make PyDictKeysObject thread-safe (#114741)

Adds locking for shared PyDictKeysObject's for dictionaries

20 months agogh-110850: Use public PyTime functions (#115746)
Victor Stinner [Tue, 20 Feb 2024 23:31:30 +0000 (00:31 +0100)] 
gh-110850: Use public PyTime functions (#115746)

Replace private _PyTime functions with public PyTime functions.

random_seed_time_pid() now reports errors to its caller.

20 months agogh-110850: Rename internal PyTime C API functions (#115734)
Victor Stinner [Tue, 20 Feb 2024 22:16:37 +0000 (23:16 +0100)] 
gh-110850: Rename internal PyTime C API functions (#115734)

Rename functions:

* _PyTime_GetSystemClock() => _PyTime_TimeUnchecked()
* _PyTime_GetPerfCounter() => _PyTime_PerfCounterUnchecked()
* _PyTime_GetMonotonicClock() => _PyTime_MonotonicUnchecked()
* _PyTime_GetSystemClockWithInfo() => _PyTime_TimeWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()

Changes:

* Remove "typedef PyTime_t PyTime_t;" which was
  "typedef PyTime_t _PyTime_t;" before a previous rename.
* Update comments of "Unchecked" functions.
* Remove invalid PyTime_Time() comment.

20 months agogh-104061: Add socket.SO_BINDTOIFINDEX constant (GH-104062)
Victor Westerhuis [Tue, 20 Feb 2024 21:08:15 +0000 (22:08 +0100)] 
gh-104061: Add socket.SO_BINDTOIFINDEX constant (GH-104062)

Add socket.SO_BINDTOIFINDEX constant

This socket option avoids a race condition between SO_BINDTODEVICE and network interface renaming.

20 months agoTier 2 cleanups and tweaks (#115534)
Guido van Rossum [Tue, 20 Feb 2024 20:24:35 +0000 (12:24 -0800)] 
Tier 2 cleanups and tweaks (#115534)

* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer`
* Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]`
* Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples
* Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg`
* Define a helper for printing uops, and unify various places where they are printed
* Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`)
* Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor

20 months agogh-115733: Fix crash involving exhausted list iterator (#115740)
Sam Gross [Tue, 20 Feb 2024 20:18:44 +0000 (15:18 -0500)] 
gh-115733: Fix crash involving exhausted list iterator (#115740)

* gh-115733: Fix crash involving exhausted iterator

* Add blurb

20 months agoGH-115727: Temporary fix of confidence score test. (GH-115728)
Mark Shannon [Tue, 20 Feb 2024 18:50:31 +0000 (18:50 +0000)] 
GH-115727: Temporary fix of confidence score test. (GH-115728)

Temporary fix of confidence score test.

20 months agogh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)
Ken Jin [Tue, 20 Feb 2024 18:47:05 +0000 (02:47 +0800)] 
gh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)

This fixes level 3 or higher lltrace debug output `--with-pydebug` runs.

20 months agogh-115103: Implement delayed free mechanism for free-threaded builds (#115367)
Sam Gross [Tue, 20 Feb 2024 18:04:37 +0000 (13:04 -0500)] 
gh-115103: Implement delayed free mechanism for free-threaded builds (#115367)

This adds `_PyMem_FreeDelayed()` and supporting functions. The
`_PyMem_FreeDelayed()` function frees memory with the same allocator as
`PyMem_Free()`, but after some delay to ensure that concurrent lock-free
readers have finished.

20 months agogh-110850: Cleanup pycore_time.h includes (#115724)
Victor Stinner [Tue, 20 Feb 2024 16:50:43 +0000 (17:50 +0100)] 
gh-110850: Cleanup pycore_time.h includes (#115724)

<pycore_time.h> include is no longer needed to get the PyTime_t type
in internal header files. This type is now provided by <Python.h>
include. Add <pycore_time.h> includes to C files instead.

20 months agogh-86291: linecache: get module name from __spec__ if available (GH-22908)
Eugene Toder [Tue, 20 Feb 2024 16:47:41 +0000 (11:47 -0500)] 
gh-86291: linecache: get module name from __spec__ if available (GH-22908)

This allows getting source code for the __main__ module when a custom
loader is used.

20 months agogh-115712: Support CSV dialects with delimiter=' ' and skipinitialspace=True (GH...
Serhiy Storchaka [Tue, 20 Feb 2024 16:09:50 +0000 (18:09 +0200)] 
gh-115712: Support CSV dialects with delimiter=' ' and skipinitialspace=True (GH-115721)

Restore support of such combination, disabled in gh-113796.

csv.writer() now quotes empty fields if delimiter is a space and
skipinitialspace is true and raises exception if quoting is not possible.

20 months agogh-115491: Keep some fields valid across allocations (free-threading) (#115573)
Sam Gross [Tue, 20 Feb 2024 15:36:40 +0000 (10:36 -0500)] 
gh-115491: Keep some fields valid across allocations (free-threading) (#115573)

This avoids filling the memory occupied by ob_tid, ob_ref_local, and
ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the
free-threaded build.

20 months agogh-101860: Expose __name__ on property (GH-101876)
Eugene Toder [Tue, 20 Feb 2024 15:14:34 +0000 (10:14 -0500)] 
gh-101860: Expose __name__ on property (GH-101876)

Useful for introspection and consistent with functions and other
descriptors.

20 months agogh-110850: Replace _PyTime_t with PyTime_t (#115719)
Victor Stinner [Tue, 20 Feb 2024 15:02:27 +0000 (16:02 +0100)] 
gh-110850: Replace _PyTime_t with PyTime_t (#115719)

Run command:

sed -i -e 's!\<_PyTime_t\>!PyTime_t!g' $(find -name "*.c" -o -name "*.h")

20 months agogh-112175: Add `eval_breaker` to `PyThreadState` (#115194)
Brett Simmers [Tue, 20 Feb 2024 14:57:48 +0000 (06:57 -0800)] 
gh-112175: Add `eval_breaker` to `PyThreadState` (#115194)

This change adds an `eval_breaker` field to `PyThreadState`. The primary
motivation is for performance in free-threaded builds: with thread-local eval
breakers, we can stop a specific thread (e.g., for an async exception) without
interrupting other threads.

The source of truth for the global instrumentation version is stored in the
`instrumentation_version` field in PyInterpreterState. Threads usually read the
version from their local `eval_breaker`, where it continues to be colocated
with the eval breaker bits.

20 months agogh-112020: Document the meaning of empty bytes returned by socket.recv() (GH-112055)
talcs [Tue, 20 Feb 2024 14:54:33 +0000 (16:54 +0200)] 
gh-112020: Document the meaning of empty bytes returned by socket.recv() (GH-112055)

20 months agogh-110850: Enhance PyTime C API tests (#115715)
Victor Stinner [Tue, 20 Feb 2024 14:53:40 +0000 (15:53 +0100)] 
gh-110850: Enhance PyTime C API tests (#115715)

20 months agoAdd missed `stream` argument (#111775)
Alexander Shadchin [Tue, 20 Feb 2024 14:09:46 +0000 (17:09 +0300)] 
Add missed `stream` argument (#111775)

* Add missed `stream` argument

* Add news

20 months agogh-110850: PyTime_Time() return 0 on success (GH-115713)
Victor Stinner [Tue, 20 Feb 2024 13:35:41 +0000 (14:35 +0100)] 
gh-110850: PyTime_Time() return 0 on success (GH-115713)

Thanks!

20 months agogh-115687: Split up guards from COMPARE_OP (GH-115688)
Ken Jin [Tue, 20 Feb 2024 11:30:49 +0000 (19:30 +0800)] 
gh-115687: Split up guards from COMPARE_OP (GH-115688)

20 months agogh-115700: Add target `_RegenCases` in Windows build for cases regeneration. (GH...
Kirill Podoprigora [Tue, 20 Feb 2024 11:10:47 +0000 (14:10 +0300)] 
gh-115700: Add target `_RegenCases` in Windows build for cases regeneration. (GH-115708)

20 months agoGH-115457: Support splitting and replication of micro ops. (GH-115558)
Mark Shannon [Tue, 20 Feb 2024 10:50:59 +0000 (10:50 +0000)] 
GH-115457: Support splitting and replication of micro ops.  (GH-115558)

20 months agoGH-112354: Initial implementation of warm up on exits and trace-stitching (GH-114142)
Mark Shannon [Tue, 20 Feb 2024 09:39:55 +0000 (09:39 +0000)] 
GH-112354: Initial implementation of warm up on exits and trace-stitching (GH-114142)

20 months agogh-113157: Document and test __get__ for MethodType (gh-115492)
Raymond Hettinger [Tue, 20 Feb 2024 07:53:25 +0000 (01:53 -0600)] 
gh-113157: Document and test __get__ for MethodType (gh-115492)

20 months agoMake the title match the content (GH-115702)
Raymond Hettinger [Tue, 20 Feb 2024 07:51:56 +0000 (01:51 -0600)] 
Make the title match the content (GH-115702)

20 months agoModernize the Sorting HowTo guide (gh-115479)
Raymond Hettinger [Tue, 20 Feb 2024 03:22:07 +0000 (21:22 -0600)] 
Modernize the Sorting HowTo guide (gh-115479)

20 months agogh-115539: Allow enum.Flag to have None members (GH-115636)
Jason Zhang [Mon, 19 Feb 2024 22:36:11 +0000 (22:36 +0000)] 
gh-115539: Allow enum.Flag to have None members (GH-115636)

20 months agogh-115543: Update py.exe to know about Python 3.13 and to install 3.12 by default...
Steve Dower [Mon, 19 Feb 2024 20:36:20 +0000 (20:36 +0000)] 
gh-115543: Update py.exe to know about Python 3.13 and to install 3.12 by default (GH-115544)

20 months agoFix typo in multiprocessing docs (#115650)
Naglis Jonaitis [Mon, 19 Feb 2024 18:19:14 +0000 (20:19 +0200)] 
Fix typo in multiprocessing docs (#115650)