Skip to content

Commit 207bb60

Browse files
authored
Merge branch 'main' into gh-161199-textio-line-endings
2 parents 3c251ea + 6d69297 commit 207bb60

76 files changed

Lines changed: 2626 additions & 429 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/CODEOWNERS‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,13 @@ Doc/library/importlib.resources.rst @jaraco @warsaw @FFY00
510510
Lib/importlib/resources/ @jaraco @warsaw @FFY00
511511
Lib/test/test_importlib/resources/ @jaraco @warsaw @FFY00
512512

513+
# IO
514+
Doc/library/io.rst @cmaloney
515+
Lib/_pyio.py @cmaloney
516+
Lib/io.py @cmaloney
517+
Lib/test/test_io/ @cmaloney
518+
Modules/_io/ @cmaloney
519+
513520
# Itertools
514521
Doc/library/itertools.rst @rhettinger
515522
Lib/test/test_itertools.py @rhettinger

‎.github/workflows/reusable-emscripten.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
f.write(f"node-version={config['node-version']}\n")
4040
f.write(f"deps-hash={h.hexdigest()}\n")
4141
with open(os.environ["GITHUB_ENV"], "a") as f:
42-
f.write(f"EMSDK_CACHE={emsdk_cache}\n")
42+
f.write(f"PY_EMSDK_CACHE={emsdk_cache}\n")
4343
- name: "Install Node.js"
4444
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
4545
with:
@@ -48,7 +48,7 @@ jobs:
4848
id: emsdk-cache
4949
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
5050
with:
51-
path: ${{ env.EMSDK_CACHE }}
51+
path: ${{ env.PY_EMSDK_CACHE }}
5252
key: emsdk-${{ steps.emscripten-config.outputs.emscripten-version }}-${{ steps.emscripten-config.outputs.deps-hash }}
5353
restore-keys: emsdk-${{ steps.emscripten-config.outputs.emscripten-version }}
5454
- name: "Install Python"

