8000 Merge branch 'main' into fix-issue-115225 · python/cpython@28dc6e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28dc6e7

Browse files
authored
Merge branch 'main' into fix-issue-115225
2 parents 27707b4 + ef17252 commit 28dc6e7

Some content is hidden

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

49 files changed

+316
-175
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ struct _Py_global_strings {
711711
STRUCT_FOR_ID(sort)
712712
STRUCT_FOR_ID(source)
713713
STRUCT_FOR_ID(source_traceback)
714+
STRUCT_FOR_ID(spam)
714715
STRUCT_FOR_ID(src)
715716
STRUCT_FOR_ID(src_dir_fd)
716717
STRUCT_FOR_ID(stacklevel)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/_pyrepl/keymap.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
pyrepl uses its own keyspec format that is meant to be a strict superset of
3131
readline's KEYSEQ format. This means that if a spec is found that readline
3232
accepts that this doesn't, it should be logged as a bug. Note that this means
33-
we're using the `\\C-o' style of readline's keyspec, not the `Control-o' sort.
33+
we're using the '\\C-o' style of readline's keyspec, not the 'Control-o' sort.
3434
3535
The extension to readline is that the sequence \\<KEY> denotes the
3636
sequence of characters produced by hitting KEY.
3737
3838
Examples:
39-
`a' - what you get when you hit the `a' key
40-
`\\EOA' - Escape - O - A (up, on my terminal)
41-
`\\<UP>' - the up arrow key
42-
`\\<up>' - ditto (keynames are case-insensitive)
43-
`\\C-o', `\\c-o' - control-o
44-
`\\M-.' - meta-period
45-
`\\E.' - ditto (that's how meta works for pyrepl)
46-
`\\<tab>', `\\<TAB>', `\\t', `\\011', '\\x09', '\\X09', '\\C-i', '\\C-I'
39+
'a' - what you get when you hit the 'a' key
40+
'\\EOA' - Escape - O - A (up, on my terminal)
41+
'\\<UP>' - the up arrow key
42+
'\\<up>' - ditto (keynames are case-insensitive)
43+
'\\C-o', '\\c-o' - control-o
44+
'\\M-.' - meta-period
45+
'\\E.' - ditto (that's how meta works for pyrepl)
46+
'\\<tab>', '\\<TAB>', '\\t', '\\011', '\\x09', '\\X09', '\\C-i', '\\C-I'
4747
- all of these are the tab character.
4848
"""
4949

Lib/_pyrepl/reader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ class Reader:
171171
* console:
172172
Hopefully encapsulates the OS dependent stuff.
173173
* pos:
174-
A 0-based index into `buffer' for where the insertion point
174+
A 0-based index into 'buffer' for where the insertion point
175175
is.
176176
* screeninfo:
177177
Ahem. This list contains some info needed to move the
178178
insertion point around reasonably efficiently.
179179
* cxy, lxy:
180180
the position of the insertion point in screen ...
181181
* syntax_table:
182-
Dictionary mapping characters to `syntax class'; read the
182+
Dictionary mapping characters to 'syntax class'; read the
183183
emacs docs to see what this means :-)
184184
* commands:
185185
Dictionary mapping command names to command classes.
@@ -431,7 +431,7 @@ def max_row(self) -> int:
431431

432432
def get_arg(self, default: int = 1) -> int:
433433
"""Return any prefix argument that the user has supplied,
434-
returning `default' if there is None. Defaults to 1.
434+
returning 'default' if there is None. Defaults to 1.
435435
"""
436436
if self.arg is None:
437437
return default
@@ -440,7 +440,7 @@ def get_arg(self, default: int = 1) -> int:
440440

441441
def get_prompt(self, lineno: int, cursor_on_line: bool) -> str:
442442
"""Return what should be in the left-hand margin for line
443-
`lineno'."""
443+
'lineno'."""
444444
if self.arg is not None and cursor_on_line:
445445
prompt = "(arg: %s) " % self.arg
446446
elif self.paste_mode:

Lib/cmd.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
1. End of file on input is processed as the command 'EOF'.
66
2. A command is parsed out of each line by collecting the prefix composed
77
of characters in the identchars member.
8-
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
8+
3. A command 'foo' is dispatched to a method 'do_foo()'; the do_ method
99
is passed a single argument consisting of the remainder of the line.
1010
4. Typing an empty line repeats the last command. (Actually, it calls the
11-
method `emptyline', which may be overridden in a subclass.)
12-
5. There is a predefined `help' method. Given an argument `topic', it
13-
calls the command `help_topic'. With no arguments, it lists all topics
11+
method 'emptyline', which may be overridden in a subclass.)
12+
5. There is a predefined 'help' method. Given an argument 'topic', it
13+
calls the command 'help_topic'. With no arguments, it lists all topics
1414
with defined help_ functions, broken into up to three topics; documented
1515
commands, miscellaneous help topics, and undocumented commands.
16-
6. The command '?' is a synonym for `help'. The command '!' is a synonym
17-
for `shell', if a do_shell method exists.
16+
6. The command '?' is a synonym for 'help'. The command '!' is a synonym
17+
for 'shell', if a do_shell method exists.
1818
7. If completion is enabled, completing commands will be done automatically,
1919
and completing of commands args is done by calling complete_foo() with
2020
arguments text, line, begidx, endidx. text is string we are matching
@@ -23,21 +23,21 @@
2323
indexes of the text being matched, which could be used to provide
2424
different completion depending upon which position the argument is in.
2525
26-
The `default' method may be overridden to intercept commands for which there
26+
The 'default' method may be overridden to intercept commands for which there
2727
is no do_ method.
2828
29-
The `completedefault' method may be overridden to intercept completions for
29+
The 'completedefault' method may be overridden to intercept completions for
3030
commands that have no complete_ method.
3131
32-
The data member `self.ruler' sets the character used to draw separator lines
32+
The data member 'self.ruler' sets the character used to draw separator lines
3333
in the help messages. If empty, no ruler line is drawn. It defaults to "=".
3434
35-
If the value of `self.intro' is nonempty when the cmdloop method is called,
35+
If the value of 'self.intro' is nonempty when the cmdloop method is called,
3636
it is printed out on interpreter startup. This value may be overridden
3737
via an optional argument to the cmdloop() method.
3838
39-
The data members `self.doc_header', `self.misc_header', and
40-
`self.undoc_header' set the headers used for the help function's
39+
The data members 'self.doc_header', 'self.misc_header', and
40+
'self.undoc_header' set the headers used for the help function's
4141
listings of documented functions, miscellaneous topics, and undocumented
4242
functions respectively.
4343
"""

Lib/configparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def write(self, fp, space_around_delimiters=True):
957957
self._sections[section].items(), d)
958958

959959
def _write_section(self, fp, section_name, section_items, delimiter, unnamed=False):
960-
"""Write a single section to the specified `fp'."""
960+
"""Write a single section to the specified 'fp'."""
961961
if not unnamed:
962962
fp.write("[{}]\n".format(section_name))
963963
for key, value in section_items:

