Skip to content

Commit 2da7291

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Import CPython 3.14.6+ stable branch (2026-07-07)
Summary: Imported python/cpython `3.14.6+` from upstream rev [`3d802b5`](https://www.github.com/python/cpython/commit/3d802b5be90a238c8f5ba4016f16eaddc60f375f) (committed 2026-07-07 18:02:59+00:00). # Commit Info - Base: (`3.14.6+`) - [`ef862d6`](https://www.github.com/python/cpython/commit/ef862d613a609ea1b1acd452583dd27a68e5afaa) (commit date: 2026-07-07 00:24:20+00:00) - Imported: (`3.14.6+`) - [`3d802b5`](https://www.github.com/python/cpython/commit/3d802b5be90a238c8f5ba4016f16eaddc60f375f) (commit date: 2026-07-07 18:02:59+00:00) # Noteworthy file changes - Low-signal files (4 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GOro8iQz03qNxOQHANwDzvBLuc0Nbr0LAAAz Reviewed By: itamaro Differential Revision: D111029362 fbshipit-source-id: f2d4be224dc929e583d40ae15b8fbff90b4b1106
1 parent e06ed22 commit 2da7291

21 files changed

Lines changed: 139 additions & 24 deletions

.github/workflows/reusable-docs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ name: Reusable Docs
33
on:
44
workflow_call:
55
workflow_dispatch:
6+
# Pushes to CPython branches seed the pip caches under the exact keys every
7+
# docs PR restores from. Without a branch-scoped copy, each PR saves a
8+
# duplicate into its own refs/pull/N/merge scope that nothing else can read.
9+
push:
10+
branches:
11+
- main
12+
- '3.*'
13+
paths:
14+
- 'Doc/pylock.toml'
15+
- 'Doc/requirements.txt'
16+
- '.github/workflows/reusable-docs.yml'
617

718
permissions:
819
contents: read

Doc/c-api/buffer.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ readonly, format
263263

264264
.. c:macro:: PyBUF_WRITEABLE
265265
266-
This is a :term:`soft deprecated` alias to :c:macro:`PyBUF_WRITABLE`.
266+
This is an alias to :c:macro:`PyBUF_WRITABLE`.
267+
268+
.. soft-deprecated:: 3.13
267269

268270
.. c:macro:: PyBUF_FORMAT
269271

Doc/c-api/code.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,16 @@ bound into a function.
214214
215215
.. c:function:: PyObject *PyCode_Optimize(PyObject *code, PyObject *consts, PyObject *names, PyObject *lnotab_obj)
216216
217-
This is a :term:`soft deprecated` function that does nothing.
217+
This is a function that does nothing.
218218
219219
Prior to Python 3.10, this function would perform basic optimizations to a
220220
code object.
221221
222222
.. versionchanged:: 3.10
223223
This function now does nothing.
224224
225+
.. soft-deprecated:: 3.13
226+
225227
226228
.. _c_codeobject_flags:
227229

Doc/c-api/gen.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ Deprecated API
9191
9292
.. c:macro:: PyAsyncGenASend_CheckExact(op)
9393
94-
This is a :term:`soft deprecated` API that was included in Python's C API
94+
This is an API that was included in Python's C API
9595
by mistake.
9696
9797
It is solely here for completeness; do not use this API.
98+
99+
.. soft-deprecated:: 3.14

Doc/c-api/intro.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -508,22 +508,22 @@ in C11.
508508
509509
.. c:macro:: Py_MEMCPY(dest, src, n)
510510
511-
This is a :term:`soft deprecated` alias to :c:func:`!memcpy`.
512-
Use :c:func:`!memcpy` directly instead.
511+
This is an alias to :c:func:`!memcpy`.
513512
514-
.. deprecated:: 3.14
515-
The macro is :term:`soft deprecated`.
513+
.. soft-deprecated:: 3.14
514+
Use :c:func:`!memcpy` directly instead.
516515
517516
.. c:macro:: Py_VA_COPY
518517
519-
This is a :term:`soft deprecated` alias to the C99-standard ``va_copy``
520-
function.
518+
This is an alias to the C99-standard ``va_copy`` function.
521519
522520
Historically, this would use a compiler-specific method to copy a ``va_list``.
523521
524522
.. versionchanged:: 3.6
525523
This is now an alias to ``va_copy``.
526524
525+
.. soft-deprecated:: 3.14
526+
527527
528528
.. _api-objects:
529529

Doc/c-api/set.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Deprecated API
204204
205205
.. c:macro:: PySet_MINSIZE
206206
207-
A :term:`soft deprecated` constant representing the size of an internal
207+
A constant representing the size of an internal
208208
preallocated table inside :c:type:`PySetObject` instances.
209209
210210
This is documented solely for completeness, as there are no guarantees
@@ -214,3 +214,5 @@ Deprecated API
214214
:c:macro:`!PySet_MINSIZE` can be replaced with a small constant like ``8``.
215215
216216
If looking for the size of a set, use :c:func:`PySet_Size` instead.
217+
218+
.. soft-deprecated:: 3.14

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,8 +1376,8 @@ and :c:data:`PyType_Type` effectively act as defaults.)
13761376

