]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
20 months agogh-112529: Simplify PyObject_GC_IsTracked and PyObject_GC_IsFinalized (#114732)
Sam Gross [Wed, 28 Feb 2024 20:37:59 +0000 (15:37 -0500)] 
gh-112529: Simplify PyObject_GC_IsTracked and PyObject_GC_IsFinalized (#114732)

20 months agogh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)
Weii Wang [Wed, 28 Feb 2024 20:15:52 +0000 (04:15 +0800)] 
gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)

Use of a proxy is intended to defer DNS for the hosts to the proxy itself, rather than a potential for information leak of the host doing DNS resolution itself for any reason.  Proxy bypass lists are strictly name based.  Most implementations of proxy support agree.

20 months agoGH-115986 Reorder pprint docs and amend some references (#116019)
Kerim Kabirov [Wed, 28 Feb 2024 19:43:05 +0000 (20:43 +0100)] 
GH-115986 Reorder pprint docs and amend some references (#116019)

Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.

Also:
- Fix pprint.pprint() references so they properly link to the module
  level function.
- Add links to sys.stdout.

20 months agogh-115816: Improve internal symbols API in optimizer (#116028)
Guido van Rossum [Wed, 28 Feb 2024 17:55:56 +0000 (09:55 -0800)] 
gh-115816: Improve internal symbols API in optimizer (#116028)

- Any `sym_set_...` call that attempts to set conflicting information
  cause the symbol to become `bottom` (contradiction).
- All `sym_is...` and similar calls return false or NULL for `bottom`.
- Everything's tested.
- The tests still pass with `PYTHONUOPSOPTIMIZE=1`.

20 months agogh-112075: Remove compiler warning from apple clang (gh-115855)
Donghee Na [Wed, 28 Feb 2024 17:51:59 +0000 (02:51 +0900)] 
gh-112075: Remove compiler warning from apple clang (gh-115855)

20 months agogh-107674: Improve performance of `sys.settrace` (GH-114986)
Tian Gao [Wed, 28 Feb 2024 15:21:42 +0000 (07:21 -0800)] 
gh-107674: Improve performance of `sys.settrace` (GH-114986)

20 months agogh-116012: Preserve GetLastError() across calls to TlsGetValue on Windows (GH-116014)
Steve Dower [Wed, 28 Feb 2024 13:58:25 +0000 (13:58 +0000)] 
gh-116012: Preserve GetLastError() across calls to TlsGetValue on Windows (GH-116014)

20 months agodoc: Use super() in subclassed JSONEncoder examples (GH-115565)
Jan Max Meyer [Wed, 28 Feb 2024 13:54:12 +0000 (14:54 +0100)] 
doc: Use super() in subclassed JSONEncoder examples (GH-115565)

Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.

20 months agogh-115765: Don't use deprecated AC_EGREP_* macros in configure.ac (#116016)
Erlend E. Aasland [Wed, 28 Feb 2024 13:35:41 +0000 (14:35 +0100)] 
gh-115765: Don't use deprecated AC_EGREP_* macros in configure.ac (#116016)

Rewrite using AX_CHECK_DEFINE and AC_CHECK_TYPES.

20 months agogh-78612: Mark up eval() using param list (#115212)
Erlend E. Aasland [Wed, 28 Feb 2024 13:03:50 +0000 (14:03 +0100)] 
gh-78612: Mark up eval() using param list (#115212)

Also mention that the 'expression' parameter can be a string.

20 months agogh-114911: Add CPUStopwatch test helper (GH-114912)
Petr Viktorin [Wed, 28 Feb 2024 11:53:48 +0000 (12:53 +0100)] 
gh-114911: Add CPUStopwatch test helper (GH-114912)

A few of our tests measure the time of CPU-bound operation, mainly
to avoid quadratic or worse behaviour.
Add a helper to ignore GC and time spent in other processes.

20 months agogh-116030: test_unparse: Add ``ctx`` argument to ``ast.Name`` calls (#116031)
Kirill Podoprigora [Wed, 28 Feb 2024 11:04:23 +0000 (13:04 +0200)] 
gh-116030: test_unparse: Add ``ctx`` argument to ``ast.Name`` calls (#116031)

20 months agogh-115773: Add tests to exercise the _Py_DebugOffsets structure (#115774)
Pablo Galindo Salgado [Wed, 28 Feb 2024 10:17:34 +0000 (10:17 +0000)] 
gh-115773: Add tests to exercise the _Py_DebugOffsets structure (#115774)

20 months agogh-105858: Expose some union-related objects as internal APIs (GH-116025)
Jelle Zijlstra [Wed, 28 Feb 2024 09:56:40 +0000 (01:56 -0800)] 
gh-105858: Expose some union-related objects as internal APIs (GH-116025)

We now use these in the AST parsing code after gh-105880. A few comparable types (e.g.,
NoneType) are already exposed as internal APIs.

20 months agogh-115961: Improve tests for compressed file-like objects (GH-115963)
Serhiy Storchaka [Wed, 28 Feb 2024 07:51:08 +0000 (09:51 +0200)] 
gh-115961: Improve tests for compressed file-like objects (GH-115963)

* Increase coverage for compressed file-like objects initialized with a
  file name, an open file object, a file object opened by file
  descriptor, and a file-like object without name and mode attributes
  (io.BytesIO)
* Increase coverage for name, fileno(), mode, readable(), writable(),
  seekable() in different modes and states
* No longer skip tests with bytes names
* Test objects implementing the path protocol, not just pathlib.Path.

20 months agogh-116026: Try disabling rebuilds of dependents in Homebrew (#116027)
Jelle Zijlstra [Wed, 28 Feb 2024 05:35:25 +0000 (21:35 -0800)] 
gh-116026: Try disabling rebuilds of dependents in Homebrew (#116027)

20 months agogh-105858: Improve AST node constructors (#105880)
Jelle Zijlstra [Wed, 28 Feb 2024 02:13:03 +0000 (18:13 -0800)] 
gh-105858: Improve AST node constructors (#105880)

Demonstration:

>>> ast.FunctionDef.__annotations__
{'name': <class 'str'>, 'args': <class 'ast.arguments'>, 'body': list[ast.stmt], 'decorator_list': list[ast.expr], 'returns': ast.expr | None, 'type_comment': str | None, 'type_params': list[ast.type_param]}
>>> ast.FunctionDef()
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'name'. This will become an error in Python 3.15.
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'args'. This will become an error in Python 3.15.
<ast.FunctionDef object at 0x101959460>
>>> node = ast.FunctionDef(name="foo", args=ast.arguments())
>>> node.decorator_list
[]
>>> ast.FunctionDef(whatever="you want", name="x", args=ast.arguments())
<stdin>:1: DeprecationWarning: FunctionDef.__init__ got an unexpected keyword argument 'whatever'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.
<ast.FunctionDef object at 0x1019581f0>

20 months agogh-112997: Don't log arguments in asyncio unless debugging (#115667)
Pierre Ossman (ThinLinc team) [Wed, 28 Feb 2024 01:39:08 +0000 (02:39 +0100)] 
gh-112997: Don't log arguments in asyncio unless debugging (#115667)

Nothing else in Python generally logs the contents of variables, so this
can be very unexpected for developers and could leak sensitive
information in to terminals and log files.

20 months agogh-114914: Avoid keeping dead StreamWriter alive (#115661)
Pierre Ossman (ThinLinc team) [Wed, 28 Feb 2024 01:27:44 +0000 (02:27 +0100)] 
gh-114914: Avoid keeping dead StreamWriter alive (#115661)

In some cases we might cause a StreamWriter to stay alive even when the
application has dropped all references to it. This prevents us from
doing automatical cleanup, and complaining that the StreamWriter wasn't
properly closed.

Fortunately, the extra reference was never actually used for anything so
we can just drop it.

20 months agobpo-43952: Fix multiprocessing Listener authkey bug (GH-25845)
Miguel Brito [Tue, 27 Feb 2024 14:57:59 +0000 (14:57 +0000)] 
bpo-43952: Fix multiprocessing Listener authkey bug (GH-25845)

Listener.accept() no longer hangs when authkey is an empty bytes object.

20 months agogh-115315: Update time.rst to include microseconds field (%f) in chart (#115316)
Tahoma Software [Tue, 27 Feb 2024 13:33:05 +0000 (08:33 -0500)] 
gh-115315: Update time.rst to include microseconds field (%f) in chart (#115316)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
20 months agoGH-115816: Assorted naming and formatting changes to improve maintainability. (GH...
Mark Shannon [Tue, 27 Feb 2024 13:25:02 +0000 (13:25 +0000)] 
GH-115816: Assorted naming and formatting changes to improve maintainability. (GH-115987)

* Rename _Py_UOpsAbstractInterpContext to _Py_UOpsContext and _Py_UOpsSymType to _Py_UopsSymbol.

* #define shortened form of _Py_uop_... names for improved readability.

20 months agoGH-115816: Make tier2 optimizer symbols testable, and add a few tests. (GH-115953)
Mark Shannon [Tue, 27 Feb 2024 10:51:26 +0000 (10:51 +0000)] 
GH-115816: Make tier2 optimizer symbols testable, and add a few tests. (GH-115953)

20 months agogh-115720: Show number of leaks in huntrleaks progress reports (GH-115726)
Petr Viktorin [Tue, 27 Feb 2024 08:51:17 +0000 (09:51 +0100)] 
gh-115720: Show number of leaks in huntrleaks progress reports (GH-115726)

Instead of showing a dot for each iteration, show:
- '.' for zero (on negative) leaks
- number of leaks for 1-9
- 'X' if there are more leaks

This allows more rapid iteration: when bisecting, I don't need
to wait for the final report to see if the test still leaks.

Also, show the full result if there are any non-zero entries.
This shows negative entries, for the unfortunate cases where
a reference is created and cleaned up in different runs.

Test *failure* is still determined by the existing heuristic.

20 months agobpo-44865: Fix yet one missing translations in argparse (GH-27668)
Jérémie Detrey [Mon, 26 Feb 2024 22:05:01 +0000 (23:05 +0100)] 
bpo-44865: Fix yet one missing translations in argparse (GH-27668)

20 months agobpo-45101: Add consistency in usage message IO between 2 versions of python-config...
Kien Dang [Mon, 26 Feb 2024 20:04:44 +0000 (03:04 +0700)] 
bpo-45101: Add consistency in usage message IO between 2 versions of python-config (GH-28162)

On --help output to stdout.
On error output to stderr.

20 months agogh-77956: Add the words 'default' and 'version' help text localizable (GH-12711)
Emmanuel Arias [Mon, 26 Feb 2024 19:20:39 +0000 (16:20 -0300)] 
gh-77956: Add the words 'default' and 'version' help text  localizable (GH-12711)

Co-authored-by: paul.j3
Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
20 months agogh-115582: Make default PC/pyconfig.h work for free-threaded builds with manual ...
Steve Dower [Mon, 26 Feb 2024 19:14:14 +0000 (19:14 +0000)] 
gh-115582: Make default PC/pyconfig.h work for free-threaded builds with manual /DPy_GIL_DISABLED (GH-115850)

20 months agogh-113942: Show functions implemented as builtin methods (GH-115306)
Serhiy Storchaka [Mon, 26 Feb 2024 18:29:49 +0000 (20:29 +0200)] 
gh-113942: Show functions implemented as builtin methods (GH-115306)

Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.

20 months agogh-112006: Fix inspect.unwrap() for types where __wrapped__ is a data descriptor...
Serhiy Storchaka [Mon, 26 Feb 2024 18:07:41 +0000 (20:07 +0200)] 
gh-112006: Fix inspect.unwrap() for types where __wrapped__ is a data descriptor (GH-115540)

This also fixes inspect.Signature.from_callable() for builtins classmethod()
and staticmethod().

20 months agogh-115168: Add pystats counter for invalidated executors (GH-115169)
Michael Droettboom [Mon, 26 Feb 2024 17:51:47 +0000 (12:51 -0500)] 
gh-115168: Add pystats counter for invalidated executors (GH-115169)

20 months agogh-115882: Reference Unknwn.h for ctypes on Windows (GH-115350)
Yuriy Chernyshov [Mon, 26 Feb 2024 17:21:55 +0000 (18:21 +0100)] 
gh-115882: Reference Unknwn.h for ctypes on Windows (GH-115350)

This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled

20 months agoRename tier 2 redundancy eliminator to optimizer (#115888)
Guido van Rossum [Mon, 26 Feb 2024 16:42:53 +0000 (08:42 -0800)] 
Rename tier 2 redundancy eliminator to optimizer (#115888)

The original name is just too much of a mouthful.

20 months agoGH-115802: JIT "small" code for macOS and Linux (GH-115826)
Brandt Bucher [Mon, 26 Feb 2024 16:32:44 +0000 (08:32 -0800)] 
GH-115802: JIT "small" code for macOS and Linux (GH-115826)

20 months agoAdd Jason as an owner of configparser to coordinate backport concerns. (#115885)
Jason R. Coombs [Mon, 26 Feb 2024 16:11:38 +0000 (11:11 -0500)] 
Add Jason as an owner of configparser to coordinate backport concerns. (#115885)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
20 months agogh-113706: Update comment about long int representation (#113707)
Michael Droettboom [Mon, 26 Feb 2024 15:18:30 +0000 (10:18 -0500)] 
gh-113706: Update comment about long int representation (#113707)

20 months agogh-115823: Calculate correctly error locations when dealing with implicit encodings...
Pablo Galindo Salgado [Mon, 26 Feb 2024 12:57:09 +0000 (13:57 +0100)] 
gh-115823: Calculate correctly error locations when dealing with implicit encodings (#115824)

20 months agogh-115931: Fix `SyntaxWarning`s in `test_unparse` (#115935)
Nikita Sobolev [Mon, 26 Feb 2024 12:32:27 +0000 (15:32 +0300)] 
gh-115931: Fix `SyntaxWarning`s in `test_unparse` (#115935)

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"