Skip to content

Commit 11746aa

Browse files
committed
Merge branch 'master' into deprecate-cval/128813
2 parents 381da37 + 7ab68cd commit 11746aa

38 files changed

+675
-338
lines changed

.github/CODEOWNERS

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
# It uses the same pattern rule for gitignore file
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

7-
# GitHub
7+
# Azure Pipelines
8+
.azure-pipelines/ @AA-Turner
9+
10+
# GitHub & related scripts
811
.github/** @ezio-melotti @hugovk @AA-Turner
12+
Tools/build/compute-changes.py @AA-Turner
13+
Tools/build/verify_ensurepip_wheels.py @AA-Turner
914

1015
# pre-commit
1116
.pre-commit-config.yaml @hugovk
1217
.ruff.toml @hugovk @AlexWaygood @AA-Turner
1318

14-
# Build system
15-
configure* @erlend-aasland @corona10
16-
Makefile.pre.in @erlend-aasland
17-
Modules/Setup* @erlend-aasland
19+
# Build system (autotools)
20+
configure* @erlend-aasland @corona10 @AA-Turner
21+
Makefile.pre.in @erlend-aasland @AA-Turner
22+
Modules/Setup* @erlend-aasland @AA-Turner
23+
Tools/build/regen-configure.sh @AA-Turner
1824

1925
# argparse
2026
**/*argparse* @savannahostrowski
@@ -67,6 +73,7 @@ Doc/make.bat @AA-Turner @hugovk
6773
Doc/requirements.txt @AA-Turner @hugovk
6874
Doc/_static/** @AA-Turner @hugovk
6975
Doc/tools/** @AA-Turner @hugovk
76+
.readthedocs.yml @AA-Turner
7077

7178
# runtime state/lifecycle
7279
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity
@@ -155,6 +162,10 @@ Doc/c-api/module.rst @ericsnowcurrently
155162
**/*importlib/resources/* @jaraco @warsaw @FFY00
156163
**/*importlib/metadata/* @jaraco @warsaw
157164

165+
# Calendar
166+
Lib/calendar.py @AA-Turner
167+
Lib/test/test_calendar.py @AA-Turner
168+
158169
# Dates and times
159170
**/*datetime* @pganssle @abalkin
160171
**/*str*time* @pganssle @abalkin
@@ -205,6 +216,11 @@ Lib/test/test_ast/ @eclips4 @tomasr8
205216
# multiprocessing
206217
**/*multiprocessing* @gpshead
207218

219+
# pydoc
220+
Lib/pydoc.py @AA-Turner
221+
Lib/pydoc_data/ @AA-Turner
222+
Lib/test/test_pydoc/ @AA-Turner
223+
208224
# SQLite 3
209225
**/*sqlite* @berkerpeksag @erlend-aasland
210226

@@ -217,6 +233,11 @@ Lib/test/test_ast/ @eclips4 @tomasr8
217233
**/*pdb* @gaogaotiantian
218234
**/*bdb* @gaogaotiantian
219235

236+
# types
237+
Lib/test/test_types.py @AA-Turner
238+
Lib/types.py @AA-Turner
239+
Modules/_typesmodule.c @AA-Turner
240+
220241
# Limited C API & stable ABI
221242
Tools/build/stable_abi.py @encukou
222243
Misc/stable_abi.toml @encukou
@@ -234,6 +255,11 @@ Doc/c-api/stable.rst @encukou
234255
/Tools/msi/ @python/windows-team
235256
/Tools/nuget/ @python/windows-team
236257

258+
# Zstandard
259+
Lib/compression/zstd/ @AA-Turner
260+
Lib/test/test_zstd.py @AA-Turner
261+
Modules/_zstd/ @AA-Turner
262+
237263
# Misc
238264
**/*itertools* @rhettinger
239265
**/*collections* @rhettinger
@@ -266,6 +292,9 @@ Doc/c-api/stable.rst @encukou
266292

267293
**/*cjkcodecs* @corona10
268294

295+
# Patchcheck
296+
Tools/patchcheck/ @AA-Turner
297+
269298
# macOS
270299
/Mac/ @python/macos-team
271300
**/*osx_support* @python/macos-team
@@ -277,9 +306,9 @@ Doc/c-api/stable.rst @encukou
277306
**/*zipfile/_path/* @jaraco
278307

279308
# Argument Clinic
280-
/Tools/clinic/** @erlend-aasland
281-
/Lib/test/test_clinic.py @erlend-aasland
282-
Doc/howto/clinic.rst @erlend-aasland
309+
/Tools/clinic/** @erlend-aasland @AA-Turner
310+
/Lib/test/test_clinic.py @erlend-aasland @AA-Turner
311+
Doc/howto/clinic.rst @erlend-aasland @AA-Turner
283312

284313
# Subinterpreters
285314
**/*interpreteridobject.* @ericsnowcurrently
@@ -323,6 +352,7 @@ Lib/test/test_configparser.py @jaraco
323352