‎Doc/c-api/init_config.rst‎

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
155155
* Set *\*value*, and return ``0`` on success.
156156
* Set an error in *config* and return ``-1`` on error.
157157
158-
*\*value* can be set to ``NULL`` if the option is an optional string and the
159-
option is unset.
158+
*\*value* can be set to ``NULL`` if the option is unset or if the option is
159+
an optional string.
160+
Optional strings are documented with the type ``str | None`` in the
161+
:ref:`Configuration Options <pyinitconfig-opts>` table.
160162
161163
On success, the string must be released with ``free(value)`` if it's not
162164
``NULL``.
@@ -204,6 +206,9 @@ only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the
204206
Set a string configuration option from a null-terminated UTF-8
205207
encoded string. The string is copied.
206208
209+
Options documented with the type ``str | None`` in the :ref:`Configuration
210+
Options <pyinitconfig-opts>` table can be set to ``NULL``.
211+
207212
* Return ``0`` on success.
208213
* Set an error in *config* and return ``-1`` on error.
209214
@@ -275,15 +280,15 @@ Configuration Options
275280
- Public
276281
* - ``"base_exec_prefix"``
277282
- :c:member:`base_exec_prefix <PyConfig.base_exec_prefix>`
278-
- ``str``
283+
- ``str | None``
279284
- Public
280285
* - ``"base_executable"``
281286
- :c:member:`base_executable <PyConfig.base_executable>`
282-
- ``str``
287+
- ``str | None``
283288
- Public
284289
* - ``"base_prefix"``
285290
- :c:member:`base_prefix <PyConfig.base_prefix>`
286-
- ``str``
291+
- ``str | None``
287292
- Public
288293
* - ``"buffered_stdio"``
289294
- :c:member:`buffered_stdio <PyConfig.buffered_stdio>`
@@ -331,15 +336,15 @@ Configuration Options
331336
- Read-only
332337
* - ``"dump_refs_file"``
333338
- :c:member:`dump_refs_file <PyConfig.dump_refs_file>`
334-
- ``str``
339+
- ``str | None``
335340
- Read-only
336341
* - ``"exec_prefix"``
337342
- :c:member:`exec_prefix <PyConfig.exec_prefix>`
338-
- ``str``
343+
- ``str | None``
339344
- Public
340345
* - ``"executable"``
341346
- :c:member:`executable <PyConfig.executable>`
342-
- ``str``
347+
- ``str | None``
343348
- Public
344349
* - ``"faulthandler"``
345350
- :c:member:`faulthandler <PyConfig.faulthandler>`
@@ -359,7 +364,7 @@ Configuration Options
359364
- Read-only
360365
* - ``"home"``
361366
- :c:member:`home <PyConfig.home>`
362-
- ``str``
367+
- ``str | None``
363368
- Read-only
364369
* - ``"import_time"``
365370
- :c:member:`import_time <PyConfig.import_time>`
@@ -431,35 +436,35 @@ Configuration Options
431436
- Public
432437
* - ``"prefix"``
433438
- :c:member:`prefix <PyConfig.prefix>`
434-
- ``str``
439+
- ``str | None``
435440
- Public
436441
* - ``"program_name"``
437442
- :c:member:`program_name <PyConfig.program_name>`
438443
- ``str``
439444
- Read-only
440445
* - ``"pycache_prefix"``
441446
- :c:member:`pycache_prefix <PyConfig.pycache_prefix>`
442-
- ``str``
447+
- ``str | None``
443448
- Public
444449
* - ``"quiet"``
445450
- :c:member:`quiet <PyConfig.quiet>`
446451
- ``bool``
447452
- Public
448453
* - ``"run_command"``
449454
- :c:member:`run_command <PyConfig.run_command>`
450-
- ``str``
455+
- ``str | None``
451456
- Read-only
452457
* - ``"run_filename"``
453458
- :c:member:`run_filename <PyConfig.run_filename>`
454-
- ``str``
459+
- ``str | None``
455460
- Read-only
456461
* - ``"run_module"``
457462
- :c:member:`run_module <PyConfig.run_module>`
458-
- ``str``
463+
- ``str | None``
459464
- Read-only
460465
* - ``"run_presite"``
461466
- :c:member:`run_presite <PyConfig.run_presite>`
462-
- ``str``
467+
- ``str | None``
463468
- Read-only
464469
* - ``"safe_path"``
465470
- :c:member:`safe_path <PyConfig.safe_path>`
@@ -479,15 +484,15 @@ Configuration Options
479484
- Read-only
480485
* - ``"stdio_encoding"``
481486
- :c:member:`stdio_encoding <PyConfig.stdio_encoding>`
482-
- ``str``
487+
- ``str | None``
483488
- Read-only
484489
* - ``"stdio_errors"``
485490
- :c:member:`stdio_errors <PyConfig.stdio_errors>`
486491
- ``str``
487492
- Read-only
488493
* - ``"stdlib_dir"``
489494
- :c:member:`stdlib_dir <PyConfig.stdlib_dir>`
490-
- ``str``
495+
- ``str | None``
491496
- Public
492497
* - ``"tracemalloc"``
493498
- :c:member:`tracemalloc <PyConfig.tracemalloc>`
@@ -542,6 +547,9 @@ Configuration Options
542547
- ``bool``
543548
- Read-only
544549
550+
The type ``str | None`` means that the option is an optional string which can
551+
be set to ``NULL``.
552+
545553
Visibility:
546554
547555
* Public: Can be retrieved by :c:func:`PyConfig_Get` and set by

‎Doc/library/__main__.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _`__main__`:
2+
13
:mod:`!__main__` --- Top-level code environment
24
===============================================
35

‎Doc/library/asyncio-protocol.rst‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,14 @@ received data, and close the connection::
737737
class EchoServerProtocol(asyncio.Protocol):
738738
def connection_made(self, transport):
739739
peername = transport.get_extra_info('peername')
740-
print('Connection from {}'.format(peername))
740+
print(f'Connection from {peername}')
741741
self.transport = transport
742742

743743
def data_received(self, data):
744744
message = data.decode()
745-
print('Data received: {!r}'.format(message))
745+
print(f'Data received: {message!r}')
746746

747-
print('Send: {!r}'.format(message))
747+
print(f'Send: {message!r}')
748748
self.transport.write(data)
749749

750750
print('Close the client socket')
@@ -790,10 +790,10 @@ data, and waits until the connection is closed::
790790

