10000 Merge remote-tracking branch 'upstream/main' into pep649-compile · python/cpython@82c0dbc · GitHub
[go: up one dir, main page]

Skip to content

Commit 82c0dbc

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pep649-compile
2 parents 1a63f5d + 858b9e8 commit 82c0dbc

File tree

7 files changed

+44
-25
lines changed

7 files changed

+44
-25
lines changed

Doc/library/hashlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
328328
your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers
329329
on the `stackexchange pbkdf2 iterations question`_ explain in detail.
330330

331-
*dklen* is the length of the derived key. If *dklen* is ``None`` then the
331+
*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the
332332
digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512.
333333

334334
>>> from hashlib import pbkdf2_hmac
@@ -357,7 +357,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
357357

358358
*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
359359
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB).
360-
*dklen* is the length of the derived key.
360+
*dklen* is the length of the derived key in bytes.
361361

362362
.. versionadded:: 3.6
363363

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ unittest
17391739

17401740
* Undocumented :meth:`TestLoader.loadTestsFromModule
17411741
<unittest.TestLoader.loadTestsFromModule>` parameter *use_load_tests*
1742-
(deprecated and ignored since Python 3.2).
1742+
(deprecated and ignored since Python 3.5).
17431743

17441744
* An alias of the :class:`~unittest.TextTestResult` class:
17451745
``_TextTestResult`` (deprecated in Python 3.2).

Lib/email/_header_value_parser.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ class _InvalidEwError(errors.HeaderParseError):
956956
DOT = ValueTerminal('.', 'dot')
957957
ListSeparator = ValueTerminal(',', 'list-separator')
958958
ListSeparator.as_ew_allowed = False
959+
ListSeparator.syntactic_break = False
959960
RouteComponentMarker = ValueTerminal('@', 'route-component-marker')
960961

961962
#
@@ -2844,7 +2845,9 @@ def _refold_parse_tree(parse_tree, *, policy):
28442845
if not hasattr(part, 'encode'):
28452846
# It's not a Terminal, do each piece individually.
28462847
parts = list(part) + parts
2847-
else:
2848+
want_encoding = False
2849+
continue
2850+
elif part.as_ew_allowed:
28482851
# It's a terminal, wrap it as an encoded word, possibly
28492852
# combining it with previously encoded words if allowed.
28502853
if (last_ew is not None and
@@ -2858,8 +2861,14 @@ def _refold_parse_tree(parse_tree, *, policy):
28582861
# so clear it now.
28592862
leading_whitespace = ''
28602863
last_charset = charset
2861-
want_encoding = False
2862-
continue
2864+
want_encoding = False
2865+
continue
2866+
else:
2867+
# It's a terminal which should be kept non-encoded
2868+
# (e.g. a ListSeparator).
2869+
last_ew = None
2870+
want_encoding = False
2871+
# fall through
28632872

28642873
if len(tstr) <= maxlen - len(lines[-1]):
28652874
lines[-1] += tstr

Lib/test/test_email/test__header_value_parser.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3077,9 +3077,17 @@ def test_address_list_with_unicode_names_in_quotes(self):
30773077
' =?utf-8?q?bei=C3=9Ft_bei=C3=9Ft?= <biter@example.com>\n')
30783078

30793079
def test_address_list_with_list_separator_after_fold(self):
3080-
to = '0123456789' * 8 + '@foo, ä <foo@bar>'
3080+
a = 'x' * 66 + '@example.com'
3081+
to = f'{a}, "Hübsch Kaktus" <beautiful@example.com>'
30813082
self._test(parser.get_address_list(to)[0],
3082-
'0123456789' * 8 + '@foo,\n =?utf-8?q?=C3=A4?= <foo@bar>\n')
3083+
f'{a},\n =?utf-8?q?H=C3=BCbsch?= Kaktus <beautiful@example.com>\n')
3084+
3085+
a = '.' * 79
3086+
to = f'"{a}" <xyz@example.com>, "Hübsch Kaktus" <beautiful@example.com>'
3087+
self._test(parser.get_address_list(to)[0],
3088+
f'{a}\n'
3089+
' <xyz@example.com>, =?utf-8?q?H=C3=BCbsch?= Kaktus '
3090+
'<beautiful@example.com>\n')
30833091

