Commit graph

15393 commits

Author SHA1 Message Date
Victor Stinner
446587c58e
gh-129813, PEP 782: Use PyBytesWriter in _ssl (#138929)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-18 16:54:18 +02:00
Sergey B Kirpichev
b0a8073f1b
gh-73487: Convert _decimal to use Argument Clinic (part 7) (#138221)
Use "defining class" converter, where possible.
2025-09-18 16:08:27 +02:00
Adam Turner
1ebd726c9b
gh-64490: Argument Clinic: Add support for `**kwds` (#138344)
This adds a scaffold of support, initially only working with
strictly positional-only arguments. The FASTCALL calling
convention is not yet supported.
2025-09-18 13:31:42 +00:00
Victor Stinner
243d599a05
gh-129813, PEP 782: Use PyBytesWriter in _sqlite (#138956)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.
2025-09-18 14:58:35 +02:00
Peter Bierma
2191497933
gh-136003: Execute pre-finalization callbacks in a loop (GH-136004) 2025-09-18 08:29:12 -04:00
Victor Stinner
d6a6fe2a5b
gh-129813, PEP 782: Use PyBytesWriter in ssl.MemoryBIO (#139113)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-18 14:25:31 +02:00
Peter Bierma
49f1c302df
gh-139098: Use multiphase initialization in _testcapi (GH-139102)
Use multiphase initialization in the _testcapi module to allow loading in subinterpreters. The isolation here isn't perfect as there's still some use of globals, but _testcapi should generally work in other interpreters.
2025-09-18 11:00:50 +00:00
Stan Ulbrych
70ad1b30df
gh-138998: expat/refresh.sh: Fail if Step 3 is not completed (GH-139049) 2025-09-18 12:47:42 +02:00
Cody Maloney
db68bfc771
gh-138720: Make Buffered closed check match flush (GH-138724)
In `_io__Buffered_flush_impl` the macro `CHECK_CLOSED` is used to check
the `buffered*` is in a good state to be flushed. That differs slightly
from `buffered_closed`.

In some cases, that difference would result in `close()` thinking the
file needed to be flushed and closed while `flush()` thought the file
was already closed.

This could happen during GC and would result in an unraisable exception.
2025-09-18 12:02:29 +02:00
Erlend E. Aasland
d1904b91cb
gh-116943: Ensure makesetup does not choke on missing EOL in Setup.* files (#139100) 2025-09-18 09:25:01 +00:00
Victor Stinner
4263bc3b3b
gh-129813, PEP 782: Use PyBytesWriter in _socket (#139097)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-18 11:20:56 +02:00
Raymond Hettinger
c25400a4b6
Revert gh-139075. The sumprod fix needs more work. (gh-139092) 2025-09-18 02:05:27 -05:00
Raymond Hettinger
b485e50fde
gh-139074: Fix missing high precision case in sumprod() (gh-139075) 2025-09-17 16:50:15 -05:00
Stefan Tatschner
a9b6b09141
gh-86819: Add ISO-TP CAN socket constants (#23794)
Co-authored-by: Stefan Tatschner <stefan@rumpelsepp.org>
Co-authored-by: Patrick Menschel <menschel.p@posteo.de>
2025-09-17 17:18:04 +00:00
Adam Turner
4b78fe9665
GH-137630: Convert `_interpqueues` to use Argument Clinic (#137685) 2025-09-17 17:35:00 +01:00
Victor Stinner
82e1920a01
gh-129813, PEP 782: Use PyBytesWriter in _testclinic (#139048)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.
2025-09-17 17:55:30 +02:00
chiri
8eb106240f
gh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and naming (#138738)
The 'row' parameter represents a ROWID. Clarify this in docs and docstrings.
2025-09-17 15:51:14 +00:00
Victor Stinner
77a22ef76a
gh-129813, PEP 782: Use PyBytesWriter in _multiprocessing (#139047)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

Change also 'read' variable type from int to Py_ssize_t.
2025-09-17 17:44:13 +02:00
Stan Ulbrych
64c876dd68
gh-138998: Upgrade vendored expat to 2.7.2 (#138999) 2025-09-17 13:46:35 +03:00
AN Long
6393068bde
fix some typos (#138977) 2025-09-16 18:33:39 +05:30
Stan Ulbrych
fc3e22a06c
gh-88473: Implement fast path in date.today() for date types (#130980)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-16 10:28:54 +01:00
Victor Stinner
4554486f15
gh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#138954)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-15 21:50:09 +00:00
Victor Stinner
e814e6b38b
gh-129813, PEP 782: Use PyBytesWriter in FileIO.read() (#138955)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-15 23:49:28 +02:00
Victor Stinner
f62b495f79
gh-129813, PEP 782: Use PyBytesWriter in _sha3 (#138923)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.
2025-09-15 22:53:03 +02:00
Cody Maloney
71defb6943
gh-129813, PEP 782: Use PyBytesWriter in _io.FileIO.readall (#138901)
Performance about the same, using the benchmark from gh-120754:

```
pyperf compare_to main.json pep782.json
read_file_small: Mean +- std dev: [main] 5.71 us +- 0.05 us -> [pep782] 5.68 us +- 0.05 us: 1.01x faster
read_file_large: Mean +- std dev: [main] 89.7 us +- 0.9 us -> [pep782] 86.9 us +- 0.8 us: 1.03x faster
read_all_rst_bytes: Mean +- std dev: [main] 926 us +- 8 us -> [pep782] 920 us +- 12 us: 1.01x faster
read_all_rst_text: Mean +- std dev: [main] 2.24 ms +- 0.02 ms -> [pep782] 2.17 ms +- 0.04 ms: 1.03x faster

Benchmark hidden because not significant (1): read_all_py_bytes

Geometric mean: 1.01x faster
```
2025-09-15 22:38:01 +02:00
Victor Stinner
c5fb72ea6c
gh-129813, PEP 782: Use PyBytesWriter in _winapi.PeekNamedPipe() (#138930)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-15 21:25:47 +01:00
Mehdi Hassan
dfd52e7a8b
gh-97517: Add documentation links to datetime strftime/strptime docstrings (#138559)
* Add documentation links to datetime strftime/strptime docstrings

- Add links to format codes documentation for all strftime methods
- Add links to format codes documentation for all strptime methods
- Addresses issue #97517

* Update C extension docstrings with format codes documentation

* Regenerate clinic code for updated docstrings

* Add clinic-generated header file for updated docstrings

* Fix docstring spacing consistency in both Python and C files

* Update Lib/_pydatetime.py

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-15 19:50:46 +01:00
Victor Stinner
a68efdf09c
gh-129813, PEP 782: Use PyBytesWriter in _hashopenssl (#138922)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.
2025-09-15 18:41:43 +02:00
Serhiy Storchaka
07d0b95b05
gh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523)
Handle ECANCELED in the same way as EINTR to work around the Posix
violation in the NetBSD's implementation.
2025-09-15 19:20:31 +03:00
Serhiy Storchaka
a003112821
gh-138712: Add os.NODEV (GH-138728) 2025-09-15 14:36:32 +00:00
Victor Stinner
67cc1cf68a
gh-129813, PEP 782: Use PyBytesWriter in _codecs.escape_decode() (#138919)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-15 16:32:43 +02:00
Victor Stinner
21c80cadc8
gh-129813, PEP 782: Use PyBytesWriter in _curses (#138920)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-15 16:24:34 +02:00
Victor Stinner
f07ae274b8
gh-129813, PEP 782: Use PyBytesWriter in fcntl (#138921)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

Don't build the fcntl with the limited C API anymore, since
the PyBytesWriter API is not part of the limited C API.
2025-09-15 16:21:43 +02:00
Serhiy Storchaka
43013f72f0
gh-138779: Use the dev_t converter for st_rdev (GH-138780)
This allows to support device numbers larger than 2**63-1.
2025-09-15 17:07:34 +03:00
Abdul
aa9ceb1721
gh-137017: Ensure Thread.is_alive() only returns False after the underlying OS thread exits (gh-137315) 2025-09-15 11:13:37 +00:00
Pablo Galindo Salgado
f01181b595
gh-138794: Communicate to PyRefTracer when they are being replaced (#138797) 2025-09-15 11:12:09 +01:00
Victor Stinner
7168e98c80
gh-129813, PEP 782: Use PyBytesWriter in lzma and zlib (#138832)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.
2025-09-13 19:27:04 +02:00
Victor Stinner
af386fd361
gh-129813, PEP 782: Use PyBytesWriter in posix extension (#138829)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-13 18:57:46 +02:00
Victor Stinner
bb743b684b
gh-129813, PEP 782: Use PyBytesWriter in socket and mmap (#138831)
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.
2025-09-13 18:31:26 +02:00
Victor Stinner
06b7891f12
gh-129813, PEP 782: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#138830)
Replace PyBytes_FromStringAndSize(NULL, 0) with
Py_GetConstant(Py_CONSTANT_EMPTY_BYTES). Py_GetConstant() cannot
fail.
2025-09-13 18:30:25 +02:00
Victor Stinner
a65236bb39
gh-129813, PEP 782: Use PyBytesWriter in pickle and struct (#138833)
Replace the private _PyBytesWriter API with the new public
PyBytesWriter API.
2025-09-13 18:26:49 +02:00
Victor Stinner
ca99af3c5e
gh-129813, PEP 782: Use PyBytesWriter in binascii (#138825)
Replace the private _PyBytesWriter API with the new public
PyBytesWriter API.
2025-09-13 18:25:16 +02:00
Victor Stinner
eec8c98d06
gh-129813, PEP 782: Use PyBytesWriter in _hashopenssl (#138835)
Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.
2025-09-12 15:39:16 +02:00
Victor Stinner
c3fca5d478
gh-129813, PEP 782: Add PyBytesWriter_Format() (#138824)
Modify PyBytes_FromFormatV() to use the public PyBytesWriter API
rather than the _PyBytesWriter private API.
2025-09-12 14:21:57 +02:00
Victor Stinner
adb414044f
gh-129813, PEP 782: Add PyBytesWriter C API (#138822) 2025-09-12 13:41:59 +02:00
Peter Bierma
f96f7c9f5b
Revert "gh-116946: fully implement GC protocol for _tkinter.Tk{app,tt}Object (#138331)" (#138807)
This reverts commit 283380a941.
2025-09-11 17:05:37 -04:00
Benjamin Peterson
5bd4bf04c4
closes gh-138706: update Unicode to 17.0.0 (#138719) 2025-09-11 09:58:39 -07:00
Bénédikt Tran
283380a941
gh-116946: fully implement GC protocol for _tkinter.Tk{app,tt}Object (#138331) 2025-09-11 12:59:30 +02:00
Bénédikt Tran
4978bfca10
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types (#138582)
The following types are now immutable:

* `_curses_panel.panel`,
* `[posix,nt].ScandirIterator`, `[posix,nt].DirEntry` (exposed in `os.py`),
* `_remote_debugging.RemoteUnwinder`,
* `_tkinter.Tcl_Obj`, `_tkinter.tkapp`, `_tkinter.tktimertoken`,
* `zlib.Compress`, and `zlib.Decompress`.
2025-09-11 09:56:20 +02:00
Dung Nguyen
1ce05537a3
gh-138008: Fix segfaults in _ctypes due to invalid argtypes (GH-138285)
Signed-off-by: Nguyen Viet Dung <29406816+magnified103@users.noreply.github.com>
Signed-off-by: Nguyen Viet Dung <dung@ekluster.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
2025-09-10 14:01:19 +02:00