791791
def connection_made(self, transport):
792792
transport.write(self.message.encode())
793-
print('Data sent: {!r}'.format(self.message))
793+
print(f'Data sent: {message!r}')
794794

795795
def data_received(self, data):
796-
print('Data received: {!r}'.format(data.decode()))
796+
print(f'Data received: {data.decode()!r}')
797797

798798
def connection_lost(self, exc):
799799
print('The server closed the connection')
@@ -846,8 +846,8 @@ method, sends back received data::
846846

847847
def datagram_received(self, data, addr):
848848
message = data.decode()
849-
print('Received %r from %s' % (message, addr))
850-
print('Send %r to %s' % (message, addr))
849+
print(f'Received {message!r} from {addr}')
850+
print(f'Send {message!r} to {addr}')
851851
self.transport.sendto(data, addr)
852852

853853

‎Doc/pylock.toml‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e
167167

168168
[[packages]]
169169
name = "docutils"
170-
version = "0.21.2"
171-
sdist = { url = "https://files.pythonhosted.org/packages/ae/ed/aefcc8cd0ba62a0560c3c18c33925362d46c6075480bfa4df87b28e169a9/docutils-0.21.2.tar.gz", upload-time = 2024-04-23T18:57:18Z, size = 2204444, hashes = { sha256 = "3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f" } }
172-
wheels = [{ url = "https://files.pythonhosted.org/packages/8f/d7/9322c609343d929e75e7e5e6255e614fcc67572cfd083959cdef3b7aad79/docutils-0.21.2-py3-none-any.whl", upload-time = 2024-04-23T18:57:14Z, size = 587408, hashes = { sha256 = "dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2" } }]
170+
version = "0.22.4"
171+
sdist = { url = "https://files.pythonhosted.org/packages/ae/b6/03bb70946330e88ffec97aefd3ea75ba575cb2e762061e0e62a213befee8/docutils-0.22.4.tar.gz", upload-time = 2025-12-18T19:00:26Z, size = 2291750, hashes = { sha256 = "4db53b1fde9abecbb74d91230d32ab626d94f6badfc575d6db9194a49df29968" } }
172+
wheels = [{ url = "https://files.pythonhosted.org/packages/02/10/5da547df7a391dcde17f59520a231527b8571e6f46fc8efb02ccb370ab12/docutils-0.22.4-py3-none-any.whl", upload-time = 2025-12-18T19:00:18Z, size = 633196, hashes = { sha256 = "d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de" } }]
173173

174174
[[packages]]
175175
name = "idna"
@@ -236,12 +236,6 @@ version = "4.1.0"
236236
sdist = { url = "https://files.pythonhosted.org/packages/ae/f9/41dc953bbeb056c17d5f7a519f50fdf010bd0553be2d630bc69d1e022703/roman_numerals-4.1.0.tar.gz", upload-time = 2025-12-17T18:25:34Z, size = 9077, hashes = { sha256 = "1af8b147eb1405d5839e78aeb93131690495fe9da5c91856cb33ad55a7f1e5b2" } }
237237
wheels = [{ url = "https://files.pythonhosted.org/packages/04/54/6f679c435d28e0a568d8e8a7c0a93a09010818634c3c3907fc98d8983770/roman_numerals-4.1.0-py3-none-any.whl", upload-time = 2025-12-17T18:25:33Z, size = 7676, hashes = { sha256 = "647ba99caddc2cc1e55a51e4360689115551bf4476d90e8162cf8c345fe233c7" } }]
238238

239-
[[packages]]
240-
name = "roman-numerals-py"
241-
version = "4.1.0"
242-
sdist = { url = "https://files.pythonhosted.org/packages/cb/b5/de96fca640f4f656eb79bbee0e79aeec52e3e0e359f8a3e6a0d366378b64/roman_numerals_py-4.1.0.tar.gz", upload-time = 2025-12-17T18:25:41Z, size = 4274, hashes = { sha256 = "f5d7b2b4ca52dd855ef7ab8eb3590f428c0b1ea480736ce32b01fef2a5f8daf9" } }
243-
wheels = [{ url = "https://files.pythonhosted.org/packages/27/2c/daca29684cbe9fd4bc711f8246da3c10adca1ccc4d24436b17572eb2590e/roman_numerals_py-4.1.0-py3-none-any.whl", upload-time = 2025-12-17T18:25:40Z, size = 4547, hashes = { sha256 = "553114c1167141c1283a51743759723ecd05604a1b6b507225e91dc1a6df0780" } }]
244-
245239
[[packages]]
246240
name = "snowballstemmer"
247241
version = "2.2.0"
@@ -250,9 +244,9 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/ed/dc/c02e01294f7265e
250244

251245
[[packages]]
252246
name = "sphinx"
253-
version = "8.2.3"
254-
sdist = { url = "https://files.pythonhosted.org/packages/38/ad/4360e50ed56cb483667b8e6dadf2d3fda62359593faabbe749a27c4eaca6/sphinx-8.2.3.tar.gz", upload-time = 2025-03-02T22:31:59Z, size = 8321876, hashes = { sha256 = "398ad29dee7f63a75888314e9424d40f52ce5a6a87ae88e7071e80af296ec348" } }
255-
wheels = [{ url = "https://files.pythonhosted.org/packages/31/53/136e9eca6e0b9dc0e1962e2c908fbea2e5ac000c2a2fbd9a35797958c48b/sphinx-8.2.3-py3-none-any.whl", upload-time = 2025-03-02T22:31:56Z, size = 3589741, hashes = { sha256 = "4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3" } }]
247+
version = "9.1.1"
248+
sdist = { url = "https://files.pythonhosted.org/packages/fc/73/567727fc8c8d85bc3adc88a246e12937cfda8d565cf1d80e85bceaa61fe5/sphinx-9.1.1.tar.gz", upload-time = 2026-10-20T00:41:13Z, size = 8725638, hashes = { sha256 = "48b627f02908f22c601b3ba9c7b17265b4f315dd05c8bc64cd4da41183f44fbc" } }
249+
wheels = [{ url = "https://files.pythonhosted.org/packages/47/18/3c66ea76da7de47e716b181c35bdbfafbd5e9af0bb247b14578e9de348e9/sphinx-9.1.1-py3-none-any.whl", upload-time = 2026-10-20T00:41:11Z, size = 3923559, hashes = { sha256 = "f8b60013ce25017be41a509e5c2d265bc1918410061315c36b809c7f335646c0" } }]
256250

257251
[[packages]]
258252
name = "sphinx-linklint"

‎Doc/reference/datamodel.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,6 +2992,8 @@ automatic property creation, proxies, frameworks, and automatic resource
29922992
locking/synchronization.
29932993

29942994

2995+
.. _customize-instance-subclass-checks:
2996+
29952997
Customizing instance and subclass checks
29962998
----------------------------------------
29972999

‎Doc/requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# won't suddenly cause build failures. Updating the version is fine as long
88
# as no warnings are raised by doing so.
99
# Keep this version in sync with ``Doc/conf.py``.
10-
sphinx<9.0.0
10+
sphinx~=9.1.1
1111

1212
pygments>=2.21
1313

‎Doc/tools/extensions/pydoc_topics.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@
4141
"callable-types",
4242
"calls",
4343
"class",
44+
"class-customization",
4445
"comparisons",
4546
"compound",
4647
"context-managers",
4748
"continue",
4849
"conversions",
4950
"customization",
51+
"customize-instance-subclass-checks",
5052
"debugger",
5153
"del",
5254
"dict",
@@ -70,6 +72,7 @@
7072
"lambda",
7173
"lazy",
7274
"lists",
75+
"name_equals_main",
7376
"match",
7477
"naming",
7578
"nonlocal",
@@ -102,6 +105,7 @@
102105
"while",
103106
"with",
104107
"yield",
108+
"__main__",
105109
})
106110

107111

‎Doc/whatsnew/3.16.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,9 @@ pydoc
614614
inherited from other classes are collapsed by default.
615615
(Contributed by Serhiy Storchaka in :gh:`153906`.)
616616

617+
* Add help for more special names to the built-in :func:`help` function.
618+
(Contributed by Adam Hartz in :gh:`137966`.)
619+
617620

618621
pickle
619622
------

0 commit comments

Comments
 (0)