30843092
# XXX Need tests with comments on various sides of a unicode token,
30853093
# and with unicode tokens in the comments. Spaces inside the quotes

Misc/NEWS.d/3.13.0a1.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ on deallocation.
563563
564564
Fix :meth:`multiprocessing.synchronize.SemLock.__setstate__` to properly
565565
initialize :attr:`multiprocessing.synchronize.SemLock._is_fork_ctx`. This
566-
fixes a regression when passing a SemLock accross nested processes.
566+
fixes a regression when passing a SemLock across nested processes.
567567

568568
Rename :attr:`multiprocessing.synchronize.SemLock.is_fork_ctx` to
569569
:attr:`multiprocessing.synchronize.SemLock._is_fork_ctx` to avoid exposing
@@ -708,7 +708,7 @@ Fixes crash when tracing in recursive calls to Python classes.
708708
.. section: Core and Builtins
709709
710710
Remove the ``_PyCFrame`` struct, moving the pointer to the current
711-
intepreter frame back to the threadstate, as it was for 3.10 and earlier.
711+
interpreter frame back to the threadstate, as it was for 3.10 and earlier.
712712
The ``_PyCFrame`` existed as a performance optimization for tracing. Since
713713
PEP 669 has been implemented, this optimization no longer applies.
714714

@@ -926,7 +926,7 @@ Isolate :mod:`!_decimal` (apply :pep:`687`). Patch by Charlie Zhao.
926926
927927
Add the exception as the third argument to ``PY_UNIND`` callbacks in
928928
``sys.monitoring``. This makes the ``PY_UNWIND`` callback consistent with
929-
the other exception hanlding callbacks.
929+
the other exception handling callbacks.
930930

931931
..
932932
@@ -935,7 +935,7 @@ the other exception hanlding callbacks.
935935
.. nonce: DdEwV8
936936
.. section: Core and Builtins
937937
938-
Raise a ``ValueError`` when a monitoring callback funtion returns
938+
Raise a ``ValueError`` when a monitoring callback function returns
939939
``DISABLE`` for events that cannot be disabled locally.
940940

941941
..
@@ -1006,7 +1006,7 @@ Add :meth:`dbm.gnu.gdbm.clear` to :mod:`dbm.gnu`. Patch By Donghee Na.
10061006
.. section: Core and Builtins
10071007
10081008
The ASYNC and AWAIT tokens are removed from the Grammar, which removes the
1009-
posibility of making ``async`` and ``await`` soft keywords when using
1009+
possibility of making ``async`` and ``await`` soft keywords when using
10101010
``feature_version<7`` in :func:`ast.parse`.
10111011

10121012
..
@@ -1028,7 +1028,7 @@ the call is not a classmethod.
10281028
.. nonce: DdqHFg
10291029
.. section: Core and Builtins
10301030
1031-
Python no longer crashes due an infrequent race when initialzing
1031+
Python no longer crashes due an infrequent race when initializing
10321032
per-interpreter interned strings. The crash would manifest when the
10331033
interpreter was finalized.
10341034

@@ -1922,7 +1922,7 @@ objects
19221922
.. nonce: RDGe8-
19231923
.. section: Library
19241924
1925-
Deprecation warning about non-integer number in :mod:`gettext` now alwais
1925+
Deprecation warning about non-integer number in :mod:`gettext` now always
19261926
refers to the line in the user code where gettext function or method is
19271927
used. Previously it could refer to a line in ``gettext`` code.
19281928

@@ -2047,7 +2047,7 @@ point.
20472047
.. nonce: fECxTj
20482048
.. section: Library
20492049
2050-
On Windows, multiprocessing ``Popen.terminate()`` now catchs
2050+
On Windows, multiprocessing ``Popen.terminate()`` now catches
20512051
:exc:`PermissionError` and get the process exit code. If the process is
20522052
still running, raise again the :exc:`PermissionError`. Otherwise, the
20532053
process terminated as expected: store its exit code. Patch by Victor
@@ -2857,7 +2857,7 @@ Seems that in some conditions, OpenSSL will return ``SSL_ERROR_SYSCALL``
28572857
instead of ``SSL_ERROR_SSL`` when a certification verification has failed,
28582858
but the error parameters will still contain ``ERR_LIB_SSL`` and
28592859
``SSL_R_CERTIFICATE_VERIFY_FAILED``. We are now detecting this situation and
2860-
raising the appropiate ``ssl.SSLCertVerificationError``. Patch by Pablo
2860+
raising the appropriate ``ssl.SSLCertVerificationError``. Patch by Pablo
28612861
Galindo
28622862

