Skip to content

Commit e8b47e4

Browse files
Merge branch 'main' into clear_NameError_suggestion
2 parents 0493ff2 + 8a32914 commit e8b47e4

77 files changed

Lines changed: 4524 additions & 2204 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ jobs:
554554
- Thread
555555
free-threading:
556556
- false
557+
- true
557558
sanitizer:
558559
- TSan
559560
include:
@@ -565,17 +566,6 @@ jobs:
565566
sanitizer: ${{ matrix.sanitizer }}
566567
free-threading: ${{ matrix.free-threading }}
567568

568-
# XXX: Temporarily allow this job to fail to not block PRs.
569-
build-san-free-threading:
570-
# ${{ '' } is a hack to nest jobs under the same sidebar category.
571-
name: Sanitizers${{ '' }} # zizmor: ignore[obfuscation]
572-
needs: build-context
573-
if: needs.build-context.outputs.run-ubuntu == 'true'
574-
uses: ./.github/workflows/reusable-san.yml
575-
with:
576-
sanitizer: TSan
577-
free-threading: true
578-
579569
cross-build-linux:
580570
name: Cross build Linux
581571
runs-on: ubuntu-26.04
@@ -679,7 +669,6 @@ jobs:
679669
- test-hypothesis
680670
- build-asan
681671
- build-san
682-
- build-san-free-threading
683672
- cross-build-linux
684673
- cifuzz
685674
if: always()
@@ -691,7 +680,6 @@ jobs:
691680
allowed-failures: >-
692681
build-android,
693682
build-emscripten,
694-
build-san-free-threading,
695683
build-windows-msi,
696684
build-ubuntu-ssltests,
697685
test-hypothesis,

Doc/c-api/float.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ most likely :exc:`OverflowError`).
233233
234234
Pack a C double as the IEEE 754 binary64 double precision format.
235235
236-
.. impl-detail::
237-
This function always succeeds in CPython.
238-
239236
240237
Unpack functions
241238
^^^^^^^^^^^^^^^^
@@ -251,9 +248,6 @@ Return value: The unpacked double. On error, this is ``-1.0`` and
251248
:c:func:`PyErr_Occurred` is true (and an exception is set, most likely
252249
:exc:`OverflowError`).
253250
254-
.. impl-detail::
255-
These functions always succeed in CPython.
256-
257251
.. c:function:: double PyFloat_Unpack2(const char *p, int le)
258252
259253
Unpack the IEEE 754 binary16 half-precision format as a C double.

Doc/library/asyncio-tools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The following commands inspect the process identified by ``PID``:
2424
2525
The commands read the target process state without executing any code in it.
2626
They are only available on supported platforms and may require permission to
27-
inspect another process. See the :ref:`permission-requirements <permission-requirements>` for details.
27+
inspect another process. See the :ref:`permission requirements <permission-requirements>` for details.
2828

2929
.. seealso::
3030

Doc/library/codecs.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,18 @@ On Windows, ``cpXXX`` codecs are available for all code pages.
10871087
But only codecs listed in the following table are guaranteed to exist on
10881088
other platforms.
10891089

1090+
On platforms that provide the C library's :manpage:`iconv(3)` function
1091+
(such as those using the GNU C Library),
1092+
every encoding known to ``iconv`` for which Python has no built-in codec
1093+
is available as well.
1094+
Such an encoding is looked up by its ``iconv`` name (for example ``cp1133``).
1095+
Prefixing the name with ``iconv:`` forces the use of the ``iconv``-based codec
1096+
even when a built-in codec of the same name exists (for example ``iconv:latin1``),
1097+
which is mostly useful for testing.
1098+
1099+
.. versionchanged:: next
1100+
Added support for encodings provided by the C library's ``iconv``.
1101+
10901102
.. impl-detail::
10911103

10921104
Some common encodings can bypass the codecs lookup machinery to

Doc/library/imaplib.rst

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,19 @@ In general, pass arguments unquoted and let the module quote them as needed.
192192
An argument that is already enclosed in double quotes is left unchanged,
193193
so that code which quotes arguments itself keeps working.
194194

195+
Mailbox names are encoded as modified UTF-7 (:rfc:`3501`, section 5.1.3),
196+
so a mailbox name containing non-ASCII characters can be passed as an
197+
ordinary :class:`str`.
198+
A :class:`str` that is already valid modified UTF-7 is left unchanged,
199+
so that a name obtained from :meth:`~IMAP4.list` (raw ``bytes`` decoded to
200+
text) round-trips; pass :class:`bytes` to send the exact bytes with no
201+
encoding.
202+
When ``UTF8=ACCEPT`` is enabled (see :meth:`~IMAP4.enable`), mailbox names
203+
are sent as UTF-8 instead.
204+
205+
.. versionchanged:: next
206+
Non-ASCII mailbox names are automatically encoded as modified UTF-7.
207+
195208
Most commands return a tuple: ``(type, [data, ...])`` where *type* is usually
196209
``'OK'`` or ``'NO'``, and *data* is either the text from the command response,
197210
or mandated results from the command. Each *data* is either a ``bytes``, or a
@@ -260,10 +273,16 @@ An :class:`IMAP4` instance has the following methods:
260273
mailbox. This is the recommended command before ``LOGOUT``.
261274

262275

263-
.. method:: IMAP4.copy(message_set, new_mailbox)
276+
.. method:: IMAP4.copy(message_set, new_mailbox, *, uid=False)
264277

265278
Copy *message_set* messages onto end of *new_mailbox*.
266279

280+
If *uid* is true, *message_set* is a set of UIDs and the ``UID COPY``
281+
command is used instead of ``COPY``.
282+
283+
.. versionchanged:: next
284+
Added the *uid* parameter.
285+
267286

268287
.. method:: IMAP4.create(mailbox)
269288

@@ -290,19 +309,33 @@ An :class:`IMAP4` instance has the following methods:
290309
The :meth:`enable` method itself, and :RFC:`6855` support.
291310

292311

293-
.. method:: IMAP4.expunge()
312+
.. method:: IMAP4.expunge(message_set=None, *, uid=False)
294313

295314
Permanently remove deleted items from selected mailbox. Generates an ``EXPUNGE``
296315
response for each deleted message. Returned data contains a list of ``EXPUNGE``
297316
message numbers in order received.
298317

318+
If *uid* is true, the ``UID EXPUNGE`` command (:rfc:`4315`) is used to remove
319+
only the messages that both are marked as deleted and have a UID in
320+
*message_set*. *message_set* is required in this case, and must be omitted
321+
otherwise.
322+
323+
.. versionchanged:: next
324+
Added the *message_set* and *uid* parameters.
325+
299326

300-
.. method:: IMAP4.fetch(message_set, message_parts)
327+
.. method:: IMAP4.fetch(message_set, message_parts, *, uid=False)
301328

302329
Fetch (parts of) messages. *message_parts* should be a string of message part
303330
names enclosed within parentheses, eg: ``"(UID BODY[TEXT])"``. Returned data
304331
are tuples of message part envelope and data.
305332

333+
If *uid* is true, *message_set* is a set of UIDs and the message numbers in
334+
the response are UIDs (``UID FETCH``).
335+
336+
.. versionchanged:: next
337+
Added the *uid* parameter.
338+
306339

307340
.. method:: IMAP4.getacl(mailbox)
308341

@@ -482,12 +515,15 @@ An :class:`IMAP4` instance has the following methods:
482515
Returned data are tuples of message part envelope and data.
483516

484517

485-
.. method:: IMAP4.move(message_set, new_mailbox)
518+
.. method:: IMAP4.move(message_set, new_mailbox, *, uid=False)
486519

487520
Move *message_set* messages onto end of *new_mailbox*.
488521

489522
The server must support the ``MOVE`` capability (:rfc:`6851`).
490523

524+
If *uid* is true, *message_set* is a set of UIDs and the ``UID MOVE``
525+
command is used instead of ``MOVE``.
526+
491527
.. versionadded:: next
492528

493529

@@ -562,7 +598,7 @@ An :class:`IMAP4` instance has the following methods:
562598
code, instead of the usual type.
563599

564600

565-
.. method:: IMAP4.search(charset, criterion[, ...])
601+
.. method:: IMAP4.search(charset, criterion[, ...], *, uid=False)
566602

567603
Search mailbox for matching messages. *charset* may be ``None``, in which case
568604
no ``CHARSET`` will be specified in the request to the server. The IMAP
@@ -571,6 +607,9 @@ An :class:`IMAP4` instance has the following methods:
571607
the ``UTF8=ACCEPT`` capability was enabled using the :meth:`enable`
572608
command.
573609

610+
If *uid* is true, the message numbers in the response are UIDs
611+
(``UID SEARCH``).
612+
574613
Example::
575614

576615
# M is a connected IMAP4 instance...
@@ -579,6 +618,9 @@ An :class:`IMAP4` instance has the following methods:
579618
# or:
580619
typ, msgnums = M.search(None, '(FROM "LDJ")')
581620

621+
.. versionchanged:: next
622+
Added the *uid* parameter.
623+
582624

583625
.. method:: IMAP4.select(mailbox='INBOX', readonly=False)
584626

@@ -623,7 +665,7 @@ An :class:`IMAP4` instance has the following methods:
623665
Returns socket instance used to connect to server.
624666

625667

626-
.. method:: IMAP4.sort(sort_criteria, charset, search_criterion[, ...])
668+
.. method:: IMAP4.sort(sort_criteria, charset, search_criterion[, ...], *, uid=False)
627669

628670
The ``sort`` command is a variant of ``search`` with sorting semantics for the
629671
results. Returned data contains a space separated list of matching message
@@ -638,8 +680,13 @@ An :class:`IMAP4` instance has the following methods:
638680
the interpretation of strings in the searching criteria. It then returns the
639681
numbers of matching messages.
640682

683+
If *uid* is true, the message numbers in the response are UIDs (``UID SORT``).
684+
641685
This is an ``IMAP4rev1`` extension command.
642686

687+
.. versionchanged:: next
688+
Added the *uid* parameter.
689+
643690

644691
.. method:: IMAP4.starttls(ssl_context=None)
645692

@@ -668,12 +715,15 @@ An :class:`IMAP4` instance has the following methods:
668715
Request named status conditions for *mailbox*.
669716

670717

671-
.. method:: IMAP4.store(message_set, command, flag_list)
718+
.. method:: IMAP4.store(message_set, command, flag_list, *, uid=False)
672719

673720
Alters flag dispositions for messages in mailbox. *command* is specified by
674721
section 6.4.6 of :rfc:`3501` as being one of "FLAGS", "+FLAGS", or "-FLAGS",
675722
optionally with a suffix of ".SILENT".
676723

724+
If *uid* is true, *message_set* is a set of UIDs and the ``UID STORE``
725+
command is used instead of ``STORE``.
726+
677727
For example, to set the delete flag on all messages::
678728

679729
typ, data = M.search(None, 'ALL')
@@ -693,12 +743,15 @@ An :class:`IMAP4` instance has the following methods:
693743
Python 3.6, handles them if they are sent from the server, since this
694744
improves real-world compatibility.
695745

746+
.. versionchanged:: next
747+
Added the *uid* parameter.
748+
696749
.. method:: IMAP4.subscribe(mailbox)
697750

698751
Subscribe to new mailbox.
699752

700753

701-
.. method:: IMAP4.thread(threading_algorithm, charset, search_criterion[, ...])
754+
.. method:: IMAP4.thread(threading_algorithm, charset, search_criterion[, ...], *, uid=False)
702755

703756
The ``thread`` command is a variant of ``search`` with threading semantics for
704757
the results. Returned data contains a space separated list of thread members.
@@ -716,8 +769,14 @@ An :class:`IMAP4` instance has the following methods:
716769
returns the matching messages threaded according to the specified threading
717770
algorithm.
718771

772+
If *uid* is true, the message numbers in the response are UIDs
773+
(``UID THREAD``).
774+
719775
This is an ``IMAP4rev1`` extension command.
720776

777+
.. versionchanged:: next
778+
Added the *uid* parameter.
779+
721780

722781
.. method:: IMAP4.uid(command, arg[, ...])
723782

Doc/library/locale.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ The :mod:`!locale` module defines the following exception and functions:
342342
.. versionchanged:: 3.14
343343
The function now temporarily sets the ``LC_CTYPE`` locale in some cases.
344344

345+
.. versionchanged:: next
346+
On glibc, the ``LC_TIME`` items (except ``ERA``) are now decoded
347+
independently of the ``LC_CTYPE`` encoding.
348+
345349

346350
.. function:: getdefaultlocale([envvars])
347351

Doc/library/tkinter.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,15 @@ distance
790790
millimetres, ``p`` for printer's points. For example, 3.5 inches is expressed
791791
as ``"3.5i"``.
792792

793+
When a screen distance option is read back (for example with :meth:`!cget`),
794+
a distance with no unit suffix is returned as an :class:`int` or a :class:`float`.
795+
A distance with a unit suffix depends on the screen resolution
796+
and is returned as an opaque Tcl object that can be passed back to Tk.
797+
798+
.. versionchanged:: next
799+
Screen distances with no unit suffix are returned as an :class:`int`
800+
or a :class:`float`.
801+
793802
font
794803
Tk uses a font description such as ``{courier 10 bold}``; in
795804
:mod:`!tkinter` this is most naturally passed as a tuple of

Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,4 @@ Doc/library/xml.sax.reader.rst
3333
Doc/library/xml.sax.rst
3434
Doc/library/xmlrpc.client.rst
3535
Doc/library/xmlrpc.server.rst
36-
Doc/whatsnew/2.4.rst
37-
Doc/whatsnew/2.5.rst
3836
Doc/whatsnew/2.6.rst

Doc/using/windows.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,9 @@ on using nuget. What follows is a summary that is sufficient for Python
11741174
developers.
11751175

11761176
The ``nuget.exe`` command line tool may be downloaded directly from
1177-
``https://aka.ms/nugetclidl``, for example, using curl or PowerShell. With the
1178-
tool, the latest version of Python for 64-bit or 32-bit machines is installed
1179-
using::
1177+
``https://dist.nuget.org/win-x86-commandline/latest/nuget.exe``, for example,
1178+
using curl or PowerShell. With the tool, the latest version of Python for
1179+
64-bit or 32-bit machines is installed using::
11801180

11811181
nuget.exe install python -ExcludeVersion -OutputDirectory .
11821182
nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory .

0 commit comments

Comments
 (0)