Commit graph

127326 commits

Author SHA1 Message Date
Andrea-Oliveri
f806463e16
gh-134004: Added the reorganize() methods to dbm.sqlite, dbm.dumb and shelve (GH-134028)
They are similar to the same named method in dbm.gnu.
2025-06-01 15:30:04 +03:00
Serhiy Storchaka
b595237166
gh-132983: Minor fixes and clean up for the _zstd module (GH-134930) 2025-06-01 11:22:15 +03:00
Rihaan Meher
fe6f8a3619
gh-133503: clarify compileall -s/-p docs (#134756)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-01 10:18:31 +02:00
Michał Górny
965c480566
gh-134970: Fix exception message in argparse module (GH-134971)
Fix the "unknown action" exception in argparse.ArgumentParser.add_argument_group()
to correctly replace the action class.
2025-06-01 08:56:56 +03:00
sobolevn
cebae977a6
gh-133891: Add missing error check to SET_COUNT macro in _testinternalcapi.c (#133892) 2025-06-01 00:33:02 +03:00
Stan Ulbrych
3704171415
gh-134835: Remove outdated list from howto/urllib2.rst (GH-134844)
🫖
2025-05-31 10:48:51 -07:00
Itamar Oren
f58873e4b2
gh-134954: Hard-cap max file descriptors in subprocess test fd_status (#134955)
* Hard-cap max file descriptors in subprocess test fd_status

On some systems, `SC_OPEN_MAX` may return a very large value (i.e. 10**30), leading to the subprocess test timing out (or run forever).
Prevent this situation by applying a hard cap on how many file descriptors are checked.

* Fix typo in usage docstring

s/fd_stats/fd_status/
2025-05-31 07:29:03 -07:00
sobolevn
5507eff19c
Improve format of InternalDocs/exception_handling.md (#134969) 2025-05-31 14:56:33 +03:00
CF Bolz-Tereick
895119ec24
skip test for sys._stdlib_dir if that is not present (#134973) 2025-05-31 13:46:22 +02:00
CF Bolz-Tereick
af0d3268d9
Skip test as cpython_only that checks whether setattr interns the attribute or not (#134972)
Skip test that checks whether setattr interns the attribute or not

The details of when a string is being interned or not is implementation
dependent.
2025-05-31 13:38:05 +02:00
Nice Zombies
c81446af1d
gh-133968: Create the Unicode writer on demand in json (#133832) 2025-05-31 13:35:51 +02:00
Bénédikt Tran
379d0bc956
gh-134696: fix hashlib tests for FIPS-only BLAKE-2 buildbot (#134968) 2025-05-31 12:48:34 +02:00
Serhiy Storchaka
ad39f01788
gh-108885: Use subtests for doctest examples run by unittest (GH-134890)
Run each example as a subtest in unit tests synthesized by
doctest.DocFileSuite() and doctest.DocTestSuite().

Add the doctest.DocTestRunner.report_skip() method.
2025-05-31 13:01:46 +03:00
Serhiy Storchaka
3c66e59766
gh-134918: Fix and improve doctest's documentation (GH-134919) 2025-05-31 12:03:08 +03:00
Serhiy Storchaka
68784fed78
gh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658)
random.getrandbits() can now generate more that 2**31 bits.
random.randbytes() can now generate more that 256 MiB.
2025-05-31 11:23:01 +03:00
Bénédikt Tran
c6e63d9d35
gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures (#134713)
OpenSSL and HACL*-based hash functions constructors now support both `data` and `string` parameters.
Previously these constructor functions inconsistently supported sometimes `data` and sometimes `string`,
while the documentation expected `data` to be given in all cases.
2025-05-31 09:37:47 +02:00
Serhiy Storchaka
4d31d19a1d
gh-134718: Omit optional Load() values in ast.dump() (GH-134934) 2025-05-31 10:32:53 +03:00
László Kiss Kollár
8e8786f898
gh-91048: Reorder result tuple of parse_code_object (#134898)
Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.
2025-05-31 00:32:36 +00:00
Steve Dower
8865b4f95b
gh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924) 2025-05-30 19:37:29 +01:00
Gregory P. Smith
310c8cd5e5
rearrange my gitingore addition w/comment to make backporting easier (#134945) 2025-05-30 18:28:14 +00:00
Gregory P. Smith
98a5b830d2
.gitignore personal Claude Code configs (#134942)
.gitignore personal Claude Code configs.

https://docs.anthropic.com/en/docs/claude-code/memory
2025-05-30 17:46:16 +00:00
Serhiy Storchaka
1a89991d23
gh-134733: Fix documentation for the show_empty option of ast.dump() (GH-134925)
Optional None values are always omitted.
2025-05-30 15:52:36 +00:00
Eric Snow
52deabefd0
gh-132775: Expand the Capability of Interpreter.call() (gh-133484)
It now supports most callables, full args, and return values.
2025-05-30 09:15:00 -06:00
Petr Viktorin
eb145fabbd
gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-30 16:27:54 +02:00
Serhiy Storchaka
cc344e8dd0
gh-134718: Fix ast.dump() for empty non-default values (GH-134926) 2025-05-30 17:25:07 +03:00
Mark Shannon
ce6a6371a2
GH-134879: Fix INSTRUMENT_FOR_ITER for list/tuple (#134897)
Fix INSTRUMENT_FOR_ITER for list/tuple
2025-05-30 07:11:42 -07:00
Bénédikt Tran
c600310663
gh-134586: mark _mi_assert_fail as noreturn, cold and throw (#134624)
We add the following attributes on `_mi_assert_fail` to help IDE introspection:

* `__attribute__((__noreturn__))`
* `__attribute__((cold))`
* `__THROW` (GCC only)
2025-05-30 14:44:03 +02:00
Victor Stinner
ebf6d13567
gh-134745: Change PyThread_allocate_lock() implementation to PyMutex (#134747)
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-05-30 10:15:47 +00:00
Jelle Zijlstra
45c6c48afc
gh-134885: zstd: Use Py_XSETREF (GH-134886) 2025-05-30 11:30:05 +02:00
Inada Naoki
b367e27af9
Doc: remove unnecessary section header (GH-134917) 2025-05-30 17:59:23 +09:00
Sam James
2f2bee2111
gh-134768: Fix definition of mt_continue_should_break() (#134769)
In 121ed71f4e, mt_continue_should_break
was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held`
with just `assert`, so it needs to be available when `NDEBUG` is undefined
too.

`Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that.

Fixes: 121ed71f4e
2025-05-30 04:42:19 +00:00
Emma Smith
5f60d0fccc
gh-134906: Document CompressionParameter.content_size_flag (#134907)
* Document CompressionParameter.content_size_flag
2025-05-29 21:37:43 -07:00
Jelle Zijlstra
381020d41f
ast docs: Fix description of ast.Constant (#134741)
Contrary to the current docs, ast.Constant will never hold containers
such as frozenset or tuple; the Python parser only emits it for simple
literals.

For precision, add the exact list of types that may be contained in an
ast.Constant.
2025-05-29 21:11:20 -07:00
Savannah Bailey
a4251411a9
GH-106235: Clarify parse_known_args documentation by removing "remaining" (#126921) 2025-05-29 20:34:34 -07:00
Serhiy Storchaka
cb8a72b301
gh-134857: Improve error report for doctests run with unittest (GH-134858)
Remove doctest module frames from tracebacks and redundant newline
character from a failure message.
2025-05-30 00:32:44 +03:00
Eric Snow
dafd14146f
gh-132775: Fix _PyFunctIon_VerifyStateless() (#134900)
The problem we're fixing here is that we were using PyDict_Size() on "defaults",
which it is actually a tuple.  We're also adding some explicit type checks.

This is a follow-up to gh-133221/gh-133528.
2025-05-29 20:13:12 +00:00
Collin Funk
d96343679f
gh-134771: Fix time_clockid_converter() on Cygwin (#134772)
Use long for clockid_t instead of int.
2025-05-29 19:35:53 +02:00
Victor Stinner
f49a07b531
gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)
Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().

Unrelated change to please the linter: remove an unused
import in test_ctypes.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-29 14:54:30 +00:00
Petr Viktorin
4109a9c6b3
gh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213) 2025-05-29 15:36:59 +02:00
Bénédikt Tran
cafbcd666a
gh-133866: remove deprecated and undocumented function ctypes.SetPointerType (GH-133869) 2025-05-29 15:28:57 +02:00
Stan Ulbrych
b783e1791b
gh-69011: : clarify & deduplicate ctypes.create_*_buffer docs (GH-132858)
This adds a warning about the possibly-missing NUL terminator, but in a way
that doesn't make it sound like a bug/wart.
2025-05-29 15:16:20 +02:00
Emma Smith
e64395e8eb
gh-134262: Fix off by one errors in download retry functions (GH-134867) 2025-05-28 18:15:39 -05:00
Emma Smith
e9d845b41d
gh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134820) 2025-05-28 22:18:34 +01:00
Pablo Galindo Salgado
e496444fdf
Add a tool to benchmark external inspection (#134810) 2025-05-28 21:27:24 +01:00
Mark Shannon
9fbd66a93d
GH-133912: Fix PyObject_GenericSetDict to handle inline values (GH-134725) 2025-05-28 19:03:41 +01:00
Serhiy Storchaka
f6324bc7ee
gh-108885: Imporove tests for doctest (GH-134832)
Test the error and failure report in more detail.
2025-05-28 20:14:56 +03:00
Serhiy Storchaka
bac3fcba5b
gh-108512: Add and use new replacements for PySys_GetObject() (GH-111035)
Add functions PySys_GetAttr(), PySys_GetAttrString(),
PySys_GetOptionalAttr() and PySys_GetOptionalAttrString().
2025-05-28 20:11:09 +03:00
Adam Turner
b265a7ddeb
GH-134848: Use a set to store `AuditEvents.sources` (#134849) 2025-05-28 17:30:53 +01:00
Victor Stinner
4635115c3f
gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (#134841)
Skip the test if the Python UTF-8 Mode is enabled and the LC_CTYPE
encoding is not UTF-8.
2025-05-28 17:43:52 +02:00
Victor Stinner
d9ec0ee733
gh-133711: Log Windows OEM code page in test.pythoninfo (#134840)
Add _winapi.GetOEMCP() function.
2025-05-28 17:41:11 +02:00