Commit graph

125635 commits

Author SHA1 Message Date
Jun Komoda
145276a072
Add .. availability:: Windows directive to COM-related function prototype (GH-127436)
Add a directive to prototype that "returns a foreign function that will call a COM method"
2025-01-07 09:36:27 +01:00
Erlend E. Aasland
b3cbd8f1b5
gh-108202: Document calendar.Calendar.firstweekday (#128566) 2025-01-07 08:59:24 +01:00
Russell Keith-Magee
e837a1f71e
gh-128146: Exclude os/log.h import on older macOS versions. (#128165)
Reworks the handling of Apple system log handling to account for older macOS 
versions that don't provide os-log.
2025-01-07 13:12:58 +08:00
Zanie Blue
24b147a19b
gh-128472: Add -skip-funcs to BOLT options to fix computed goto errors (gh-128511)
* Add `-skip-funcs` to BOLT options to fix computed goto errors

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>

* NEWS

---------

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
2025-01-07 12:02:55 +09:00
Stan Ulbrych
953b49e546
gh-108202: Document calendar.Calendar methods getfirstweekday and setfirstweekday (#127579) 2025-01-07 00:38:45 +01:00
Michael H
7363476b64
gh-128559: Remove typing import from asyncio.timeouts (#128560) 2025-01-06 15:03:27 -08:00
Hood Chatham
61c1a2478e
gh-127146: Strip dash from Emscripten compiler version (#128557)
`emcc -dumpversion` will sometimes say e.g., `4.0.0-git` but in this case
uname does not include `-git` in the version string. Use cut to delete
everything after the dash.
2025-01-07 06:26:35 +08:00
Hood Chatham
616692d465
gh-127146: Skip Emscripten tests with pending fixes (#128549)
Marks some additional tests as skipped on Emscripten. Many of these skips can be
reverted when the next Emscripten release is available.
2025-01-07 06:25:29 +08:00
Mark Shannon
2434fd2d50
GH-128533: Add NOT_TAKEN instruction after bytecode optimization. (GH-128554) 2025-01-06 22:01:07 +00:00
Hood Chatham
b6c919b674
gh-127146: Fix test_sysconfigdata_json for Emscripten (#128556) 2025-01-06 19:45:14 +00:00
Mark Shannon
f826beca0c
GH-128375: Better instrument for FOR_ITER (GH-128445) 2025-01-06 17:54:47 +00:00
Mark Shannon
b9c693dcca
GH-128073: Include EXIT_IF when checking for escaping calls (GH-128537) 2025-01-06 14:16:22 +00:00
Victor Stinner
f89e5e20cb
gh-127350: Add Py_fopen() and Py_fclose() functions (#127821) 2025-01-06 12:43:09 +00:00
Kumar Aditya
7e8c571604
gh-128340: add thread safe handle for loop.call_soon_threadsafe (#128369)
Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.
2025-01-06 18:05:11 +05:30
Serhiy Storchaka
657d7b77e5
gh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder (GH-128451)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2025-01-06 13:28:50 +01:00
Bénédikt Tran
1ef6bf4e29
gh-111178: fix UBSan failures in Objects/descrobject.c (GH-128245)
fix UBSan failures for `propertyobject`
2025-01-06 12:50:01 +01:00
Serhiy Storchaka
8d15058d61
gh-77214: Update outdated documentation for numeric PyArg_Parse formats (GH-128454) 2025-01-06 12:50:28 +02:00
Jelle Zijlstra
d50fa0541b
gh-128089: Add PYC magic number for VALUE_WITH_FAKE_GLOBALS (#128097)
Assign 3610 PYC magic number to VALUE_WITH_FAKE_GLOBALS
format of annotationlib.
2025-01-06 10:30:42 +00:00
Sergey B Kirpichev
879d287f49
gh-102471: convert decimal module to use PyLong_Export API (PEP 757) (#128267) 2025-01-06 11:29:18 +01:00
Tomas R.
aef52ca8b3
gh-128519: Align the docstring of untokenize() to match the docs (#128521) 2025-01-06 08:42:26 +00:00
RanKKI
a62ba52f14
gh-98188: Fix EmailMessage.get_payload to decode data when CTE value has extra text (#127547)
Up to this point message handling has been very strict with regards to content encoding values: mixed case was accepted, but trailing blanks or other text would cause decoding failure, even if the first token was a valid encoding.  By Postel's Rule we should go ahead and decode as long as we can recognize that first token.  We have not thought of any security or backward compatibility concerns with this fix.

This fix does introduce a new technique/pattern to the Message code: we look to see if the header has a 'cte' attribute, and if so we use that.  This effectively promotes the header API exposed by HeaderRegistry to an API that any header parser "should" support.  This seems like a reasonable thing to do.  It is not, however, a requirement, as the string value of the header is still used if there is no cte attribute.

The full fix (ignore any trailing blanks or blank-separated trailing text) applies only to the non-compat32 API.  compat32 is only fixed to the extent that it now ignores trailing spaces.  Note that the HeaderRegistry parsing still records a HeaderDefect if there is extra text.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-05 20:32:16 -05:00
Yuki Kobayashi
3b231be8f0
Docs: fix MessageDefect references in email.policy docs (#128468) 2025-01-05 22:58:31 +01:00
Damien
2228e92da3
gh-128504: Upgrade doctest to ubuntu-24.04 (#128506)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-01-05 12:07:18 +00:00
Donghee Na
ae23a012e6
gh-128137: Update PyASCIIObject to handle interned field with the atomic operation (gh-128196) 2025-01-05 18:17:06 +09:00
Zanie Blue
b60044b838
gh-128437: Add BOLT_COMMON_FLAGS with -update-debug-sections (gh-128455)
Add `BOLT_COMMON_FLAGS` with `-update-debug-sections`

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
2025-01-05 13:16:30 +09:00
Erlend E. Aasland
0cafa97932
gh-115765: Document and enforce Autoconf 2.72 requirement (#128502) 2025-01-04 23:38:46 +00:00
Beomsoo Kim
e8b6b39ff7
gh-127553: Remove outdated TODO comment in _pydatetime (#127564) 2025-01-04 23:38:49 +01:00
RUANG (James Roy)
8ade15343d
gh-127954: Document PyObject_DelItemString (#127986) 2025-01-04 21:48:20 +01:00
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