13771377
.. versionchanged:: 3.9
13781378

1379-
Renamed to the current name, without the leading underscore.
1380-
The old provisional name is :term:`soft deprecated`.
1379+
Renamed to the current name, without the leading underscore.
1380+
The old provisional name is :term:`soft deprecated`.
13811381

13821382
.. versionchanged:: 3.12
13831383

@@ -1486,11 +1486,13 @@ and :c:data:`PyType_Type` effectively act as defaults.)
14861486

14871487
.. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG
14881488
1489-
This is a :term:`soft deprecated` macro that does nothing.
1489+
This macro does nothing.
14901490
Historically, this would indicate that the
14911491
:c:member:`~PyTypeObject.tp_version_tag` field was available and
14921492
initialized.
14931493

1494+
.. soft-deprecated:: 3.13
1495+
14941496

14951497
.. c:macro:: Py_TPFLAGS_INLINE_VALUES
14961498

Doc/library/ctypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,8 +3191,8 @@ Arrays and pointers
31913191
Equivalent to ``type * length``, where *type* is a
31923192
:mod:`!ctypes` data type and *length* an integer.
31933193

3194-
This function is :term:`soft deprecated` in favor of multiplication.
3195-
There are no plans to remove it.
3194+
.. soft-deprecated:: 3.14
3195+
In favor of multiplication.
31963196

31973197

31983198
.. class:: _Pointer

Doc/library/mimetypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ the information :func:`init` sets up.
5757
Added support for *url* being a :term:`path-like object`.
5858

5959
.. soft-deprecated:: 3.13
60-
Passing a file path instead of URL is :term:`soft deprecated`.
60+
Passing a file path instead of URL.
6161
Use :func:`guess_file_type` for this.
6262

6363

Lib/imaplib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@
131131
# We compile these in _mode_xxx.
132132
_Literal = br'.*{(?P<size>\d+)}$'
133133
_Untagged_status = br'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?'
134+
# Only NUL, CR and LF are unsafe (they cannot be represented even in
135+
# a quoted string); other control characters are sent quoted.
136+
_control_chars = re.compile(b'[\x00\r\n]')
134137
_non_astring_char = re.compile(br'[(){ \x00-\x1f\x7f-\xff%*\\"]')
135138
_non_list_char = re.compile(br'[(){ \x00-\x1f\x7f-\xff\\"]')
136139
_quoted = re.compile(br'"(?:[^"\\]|\\.)*+"')
@@ -1155,6 +1158,8 @@ def _command(self, name, *args):
11551158
if arg is None: continue
11561159
if isinstance(arg, str):
11571160
arg = bytes(arg, self._encoding)
1161+
if _control_chars.search(arg):
1162+
raise ValueError("NUL, CR and LF not allowed in commands")
11581163
data = data + b' ' + arg
11591164

11601165
literal = self.literal

0 commit comments

Comments
 (0)