Lib/doctest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ class DocTestRunner:
12271227
`OutputChecker` to the constructor.
12281228
12291229
The test runner's display output can be controlled in two ways.
1230-
First, an output function (`out) can be passed to
1230+
First, an output function (`out`) can be passed to
12311231
`TestRunner.run`; this function will be called with strings that
12321232
should be displayed. It defaults to `sys.stdout.write`. If
12331233
capturing the output is not sufficient, then the display output
@@ -2734,7 +2734,7 @@ def testsource(module, name):
27342734
return testsrc
27352735

27362736
def debug_src(src, pm=False, globs=None):
2737-
"""Debug a single doctest docstring, in argument `src`'"""
2737+
"""Debug a single doctest docstring, in argument `src`"""
27382738
testsrc = script_from_examples(src)
27392739
debug_script(testsrc, pm, globs)
27402740

Lib/email/_parseaddr.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class AddrlistClass:
224224
def __init__(self, field):
225225
"""Initialize a new instance.
226226
227-
`field' is an unparsed address header field, containing
227+
'field' is an unparsed address header field, containing
228228
one or more addresses.
229229
"""
230230
self.specials = '()<>@,:;.\"[]'
@@ -233,7 +233,7 @@ def __init__(self, field):
233233
self.CR = '\r\n'
234234
self.FWS = self.LWS + self.CR
235235
self.atomends = self.specials + self.LWS + self.CR
236-
# Note that RFC 2822 now specifies `.' as obs-phrase, meaning that it
236+
# Note that RFC 2822 now specifies '.' as obs-phrase, meaning that it
237237
# is obsolete syntax. RFC 2822 requires that we recognize obsolete
238238
# syntax, so allow dots in phrases.
239239
self.phraseends = self.atomends.replace('.', '')
@@ -423,14 +423,14 @@ def getdomain(self):
423423
def getdelimited(self, beginchar, endchars, allowcomments=True):
424424
"""Parse a header fragment delimited by special characters.
425425
426-
`beginchar' is the start character for the fragment.
427-
If self is not looking at an instance of `beginchar' then
426+
'beginchar' is the start character for the fragment.
427+
If self is not looking at an instance of 'beginchar' then
428428
getdelimited returns the empty string.
429429
430-
`endchars' is a sequence of allowable end-delimiting characters.
430+
'endchars' is a sequence of allowable end-delimiting characters.
431431
Parsing stops when one of these is encountered.
432432
433-
If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
433+
If 'allowcomments' is non-zero, embedded RFC 2822 comments are allowed
434434
within the parsed fragment.
435435
"""
436436
if self.field[self.pos] != beginchar:
@@ -474,7 +474,7 @@ def getatom(self, atomends=None):
474474
475475
Optional atomends specifies a different set of end token delimiters
476476
(the default is to use self.atomends). This is used e.g. in
477-
getphraselist() since phrase endings must not include the `.' (which
477+
getphraselist() since phrase endings must not include the '.' (which
478478
is legal in phrases)."""
479479
atomlist = ['']
480480
if atomends is None:

Lib/email/_policybase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta):
150150
wrapping is done. Default is 78.
151151
152152
mangle_from_ -- a flag that, when True escapes From_ lines in the
153-
body of the message by putting a `>' in front of
153+
body of the message by putting a '>' in front of
154154
them. This is used when the message is being
155155
serialized by a generator. Default: False.
156156

Lib/email/base64mime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
with Base64 encoding.
1616
1717
RFC 2045 defines a method for including character set information in an
18-
`encoded-word' in a header. This method is commonly used for 8-bit real names
18+
'encoded-word' in a header. This method is commonly used for 8-bit real names
1919
in To:, From:, Cc:, etc. fields, as well as Subject: lines.
2020
2121
This module does not do the line wrapping or end-of-line character conversion

Lib/email/charset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class Charset:
175175
module expose the following information about a character set:
176176
177177
input_charset: The initial character set specified. Common aliases
178-
are converted to their `official' email names (e.g. latin_1
178+
are converted to their 'official' email names (e.g. latin_1
179179
is converted to iso-8859-1). Defaults to 7-bit us-ascii.
180180
181181
header_encoding: If the character set must be encoded before it can be
@@ -245,7 +245,7 @@ def __eq__(self, other):
245245
def get_body_encoding(self):
246246
"""Return the content-transfer-encoding used for body encoding.
247247
248-
This is either the string `quoted-printable' or `base64' depending on
248+
This is either the string 'quoted-printable' or 'base64' depending on
249249
the encoding used, or it is a function in which case you should call
250250
the function with a single argument, the Message object being
251251
encoded. The function should then set the Content-Transfer-Encoding

Lib/email/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, *,
4141
4242
Optional mangle_from_ is a flag that, when True (the default if policy
4343
is not set), escapes From_ lines in the body of the message by putting
44-
a `>' in front of them.
44+
a '>' in front of them.
4545
4646
Optional maxheaderlen specif F438 ies the longest length for a non-continued
4747
header. When a header line is longer (in characters, with tabs
@@ -74,7 +74,7 @@ def flatten(self, msg, unixfrom=False, linesep=None):
7474
7575
unixfrom is a flag that forces the printing of a Unix From_ delimiter
7676
before the first object in the message tree. If the original message
77-
has no From_ delimiter, a `standard' one is crafted. By default, this
77+
has no From_ delimiter, a 'standard' one is crafted. By default, this
7878
is False to inhibit the printing of any From_ delimiter.
7979
8080
Note that for subobjects, no From_ line is printed.
@@ -456,7 +456,7 @@ def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, fmt=None, *,
456456
argument is allowed.
457457
458458
Walks through all subparts of a message. If the subpart is of main
459-
type `text', then it prints the decoded payload of the subpart.
459+
type 'text', then it prints the decoded payload of the subpart.
460460
461461
Otherwise, fmt is a format string that is used instead of the message
462462
payload. fmt is expanded with the following keywords (in

Lib/email/header.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def __init__(self, s=None, charset=None,
192192
193193
The maximum line length can be specified explicitly via maxlinelen. For
194194
splitting the first line to a shorter value (to account for the field
195-
header which isn't included in s, e.g. `Subject') pass in the name of
195+
header which isn't included in s, e.g. 'Subject') pass in the name of
196196
the field in header_name. The default maxlinelen is 78 as recommended
197197
by RFC 2822.
198198
@@ -276,7 +276,7 @@ def append(self, s, charset=None, errors='strict'):
276276
output codec of the charset. If the string cannot be encoded to the
277277
output codec, a UnicodeError will be raised.
278278
279-
Optional `errors' is passed as the errors argument to the decode
279+
Optional 'errors' is passed as the errors argument to the decode
280280
call if s is a byte string.
281281
"""
282282
if charset is None:
@@ -326,7 +326,7 @@ def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
326326
327327
Optional splitchars is a string containing characters which should be
328328
given extra weight by the splitting algorithm during normal header
329-
wrapping. This is in very rough support of RFC 2822's `higher level
329+
wrapping. This is in very rough support of RFC 2822's 'higher level
330330
syntactic breaks': split points preceded by a splitchar are preferred
331331
during line splitting, with the characters preferred in the order in
332332
which they appear in the string. Space and tab may be included in the

Lib/email/iterators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def body_line_iterator(msg, decode=False):
4343
def typed_subpart_iterator(msg, maintype='text', subtype=None):
4444
"""Iterate over the subparts with a given MIME type.
4545
46-
Use `maintype' as the main MIME type to match against; this defaults to
47-
"text". Optional `subtype' is the MIME subtype to match against; if
46+
Use 'maintype' as the main MIME type to match against; this defaults to
47+
"text". Optional 'subtype' is the MIME subtype to match against; if
4848
omitted, only the main type is matched.
4949
"""
5050
for subpart in msg.walk():

0 commit comments

Comments
 (0)
0