Commit Graph

124907 Commits

Author SHA1 Message Date
Erlend E. Aasland 87ee76062a
Docs: amend json.dump() post gh-128482 (#128489) 2025-01-04 19:57:59 +01:00
Stan Ulbrych f28d471fbe
gh-126719: Clarify math.fmod docs (#127741)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-04 18:38:57 +01:00
Barney Gale fd94c6a803
pathlib tests: create `walk()` test hierarchy without using class under test (#128338)
In the tests for `pathlib.Path.walk()`, avoid using the path class under
test (`self.cls`) in test setup. Instead we use `os` functions in
`test_pathlib`, and direct manipulation of `DummyPath` internal data in
`test_pathlib_abc`.
2025-01-04 15:45:24 +00:00
Erlend E. Aasland a0088b40bb
Docs: mark up json.dump() using parameter list (#128482)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-01-04 15:44:34 +00:00
Barney Gale 95352dcb93
GH-127381: pathlib ABCs: remove `PathBase.move()` and `move_into()` (#128337)
These methods combine `_delete()` and `copy()`, but `_delete()` isn't part
of the public interface, and it's unlikely to be added until the pathlib
ABCs are made official, or perhaps even later.
2025-01-04 12:53:51 +00:00
Erlend E. Aasland a4e773c540
gh-128152: Argument Clinic: ignore pre-processor directives inside C comments (#128464) 2025-01-04 11:46:04 +01:00
sobolevn 03ede5afe2
Add `check-readthedocs` pre-commit hook (#128453) 2025-01-04 13:31:01 +03:00
Kumar Aditya 513a4efa75
gh-128002: fix many thread safety issues in asyncio (#128147)
* Makes `_asyncio.Task` and `_asyncio.Future` thread-safe by adding critical sections
* Add assertions to check for thread safety checking locking of object by critical sections in internal functions
* Make `_asyncio.all_tasks` thread safe when eager tasks are used
* Add a thread safety test
2025-01-04 14:18:22 +05:30
Sam Gross f1574859d7
gh-125985: Fix `cmodule_function()` scaling benchmark (#128460)
Add a separate benchmark that measures the effect of
`_PyObject_LookupSpecial()` on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I
unintentionally changed the "cmodule_function" benchmark to pass an
`int` to `math.floor()` instead of a `float`, which causes it to use the
`_PyObject_LookupSpecial()` code path. `_PyObject_LookupSpecial()` has
its own scaling issues that we want to measure separately from calling a
function on a C module.
2025-01-03 21:48:47 +00:00
Zanie Blue b75ed951d4
gh-128354: Consistently use LIBS over LDFLAGS in library build checks (#128359) 2025-01-03 21:51:06 +01:00
Zanie Blue 4974bbdb29
gh-128456: Use '-reorder-functions=cdsort' for BOLT builds (#128457)
'hfsort+' is deprecated in favor of 'cdsort'.
2025-01-03 20:49:50 +00:00
Peter Bierma befcfdfdab
gh-128400: Only show the current thread in `faulthandler` if the GIL is disabled (GH-128425) 2025-01-03 14:14:57 -05:00
Alexander Shadchin 46cb6340d7
gh-127903: Fix a crash on debug builds when calling `Objects/unicodeobject::_copy_characters`` (#127876) 2025-01-03 18:47:58 +00:00
Bénédikt Tran 4c14f03495
gh-89083: improve UUIDv8 uniqueness tests (GH-128149)
improve UUIDv8 uniqueness tests
2025-01-03 15:51:22 +01:00
Bénédikt Tran 1c9b020479
gh-111178: fix UBSan failures in `Modules/zlibmodule.c` (GH-128252) 2025-01-03 15:36:41 +01:00
Bénédikt Tran 5643032053
gh-111178: fix UBSan failures in `Objects/tupleobject.c` (GH-128251)
fix UBSan failures for `_PyTupleIterObject`
2025-01-03 15:35:05 +01:00
Bénédikt Tran aad5ba4b6a
gh-111178: fix UBSan failures in `Objects/enumobject.c` (GH-128246)
* fix UBSan failures for `enumobject`
* fix UBSan failures for `reversedobject`
2025-01-03 15:29:41 +01:00
Bénédikt Tran 621d4ff35e
gh-111178: fix UBSan failures in `Modules/curses*.c` (GH-128244)
* fix UBSan failures in `_cursesmodule.c`
* fix UBSan failures in `_curses_panel.c`
* suppress an unused return value
2025-01-03 15:12:40 +01:00
Bénédikt Tran 8522f8bacb
gh-111178: fix UBSan failures in `Modules/_csv.c` (GH-128243)
Also: suppress unused return values
2025-01-03 15:04:33 +01:00
Rian Hunter b4f799b1e7
gh-112015: Implement `ctypes.memoryview_at()` (GH-112018)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-03 14:07:07 +01:00
Hugo van Kemenade f21af186bf
gh-128317: Highlight today in colour in calendar CLI output (#128318)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-03 14:56:24 +02:00
Bénédikt Tran fa985bee61
gh-127787: refactor helpers for `PyUnicodeErrorObject` internal interface (GH-127789)
- Unify `get_unicode` and `get_string` in a single function.

- Allow to retrieve the underlying `object` attribute, its
  size, and the adjusted 'start' and 'end', all at once.
  Add a new `_PyUnicodeError_GetParams` internal function for this.
  (In `exceptions.c`, it's somewhat common to not need all the attributes,
  but the compiler has opportunity to inline the function and optimize
  unneeded work away. Outside that file, we'll usually need all or
  most of them at once.)

- Use a common implementation for the following functions:

  - `PyUnicode{Decode,Encode}Error_GetEncoding`
  - `PyUnicode{Decode,Encode,Translate}Error_GetObject`
  - `PyUnicode{Decode,Encode,Translate}Error_{Get,Set}Reason`
  - `PyUnicode{Decode,Encode,Translate}Error_{Get,Set}{Start,End}`
2025-01-03 13:37:02 +01:00
Erlend E. Aasland 8abd6cef68
gh-115765: Upgrade to GNU Autoconf 2.72 (#128411) 2025-01-03 11:37:54 +00:00
Thomas Grainger 4ed36d6efb
gh-128404: Remove `asyncio` from `Lib/test/test_sys_settrace` (#128435) 2025-01-03 12:33:35 +02:00
jb2170 830e10651b
gh-127529: Correct asyncio's `accept_connection` behaviour for handling `ConnectionAbortedError` (#127532)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-03 10:32:36 +00:00
Zanie Blue bb2dfadb92
gh-128104: Remove `Py_STRFTIME_C99_SUPPORT`; require C99-compliant strftime (#128106) 2025-01-03 11:04:03 +01:00
Stan Ulbrych bb73426caf
gh-108202: Document calendar.TextCalendar formatting helpers (#127608)
Document the following TextCalendar methods:
- formatday()
- formatmonthname()
- formatweekday()
- formatweekheader()
2025-01-03 10:57:15 +01:00
Abhijeet 0706bab1c0
gh-128133: use relaxed atomics for hash of bytes (#128412) 2025-01-03 13:50:56 +05:30
Thomas Grainger b49c68a1b3
gh-128404: remove asyncio from test_type_params (#128436) 2025-01-03 07:50:24 +00:00
Nathan Goldbaum e7adeecc2b
gh-128426: Mention PySequence_Fast in free-threading C API HOWTO (#128428) 2025-01-03 13:10:24 +05:30
Sam Gross 8eebe4e6d0
gh-128212: Fix race in `_PyUnicode_CheckConsistency` (GH-128367)
There was a data race on the utf8 field between `PyUnicode_SET_UTF8` and
`_PyUnicode_CheckConsistency`. Use the `_PyUnicode_UTF8()` accessor,
which uses an atomic load internally, to avoid the data race.
2025-01-02 14:02:54 -05:00
Peter Bierma c9356feef2
gh-128400: Stop-the-world when manually calling `faulthandler` (GH-128422) 2025-01-02 13:56:01 -05:00
Anders Kaseorg a626f9a67b
Remove asserts that confuse `enum _framestate` with `enum _frameowner` (GH-124148)
The `owner` field of `_PyInterpreterFrame` is supposed to be a member of
`enum _frameowner`, but `FRAME_CLEARED` is a member of `enum _framestate`.

At present, it happens that `FRAME_CLEARED` is not numerically equal to any
member of `enum _frameowner`, but that could change in the future. The code
that incorrectly assigned `owner = FRAME_CLEARED` was deleted in commit
a53cc3f494 (GH-116687). Remove the incorrect
checks for `owner != FRAME_CLEARED` as well.
2025-01-02 16:55:33 +00:00
Zhikang Yan 58e9f95c4a
gh-128014: Fix passing default='' to the tkinter method wm_iconbitmap() (GH-128015)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-01-02 17:51:57 +02:00
Hugo van Kemenade c9d2bc6d7f
Revert "Doc: Show object descriptions in the table of contents (#125757)" (#128406) 2025-01-02 14:35:00 +00:00
Thomas Grainger 9ba0528537
gh-128404: Remove ``asyncio`` from ``test_builtin`` (#128403)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-02 15:00:26 +02:00
Sebastian Pipping 8e48a6edc7
gh-126624: Expose error code ``XML_ERROR_NOT_STARTED`` of Expat >=2.6.4 (#126625)
Expose error code ``XML_ERROR_NOT_STARTED`` in `xml.parsers.expat.errors` which was
introduced in Expat 2.6.4.


Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-02 14:54:38 +02:00
Serhiy Storchaka a3711d1541
gh-124130: Fix a bug in matching regular expression \B in empty string (GH-127007) 2025-01-02 12:11:21 +00:00
Serhiy Storchaka 8d16919a06
gh-123925: Fix building curses on platforms without libncursesw (GH-128405) 2025-01-02 13:38:21 +02:00
Shin-myoung-serp e1baa778f6
gh-95371: Add support for other image formats(e.g. PNG) to the turtle… (#95378)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2025-01-02 11:45:07 +02:00
abkmystery 60c6518469
gh-128349: Use `.. data::` instead of `.. class::` for pre-defined decimal `Context` objects (#128379) 2025-01-02 09:20:31 +02:00
qqwqqw689 c810ed7c8e
gh-126469: remove unnecessary error-checking branch in `lexer.c` (#126473) 2025-01-01 22:11:29 +00:00
RUANG (James Roy) a327810169
Fix while statements with non-bool conditions in `_pyrepl` (#127509)
Fix non-bool value conditions
2025-01-01 20:39:28 +00:00
Kumar Aditya bb9d955e16
gh-128277: remove unnecessary critical section from `socket.close` (#128305)
Remove unnecessary critical section from `socket.close` as it now uses relaxed atomics for `sock_fd`.
2025-01-01 18:00:47 +05:30
Kirill Podoprigora d903b17499
gh-121676: Raise a ``DeprecationWarning`` if the Python implementation of ``functools.reduce`` is called with `function` or `sequence` as a keyword args (#121677)
Python implementation of `functools` allows calling `reduce`
with `function` or `sequence` as keyword args. This doesn't
match behavior of our C accelerator and our documentation
for `functools.reduce` states that `function`and `sequence`
are positional-only arguments.

Now calling a Python implementation of `functools.reduce`
with `function` or `sequence` as keyword args would raise
a `DeprecationWarning` and is planned to be prohibited in
Python 3.16.


Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-01 13:36:47 +02:00
Stan Ulbrych c5438fdf47
Reword `about.rst` to not limit Sphinx (#128325)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-12-31 23:22:33 +02:00
Kumar Aditya e389d6c650
gh-128277: make globals variables thread safe in socket module (#128286) 2024-12-31 19:10:06 +05:30
Serhiy Storchaka b2ac70a62a
gh-88834: Unify the instance check for typing.Union and types.UnionType (GH-128363)
Union now uses the instance checks against its parameters instead of
the subclass checks.
2024-12-31 10:02:58 +02:00
Kumar Aditya 7c72c1f0df
gh-128277: use relaxed atomics for `sock_fd` (#128304) 2024-12-31 11:50:35 +05:30
Ken Jin 7ef4907412
gh-128262: Allow specialization of calls to classes with __slots__ (GH-128263) 2024-12-31 12:24:17 +08:00