Skip to content

Commit f1f0e11

Browse files
Merge branch 'main' into tkinter-photoimage-redither
2 parents 9ec0b58 + d1dbdbf commit f1f0e11

14 files changed

Lines changed: 103 additions & 38 deletions

File tree

Doc/deprecations/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Deprecations
22
============
33

4-
.. include:: pending-removal-in-3.16.rst
5-
64
.. include:: pending-removal-in-3.17.rst
75

86
.. include:: pending-removal-in-3.18.rst
@@ -20,8 +18,6 @@ Deprecations
2018
C API deprecations
2119
------------------
2220

23-
.. include:: c-api-pending-removal-in-3.16.rst
24-
2521
.. include:: c-api-pending-removal-in-3.18.rst
2622

2723
.. include:: c-api-pending-removal-in-3.19.rst

Doc/tools/removed-ids.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ c-api/file.html: deprecated-api
77
# Removed sections
88
library/asyncio-task.html: terminating-a-task-group
99
deprecations/index.html: pending-removal-in-python-3-15
10+
deprecations/index.html: pending-removal-in-python-3-16
1011
deprecations/index.html: c-api-pending-removal-in-python-3-15
12+
deprecations/index.html: c-api-pending-removal-in-python-3-16
1113

1214
# Removed libmpdec
1315
using/configure.html: cmdoption-with-system-libmpdec

Doc/whatsnew/3.16.rst

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ gzip
9999
which is passed on to the constructor of the :class:`~gzip.GzipFile` class.
100100
(Contributed by Marin Misur in :gh:`91372`.)
101101

102-
lzma
103-
----
104-
105-
* Add support of new BCJ filters ARM64 and RISC-V via
106-
:const:`!lzma.FILTER_ARM64` and :const:`!lzma.FILTER_RISCV`. Note that the
107-
new filters will work only if runtime library supports them. ARM64 filter
108-
requires ``lzma`` 5.4.0 or newer while RISC-V requires 5.6.0 or newer.
109-
(Contributed by Chien Wong in :gh:`115988`.)
110102

111103
logging
112104
-------
@@ -119,6 +111,17 @@ logging
119111
before the rotation interval expires.
120112
(Contributed by Iván Márton and Serhiy Storchaka in :gh:`84649`.)
121113

114+
115+
lzma
116+
----
117+
118+
* Add support of new BCJ filters ARM64 and RISC-V via
119+
:const:`!lzma.FILTER_ARM64` and :const:`!lzma.FILTER_RISCV`. Note that the
120+
new filters will work only if the runtime library supports them. ARM64 filter
121+
requires ``lzma`` 5.4.0 or newer while RISC-V requires 5.6.0 or newer.
122+
(Contributed by Chien Wong in :gh:`115988`.)
123+
124+
122125
math
123126
----
124127

@@ -130,20 +133,23 @@ math
130133
754-2019 and standardized in C23.
131134
(Contributed by Jeff Epler in :gh:`150534`.)
132135

136+
133137
os
134138
--
135139

136140
* Add :func:`os.pidfd_getfd` for duplicating a file descriptor from another
137141
process via a pidfd. Available on Linux 5.6+.
138142
(Contributed by Maurycy Pawłowski-Wieroński in :gh:`149464`.)
139143

144+
140145
shlex
141146
-----
142147

143148
* Add keyword-only parameter *force* to :func:`shlex.quote` to force quoting
144149
a string, even if it is already safe for a shell without being quoted.
145150
(Contributed by Jay Berry in :gh:`148846`.)
146151

152+
147153
tkinter
148154
-------
149155

@@ -161,19 +167,20 @@ tkinter
161167
dithered image when its data was supplied in pieces.
162168
(Contributed by Serhiy Storchaka in :gh:`151888`.)
163169

170+
164171
xml
165172
---
166173

