127146 Commits

Author SHA1 Message Date
Yuki Kobayashi
15a8b5b9bd
gh-110631: Fix some incorrect indents in the documentation (#129312) 2025-05-21 13:52:02 +00:00
Eric Snow
88f8102a8f
gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)
It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`.  There's also room for other fallback modes if that later makes sense.
2025-05-21 07:23:48 -06:00
Emma Smith
0c5a8b0b55
gh-134262: Add retries to generate_sbom.py (#134263)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-21 16:14:36 +03:00
Peter Bierma
b8998fe2d8
gh-131185: Use a proper thread-local for cached thread states (gh-132510)
Switches over to a _Py_thread_local in place of autoTssKey, and also fixes a few other checks regarding PyGILState_Ensure after finalization.

Note that this doesn't fix concurrent use of PyGILState_Ensure with Py_Finalize; I'm pretty sure zapthreads doesn't work at all, and that needs to be fixed seperately.
2025-05-21 07:01:25 -06:00
sobolevn
dcfc91e4e5
Fix signature of _curses.assume_default_colors in the docs (#134409) 2025-05-21 15:56:34 +03:00
Noam Cohen
e6dde10a69
gh-132542: Only run test_native_id_after_fork if native_id is supported (GH-134408) 2025-05-21 14:10:57 +03:00
Sofia Toro
c740fe3bd0
gh-134360 Add processName attribute to logging.Formatter docstring (GH-134371) 2025-05-21 05:49:06 +01:00
Tim Hatch
1298511b41
gh-72680: Fix false positives when using zipfile.is_zipfile() (GH-134250)
bpo-28494: Improve zipfile.is_zipfile reliability

The zipfile.is_zipfile function would only search for the EndOfZipfile
section header. This failed to correctly identify non-zipfiles that
contained this header. Now the zipfile.is_zipfile function verifies
the first central directory entry.

Changes:
* Extended zipfile.is_zipfile to verify zipfile catalog
* Added tests to validate failure of binary non-zipfiles
* Reuse 'concat' handling for is_zipfile

Co-authored-by: John Jolly <john.jolly@gmail.com>
2025-05-20 18:32:41 -07:00
Pablo Galindo Salgado
d327159eb4
gh-91048: Fix error path result in _remote_debugging_module (#134347) 2025-05-20 19:54:09 -04:00
ivonastojanovic
6856a04d68
Add documentation for remote debugging with pdb (#134260)
* Mention remote debugging via -p PID in usage text

Adds a brief note to the pdb help summary about attaching to a running
process using the -p option, making the remote debugging feature
more visible.

* Mention remote debugging in pdb.rst
2025-05-20 19:50:49 -04:00
Brandt Bucher
2f0570caf4
GH-131798: Narrow types more aggressively in the JIT (GH-134373) 2025-05-20 18:09:51 -04:00
Nadeshiko Manju
e1c0c451a2
GH-131798: Narrow the return type of _GET_LEN to int (GH-133345) 2025-05-20 18:02:50 -04:00
Chris Eibl
e4fbfb1288
GH-130727: Avoid race condition in _wmimodule by copying shared data (GH-134313) 2025-05-20 22:21:25 +01:00
tigerding
aadda87b3d
gh-134209: use heap-allocated memory in _curses.window.{instr,getstr} (GH-134283)
* made curses buffer heap allocated instead of stack
* change docs to explicitly mention the max buffer size
* changing GetStr() function to behave similarly too
* Update Doc/library/curses.rst
* Update instr with proper return error handling
* Update Modules/_cursesmodule.c
* change to strlen and better memory safety
* change from const int to Py_ssize_t
* add mem allocation guard
* update versionchanged to mention it was an increase.
* explicitly use versionchanged 3.14 as that is its own branch now.

TESTED: `python -m test -u curses test_curses`

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-20 20:36:04 +00:00
Kevin Hernández
a3a3cf6d15
gh-134215: PyREPL: Do not show underscored modules by default during autocompletion (gh-134267)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 22:26:48 +02:00
Chris Patti
c91ad5da9d
gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 21:47:57 +02:00
devdanzin
c7f8e706e1
gh-90117: handle dict and mapping views in pprint (#30135)
* Teach pprint about dict views with PrettyPrinter._pprint_dict_view and ._pprint_dict_items_view.
* Use _private names for _dict_*_view attributes of PrettyPrinter.
* Use explicit 'items' keyword when calling _pprint_dict_view from _pprint_dict_items_view.
* 📜🤖 Added by blurb_it.
* Improve tests
* Add tests for collections.abc.[Keys|Items|Mapping|Values]View support in pprint.
* Add support for collections.abc.[Keys|Items|Mapping|Values]View in pprint.
* Split _pprint_dict_view into _pprint_abc_view, so pretty-printing normal dict views and ABC views is handled in two simple methods.
* Simplify redundant code.
* Add collections.abc views to some existing pprint tests.
* Test that views from collection.UserDict are correctly formatted by pprint.
* Handle recursive dict and ABC views.
* Test that subclasses of ABC views work in pprint.
* Test dict views coming from collections.Counter.
* Test ABC views coming from collections.ChainMap.
* Test odict views coming from collections.OrderedDict.
* Rename _pprint_abc_view to _pprint_mapping_abc_view.
* Add pprint test for mapping ABC views where ._mapping has a custom __repr__ and fix ChainMap test.
* When a mapping ABC view has a ._mapping that defines a custom __repr__, dispatch pretty-printing it by that __repr__.
* Add tests for ABC mapping views subclasses that don't replace __repr__, also handling those that delete ._mapping on instances.
* Simplify the pretty printing of ABC mapping views.
* Add a test for depth handling when pretty printing dict views.
* Fix checking whether the view type is a subclass of an items view, add a test.
* Move construction of the views __repr__ set out of _safe_repr.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-20 12:30:00 -07:00
Hood Chatham
91e6a58e2d
gh-127146: xfail more Emscripten stack overflows (#134358)
Adds some additional test xfails for Emscripten stack overflows. Also corrects a test skip for test_io.
2025-05-20 18:41:14 +00:00
Hood Chatham
3b7888bf3d
gh-106213: Shorten Emscripten wasm-gc trampoline by a little (#133984)
Using the if instruction results in slightly shorter trampoline code.
2025-05-20 14:22:49 -04:00
Alex Kautz
36eb711d2f
gh-85045: clarified that the underlying buffer of a TextIOBase can be a RawIOBase (GH-134372)
Added a clarification that the underlying binary buffer of a TextIOBase can be a BufferedIOBase OR a RawIOBase
2025-05-20 18:18:58 +00:00
Kumar Aditya
b430e92dd8
gh-127945: Update What's New in Python 3.14 for free-threaded ctypes (#134332) 2025-05-20 22:27:23 +05:30
Kumar Aditya
0584533dc7
gh-128002: add what's new docs for asyncio (#134324) 2025-05-20 22:11:58 +05:30
Stan Ulbrych
99b580857f
gh-122781: Allow empty offset for %z in strptime (#132922)
* commit

* Move tests
2025-05-20 16:39:58 +00:00
Brandt Bucher
7ad90463df
GH-133779: Fix finding pyconfig.h on Windows JIT builds (GH-134349) 2025-05-20 12:32:26 -04:00
Noam Cohen
6b73502313
gh-132542: Set native thread ID after fork (GH-132701) 2025-05-20 16:20:25 +00:00
Stan Ulbrych
86397cf65d
gh-76075: Correct datetime.timestamp documentation (#131202)
* Clean up timestamp docs

* Update datetime.rst

* Suggestion
2025-05-20 12:18:53 -04:00
Kumar Aditya
ec39fd2c20
gh-133980: use atomic store in PyObject_GenericSetDict (#133988) 2025-05-20 21:11:47 +05:30
Donghee Na
317c496223
gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx (#134238) 2025-05-20 11:39:56 -04:00
Pablo Galindo Salgado
dd7f113057
gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (#134286)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2025-05-20 15:31:37 +00:00
Mark Shannon
6dcb0fdfe0
GH-134282: Always borrow references LOAD_CONST (GH-134284) 2025-05-20 11:24:11 -04:00
Christian Harries
f695eca60c
gh-86802: Fix asyncio memory leak; shielded task exceptions log once through the exception handler (gh-134331)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 17:14:27 +02:00
Yuki Kobayashi
f3acbb72ff
gh-101100: Fix Sphinx warnings in library/decimal.rst (#134303) 2025-05-20 17:46:13 +03:00
Bas Bloemsaat
5ab66a882d
gh-62824: Add alias for iso-8859-8-i which is the same as iso-8859-8 (gh-134306)
Co-authored-by: David Goncalves <davegoncalves@gmail.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2025-05-20 15:14:02 +02:00
Richard Hansen
3246ea514d
gh-75459: Doc: C API: Improve object life cycle documentation (GH-125962)
* Add "cyclic isolate" to the glossary.
  * Add a new "Object Life Cycle" page.
  * Improve docs for related API, with special focus on cross-references and warnings

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-20 14:25:50 +02:00
abstractedfox
306f9e04e5
gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (#134234)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-20 12:24:27 +00:00
Serhiy Storchaka
a31bbc951a
gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH-123069)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-05-20 14:08:40 +02:00
Sergey B Kirpichev
175ba3639f
gh-72902: improve Fraction constructor speed for typical inputs (GH-134320)
This moves abc check for numbers.Rational - down.
2025-05-20 12:47:27 +03:00
Bénédikt Tran
e007e62ba7
gh-125843: fix test_curses.test_attributes on x86-64 macOS (#134252)
While some `libcurses` functions are meant to return OK on success,
this is not always the case for all implementations. As such, we relax
the checks on the return values and allow any non-ERR value to be
considered equivalent to OK.
2025-05-20 09:15:39 +00:00
Guido van Rossum
28625d4f95
gh-128307: Update what's new in 3.13 and 3.14 with create_task changes of asyncio (#134304)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-20 14:11:22 +05:30
Serhiy Storchaka
e29171bf8a
Clean up test_posixpath (GH-134315)
* Ensure that created files and dirs are always removed after test.
  Now addCleanup() does not conflict with tearDown().
* Use os_helper.unlink() and os_helper.rmdir().
* Import TESTFN from os_helper.
2025-05-20 10:51:44 +03:00
Inada Naoki
652d6938ef
gh-133374: fix test_python_legacy_windows_stdio (GH-134080) 2025-05-20 13:33:54 +09:00
Gustaf
e3dda8f818
gh-133940: test_strftime incorrectly calculates expected week (GH-134281)
Let the system determine the correct tm_wday and tm_isdst.
2025-05-19 17:54:48 -07:00
Alek Binion
66aaad6103
gh-134201: Expand explanation of Base85 encodings in base64 docs (#134288)
Explain history of de-facto standard and how to pick between the two Base-85 encoding functions in the base-64 module.

---------

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2025-05-19 18:59:06 -05:00
Stan Ulbrych
46d7c114d8
gh-132983: Add zstd version info to test.pythoninfo (#134230)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-20 00:06:04 +02:00
Tomas R.
a7f317d730
GH-131798: Add _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW (GH-134268) 2025-05-19 18:00:53 -04:00
Bénédikt Tran
1fbb0603a8
gh-131178: remove runtime tests for http.server CLI (#134287)
The runtime behavior of `http.server` CLI is hard to test on an arbitrary platform.
As such, tests asserting the correctness of `python -m http.server` are temporarily
removed and will be rewritten later once a universal solution has been found.
2025-05-19 21:59:14 +00:00
Tom Wang
8421b03b16
gh-134235: Import Autocomplete for Builtin Modules (GH-134277)
* added enhancement auto completing import with sys builtins

---------

Co-authored-by: Hunter <hyoung3@gmail.com>
2025-05-19 14:21:30 -07:00
John Keith Hohm
470941782f
gh-88994: Change datetime.datetime.now to half-even rounding (#134258)
Change `datetime.datetime.now` to half-even rounding
for consistency with `datetime.fromtimestamp`.
2025-05-19 22:48:55 +02:00
Diego Russo
42d03f3933
GH-131798: Split CALL_LIST_APPEND into several uops (GH-134240) 2025-05-19 15:48:55 -04:00
Sahil Shah
92f85ff3a0
gh-80184: Set getattr(socket, "SOMAXCONN", 5) as the default queue size for TCPServer (GH-134249)
socketserver.TCPServer default queue size becomes SOMAXCONN instead of 5 when possible.
2025-05-19 19:28:09 +00:00