Skip to content

Commit dcae8f0

Browse files
authored
Update some libs and tests from 3.14.3 to 3.14.4 (#7576)
* Update some libs and tests to 3.14.4 * Update `pydoc_data`
1 parent f937cde commit dcae8f0

15 files changed

Lines changed: 728 additions & 383 deletions

‎Lib/_android_support.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ def write(self, prio, tag, message):
168168
# message.
169169
message = message.replace(b"\x00", b"\xc0\x80")
170170

171+
# On API level 30 and higher, Logcat will strip any number of leading
172+
# newlines. This is visible in all `logcat` modes, even --binary. Work
173+
# around this by adding a leading space, which shouldn't make any
174+
# difference to the log's usability.
175+
if message.startswith(b"\n"):
176+
message = b" " + message
177+
171178
with self._lock:
172179
now = time()
173180
self._bucket_level += (

‎Lib/annotationlib.py‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ def get_annotations(
919919
does not exist, the __annotate__ function is called. The
920920
FORWARDREF format uses __annotations__ if it exists and can be
921921
evaluated, and otherwise falls back to calling the __annotate__ function.
922-
The SOURCE format tries __annotate__ first, and falls back to
922+
The STRING format tries __annotate__ first, and falls back to
923923
using __annotations__, stringified using annotations_to_string().
924924
925925
This function handles several details for you:
@@ -1037,13 +1037,26 @@ def get_annotations(
10371037
obj_globals = obj_locals = unwrap = None
10381038

10391039
if unwrap is not None:
1040+
# Use an id-based visited set to detect cycles in the __wrapped__
1041+
# and functools.partial.func chain (e.g. f.__wrapped__ = f).
1042+
# On cycle detection we stop and use whatever __globals__ we have
1043+
# found so far, mirroring the approach of inspect.unwrap().
1044+
_seen_ids = {id(unwrap)}
10401045
while True:
10411046
if hasattr(unwrap, "__wrapped__"):
1042-
unwrap = unwrap.__wrapped__
1047+
candidate = unwrap.__wrapped__
1048+
if id(candidate) in _seen_ids:
1049+
break
1050+
_seen_ids.add(id(candidate))
1051+
unwrap = candidate
10431052
continue
10441053
if functools := sys.modules.get("functools"):
10451054
if isinstance(unwrap, functools.partial):
1046-
unwrap = unwrap.func
1055+
candidate = unwrap.func
1056+
if id(candidate) in _seen_ids:
1057+
break
1058+
_seen_ids.add(id(candidate))
1059+
unwrap = candidate
10471060
continue
10481061
break
10491062
if hasattr(unwrap, "__globals__"):

‎Lib/argparse.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def _copy_items(items):
149149
return copy.copy(items)
150150

151151

152+
def _identity(value):
153+
return value
154+
155+
152156
# ===============
153157
# Formatting Help
154158
# ===============
@@ -200,7 +204,7 @@ def _set_color(self, color):
200204
self._decolor = decolor
201205
else:
202206
self._theme = get_theme(force_no_color=True).argparse
203-
self._decolor = lambda text: text
207+
self._decolor = _identity
204208

205209
# ===============================
206210
# Section and indentation methods
@@ -1903,9 +1907,7 @@ def __init__(self,
19031907
self._subparsers = None
19041908

19051909
# register types
1906-
def identity(string):
1907-
return string
1908-
self.register('type', None, identity)
1910+
self.register('type', None, _identity)
19091911

19101912
# add help argument if necessary
19111913
# (using explicit default to override global argument_default)

‎Lib/glob.py‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
1717
include_hidden=False):
18-
"""Return a list of paths matching a pathname pattern.
18+
"""Return a list of paths matching a `pathname` pattern.
1919
2020
The pattern may contain simple shell-style wildcards a la
2121
fnmatch. Unlike fnmatch, filenames starting with a
@@ -25,6 +25,15 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
2525
The order of the returned list is undefined. Sort it if you need a
2626
particular order.
2727
28+
If `root_dir` is not None, it should be a path-like object specifying the
29+
root directory for searching. It has the same effect as changing the
30+
current directory before calling it (without actually
31+
changing it). If pathname is relative, the result will contain
32+
paths relative to `root_dir`.
33+
34+
If `dir_fd` is not None, it should be a file descriptor referring to a
35+
directory, and paths will then be relative to that directory.
36+
2837
If `include_hidden` is true, the patterns '*', '?', '**' will match hidden
2938
directories.
3039
@@ -36,7 +45,7 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
3645

3746
def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
3847
include_hidden=False):
39-
"""Return an iterator which yields the paths matching a pathname pattern.
48+
"""Return an iterator which yields the paths matching a `pathname` pattern.
4049
4150
The pattern may contain simple shell-style wildcards a la
4251
fnmatch. However, unlike fnmatch, filenames starting with a
@@ -46,7 +55,19 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
4655
The order of the returned paths is undefined. Sort them if you need a
4756
particular order.
4857
49-
If recursive is true, the pattern '**' will match any files and
58+
If `root_dir` is not None, it should be a path-like object specifying
59+
the root directory for searching. It has the same effect as changing
60+
the current directory before calling it (without actually
61+
changing it). If pathname is relative, the result will contain
62+
paths relative to `root_dir`.
63+
64+
If `dir_fd` is not None, it should be a file descriptor referring to a
65+
directory, and paths will then be relative to that directory.
66+
67+
If `include_hidden` is true, the patterns '*', '?', '**' will match hidden
68+
directories.
69+
70+
If `recursive` is true, the pattern '**' will match any files and
5071
zero or more directories and subdirectories.
5172
"""
5273
sys.audit("glob.glob", pathname, recursive)

‎Lib/inspect.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,11 +2660,12 @@ class Parameter:
26602660
The annotation for the parameter if specified. If the
26612661
parameter has no annotation, this attribute is set to
26622662
`Parameter.empty`.
2663-
* kind : str
2663+
* kind
26642664
Describes how argument values are bound to the parameter.
26652665
Possible values: `Parameter.POSITIONAL_ONLY`,
26662666
`Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
26672667
`Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
2668+
Every value has a `description` attribute describing meaning.
26682669
"""
26692670

26702671
__slots__ = ('_name', '_kind', '_default', '_annotation')

‎Lib/pydoc_data/module_docs.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Autogenerated by Sphinx on Tue Feb 3 17:32:13 2026
1+
# Autogenerated by Sphinx on Tue Apr 7 16:13:12 2026
22
# as part of the release process.
33

44
module_docs = {

0 commit comments

Comments
 (0)