Commit graph

34551 commits

Author SHA1 Message Date
Weilin Du
561212a033
Doc: More duplicate word fixes (GH-136299) 2025-07-11 21:18:47 +03:00
Victor Stinner
2c9a8011c6
gh-135906: Test the internal C API in test_cext (#136247)
Remove duplicated definition: atexit_datacallbackfunc type
is already defined by Include/cpython/pylifecycle.h.
2025-07-11 16:48:43 +02:00
Victor Stinner
cbf007beeb
gh-136156: Remove tempfile test_link_tmpfile() (#136534)
It's not always possible to guarantee that the file was opened with
O_TMPFILE even if tempfile._O_TMPFILE_WORKS is true.
2025-07-11 16:45:31 +02:00
Ethan Furman
49365bd110
gh-107538: [Enum] fix handling of inverted/negative values (GH-132273)
* Fix flag mask inversion when unnamed flags exist.

For example:

    class Flag(enum.Flag):
        A = 0x01
        B = 0x02
        MASK = 0xff

    ~Flag.MASK is Flag(0)

* EJECT and KEEP flags (IntEnum is KEEP) use direct value.

* correct Flag inversion to only flip flag bits

IntFlag will flip all bits -- this only makes a difference in flag sets with
missing values.

* correct negative assigned values in flags

negative values are no longer used as-is, but become inverted; i.e.

    class Y(self.enum_type):
        A = auto()
        B = auto()
        C = ~A        # aka ~1 aka 0b1 110 (from enum.bin()) aka 6
        D = auto()

    assert Y.C. is Y.B|Y.D
2025-07-10 16:49:09 -07:00
Sergey Miryanov
c560df9658
gh-136517: Print uncollectable objects if DEBUG_UNCOLLECTABLE mode was set (#136518) 2025-07-10 22:13:23 +01:00
László Kiss Kollár
59acdba820
gh-135953: Implement sampling tool under profile.sample (#135998)
Implement a statistical sampling profiler that can profile external
Python processes by PID. Uses the _remote_debugging module and converts
the results to pstats-compatible format for analysis.


Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2025-07-10 18:44:24 +01:00
Dave Peck
f1b8d01c80
gh-132661: Add default value (of "") for Interpolation.expression (#136441) 2025-07-10 16:27:41 +02:00
Rogdham
f519918ec6
gh-136394: Fix race condition in test_zstd (GH-136432) 2025-07-10 08:47:27 -04:00
sobolevn
c176543349
gh-136438: Make sure test_builtins pass with all optimization levels (#136474) 2025-07-10 11:57:29 +03:00
Pablo Galindo Salgado
ea45a2f97c
gh-136476: Show the full stack in get_async_stack_trace in _remote_debugging (#136483) 2025-07-09 23:11:17 +00:00
Victor Stinner
92b33c9590
gh-136156: Skip test_tempfile.test_link_tmpfile() on Android (#136430)
Adds a test skip on platforms where hard links are not available (which includes Android).
2025-07-10 06:17:21 +08:00
Jelle Zijlstra
797abd1f7f
gh-134657: Remove newly added private names from asyncio.__all__ (#134665) 2025-07-09 13:25:46 +05:30
Neil Schemenauer
b6b99bf7f1
GH-91636: Clear weakrefs created by finalizers. (GH-136401)
Weakrefs to unreachable garbage that are created during running of
finalizers need to be cleared.  This avoids exposing objects that
have `tp_clear` called on them to Python-level code.
2025-07-08 12:19:57 -07:00
Hugo van Kemenade
bc9bc078df
Update bytecode magic number in tests for the 3.14 release candidate (#136427) 2025-07-08 20:11:48 +03:00
Victor Stinner
6c81e8c57a
gh-136156: Allow using linkat() with TemporaryFile (#136281)
tempfile.TemporaryFile() no longer uses os.O_EXCL with os.O_TMPFILE,
so it's possible to use linkat() on the file descriptor.
2025-07-08 18:39:47 +02:00
AN Long
490eea0281
gh-136380: Fix import behavior for concurrent.futures.InterpreterPoolExecutor (#136381)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-08 13:32:14 +00:00
Pablo Galindo Salgado
ba9c198630
gh-136186: Fix race condition in test_external_inspection.test_only_active_thread (#136347) 2025-07-08 13:23:31 +01:00
sobolevn
db699db99d
gh-136297: Fix hypothesis and subTest usage in test_zoneinfo_property.py (#136384) 2025-07-08 07:51:36 +00:00
Kumar Aditya
51934000ba
gh-117657: enable test_capi under TSAN (#136269) 2025-07-08 13:05:24 +05:30
Kumar Aditya
0240ef4705
gh-98388: add tests for happy eyeballs (#136368) 2025-07-07 23:30:27 +05:30
Serhiy Storchaka
b7aa2a4b4d
gh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (GH-136335)
On NetBSD, ndbm.open() does not fail for empty file.
2025-07-07 15:14:17 +03:00
Sergey B Kirpichev
3e849d75f4
gh-87790: support thousands separators for formatting fractional part of Fraction (#132204) 2025-07-07 11:16:31 +03:00
Sergey B Kirpichev
90a5b4402b
gh-87790: support thousands separators for formatting fractional part of Decimal (#132202)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-07 11:16:27 +03:00
Serhiy Storchaka
85b817da94
gh-136289: Fix test_sqlite3 on platforms with strict UTF-8 filesystem (GH-136326) 2025-07-07 06:29:00 +00:00
Jelle Zijlstra
9312702d2e
gh-136316: Make typing.evaluate_forward_ref better at evaluating nested forwardrefs (#136319) 2025-07-06 16:44:20 -07:00
sobolevn
c89f76e6c4
gh-136021: Make type_params a required parameter for typing._eval_type (#136332) 2025-07-06 22:11:13 +03:00
sobolevn
06e347b846
gh-136285: Improve pickle protocol testing in test_interpreters (#136286) 2025-07-06 07:35:30 +00:00
Emma Smith
5dac137b9f
gh-136315: Fix skipped multithreading test in test_zstd (#136320)
Fix skipped test in test_zstd
2025-07-05 17:32:28 +00:00
Victorien
5b56daa9d7
gh-130870: Preserve GenericAlias subclasses in typing.get_type_hints() (#131583) 2025-07-05 06:55:39 -07:00
sobolevn
5de7e3f973
gh-136297: Test all pickle protocols in test_zoneinfo_property.py (#136298) 2025-07-05 09:14:40 +03:00
Richard Levasseur
93263d4314
gh-135773: have pyvenv.cfg without home key anchor a venv and deduce home (#135831)
This is still formally undefined behaviour, but we may as well
keep the *same* undefined behaviour as previous versions.

PEP 796 proposes a cleaner and more consistent replacement for 3.15+
2025-07-04 23:44:37 +10:00
Serhiy Storchaka
8ac7613dc8
gh-102555: Fix comment parsing in HTMLParser according to the HTML5 standard (GH-135664)
* "--!>" now ends the comment.
* "-- >" no longer ends the comment.
* Support abnormally ended empty comments "<-->" and "<--->".

---------

Co-author: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-07-04 07:00:23 +00:00
Cody Maloney
48cb9b6112
gh-133982: Test _pyio.BytesIO in free-threaded tests (gh-136218) 2025-07-04 11:27:21 +09:00
Serhiy Storchaka
0243f97cba
gh-135661: Fix parsing start and end tags in HTMLParser according to the HTML5 standard (GH-135930)
* Whitespaces no longer accepted between `</` and the tag name.
  E.g. `</ script>` does not end the script section.

* Vertical tabulation (`\v`) and non-ASCII whitespaces no longer recognized
  as whitespaces. The only whitespaces are `\t\n\r\f `.

* Null character (U+0000) no longer ends the tag name.

* Attributes and slashes after the tag name in end tags are now ignored,
  instead of terminating after the first `>` in quoted attribute value.
  E.g. `</script/foo=">"/>`.

* Multiple slashes and whitespaces between the last attribute and closing `>`
  are now ignored in both start and end tags. E.g. `<a foo=bar/ //>`.

* Multiple `=` between attribute name and value are no longer collapsed.
  E.g. `<a foo==bar>` produces attribute "foo" with value "=bar".

* Whitespaces between the `=` separator and attribute name or value are no
  longer ignored. E.g. `<a foo =bar>` produces two attributes "foo" and
  "=bar", both with value None; `<a foo= bar>` produces two attributes:
  "foo" with value "" and "bar" with value None.

* Fix Sphinx errors.

* Apply suggestions from code review

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

* Address review comments.

* Move to Security.

---------

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2025-07-03 23:33:02 +03:00
Victor Stinner
da79ac9d26
gh-135075: Make PyObject_SetAttr() fail with NULL value and exception (#136180)
Make PyObject_SetAttr() and PyObject_SetAttrString() fail if called
with NULL value and an exception set.
2025-07-03 14:51:44 +02:00
Sergey B Kirpichev
c113a8e523
gh-130664: Treat '0' fill character with align '=' as zero-padding for Fraction's (GH-131067) 2025-07-03 13:57:31 +03:00
Kira
e0245c789f
gh-135640: Adds more type checking to ElementTree (GH-135643) 2025-07-03 10:48:47 +03:00
Serhiy Storchaka
9084b15156
gh-135836: Fix IndexError in asyncio.create_connection() (#135875) 2025-07-03 09:38:39 +05:30
sobolevn
41a9b46ad4
gh-136203: Improve TypeError msg when comparing two MappingProxyTypes (#136204)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-02 19:05:28 +03:00
sobolevn
ab7196a2f5
gh-136193: Improve TypeError msg when comparing two SimpleNamespaces (#136195)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-02 14:32:41 +03:00
Garry Cairns
51ab66b3d5
gh-134567: Add the formatter parameter in unittest.TestCase.assertLogs (GH-134570) 2025-07-02 09:51:19 +00:00
Ken Jin
b3308973e3
gh-136183: Deal with escapes in JIT optimizer's constant evaluator (GH-136184) 2025-07-02 14:08:25 +08:00
Serhiy Storchaka
86c3316183
gh-134280: Disable constant folding for ~ with a boolean argument (GH-134982)
This moves the deprecation warning from compile time to run time.
2025-07-01 20:24:04 +03:00
Stan Ulbrych
93809a918f
gh-105456: Remove 3 deprecated sre_* modules (#135994) 2025-07-01 17:31:07 +02:00
Zackery Spytz
12ce16bc13
gh-87298: Add tests for find_in_strong_cache() bug in _zoneinfo (GH-24829)
Co-authored-by: Paul Ganssle <p.ganssle@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-01 14:55:24 +00:00
heliang666s
0e19db653d
gh-135836: Fix IndexError in asyncio.create_connection with empty exceptions list (#135845)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-01 11:50:11 +00:00
Petr Viktorin
fe119a0817
gh-87135: threading.Lock: Raise rather than hang on Python finalization (GH-135991)
After Python finalization gets to the point where no other thread
can attach thread state, attempting to acquire a Python lock must hang.
Raise PythonFinalizationError instead of hanging.
2025-07-01 10:57:42 +02:00
Petr Viktorin
845263adc6
gh-133157: remove usage of _Py_NO_SANITIZE_UNDEFINED in pyexpat (#135346)
This was the last usage, so the macro is removed as well.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-07-01 10:54:08 +02:00
Cody Maloney
23caccf74c
gh-133982: Use implementation-specific open in test_fileio.OtherFileTests (GH-135364) 2025-06-30 17:56:11 -04:00
sobolevn
7e33558455
gh-135422: Fix regression in SyntaxError messages after #134036 (#135423) 2025-06-30 21:52:26 +03:00