28632863
..
@@ -2979,7 +2979,7 @@ method. Patch by James Cave.
29792979
.. section: Library
29802980
29812981
Fix overflow on 32-bit systems with :mod:`asyncio` :func:`os.sendfile`
2982-
implemention.
2982+
implementation.
29832983

29842984
..
29852985
@@ -3251,7 +3251,7 @@ Eliseev.
32513251
.. nonce: NN35-U
32523252
.. section: Library
32533253
3254-
Optimize ``(?!)`` (pattern which alwais fails) in regular expressions.
3254+
Optimize ``(?!)`` (pattern which always fails) in regular expressions.
32553255

32563256
..
32573257
@@ -3495,7 +3495,7 @@ star imports.
34953495
.. nonce: TJEUkd
34963496
.. section: Library
34973497
3498-
Zipapp will now skip over apending an archive to itself.
3498+
Zipapp will now skip over appending an archive to itself.
34993499

35003500
..
35013501
@@ -4564,7 +4564,7 @@ Deprecate passing any arguments to :func:`threading.RLock`.
45644564
.. nonce: o5Zb0t
45654565
.. section: Library
45664566
4567-
Refactored ``zipfile._strip_extra`` to use higher level abstactions for
4567+
Refactored ``zipfile._strip_extra`` to use higher level abstractions for
45684568
extras instead of a heavy-state loop.
45694569

45704570
..
@@ -5014,7 +5014,7 @@ by Victor Stinner.
50145014
50155015
Fix test_timeout() of test_concurrent_futures.test_wait. Remove the future
50165016
which may or may not complete depending if it takes longer than the timeout
5017-
ot not. Keep the second future which does not complete before wait()
5017+
or not. Keep the second future which does not complete before wait()
50185018
timeout. Patch by Victor Stinner.
50195019

50205020
..
@@ -5104,7 +5104,7 @@ Victor Stinner.
51045104
51055105
regrtest: Add ``--fast-ci`` and ``--slow-ci`` options. ``--fast-ci`` uses a
51065106
default timeout of 10 minutes and ``-u all,-cpu`` (skip slowest tests).
5107-
``--slow-ci`` uses a default timeout of 20 minues and ``-u all`` (run all
5107+
``--slow-ci`` uses a default timeout of 20 minutes and ``-u all`` (run all
5108< 2851 /code>5108
tests). Patch by Victor Stinner.
51095109

51105110
..
@@ -5232,7 +5232,7 @@ and ``sysctl net.inet.udp.blackhole=1``). Patch by Victor Stinner.
52325232
52335233
Skip ``test_gdb`` if gdb is unable to retrieve Python frame objects: if a
52345234
frame is ``<optimized out>``. When Python is built with "clang -Og", gdb can
5235-
fail to retrive the *frame* parameter of ``_PyEval_EvalFrameDefault()``. In
5235+
fail to retrieve the *frame* parameter of ``_PyEval_EvalFrameDefault()``. In
52365236
this case, tests like ``py_bt()`` are likely to fail. Without getting access
52375237
to Python frames, ``python-gdb.py`` is mostly clueless on retrieving the
52385238
Python traceback. Moreover, ``test_gdb`` is no longer skipped on macOS if

Misc/NEWS.d/3.13.0b1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ before creating the :class:`~tkinter.Tk` object or call the
13511351
:meth:`~tkinter.Tk.wantobject` method of the :class:`!Tk` object with argument
13521352
``2`` makes now arguments to callbacks registered in the :mod:`tkinter` module
13531353
to be passed as various Python objects (``int``, ``float``, ``bytes``, ``tuple``),
1354-
depending on their internal represenation in Tcl, instead of always ``str``.
1354+
depending on their internal representation in Tcl, instead of always ``str``.
13551355
:data:`!tkinter.wantobject` is now set to ``2`` by default.
13561356

13571357
..
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an AttributeError in the :mod:`email` module when re-fold a long address
2+
list. Also fix more cases of incorrect encoding of the address separator in the address list.

0 commit comments

Comments
 (0)
0