Skip to content

Commit 579822c

Browse files
committed
Merge branch 'master' into ac-argsbuf/136681
2 parents e6eb219 + 180b3eb commit 579822c

22 files changed

+162
-51
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
root = true
22

3-
[*.{py,c,cpp,h,js,rst,md,yml,yaml}]
3+
[*.{py,c,cpp,h,js,rst,md,yml,yaml,gram}]
44
trim_trailing_whitespace = true
55
insert_final_newline = true
66
indent_style = space
77

8-
[*.{py,c,cpp,h}]
8+
[*.{py,c,cpp,h,gram}]
99
indent_size = 4
1010

1111
[*.rst]

Doc/library/importlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ Functions
206206
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
207207
a :class:`~importlib.machinery.ModuleSpec`.
208208

209+
.. warning::
210+
This function is not thread-safe. Calling it from multiple threads can result
211+
in unexpected behavior. It's recommended to use the :class:`threading.Lock`
212+
or other synchronization primitives for thread-safe module reloading.
209213

210214
:mod:`importlib.abc` -- Abstract base classes related to import
211215
---------------------------------------------------------------

Doc/library/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ functions.
13171317
In Python versions earlier than 3.4, this function could also be passed a
13181318
text level, and would return the corresponding numeric value of the level.
13191319
This undocumented behaviour was considered a mistake, and was removed in
1320-
Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility.
1320+
Python 3.4, but reinstated in 3.4.2 in order to retain backward compatibility.
13211321

13221322
.. function:: getHandlerByName(name)
13231323

Doc/library/venv.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ The :mod:`!venv` module supports creating lightweight "virtual environments",
2222
each with their own independent set of Python packages installed in
2323
their :mod:`site` directories.
2424
A virtual environment is created on top of an existing
25-
Python installation, known as the virtual environment's "base" Python, and may
26-
optionally be isolated from the packages in the base environment,
27-
so only those explicitly installed in the virtual environment are available.
28-
See :ref:`sys-path-init-virtual-environments` and :mod:`site`'s
25+
Python installation, known as the virtual environment's "base" Python, and by
26+
default is isolated from the packages in the base environment,
27+
so that only those explicitly installed in the virtual environment are
28+
available. See :ref:`sys-path-init-virtual-environments` and :mod:`site`'s
2929
:ref:`virtual environments documentation <site-virtual-environments-configuration>`
3030
for more information.
3131

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ def skip_android_selinux(name):
570570
is_wasi = sys.platform == "wasi"
571571

572572
def skip_emscripten_stack_overflow():
573-
return unittest.skipIf(is_emscripten, "Exhausts limited stack on Emscripten")
573+
return unittest.skipIf(is_emscripten, "Exhausts stack on Emscripten")
574574

575575
def skip_wasi_stack_overflow():
576576
return unittest.skipIf(is_wasi, "Exhausts stack on WASI")

Lib/test/test_descr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ def __del__(self):
39423942
# it as a leak.
39433943
del C.__del__
39443944

3945-
@unittest.skipIf(support.is_emscripten, "Seems to works in Pyodide?")
3945+
@support.skip_emscripten_stack_overflow()
39463946
@support.skip_wasi_stack_overflow()
39473947
def test_slots_trash(self):
39483948
# Testing slot trash...

Lib/test/test_fstring.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,18 @@ def __repr__(self):
16511651
self.assertEqual(f"{1+2 = # my comment
16521652
}", '1+2 = \n 3')
16531653

1654+
self.assertEqual(f'{""" # booo
1655+
"""=}', '""" # booo\n """=\' # booo\\n \'')
1656+
1657+
self.assertEqual(f'{" # nooo "=}', '" # nooo "=\' # nooo \'')
1658+
self.assertEqual(f'{" \" # nooo \" "=}', '" \\" # nooo \\" "=\' " # nooo " \'')
1659+
1660+
self.assertEqual(f'{ # some comment goes here
1661+
"""hello"""=}', ' \n """hello"""=\'hello\'')
1662+
self.assertEqual(f'{"""# this is not a comment
1663+
a""" # this is a comment
1664+
}', '# this is not a comment\n a')
1665+
16541666
# These next lines contains tabs. Backslash escapes don't
16551667
# work in f-strings.
16561668
# patchcheck doesn't like these tabs. So the only way to test

Lib/test/test_os.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,11 +1918,9 @@ def test_makedir(self):
19181918
support.is_wasi,
19191919
"WASI's umask is a stub."
19201920
)
1921-
@unittest.skipIf(
1922-
support.is_emscripten,
1923-
"TODO: Fails in buildbot; see #135783"
1924-
)
19251921
def test_mode(self):
1922+
# Note: in some cases, the umask might already be 2 in which case this
1923+
# will pass even if os.umask is actually broken.
19261924
with os_helper.temp_umask(0o002):
19271925
base = os_helper.TESTFN
19281926
parent = os.path.join(base, 'dir1')

Lib/test/test_warnings/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,13 +555,7 @@ def test_warn_explicit_non_ascii_filename(self):
555555
with self.module.catch_warnings(record=True) as w:
556556
self.module.resetwarnings()
557557
self.module.filterwarnings("always", category=UserWarning)
558-
filenames = ["nonascii\xe9\u20ac"]
559-
if not support.is_emscripten:
560-
# JavaScript does not like surrogates.
561-
# Invalid UTF-8 leading byte 0x80 encountered when
562-
# deserializing a UTF-8 string in wasm memory to a JS
563-
# string!
564-
filenames.append("surrogate\udc80")
558+
filenames = ["nonascii\xe9\u20ac", "surrogate\udc80"]
565559
for filename in filenames:
566560
try:
567561
os.fsencode(filename)

Lib/test/test_xml_etree_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_del_attribute(self):
5858
self.assertEqual(element.attrib, {'A': 'B', 'C': 'D'})
5959

6060
@support.skip_wasi_stack_overflow()
61-
@unittest.skipIf(support.is_emscripten, "segfaults")
61+
@support.skip_emscripten_stack_overflow()
6262
def test_trashcan(self):
6363
# If this test fails, it will most likely die via segfault.
6464
e = root = cET.Element('root')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy