Skip to content

Commit 06f9db8

Browse files
authored
Merge branch 'main' into fix_memory_leak_sys_getwindowsversion_from_kernel32
2 parents 18cf3a2 + 74e2acd commit 06f9db8

28 files changed

+714
-1581
lines changed

.github/CODEOWNERS

+6-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ Lib/test/test_interpreters/ @ericsnowcurrently
298298
**/*-ios* @freakboy3742
299299

300300
# WebAssembly
301-
/Tools/wasm/ @brettcannon @freakboy3742
301+
Tools/wasm/config.site-wasm32-emscripten @freakboy3742
302+
/Tools/wasm/README.md @brettcannon @freakboy3742
303+
/Tools/wasm/wasi-env @brettcannon
304+
/Tools/wasm/wasi.py @brettcannon
305+
/Tools/wasm/emscripten @freakboy3742
306+
/Tools/wasm/wasi @brettcannon
302307

303308
# SBOM
304309
/Misc/externals.spdx.json @sethmlarson

Include/internal/pycore_magic_number.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ Known values:
277277
Python 3.14a7 3622 (Store annotations in different class dict keys)
278278
Python 3.14a7 3623 (Add BUILD_INTERPOLATION & BUILD_TEMPLATE opcodes)
279279
Python 3.14b1 3624 (Don't optimize LOAD_FAST when local is killed by DELETE_FAST)
280+
Python 3.15a0 3650 (Initial version)
280281
281-
Python 3.15 will start with 3650
282+
Python 3.16 will start with 3700
282283
283284
Please don't copy-paste the same pre-release tag for new entries above!!!
284285
You should always use the *upcoming* tag. For example, if 3.12a6 came out
@@ -289,7 +290,7 @@ PC/launcher.c must also be updated.
289290
290291
*/
291292

292-
#define PYC_MAGIC_NUMBER 3624
293+
#define PYC_MAGIC_NUMBER 3650
293294
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
294295
(little-endian) and then appending b'\r\n'. */
295296
#define PYC_MAGIC_NUMBER_TOKEN \

Lib/curses/__init__.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ def initscr():
3030
fd=_sys.__stdout__.fileno())
3131
stdscr = _curses.initscr()
3232
for key, value in _curses.__dict__.items():
33-
if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
33+
if key.startswith('ACS_') or key in ('LINES', 'COLS'):
3434
setattr(curses, key, value)
35-
3635
return stdscr
3736

3837
# This is a similar wrapper for start_color(), which adds the COLORS and
@@ -41,12 +40,9 @@ def initscr():
4140

4241
def start_color():
4342
import _curses, curses
44-
retval = _curses.start_color()
45-
if hasattr(_curses, 'COLORS'):
46-
curses.COLORS = _curses.COLORS
47-
if hasattr(_curses, 'COLOR_PAIRS'):
48-
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
49-
return retval
43+
_curses.start_color()
44+
curses.COLORS = _curses.COLORS
45+
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
5046

5147
# Import Python has_key() implementation if _curses doesn't contain has_key()
5248

@@ -85,10 +81,11 @@ def wrapper(func, /, *args, **kwds):
8581
# Start color, too. Harmless if the terminal doesn't have
8682
# color; user can test with has_color() later on. The try/catch
8783
# works around a minor bit of over-conscientiousness in the curses
88-
# module -- the error return from C start_color() is ignorable.
84+
# module -- the error return from C start_color() is ignorable,
85+
# unless they are raised by the interpreter due to other issues.
8986
try:
9087
start_color()
91-
except:
88+
except _curses.error:
9289
pass
9390

9491
return func(stdscr, *args, **kwds)

Lib/sysconfig/__init__.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,7 @@ def _safe_realpath(path):
219219
if "_PYTHON_PROJECT_BASE" in os.environ:
220220
_PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])
221221

222-
def is_python_build(check_home=None):
223-
if check_home is not None:
224-
import warnings
225-
warnings.warn(
226-
(
227-
'The check_home argument of sysconfig.is_python_build is '
228-
'deprecated and its value is ignored. '
229-
'It will be removed in Python 3.15.'
230-
),
231-
DeprecationWarning,
232-
stacklevel=2,
233-
)
222+
def is_python_build():
234223
for fn in ("Setup", "Setup.local"):
235224
if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
236225
return True

Lib/test/test_ast/test_ast.py

+11
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,17 @@ def test_constant_as_name(self):
821821
with self.assertRaisesRegex(ValueError, f"identifier field can't represent '{constant}' constant"):
822822
compile(expr, "<test>", "eval")
823823

824+
def test_constant_as_unicode_name(self):
825+
constants = [
826+
("True", b"Tru\xe1\xb5\x89"),
827+
("False", b"Fal\xc5\xbfe"),
828+
("None", b"N\xc2\xbane"),
829+
]
830+
for constant in constants:
831+
with self.assertRaisesRegex(ValueError,
832+
f"identifier field can't represent '{constant[0]}' constant"):
833+
ast.parse(constant[1], mode="eval")
834+
824835
def test_precedence_enum(self):
825836
class _Precedence(enum.IntEnum):
826837
"""Precedence table that originated from python grammar."""

Lib/test/test_clinic.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,7 @@ def check_depr_star(self, pnames, fn, /, *args, name=None, **kwds):
29852985
regex = (
29862986
fr"Passing( more than)?( [0-9]+)? positional argument(s)? to "
29872987
fr"{re.escape(name)}\(\) is deprecated. Parameters? {pnames} will "
2988-
fr"become( a)? keyword-only parameters? in Python 3\.14"
2988+
fr"become( a)? keyword-only parameters? in Python 3\.37"
29892989
)
29902990
self.check_depr(regex, fn, *args, **kwds)
29912991

@@ -2998,7 +2998,7 @@ def check_depr_kwd(self, pnames, fn, *args, name=None, **kwds):
29982998
regex = (
29992999
fr"Passing keyword argument{pl} {pnames} to "
30003000
fr"{re.escape(name)}\(\) is deprecated. Parameter{pl} {pnames} "
3001-
fr"will become positional-only in Python 3\.14."
3001+
fr"will become positional-only in Python 3\.37."
30023002
)
30033003
self.check_depr(regex, fn, *args, **kwds)
30043004

@@ -3782,9 +3782,9 @@ def test_depr_star_multi(self):
37823782
fn("a", b="b", c="c", d="d", e="e", f="f", g="g", h="h")
37833783
errmsg = (
37843784
"Passing more than 1 positional argument to depr_star_multi() is deprecated. "
3785-
"Parameter 'b' will become a keyword-only parameter in Python 3.16. "
3786-
"Parameters 'c' and 'd' will become keyword-only parameters in Python 3.15. "
3787-
"Parameters 'e', 'f' and 'g' will become keyword-only parameters in Python 3.14.")
3785+
"Parameter 'b' will become a keyword-only parameter in Python 3.39. "
3786+
"Parameters 'c' and 'd' will become keyword-only parameters in Python 3.38. "
3787+
"Parameters 'e', 'f' and 'g' will become keyword-only parameters in Python 3.37.")
37883788
check = partial(self.check_depr, re.escape(errmsg), fn)
37893789
check("a", "b", c="c", d="d", e="e", f="f", g="g", h="h")
37903790
check("a", "b", "c", d="d", e="e", f="f", g="g", h="h")
@@ -3883,9 +3883,9 @@ def test_depr_kwd_multi(self):
38833883
fn("a", "b", "c", "d", "e", "f", "g", h="h")
38843884
errmsg = (
38853885
"Passing keyword arguments 'b', 'c', 'd', 'e', 'f' and 'g' to depr_kwd_multi() is deprecated. "
3886-
"Parameter 'b' will become positional-only in Python 3.14. "
3887-
"Parameters 'c' and 'd' will become positional-only in Python 3.15. "
3888-
"Parameters 'e', 'f' and 'g' will become positional-only in Python 3.16.")
3886+
"Parameter 'b' will become positional-only in Python 3.37. "
3887+
"Parameters 'c' and 'd' will become positional-only in Python 3.38. "
3888+
"Parameters 'e', 'f' and 'g' will become positional-only in Python 3.39.")
38893889
check = partial(self.check_depr, re.escape(errmsg), fn)
38903890
check("a", "b", "c", "d", "e", "f", g="g", h="h")
38913891
check("a", "b", "c", "d", "e", f="f", g="g", h="h")
@@ -3900,17 +3900,17 @@ def test_depr_multi(self):
39003900
self.assertRaises(TypeError, fn, "a", "b", "c", "d", "e", "f", "g")
39013901
errmsg = (
39023902
"Passing more than 4 positional arguments to depr_multi() is deprecated. "
3903-
"Parameter 'e' will become a keyword-only parameter in Python 3.15. "
3904-
"Parameter 'f' will become a keyword-only parameter in Python 3.14.")
3903+
"Parameter 'e' will become a keyword-only parameter in Python 3.38. "
3904+
"Parameter 'f' will become a keyword-only parameter in Python 3.37.")
39053905
check = partial(self.check_depr, re.escape(errmsg), fn)
39063906
check("a", "b", "c", "d", "e", "f", g="g")
39073907
check("a", "b", "c", "d", "e", f="f", g="g")
39083908
fn("a", "b", "c", "d", e="e", f="f", g="g")
39093909
fn("a", "b", "c", d="d", e="e", f="f", g="g")
39103910
errmsg = (
39113911
"Passing keyword arguments 'b' and 'c' to depr_multi() is deprecated. "
3912-
"Parameter 'b' will become positional-only in Python 3.14. "
3913-
"Parameter 'c' will become positional-only in Python 3.15.")
3912+
"Parameter 'b' will become positional-only in Python 3.37. "
3913+
"Parameter 'c' will become positional-only in Python 3.38.")
39143914
check = partial(self.check_depr, re.escape(errmsg), fn)
39153915
check("a", "b", c="c", d="d", e="e", f="f", g="g")
39163916
check("a", b="b", c="c", d="d", e="e", f="f", g="g")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Raise :exc:`ValueError` when constants ``True``, ``False`` or ``None`` are
2+
used as an identifier after NFKC normalization.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts`
2+
in non Windows desktop builds since the underlying functionality is missing.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Removed the ``check_home`` parameter from :func:`sysconfig.is_python_build`,
2+
deprecated since Python 3.12.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Avoid using console I/O in WinAPI partitions that don’t support it

0 commit comments

Comments
 (0)