324353
# Doc sections
325354
Doc/reference/ @willingc @AA-Turner
355+
Doc/whatsnew/ @AA-Turner
326356

327357
**/*weakref* @kumaraditya303
328358

@@ -336,7 +366,7 @@ Modules/_xxtestfuzz/ @ammaraskar
336366
# t-strings
337367
**/*interpolationobject* @lysnikolaou
338368
**/*templateobject* @lysnikolaou
339-
**/*templatelib* @lysnikolaou
369+
**/*templatelib* @lysnikolaou @AA-Turner
340370
**/*tstring* @lysnikolaou
341371

342372
# Remote debugging
@@ -346,3 +376,6 @@ Modules/_remote_debugging_module.c @pablogsal @ambv @1st1
346376

347377
# gettext
348378
**/*gettext* @tomasr8
379+
380+
# Internal Docs
381+
InternalDocs/ @AA-Turner

Doc/library/sqlite3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Module constants
509509

510510
.. data:: SQLITE_KEYWORDS
511511

512-
A :class:`tuple` containing all sqlite3 keywords.
512+
A :class:`tuple` containing all SQLite keywords.
513513

514514
This constant is only available if Python was compiled with SQLite
515515
3.24.0 or greater.

Doc/library/time.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ These constants are used as parameters for :func:`clock_getres` and
935935

936936
.. data:: CLOCK_TAI
937937

938-
`International Atomic Time <https://www.nist.gov/pml/time-and-frequency-division/nist-time-frequently-asked-questions-faq#tai>`_
938+
`International Atomic Time <https://www.nist.gov/pml/time-and-frequency-division/how-utcnist-related-coordinated-universal-time-utc-international>`_
939939

940940
The system must have a current leap second table in order for this to give
941941
the correct answer. PTP or NTP software can maintain a leap second table.

Doc/library/warnings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ Available Functions
458458
lower.one_way(**kw)
459459

460460
This makes the warning refer to both the ``example.lower.one_way()`` and
461-
``package.higher.another_way()`` call sites only from calling code living
461+
``example.higher.another_way()`` call sites only from calling code living
462462
outside of ``example`` package.
463463

464464
*source*, if supplied, is the destroyed object which emitted a

Doc/reference/compound_stmts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ have ambiguous semantics.
386386

387387
It is not possible to mix :keyword:`except` and :keyword:`!except*`
388388
in the same :keyword:`try`.
389-
:keyword:`break`, :keyword:`continue` and :keyword:`return`
389+
The :keyword:`break`, :keyword:`continue`, and :keyword:`return` statements
390390
cannot appear in an :keyword:`!except*` clause.
391391

392392

Doc/whatsnew/3.15.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,15 @@ ctypes
418418
(Contributed by Bénédikt Tran in :gh:`133866`.)
419419

420420

421+
glob
422+
----
423+
424+
* Removed the undocumented :func:`!glob.glob0` and :func:`!glob.glob1`
425+
functions, which have been deprecated since Python 3.13. Use
426+
:func:`glob.glob` and pass a directory to its *root_dir* argument instead.
427+
(Contributed by Barney Gale in :gh:`137466`.)
428+
429+
421430
http.server
422431
-----------
423432

Lib/asyncio/__main__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import argparse
22
import ast
33
import asyncio
4-
import asyncio.tools
54
import concurrent.futures
65
import contextvars
76
import inspect
@@ -11,6 +10,9 @@
1110
import threading
1211
import types
1312
import warnings
13+
from asyncio.tools import (TaskTableOutputFormat,
14+
display_awaited_by_tasks_table,
15+
display_awaited_by_tasks_tree)
1416

1517
from _colorize import get_theme
1618
from _pyrepl.console import InteractiveColoredConsole
@@ -153,17 +155,22 @@ def interrupt(self) -> None:
153155
"ps", help="Display a table of all pending tasks in a process"
154156
)
155157
ps.add_argument("pid", type=int, help="Process ID to inspect")
158+
formats = [fmt.value for fmt in TaskTableOutputFormat]
159+
formats_to_show = [fmt for fmt in formats
160+
if fmt != TaskTableOutputFormat.bsv.value]
161+
ps.add_argument("--format", choices=formats, default="table",
162+
metavar=f"{{{','.join(formats_to_show)}}}")
156163
pstree = subparsers.add_parser(
157164
"pstree", help="Display a tree of all pending tasks in a process"
158165
)
159166
pstree.add_argument("pid", type=int, help="Process ID to inspect")
160167
args = parser.parse_args()
161168
match args.command:
162169
case "ps":
163-
asyncio.tools.display_awaited_by_tasks_table(args.pid)
170+
display_awaited_by_tasks_table(args.pid, format=args.format)
164171
sys.exit(0)
165172
case "pstree":
166-
asyncio.tools.display_awaited_by_tasks_tree(args.pid)
173+
display_awaited_by_tasks_tree(args.pid)
167174
sys.exit(0)
168175
case None:
169176
pass # continue to the interactive shell

Lib/asyncio/tools.py

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""Tools to analyze tasks running in asyncio programs."""
22

3-
from collections import defaultdict, namedtuple
3+
from collections import defaultdict
4+
import csv
45
from itertools import count
5-
from enum import Enum
6+
from enum import Enum, StrEnum, auto
67
import sys
78
from _remote_debugging import RemoteUnwinder, FrameInfo
89

@@ -232,18 +233,56 @@ def _get_awaited_by_tasks(pid: int) -> list:
232233
sys.exit(1)
233234

234235

235-
def display_awaited_by_tasks_table(pid: int) -> None:
236+
class TaskTableOutputFormat(StrEnum):
237+
table = auto()
238+
csv = auto()
239+
bsv = auto()
240+
# 🍌SV is not just a format. It's a lifestyle. A philosophy.
241+
# https://www.youtube.com/watch?v=RrsVi1P6n0w
242+
243+
244+
def display_awaited_by_tasks_table(pid, *, format=TaskTableOutputFormat.table):
236245
"""Build and print a table of all pending tasks under `pid`."""
237246

238247
tasks = _get_awaited_by_tasks(pid)
239248
table = build_task_table(tasks)
240-
# Print the table in a simple tabular format
241-
print(
242-
f"{'tid':<10} {'task id':<20} {'task name':<20} {'coroutine stack':<50} {'awaiter chain':<50} {'awaiter name':<15} {'awaiter id':<15}"
243-
)
244-
print("-" * 180)
249+
format = TaskTableOutputFormat(format)
250+
if format == TaskTableOutputFormat.table:
251+
_display_awaited_by_tasks_table(table)
252+
else:
253+
_display_awaited_by_tasks_csv(table, format=format)
254+
255+
256+
_row_header = ('tid', 'task id', 'task name', 'coroutine stack',
257+
'awaiter chain', 'awaiter name', 'awaiter id')
258+
259+
260+
def _display_awaited_by_tasks_table(table):
261+
"""Print the table in a simple tabular format."""
262+
print(_fmt_table_row(*_row_header))
263+
print('-' * 180)
245264
for row in table:
246-
print(f"{row[0]:<10} {row[1]:<20} {row[2]:<20} {row[3]:<50} {row[4]:<50} {row[5]:<15} {row[6]:<15}")
265+
print(_fmt_table_row(*row))
266+
267+
268+
def _fmt_table_row(tid, task_id, task_name, coro_stack,
269+
awaiter_chain, awaiter_name, awaiter_id):
270+
# Format a single row for the table format
271+
return (f'{tid:<10} {task_id:<20} {task_name:<20} {coro_stack:<50} '
272+
f'{awaiter_chain:<50} {awaiter_name:<15} {awaiter_id:<15}')
273+
274+
275+
def _display_awaited_by_tasks_csv(table, *, format):
276+
"""Print the table in CSV format"""
277+
if format == TaskTableOutputFormat.csv:
278+
delimiter = ','
279+
elif format == TaskTableOutputFormat.bsv:
280+
delimiter = '\N{BANANA}'
281+
else:
282+
raise ValueError(f"Unknown output format: {format}")
283+
csv_writer = csv.writer(sys.stdout, delimiter=delimiter)
284+
csv_writer.writerow(_row_header)
285+
csv_writer.writerows(table)
247286

248287

249288
def display_awaited_by_tasks_tree(pid: int) -> None:

Lib/glob.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,6 @@ def _glob0(dirname, basename, dir_fd, dironly, include_hidden=False):
122122
return [basename]
123123
return []
124124

125-
_deprecated_function_message = (
126-
"{name} is deprecated and will be removed in Python {remove}. Use "
127-
"glob.glob and pass a directory to its root_dir argument instead."
128-
)
129-
130-
def glob0(dirname, pattern):
131-
import warnings
132-
warnings._deprecated("glob.glob0", _deprecated_function_message, remove=(3, 15))
133-
return _glob0(dirname, pattern, None, False)
134-
135-
def glob1(dirname, pattern):
136-
import warnings
137-
warnings._deprecated("glob.glob1", _deprecated_function_message, remove=(3, 15))
138-
return _glob1(dirname, pattern, None, False)
139-
140125
# This helper function recursively yields relative pathnames inside a literal
141126
# directory.
142127

Lib/sysconfig/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,13 @@ def _init_non_posix(vars):
412412
vars['EXE'] = '.exe'
413413
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
414414
vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
415-
vars['TZPATH'] = ''
415+
# No standard path exists on Windows for this, but we'll check
416+
# whether someone is imitating a POSIX-like layout
417+
check_tzpath = os.path.join(vars['prefix'], 'share', 'zoneinfo')
418+
if os.path.exists(check_tzpath):
419+
vars['TZPATH'] = check_tzpath
420+
else:
421+
vars['TZPATH'] = ''
416422

417423
#
418424
# public APIs

0 commit comments

Comments
 (0)