167174
* Add support for multiple multi-byte encodings in the :mod:`XML parser
168-
<xml.parsers.expat>`: "cp932", "cp949", "cp950", "Big5","EUC-JP",
175+
<xml.parsers.expat>`: "cp932", "cp949", "cp950", "Big5", "EUC-JP",
169176
"GB2312", "GBK", "johab", and "Shift_JIS".
170177
Add partial support (only BMP characters) for multi-byte encodings
171178
"Big5-HKSCS", "EUC_JIS-2004", "EUC_JISX0213", "Shift_JIS-2004",
172179
"Shift_JISX0213", "utf-8-sig" and non-standard aliases like "UTF8"
173180
(without hyphen).
174181
The parser now raises :exc:`ValueError` for known unsupported
175-
multi-byte encodings such us "ISO-2022-JP" or "raw-unicode-escape"
176-
instead of failing later, when encounter non-ASCII data.
182+
multi-byte encodings such as "ISO-2022-JP" or "raw-unicode-escape"
183+
instead of failing later, when encountering non-ASCII data.
177184
(Contributed by Serhiy Storchaka in :gh:`62259`.)
178185

179186
zipfile
@@ -283,14 +290,17 @@ tarfile
283290
Deprecated
284291
==========
285292

293+
New deprecations
294+
----------------
295+
286296
* :mod:`abc`
287297

288-
* Soft-deprecated since Python 3.3 :class:`abc.abstractclassmethod`,
289-
:class:`abc.abstractstaticmethod`, and :class:`abc.abstractproperty`
290-
now raise a :exc:`DeprecationWarning`.
291-
These classes will be removed in Python 3.21, instead
292-
use :func:`abc.abstractmethod` with :func:`classmethod`,
293-
:func:`staticmethod`, and :class:`property` respectively.
298+
* Soft-deprecated since Python 3.3 :class:`abc.abstractclassmethod`,
299+
:class:`abc.abstractstaticmethod`, and :class:`abc.abstractproperty`
300+
now raise a :exc:`DeprecationWarning`.
301+
These classes will be removed in Python 3.21, instead
302+
use :func:`abc.abstractmethod` with :func:`classmethod`,
303+
:func:`staticmethod`, and :class:`property` respectively.
294304

295305
* :mod:`ast`:
296306

@@ -329,7 +339,7 @@ Build changes
329339
=============
330340

331341
* Remove the bundled copy of the libmpdec_ decimal library from the CPython source tree
332-
to simplify maintenence and updates. The :mod:`decimal` module will now
342+
to simplify maintenance and updates. The :mod:`decimal` module will now
333343
unconditionally use the system's libmpdec decimal library. Also remove the
334344
now unused :option:`!--with-system-libmpdec` :program:`configure` flag.
335345
This change has no impact on binary releases of Python, which have been

Lib/_pyio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@ def truncate(self, pos=None):
19281928
"""Truncate size to pos, where pos is an int."""
19291929
self._unsupported("truncate")
19301930

1931-
def readline(self):
1931+
def readline(self, size=-1, /):
19321932
"""Read until newline or EOF.
19331933
19341934
Returns an empty string if EOF is hit immediately.

Lib/test/test_type_params.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import annotationlib
2+
import inspect
23
import textwrap
34
import types
45
import unittest
@@ -1446,6 +1447,30 @@ def f[T: int = int, **P = int, *Ts = int](): pass
14461447
self.assertIs(annotationlib.call_evaluate_function(case, annotationlib.Format.FORWARDREF), int)
14471448
self.assertEqual(annotationlib.call_evaluate_function(case, annotationlib.Format.STRING), 'int')
14481449

1450+
def test_signature(self):
1451+
# gh-151665: the ".format" parameter of compiler-generated evaluators
1452+
# used to break inspect.signature(). It should show up as "format".
1453+
type Alias = int
1454+
def f[T: int = int, **P = int, *Ts = int](): pass
1455+
T, P, Ts = f.__type_params__
1456+
def g[U: (int, str)](): pass
1457+
U, = g.__type_params__
1458+
cases = [
1459+
Alias.evaluate_value,
1460+
T.evaluate_bound,
1461+
T.evaluate_default,
1462+
P.evaluate_default,
1463+
Ts.evaluate_default,
1464+
U.evaluate_constraints,
1465+
]
1466+
for case in cases:
1467+
with self.subTest(case=case):
1468+
sig = inspect.signature(case)
1469+
self.assertEqual(str(sig), '(format=1, /)')
1470+
param, = sig.parameters.values()
1471+
self.assertEqual(param.name, 'format')
1472+
self.assertIs(param.kind, inspect.Parameter.POSITIONAL_ONLY)
1473+
14491474
def test_constraints(self):
14501475
def f[T: (int, str)](): pass
14511476
T, = f.__type_params__

Lib/venv/scripts/common/activate.fish

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ end
3434
deactivate nondestructive
3535

3636
set -gx VIRTUAL_ENV __VENV_DIR__
37+
if string match -qr 'CYGWIN|MSYS|MINGW' (uname)
38+
set -gx VIRTUAL_ENV (cygpath -u $VIRTUAL_ENV)
39+
end
3740

3841
set -gx _OLD_VIRTUAL_PATH $PATH
3942
set -gx PATH "$VIRTUAL_ENV/"__VENV_BIN_NAME__ $PATH
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:func:`inspect.signature` now works on the lazy evaluators of type aliases
2+
and type parameters instead of raising :exc:`ValueError`.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix OOM error handling in :c:func:`PyFrame_GetBack` to propagate exceptions instead of masking them as None.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed venv exporting mixed path styles to PATH on Windows inside fish (via Cygwin, MinGW or MSYS2)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add missing ``size`` positional argument to the pure-Python implementation of :meth:`io.TextIOBase.readline`.

0 commit comments

Comments
 (0)