Skip to content

Commit c775e96

Browse files
committed
Merge branch 'main' into pr/92078
2 parents 911ddb0 + 17718b0 commit c775e96

24 files changed

+1432
-1519
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ jobs:
422422
# failing when executed from inside a virtual environment.
423423
"${VENV_PYTHON}" -m test \
424424
-W \
425-
-o \
425+
--slowest \
426426
-j4 \
427+
--timeout 900 \
427428
-x test_asyncio \
428429
-x test_multiprocessing_fork \
429430
-x test_multiprocessing_forkserver \

Doc/deprecations/c-api-pending-removal-in-3.15.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Pending removal in Python 3.15
1010
:c:func:`PyWeakref_GetRef` on Python 3.12 and older.
1111
* :c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro:
1212
Use :c:type:`wchar_t` instead.
13+
* :c:func:`!PyUnicode_AsDecodedObject`:
14+
Use :c:func:`PyCodec_Decode` instead.
15+
* :c:func:`!PyUnicode_AsDecodedUnicode`:
16+
Use :c:func:`PyCodec_Decode` instead; Note that some codecs (for example, "base64")
17+
may return a type other than :class:`str`, such as :class:`bytes`.
18+
* :c:func:`!PyUnicode_AsEncodedObject`:
19+
Use :c:func:`PyCodec_Encode` instead.
20+
* :c:func:`!PyUnicode_AsEncodedUnicode`:
21+
Use :c:func:`PyCodec_Encode` instead; Note that some codecs (for example, "base64")
22+
may return a type other than :class:`bytes`, such as :class:`str`.
1323
* Python initialization functions, deprecated in Python 3.13:
1424

1525
* :c:func:`Py_GetPath`:

Doc/deprecations/c-api-pending-removal-in-future.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ although there is currently no date scheduled for their removal.
1818
Use :c:func:`PyOS_AfterFork_Child` instead.
1919
* :c:func:`PySlice_GetIndicesEx`:
2020
Use :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices` instead.
21-
* :c:func:`!PyUnicode_AsDecodedObject`:
22-
Use :c:func:`PyCodec_Decode` instead.
23-
* :c:func:`!PyUnicode_AsDecodedUnicode`:
24-
Use :c:func:`PyCodec_Decode` instead.
25-
* :c:func:`!PyUnicode_AsEncodedObject`:
26-
Use :c:func:`PyCodec_Encode` instead.
27-
* :c:func:`!PyUnicode_AsEncodedUnicode`:
28-
Use :c:func:`PyCodec_Encode` instead.
2921
* :c:func:`PyUnicode_READY`:
3022
Unneeded since Python 3.12
3123
* :c:func:`!PyErr_Display`:

Doc/deprecations/pending-removal-in-future.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,6 @@ although there is currently no date scheduled for their removal.
153153
:class:`~xml.etree.ElementTree.Element` is deprecated. In a future release it
154154
will always return ``True``. Prefer explicit ``len(elem)`` or
155155
``elem is not None`` tests instead.
156+
157+
* :func:`sys._clear_type_cache` is deprecated:
158+
use :func:`sys._clear_internal_caches` instead.

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,9 @@ sys
12501250
* On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore.
12511251
It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``.
12521252

1253+
* Raise :exc:`DeprecationWarning` for :func:`sys._clear_type_cache`. This
1254+
function was deprecated in Python 3.13 but it didn't raise a runtime warning.
1255+
12531256

12541257
sys.monitoring
12551258
--------------

Include/unicodeobject.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_Decode(
344344
/* Decode a Unicode object unicode and return the result as Python
345345
object.
346346
347-
This API is DEPRECATED. The only supported standard encoding is rot13.
347+
This API is DEPRECATED and will be removed in 3.15.
348+
The only supported standard encoding is rot13.
348349
Use PyCodec_Decode() to decode with rot13 and non-standard codecs
349350
that decode from str. */
350351

@@ -357,7 +358,8 @@ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject(
357358
/* Decode a Unicode object unicode and return the result as Unicode
358359
object.
359360
360-
This API is DEPRECATED. The only supported standard encoding is rot13.
361+
This API is DEPRECATED and will be removed in 3.15.
362+
The only supported standard encoding is rot13.
361363
Use PyCodec_Decode() to decode with rot13 and non-standard codecs
362364
that decode from str to str. */
363365

@@ -370,7 +372,8 @@ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode(
370372
/* Encodes a Unicode object and returns the result as Python
371373
object.
372374
373-
This API is DEPRECATED. It is superseded by PyUnicode_AsEncodedString()
375+
This API is DEPRECATED and will be removed in 3.15.
376+
It is superseded by PyUnicode_AsEncodedString()
374377
since all standard encodings (except rot13) encode str to bytes.
375378
Use PyCodec_Encode() for encoding with rot13 and non-standard codecs
376379
that encode form str to non-bytes. */
@@ -393,7 +396,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(
393396
/* Encodes a Unicode object and returns the result as Unicode
394397
object.
395398
396-
This API is DEPRECATED. The only supported standard encodings is rot13.
399+
This API is DEPRECATED and will be removed in 3.15.
400+
The only supported standard encodings is rot13.
397401
Use PyCodec_Encode() to encode with rot13 and non-standard codecs
398402
that encode from str to str. */
399403

Lib/test/test_cmd_line.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import tempfile
1010
import textwrap
1111
import unittest
12+
import warnings
1213
from test import support
1314
from test.support import os_helper
1415
from test.support import force_not_colorized
@@ -936,14 +937,20 @@ def test_python_asyncio_debug(self):
936937
@unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option")
937938
def test_python_dump_refs(self):
938939
code = 'import sys; sys._clear_type_cache()'
939-
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1')
940+
# TODO: Remove warnings context manager once sys._clear_type_cache is removed
941+
with warnings.catch_warnings():
942+
warnings.simplefilter("ignore", DeprecationWarning)
943+
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1')
940944
self.assertEqual(rc, 0)
941945

942946
@unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option")
943947
def test_python_dump_refs_file(self):
944948
with tempfile.NamedTemporaryFile() as dump_file:
945949
code = 'import sys; sys._clear_type_cache()'
946-
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name)
950+
# TODO: Remove warnings context manager once sys._clear_type_cache is removed
951+
with warnings.catch_warnings():
952+
warnings.simplefilter("ignore", DeprecationWarning)
953+
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name)
947954
self.assertEqual(rc, 0)
948955
with open(dump_file.name, 'r') as file:
949956
contents = file.read()

0 commit comments

Comments
 (0)