1.. bpo: 47212
2.. date: 2022-04-05-11-29-21
3.. nonce: leF4pz
4.. release date: 2022-04-05
5.. section: Core and Builtins
6
7Raise :exc:`IndentationError` instead of :exc:`SyntaxError` for a bare
8``except`` with no following indent. Improve :exc:`SyntaxError` locations
9for an un-parenthesized generator used as arguments. Patch by Matthieu
10Dartiailh.
11
12..
13
14.. bpo: 47186
15.. date: 2022-04-04-17-41-10
16.. nonce: aQWoSh
17.. section: Core and Builtins
18
19Replace :opcode:`JUMP_IF_NOT_EG_MATCH` by :opcode:`CHECK_EG_MATCH` + jump.
20
21..
22
23.. bpo: 47176
24.. date: 2022-04-02-14-32-21
25.. nonce: kTygYI
26.. section: Core and Builtins
27
28Emscripten builds cannot handle signals in the usual way due to platform
29limitations. Python can now handle signals. To use, set
30Module.Py_EmscriptenSignalBuffer to be a single byte SharedArrayBuffer and
31set Py_EMSCRIPTEN_SIGNAL_HANDLING to 1. Writing a number into the
32SharedArrayBuffer will cause the corresponding signal to be raised into the
33Python thread.
34
35..
36
37.. bpo: 47186
38.. date: 2022-04-01-11-53-59
39.. nonce: RBCPk8
40.. section: Core and Builtins
41
42Replace :opcode:`JUMP_IF_NOT_EXC_MATCH` by :opcode:`CHECK_EXC_MATCH` + jump.
43
44..
45
46.. bpo: 47120
47.. date: 2022-03-31-21-43-57
48.. nonce: NgxQbA
49.. section: Core and Builtins
50
51Replace the absolute jump opcode :opcode:`JUMP_NO_INTERRUPT` by the relative
52:opcode:`JUMP_BACKWARD_NO_INTERRUPT`.
53
54..
55
56.. bpo: 46841
57.. date: 2022-03-31-15-57-42
58.. nonce: U-25Z6
59.. section: Core and Builtins
60
61Avoid unnecessary allocations when comparing code objects.
62
63..
64
65.. bpo: 47182
66.. date: 2022-03-31-15-37-02
67.. nonce: e_4SsC
68.. section: Core and Builtins
69
70Fix a crash when using a named unicode character like ``"\N{digit nine}"``
71after the main interpreter has been initialized a second time.
72
73..
74
75.. bpo: 47162
76.. date: 2022-03-30-13-13-25
77.. nonce: yDJMUm
78.. section: Core and Builtins
79
80WebAssembly cannot deal with bad function pointer casts (different count or
81types of arguments). Python can now use call trampolines to mitigate the
82problem. Define :c:macro:`PY_CALL_TRAMPOLINE` to enable call trampolines.
83
84..
85
86.. bpo: 46775
87.. date: 2022-03-30-02-36-25
88.. nonce: e3Oxqf
89.. section: Core and Builtins
90
91Some Windows system error codes(>= 10000) are now mapped into the correct
92errno and may now raise a subclass of :exc:`OSError`. Patch by Dong-hee Na.
93
94..
95
96.. bpo: 47129
97.. date: 2022-03-26-16-35-57
98.. nonce: hDg2Vt
99.. section: Core and Builtins
100
101Improve error messages in f-string syntax errors concerning empty
102expressions.
103
104..
105
106.. bpo: 47117
107.. date: 2022-03-26-15-45-57
108.. nonce: 60W6GQ
109.. section: Core and Builtins
110
111Fix a crash if we fail to decode characters in interactive mode if the
112tokenizer buffers are uninitialized. Patch by Pablo Galindo.
113
114..
115
116.. bpo: 47127
117.. date: 2022-03-26-12-21-53
118.. nonce: Mh86RB
119.. section: Core and Builtins
120
121Speed up calls to c functions with keyword arguments by 25% with
122specialization. Patch by Kumar Aditya.
123
124..
125
126.. bpo: 47120
127.. date: 2022-03-25-21-51-10
128.. nonce: 9YJ-Xw
129.. section: Core and Builtins
130
131Replaced :opcode:`JUMP_ABSOLUTE` by the relative jump
132:opcode:`JUMP_BACKWARD`.
133
134..
135
136.. bpo: 42197
137.. date: 2022-03-22-15-12-28
138.. nonce: SwrrFO
139.. section: Core and Builtins
140
141:c:func:`PyFrame_FastToLocalsWithError` and :c:func:`PyFrame_LocalsToFast`
142are no longer called during profiling nor tracing. C code can access the
143``f_locals`` attribute of :c:type:`PyFrameObject` by calling
144:c:func:`PyFrame_GetLocals`.
145
146..
147
148.. bpo: 47070
149.. date: 2022-03-19-21-50-59
150.. nonce: wPcsQh
151.. section: Core and Builtins
152
153Improve performance of ``array_inplace_repeat`` by reducing the number of
154invocations of ``memcpy``. Refactor the ``repeat`` and inplace ``repeat``
155methods of ``array``, ``bytes``, ``bytearray`` and ``unicodeobject`` to use
156the common ``_PyBytes_Repeat``.
157
158..
159
160.. bpo: 47053
161.. date: 2022-03-17-22-47-29
162.. nonce: QAXk8Q
163.. section: Core and Builtins
164
165Reduce de-optimization in the specialized ``BINARY_OP_INPLACE_ADD_UNICODE``
166opcode.
167
168..
169
170.. bpo: 47045
171.. date: 2022-03-17-16-25-57
172.. nonce: xQgHul
173.. section: Core and Builtins
174
175Remove the ``f_state`` field from the _PyInterpreterFrame struct. Add the
176``owner`` field to the _PyInterpreterFrame struct to make ownership explicit
177to simplify clearing and deallocing frames and generators.
178
179..
180
181.. bpo: 46968
182.. date: 2022-03-17-14-22-23
183.. nonce: 4gz4NA
184.. section: Core and Builtins
185
186Check for the existence of the "sys/auxv.h" header in :mod:`faulthandler` to
187avoid compilation problems in systems where this header doesn't exist. Patch
188by Pablo Galindo
189
190..
191
192.. bpo: 46329
193.. date: 2022-03-16-12-19-25
194.. nonce: 9oS0HT
195.. section: Core and Builtins
196
197Use low bit of ``LOAD_GLOBAL`` to indicate whether to push a ``NULL`` before
198the global. Helps streamline the call sequence a bit.
199
200..
201
202.. bpo: 46841
203.. date: 2022-03-16-11-05-35
204.. nonce: yUoIHg
205.. section: Core and Builtins
206
207Quicken bytecode in-place by storing it as part of the corresponding
208``PyCodeObject``.
209
210..
211
212.. bpo: 47012
213.. date: 2022-03-14-11-15-11
214.. nonce: 5L6NoE
215.. section: Core and Builtins
216
217Speed up iteration of :class:`bytes` and :class:`bytearray` by 30%. Patch by
218Kumar Aditya.
219
220..
221
222.. bpo: 47009
223.. date: 2022-03-14-09-45-10
224.. nonce: ZI05b5
225.. section: Core and Builtins
226
227Improved the performance of :meth:`list.append()` and list comprehensions by
228optimizing for the common case, where no resize is needed. Patch by Dennis
229Sweeney.
230
231..
232
233.. bpo: 47005
234.. date: 2022-03-13-21-04-20
235.. nonce: OHBfCc
236.. section: Core and Builtins
237
238Improve performance of ``bytearray_repeat`` and ``bytearray_irepeat`` by
239reducing the number of invocations of ``memcpy``.
240
241..
242
243.. bpo: 46829
244.. date: 2022-03-12-21-07-21
245.. nonce: cpGoPV
246.. section: Core and Builtins
247
248Deprecate passing a message into :meth:`asyncio.Future.cancel` and
249:meth:`asyncio.Task.cancel`
250
251..
252
253.. bpo: 46993
254.. date: 2022-03-12-09-44-31
255.. nonce: -13hGo
256.. section: Core and Builtins
257
258Speed up :class:`bytearray` creation from :class:`list` and :class:`tuple`
259by 40%. Patch by Kumar Aditya.
260
261..
262
263.. bpo: 39829
264.. date: 2022-03-11-09-39-01
265.. nonce: mlW3Su
266.. section: Core and Builtins
267
268Removed the ``__len__()`` call when initializing a list and moved
269initializing to ``list_extend``. Patch by Jeremiah Pascual.
270
271..
272
273.. bpo: 46944
274.. date: 2022-03-08-10-50-42
275.. nonce: cnaIK3
276.. section: Core and Builtins
277
278Speed up throwing exception in generator with :const:`METH_FASTCALL` calling
279convention. Patch by Kumar Aditya.
280
281..
282
283.. bpo: 46841
284.. date: 2022-03-07-15-54-39
285.. nonce: 7wG92r
286.. section: Core and Builtins
287
288Modify :opcode:`STORE_SUBSCR` to use an inline cache entry (rather than its
289oparg) as an adaptive counter.
290
291..
292
293.. bpo: 46841
294.. date: 2022-03-06-10-37-36
295.. nonce: O12Pba
296.. section: Core and Builtins
297
298Use inline caching for :opcode:`PRECALL` and :opcode:`CALL`, and remove the
299internal machinery for managing the (now unused) non-inline caches.
300
301..
302
303.. bpo: 46881
304.. date: 2022-03-03-09-08-17
305.. nonce: ckD4tT
306.. section: Core and Builtins
307
308Statically allocate and initialize the latin1 characters.
309
310..
311
312.. bpo: 46838
313.. date: 2022-02-25-22-42-30
314.. nonce: RB6kEy
315.. section: Core and Builtins
316
317Improve syntax errors for incorrect function definitions. Patch by Pablo
318Galindo
319
320..
321
322.. bpo: 43721
323.. date: 2022-02-01-10-05-27
324.. nonce: -1XAIo
325.. section: Core and Builtins
326
327Fix docstrings of :attr:`~property.getter`, :attr:`~property.setter`, and
328:attr:`~property.deleter` to clarify that they create a new copy of the
329property.
330
331..
332
333.. bpo: 43224
334.. date: 2022-01-20-16-48-09
335.. nonce: WDihrT
336.. section: Core and Builtins
337
338Make grammar changes required for PEP 646.
339
340..
341
342.. bpo: 47208
343.. date: 2022-04-04-08-54-31
344.. nonce: cOh9xZ
345.. section: Library
346
347Allow vendors to override :const:`CTYPES_MAX_ARGCOUNT`.
348
349..
350
351.. bpo: 23689
352.. date: 2022-04-03-13-19-08
353.. nonce: TFSc3E
354.. section: Library
355
356:mod:`re` module: fix memory leak when a match is terminated by a signal or
357memory allocation failure. Patch by Ma Lin.
358
359..
360
361.. bpo: 47167
362.. date: 2022-03-30-18-35-50
363.. nonce: nCNHsB
364.. section: Library
365
366Allow overriding a future compliance check in :class:`asyncio.Task`.
367
368..
369
370.. bpo: 47151
371.. date: 2022-03-30-01-17-43
372.. nonce: z-nQkR
373.. section: Library
374
375When subprocess tries to use vfork, it now falls back to fork if vfork
376returns an error. This allows use in situations where vfork isn't allowed by
377the OS kernel.
378
379..
380
381.. bpo: 47152
382.. date: 2022-03-29-19-14-53
383.. nonce: 5rl5ZK
384.. section: Library
385
386Convert the :mod:`re` module into a package. Deprecate modules
387``sre_compile``, ``sre_constants`` and ``sre_parse``.
388
389..
390
391.. bpo: 4833
392.. date: 2022-03-28-20-16-37
393.. nonce: 2vSUE5
394.. section: Library
395
396Add :meth:`ZipFile.mkdir`
397
398..
399
400.. bpo: 27929
401.. date: 2022-03-28-13-35-50
402.. nonce: j5mAmV
403.. section: Library
404
405Fix :meth:`asyncio.loop.sock_connect` to only resolve names for
406:const:`socket.AF_INET` or :const:`socket.AF_INET6` families. Resolution may
407not make sense for other families, like :const:`socket.AF_BLUETOOTH` and
408:const:`socket.AF_UNIX`.
409
410..
411
412.. bpo: 14265
413.. date: 2022-03-27-10-41-24
414.. nonce: OBMlAi
415.. section: Library
416
417Adds the fully qualified test name to unittest output
418
419..
420
421.. bpo: 47061
422.. date: 2022-03-26-13-14-43
423.. nonce: QLxbC6
424.. section: Library
425
426Deprecate the aifc module.
427
428..
429
430.. bpo: 39622
431.. date: 2022-03-25-01-27-25
432.. nonce: ieBIMp
433.. section: Library
434
435Handle Ctrl+C in asyncio programs to interrupt the main task.
436
437..
438
439.. bpo: 47101
440.. date: 2022-03-23-15-31-02
441.. nonce: rVSld-
442.. section: Library
443
444:const:`hashlib.algorithms_available` now lists only algorithms that are
445provided by activated crypto providers on OpenSSL 3.0. Legacy algorithms are
446not listed unless the legacy provider has been loaded into the default OSSL
447context.
448
449..
450
451.. bpo: 47099
452.. date: 2022-03-23-14-16-38
453.. nonce: 2raait
454.. section: Library
455
456All :exc:`URLError` exception messages raised in
457:class:`urllib.request.URLopener` now contain a colon between ``ftp error``
458and the rest of the message. Previously,
459:func:`~urllib.request.URLopener.open_ftp` missed the colon. Patch by Oleg
460Iarygin.
461
462..
463
464.. bpo: 47099
465.. date: 2022-03-23-13-55-41
466.. nonce: P6quRP
467.. section: Library
468
469Exception chaining is changed from
470:func:`Exception.with_traceback`/:func:`sys.exc_info` to :pep:`3134`. Patch
471by Oleg Iarygin.
472
473..
474
475.. bpo: 47095
476.. date: 2022-03-23-12-07-26
477.. nonce: P3YTrh
478.. section: Library
479
480:mod:`hashlib`'s internal ``_blake2`` module now prefers ``libb2`` from
481https://www.blake2.net/ over Python's vendored copy of blake2.
482
483..
484
485.. bpo: 47098
486.. date: 2022-03-23-10-07-41
487.. nonce: 7AN_qp
488.. section: Library
489
490The Keccak Code Package for :mod:`hashlib`'s internal ``_sha3`` module has
491been replaced with tiny_sha3. The module is used as fallback when Python is
492built without OpenSSL.
493
494..
495
496.. bpo: 47088
497.. date: 2022-03-22-19-18-31
498.. nonce: JM1kNI
499.. section: Library
500
501Implement :data:`typing.LiteralString`, part of :pep:`675`. Patch by Jelle
502Zijlstra.
503
504..
505
506.. bpo: 42885
507.. date: 2022-03-21-08-32-19
508.. nonce: LCnTTp
509.. section: Library
510
511Optimize :func:`re.search`, :func:`re.split`, :func:`re.findall`,
512:func:`re.finditer` and :func:`re.sub` for regular expressions starting with
513``\A`` or ``^``.
514
515..
516
517.. bpo: 23691
518.. date: 2022-03-20-22-13-24
519.. nonce: Nc2TrW
520.. section: Library
521
522Protect the :func:`re.finditer` iterator from re-entering.
523
524..
525
526.. bpo: 47067
527.. date: 2022-03-20-17-15-56
528.. nonce: XXLnje
529.. section: Library
530
531Optimize calling ``GenericAlias`` objects by using :pep:`590` ``vectorcall``
532and by replacing ``PyObject_SetAttrString`` with ``PyObject_SetAttr``.
533
534..
535
536.. bpo: 28080
537.. date: 2022-03-20-15-54-41
538.. nonce: kn35Vk
539.. section: Library
540
541Add the *metadata_encoding* parameter in the :class:`zipfile.ZipFile`
542constructor and the ``--metadata-encoding`` option in the :mod:`zipfile` CLI
543to allow reading zipfiles using non-standard codecs to encode the filenames
544within the archive.
545
546..
547
548.. bpo: 47000
549.. date: 2022-03-20-13-00-08
550.. nonce: p8HpG0
551.. section: Library
552
553Make :func:`io.text_encoding` returns "utf-8" when UTF-8 mode is enabled.
554
555..
556
557.. bpo: 42369
558.. date: 2022-03-19-19-56-04
559.. nonce: Ok828t
560.. section: Library
561
562Fix thread safety of :meth:`zipfile._SharedFile.tell` to avoid a
563"zipfile.BadZipFile: Bad CRC-32 for file" exception when reading a
564:class:`ZipFile` from multiple threads.
565
566..
567
568.. bpo: 38256
569.. date: 2022-03-19-15-54-41
570.. nonce: FoMbjE
571.. section: Library
572
573Fix :func:`binascii.crc32` when it is compiled to use zlib'c crc32 to work
574properly on inputs 4+GiB in length instead of returning the wrong result.
575The workaround prior to this was to always feed the function data in
576increments smaller than 4GiB or to just call the zlib module function.
577
578We also have :func:`binascii.crc32` release the GIL when computing on larger
579inputs as :func:`zlib.crc32` and :mod:`hashlib` do.
580
581This also boosts performance on Windows as it now uses the zlib crc32
582implementation for :func:`binascii.crc32` for a 2-3x speedup.
583
584That the stdlib has a crc32 API in two modules is a known historical oddity.
585This moves us closer to a single implementation behind them.
586
587..
588
589.. bpo: 47066
590.. date: 2022-03-19-14-12-23
591.. nonce: we3YFx
592.. section: Library
593
594Global inline flags (e.g. ``(?i)``) can now only be used at the start of the
595regular expressions.  Using them not at the start of expression was
596deprecated since Python 3.6.
597
598..
599
600.. bpo: 39394
601.. date: 2022-03-19-13-38-29
602.. nonce: 7j6WL6
603.. section: Library
604
605A warning about inline flags not at the start of the regular expression now
606contains the position of the flag.
607
608..
609
610.. bpo: 433030
611.. date: 2022-03-19-08-42-57
612.. nonce: UTwRX7
613.. section: Library
614
615Add support of atomic grouping (``(?>...)``) and possessive quantifiers
616(``*+``, ``++``, ``?+``, ``{m,n}+``) in :mod:`regular expressions <re>`.
617
618..
619
620.. bpo: 47062
621.. date: 2022-03-18-22-46-18
622.. nonce: RNc99_
623.. section: Library
624
625Implement :class:`asyncio.Runner` context manager.
626
627..
628
629.. bpo: 46382
630.. date: 2022-03-18-17-25-57
631.. nonce: zQUJ66
632.. section: Library
633
634:func:`~dataclasses.dataclass` ``slots=True`` now correctly omits slots
635already defined in base classes. Patch by Arie Bovenberg.
636
637..
638
639.. bpo: 47057
640.. date: 2022-03-18-14-22-38
641.. nonce: n-IHbt
642.. section: Library
643
644Use FASTCALL convention for ``FutureIter.throw()``
645
646..
647
648.. bpo: 47061
649.. date: 2022-03-18-13-30-40
650.. nonce: etLHK5
651.. section: Library
652
653Deprecate the various modules listed by :pep:`594`:
654
655aifc, asynchat, asyncore, audioop, cgi, cgitb, chunk, crypt, imghdr, msilib,
656nntplib, nis, ossaudiodev, pipes, smtpd, sndhdr, spwd, sunau, telnetlib, uu,
657xdrlib
658
659..
660
661.. bpo: 34790
662.. date: 2022-03-17-19-38-40
663.. nonce: zQIiVJ
664.. section: Library
665
666Remove passing coroutine objects to :func:`asyncio.wait`.
667
668..
669
670.. bpo: 47039
671.. date: 2022-03-17-01-54-13
672.. nonce: 0Yxv0K
673.. section: Library
674
675Normalize ``repr()`` of asyncio future and task objects.
676
677..
678
679.. bpo: 2604
680.. date: 2022-03-16-18-25-19
681.. nonce: jeopdL
682.. section: Library
683
684Fix bug where doctests using globals would fail when run multiple times.
685
686..
687
688.. bpo: 45150
689.. date: 2022-03-16-11-52-52
690.. nonce: kYbIME
691.. section: Library
692
693Add :func:`hashlib.file_digest` helper for efficient hashing of file object.
694
695..
696
697.. bpo: 34861
698.. date: 2022-03-16-08-49-12
699.. nonce: p8ugVg
700.. section: Library
701
702Made cumtime the default sorting key for cProfile
703
704..
705
706.. bpo: 45997
707.. date: 2022-03-15-18-32-12
708.. nonce: 4n2aVU
709.. section: Library
710
711Fix :class:`asyncio.Semaphore` re-aquiring FIFO order.
712
713..
714
715.. bpo: 47022
716.. date: 2022-03-15-09-29-52
717.. nonce: uaEDcI
718.. section: Library
719
720The :mod:`asynchat`, :mod:`asyncore` and  :mod:`smtpd` modules have been
721deprecated since at least Python 3.6. Their documentation and deprecation
722warnings and have now been updated to note they will removed in Python 3.12
723(:pep:`594`).
724
725..
726
727.. bpo: 43253
728.. date: 2022-03-15-07-53-45
729.. nonce: rjdLFj
730.. section: Library
731
732Fix a crash when closing transports where the underlying socket handle is
733already invalid on the Proactor event loop.
734
735..
736
737.. bpo: 40280
738.. date: 2022-03-14-09-26-42
739.. nonce: 2-k8TV
740.. section: Library
741
742:func:`select.select` now passes ``NULL`` to ``select`` for each empty
743fdset.
744
745..
746
747.. bpo: 47004
748.. date: 2022-03-13-15-04-05
749.. nonce: SyYpxd
750.. section: Library
751
752Apply bugfixes from importlib_metadata 4.11.3, including bugfix for
753EntryPoint.extras, which was returning match objects and not the extras
754strings.
755
756..
757
758.. bpo: 46998
759.. date: 2022-03-13-08-52-58
760.. nonce: cHh-9O
761.. section: Library
762
763Allow subclassing of :class:`typing.Any`. Patch by Shantanu Jain.
764
765..
766
767.. bpo: 46995
768.. date: 2022-03-12-13-50-42
769.. nonce: 2kdNDg
770.. section: Library
771
772Deprecate missing :meth:`asyncio.Task.set_name` for third-party task
773implementations, schedule making it mandatory in Python 3.13.
774
775..
776
777.. bpo: 46994
778.. date: 2022-03-12-12-34-13
779.. nonce: d7hPdz
780.. section: Library
781
782Accept explicit contextvars.Context in :func:`asyncio.create_task` and
783:meth:`asyncio.loop.create_task`.
784
785..
786
787.. bpo: 46981
788.. date: 2022-03-12-11-30-42
789.. nonce: ltWCxH
790.. section: Library
791
792``typing.get_args(typing.Tuple[()])`` now returns ``()`` instead of
793``((),)``.
794
795..
796
797.. bpo: 46968
798.. date: 2022-03-11-17-56-25
799.. nonce: pPVvNo
800.. section: Library
801
802Add ``os.sysconf_names['SC_MINSIGSTKSZ']``.
803
804..
805
806.. bpo: 46985
807.. date: 2022-03-11-13-34-16
808.. nonce: BgoMr2
809.. section: Library
810
811Upgrade pip wheel bundled with ensurepip (pip 22.0.4)
812
813..
814
815.. bpo: 46968
816.. date: 2022-03-10-14-51-11
817.. nonce: ym2QxL
818.. section: Library
819
820:mod:`faulthandler`: On Linux 5.14 and newer, dynamically determine size of
821signal handler stack size CPython allocates using
822``getauxval(AT_MINSIGSTKSZ)``. This changes allows for Python extension's
823request to Linux kernel to use AMX_TILE instruction set on Sapphire Rapids
824Xeon processor to succeed, unblocking use of the ISA in frameworks.
825
826..
827
828.. bpo: 46917
829.. date: 2022-03-10-14-47-16
830.. nonce: s19zcy
831.. section: Library
832
833The :data:`math.nan` value is now always available. Patch by Victor Stinner.
834
835..
836
837.. bpo: 46955
838.. date: 2022-03-08-22-41-59
839.. nonce: IOoonN
840.. section: Library
841
842Expose :class:`asyncio.base_events.Server` as :class:`asyncio.Server`. Patch
843by Stefan Zabka.
844
845..
846
847.. bpo: 23325
848.. date: 2022-03-08-11-34-06
849.. nonce: 3VQnfo
850.. section: Library
851
852The :mod:`signal` module no longer assumes that :const:`~signal.SIG_IGN` and
853:const:`~signal.SIG_DFL` are small int singletons.
854
855..
856
857.. bpo: 46932
858.. date: 2022-03-07-20-20-34
859.. nonce: xbarAs
860.. section: Library
861
862Update bundled libexpat to 2.4.7
863
864..
865
866.. bpo: 46933
867.. date: 2022-03-05-21-51-31
868.. nonce: 6yzWtb
869.. section: Library
870
871The :mod:`pwd` module is now optional. :func:`os.path.expanduser` returns
872the path when the :mod:`pwd` module is not available.
873
874..
875
876.. bpo: 40059
877.. date: 2022-02-23-01-11-08
878.. nonce: Iwc9UH
879.. section: Library
880
881:pep:`680`, the :mod:`tomllib` module. Adds support for parsing TOML.
882
883..
884
885.. bpo: 464471
886.. date: 2022-02-21-11-41-23
887.. nonce: fL06TV
888.. section: Library
889
890:func:`asyncio.timeout` and :func:`asyncio.timeout_at` context managers
891added. Patch by Tin Tvrtković and Andrew Svetlov.
892
893..
894
895.. bpo: 46805
896.. date: 2022-02-20-23-03-32
897.. nonce: HZ8xWG
898.. section: Library
899
900Added raw datagram socket functions for asyncio:
901:meth:`~asyncio.AbstractEventLoop.sock_sendto`,
902:meth:`~asyncio.AbstractEventLoop.sock_recvfrom` and
903:meth:`~asyncio.AbstractEventLoop.sock_recvfrom_into`.
904
905..
906
907.. bpo: 46644
908.. date: 2022-02-05-22-14-44
909.. nonce: P--1Cz
910.. section: Library
911
912No longer require valid typeforms to be callable. This allows
913:data:`typing.Annotated` to wrap :data:`typing.ParamSpecArgs` and
914:data:`dataclasses.InitVar`. Patch by Gregory Beauregard.
915
916..
917
918.. bpo: 46581
919.. date: 2022-02-01-11-32-47
920.. nonce: t7Zw65
921.. section: Library
922
923Brings :class:`ParamSpec` propagation for :class:`GenericAlias` in line with
924:class:`Concatenate` (and others).
925
926..
927
928.. bpo: 45413
929.. date: 2022-01-31-15-19-38
930.. nonce: 1vaS0V
931.. section: Library
932
933Define *posix_venv* and *nt_venv* :ref:`sysconfig installation schemes
934<installation_paths>` to be used for bootstrapping new virtual environments.
935Add *venv* sysconfig installation scheme to get the appropriate one of the
936above. The schemes are identical to the pre-existing *posix_prefix* and *nt*
937install schemes. The :mod:`venv` module now uses the *venv* scheme to create
938new virtual environments instead of hardcoding the paths depending only on
939the platform. Downstream Python distributors customizing the *posix_prefix*
940or *nt* install scheme in a way that is not compatible with the install
941scheme used in virtual environments are encouraged not to customize the
942*venv* schemes. When Python itself runs in a virtual environment,
943:func:`sysconfig.get_default_scheme` and
944:func:`sysconfig.get_preferred_scheme` with ``key="prefix"`` returns *venv*.
945
946..
947
948.. bpo: 43224
949.. date: 2022-01-30-22-05-53
950.. nonce: E-eT22
951.. section: Library
952
953Implement support for PEP 646 in typing.py.
954
955..
956
957.. bpo: 43224
958.. date: 2022-01-30-20-32-40
959.. nonce: zqrQsj
960.. section: Library
961
962Allow unpacking types.GenericAlias objects, e.g. ``*tuple[int, str]``.
963
964..
965
966.. bpo: 46557
967.. date: 2022-01-28-01-23-25
968.. nonce: XSbhyQ
969.. section: Library
970
971Warnings captured by the logging module are now logged without a format
972string to prevent systems that group logs by the msg argument from grouping
973captured warnings together.
974
975..
976
977.. bpo: 41370
978.. date: 2022-01-27-11-54-16
979.. nonce: gYxCPE
980.. section: Library
981
982:func:`typing.get_type_hints` now supports evaluating strings as forward
983references in :ref:`PEP 585 generic aliases <types-genericalias>`.
984
985..
986
987.. bpo: 46607
988.. date: 2022-01-26-18-30-34
989.. nonce: xnhT4a
990.. section: Library
991
992Add :exc:`DeprecationWarning` to :class:`LegacyInterpolation`, deprecated in
993the docstring since Python 3.2. Will be removed in Python 3.13. Use
994:class:`BasicInterpolation` or :class:`ExtendedInterpolation` instead.
995
996..
997
998.. bpo: 26120
999.. date: 2022-01-25-15-45-04
1000.. nonce: YzrBMO
1001.. section: Library
1002
1003:mod:`pydoc` now excludes __future__ imports from the module's data items.
1004
1005..
1006
1007.. bpo: 46480
1008.. date: 2022-01-23-16-33-07
1009.. nonce: E4jHlh
1010.. section: Library
1011
1012Add :func:`typing.assert_type`. Patch by Jelle Zijlstra.
1013
1014..
1015
1016.. bpo: 46421
1017.. date: 2022-01-18-01-29-38
1018.. nonce: 9LdmNr
1019.. section: Library
1020
1021Fix a unittest issue where if the command was invoked as ``python -m
1022unittest`` and the filename(s) began with a dot (.), a ``ValueError`` is
1023returned.
1024
1025..
1026
1027.. bpo: 46245
1028.. date: 2022-01-03-20-12-14
1029.. nonce: 3w4RlA
1030.. section: Library
1031
1032Add optional parameter *dir_fd* in :func:`shutil.rmtree`.
1033
1034..
1035
1036.. bpo: 22859
1037.. date: 2021-12-29-19-37-49
1038.. nonce: AixHW7
1039.. section: Library
1040
1041:meth:`~unittest.TestProgram.usageExit` is marked deprecated, to be removed
1042in 3.13.
1043
1044..
1045
1046.. bpo: 46170
1047.. date: 2021-12-26-14-45-51
1048.. nonce: AQ7kSM
1049.. section: Library
1050
1051Improve the error message when you try to subclass an instance of
1052:class:`typing.NewType`.
1053
1054..
1055
1056.. bpo: 40296
1057.. date: 2021-12-25-14-13-14
1058.. nonce: p0YVGB
1059.. section: Library
1060
1061Fix supporting generic aliases in :mod:`pydoc`.
1062
1063..
1064
1065.. bpo: 20392
1066.. date: 2021-12-22-12-02-27
1067.. nonce: CLAFIp
1068.. section: Library
1069
1070Fix inconsistency with uppercase file extensions in
1071:meth:`MimeTypes.guess_type`. Patch by Kumar Aditya.
1072
1073..
1074
1075.. bpo: 46030
1076.. date: 2021-12-10-07-07-47
1077.. nonce: UN349J
1078.. section: Library
1079
1080Add ``LOCAL_CREDS``, ``LOCAL_CREDS_PERSISTENT`` and ``SCM_CREDS2`` FreeBSD
1081constants to the socket module.
1082
1083..
1084
1085.. bpo: 44439
1086.. date: 2021-11-08-20-27-41
1087.. nonce: I_8qro
1088.. section: Library
1089
1090Fix ``.write()`` method of a member file in ``ZipFile``, when the input data
1091is an object that supports the buffer protocol, the file length may be
1092wrong.
1093
1094..
1095
1096.. bpo: 45171
1097.. date: 2021-09-11-16-06-54
1098.. nonce: ec597j
1099.. section: Library
1100
1101Fix handling of the ``stacklevel`` argument to logging functions in the
1102:mod:`logging` module so that it is consistent across all logging functions
1103and, as advertised, similar to the ``stacklevel`` argument used in
1104:meth:`~warnings.warn`.
1105
1106..
1107
1108.. bpo: 24959
1109.. date: 2021-09-06-15-46-53
1110.. nonce: UVFgiO
1111.. section: Library
1112
1113Fix bug where :mod:`unittest` sometimes drops frames from tracebacks of
1114exceptions raised in tests.
1115
1116..
1117
1118.. bpo: 44859
1119.. date: 2021-08-10-00-05-53
1120.. nonce: 9e9_3V
1121.. section: Library
1122
1123Raise more accurate and :pep:`249` compatible exceptions in :mod:`sqlite3`.
1124
1125* Raise :exc:`~sqlite3.InterfaceError` instead of
1126  :exc:`~sqlite3.ProgrammingError` for ``SQLITE_MISUSE`` errors.
1127* Don't overwrite :exc:`BufferError` with :exc:`ValueError` when conversion to
1128  BLOB fails.
1129* Raise :exc:`~sqlite3.ProgrammingError` instead of :exc:`~sqlite3.Warning` if
1130  user tries to :meth:`~sqlite3.Cursor.execute()` more than one SQL statement.
1131* Raise :exc:`~sqlite3.ProgrammingError` instead of :exc:`ValueError` if an SQL
1132  query contains null characters.
1133
1134..
1135
1136.. bpo: 44493
1137.. date: 2021-07-26-10-46-49
1138.. nonce: xp3CRH
1139.. section: Library
1140
1141Add missing terminated NUL in sockaddr_un's length
1142
1143This was potentially observable when using non-abstract AF_UNIX datagram
1144sockets to processes written in another programming language.
1145
1146..
1147
1148.. bpo: 41930
1149.. date: 2021-06-17-00-02-58
1150.. nonce: JS6fsd
1151.. section: Library
1152
1153Add :meth:`~sqlite3.Connection.serialize` and
1154:meth:`~sqlite3.Connection.deserialize` support to :mod:`sqlite3`. Patch by
1155Erlend E. Aasland.
1156
1157..
1158
1159.. bpo: 33178
1160.. date: 2021-04-20-16-48-07
1161.. nonce: kSnWwb
1162.. section: Library
1163
1164Added :class:`ctypes.BigEndianUnion` and :class:`ctypes.LittleEndianUnion`
1165classes, as originally documented in the library docs but not yet
1166implemented.
1167
1168..
1169
1170.. bpo: 43352
1171.. date: 2021-03-31-15-22-45
1172.. nonce: nSjMuE
1173.. section: Library
1174
1175Add an Barrier object in synchronization primitives of *asyncio* Lib in
1176order to be consistant with Barrier from *threading* and *multiprocessing*
1177libs*
1178
1179..
1180
1181.. bpo: 35859
1182.. date: 2019-03-14-09-08-25
1183.. nonce: 8lFdLe
1184.. section: Library
1185
1186:mod:`re` module, fix a few bugs about capturing group. In rare cases,
1187capturing group gets an incorrect string. Patch by Ma Lin.
1188
1189..
1190
1191.. bpo: 45099
1192.. date: 2022-03-29-13-25-49
1193.. nonce: dagdhx
1194.. section: Documentation
1195
1196Document internal :mod:`asyncio` API.
1197
1198..
1199
1200.. bpo: 47126
1201.. date: 2022-03-26-12-20-16
1202.. nonce: p6_Ovm
1203.. section: Documentation
1204
1205Update PEP URLs to :pep:`676`'s new canonical form.
1206
1207..
1208
1209.. bpo: 47040
1210.. date: 2022-03-17-13-35-28
1211.. nonce: 4Dn48U
1212.. section: Documentation
1213
1214Clarified the old Python versions compatiblity note of
1215:func:`binascii.crc32` / :func:`zlib.adler32` / :func:`zlib.crc32`
1216functions.
1217
1218..
1219
1220.. bpo: 46033
1221.. date: 2022-01-03-18-50-39
1222.. nonce: 7WeF0f
1223.. section: Documentation
1224
1225Clarify ``for`` statement execution in its doc.
1226
1227..
1228
1229.. bpo: 45790
1230.. date: 2021-11-12-11-03-55
1231.. nonce: 6yuhe8
1232.. section: Documentation
1233
1234Adjust inaccurate phrasing in :doc:`../extending/newtypes_tutorial` about
1235the ``ob_base`` field and the macros used to access its contents.
1236
1237..
1238
1239.. bpo: 42340
1240.. date: 2020-11-12-21-26-31
1241.. nonce: apumUL
1242.. section: Documentation
1243
1244Document that in some circumstances :exc:`KeyboardInterrupt` may cause the
1245code to enter an inconsistent state. Provided a sample workaround to avoid
1246it if needed.
1247
1248..
1249
1250.. bpo: 41233
1251.. date: 2020-07-07-22-54-51
1252.. nonce: lyUJ8L
1253.. section: Documentation
1254
1255Link the errnos referenced in ``Doc/library/exceptions.rst`` to their
1256respective section in ``Doc/library/errno.rst``, and vice versa. Previously
1257this was only done for EINTR and InterruptedError. Patch by Yan "yyyyyyyan"
1258Orestes.
1259
1260..
1261
1262.. bpo: 47205
1263.. date: 2022-04-03-14-38-21
1264.. nonce: hbbTnh
1265.. section: Tests
1266
1267Skip test for :func:`~os.sched_getaffinity` and
1268:func:`~os.sched_setaffinity` error case on FreeBSD.
1269
1270..
1271
1272.. bpo: 46126
1273.. date: 2022-03-26-11-41-19
1274.. nonce: q14Ioy
1275.. section: Tests
1276
1277Restore 'descriptions' when running tests internally.
1278
1279..
1280
1281.. bpo: 47104
1282.. date: 2022-03-23-22-45-51
1283.. nonce: _esUq8
1284.. section: Tests
1285
1286Rewrite :func:`asyncio.to_thread` tests to use
1287:class:`unittest.IsolatedAsyncioTestCase`.
1288
1289..
1290
1291.. bpo: 40280
1292.. date: 2022-03-19-10-25-04
1293.. nonce: wBRSel
1294.. section: Tests
1295
1296The test suite is now passing on the Emscripten platform. All fork, socket,
1297and subprocess-based tests are skipped.
1298
1299..
1300
1301.. bpo: 47037
1302.. date: 2022-03-16-21-29-30
1303.. nonce: xcrLpJ
1304.. section: Tests
1305
1306Skip ``strftime("%4Y")`` feature test on Windows. It can cause an assertion
1307error in debug builds.
1308
1309..
1310
1311.. bpo: 46587
1312.. date: 2022-03-14-17-10-35
1313.. nonce: ASDsJX
1314.. section: Tests
1315
1316Skip tests if platform's ``strftime`` does not support non-portable glibc
1317extensions.
1318
1319..
1320
1321.. bpo: 47015
1322.. date: 2022-03-13-23-43-40
1323.. nonce: FjmCsz
1324.. section: Tests
1325
1326A test case for :func:`os.sendfile` is converted from deprecated
1327:mod:`asyncore` (see :pep:`594`) to :mod:`asyncio`. Patch by Oleg Iarygin.
1328
1329..
1330
1331.. bpo: 40280
1332.. date: 2022-04-02-17-52-38
1333.. nonce: U8Dd0H
1334.. section: Build
1335
1336Add configure option :option:`--enable-wasm-dynamic-linking` to enable
1337``dlopen`` and MAIN_MODULE / SIDE_MODULE on ``wasm32-emscripten``.
1338
1339..
1340
1341.. bpo: 46023
1342.. date: 2022-04-01-16-12-53
1343.. nonce: 1Z1OcC
1344.. section: Build
1345
1346``makesetup`` now detects and skips all duplicated module definitions. The
1347first entry wins.
1348
1349..
1350
1351.. bpo: 40280
1352.. date: 2022-03-24-12-12-35
1353.. nonce: eAQWrM
1354.. section: Build
1355
1356Add SOABI ``wasm32-emscripten`` for Emscripten and ``wasm32-wasi`` for WASI
1357on 32bit WASM as well as ``wasm64`` counter parts.
1358
1359..
1360
1361.. bpo: 47032
1362.. date: 2022-03-16-00-37-40
1363.. nonce: tsS9KE
1364.. section: Build
1365
1366Ensure Windows install builds fail correctly with a non-zero exit code when
1367part of the build fails.
1368
1369..
1370
1371.. bpo: 47024
1372.. date: 2022-03-15-09-28-55
1373.. nonce: t7-dcu
1374.. section: Build
1375
1376Update OpenSSL to 1.1.1n for macOS installers and all Windows builds.
1377
1378..
1379
1380.. bpo: 46996
1381.. date: 2022-03-12-18-09-31
1382.. nonce: SygzVz
1383.. section: Build
1384
1385The :mod:`tkinter` package now requires Tcl/Tk version 8.5.12 or newer.
1386
1387..
1388
1389.. bpo: 46973
1390.. date: 2022-03-10-14-30-39
1391.. nonce: _LEvnc
1392.. section: Build
1393
1394Add ``regen-configure`` make target to regenerate configure script with
1395Christian's container image ``quay.io/tiran/cpython_autoconf:269``.
1396
1397..
1398
1399.. bpo: 46917
1400.. date: 2022-03-10-09-37-05
1401.. nonce: fry4aK
1402.. section: Build
1403
1404Building Python now requires support of IEEE 754 floating point numbers.
1405Patch by Victor Stinner.
1406
1407..
1408
1409.. bpo: 45774
1410.. date: 2022-03-04-21-24-02
1411.. nonce: 9AhC0r
1412.. section: Build
1413
1414``configure`` now verifies that all SQLite C APIs needed for the
1415:mod:`sqlite3` extension module are found.
1416
1417..
1418
1419.. bpo: 47194
1420.. date: 2022-04-01-14-57-40
1421.. nonce: IB0XL4
1422.. section: Windows
1423
1424Update ``zlib`` to v1.2.12 to resolve CVE-2018-25032.
1425
1426..
1427
1428.. bpo: 47171
1429.. date: 2022-03-30-19-55-00
1430.. nonce: MbqCWn
1431.. section: Windows
1432
1433Enables installing the :file:`py.exe` launcher on Windows ARM64.
1434
1435..
1436
1437.. bpo: 46566
1438.. date: 2022-03-23-12-51-46
1439.. nonce: 4x4a7e
1440.. section: Windows
1441
1442Upgraded :ref:`launcher` to support a new ``-V:company/tag`` argument for
1443full :pep:`514` support and to detect ARM64 installs. The ``-64`` suffix on
1444arguments is deprecated, but still selects any non-32-bit install. Setting
1445:envvar:`PYLAUNCHER_ALLOW_INSTALL` and specifying a version that is not
1446installed will attempt to install the requested version from the Microsoft
1447Store.
1448
1449..
1450
1451.. bpo: 47086
1452.. date: 2022-03-21-20-45-01
1453.. nonce: bIuKlF
1454.. section: Windows
1455
1456The installer for Windows now includes documentation as loose HTML files
1457rather than a single compiled :file:`.chm` file.
1458
1459..
1460
1461.. bpo: 46907
1462.. date: 2022-03-13-11-18-41
1463.. nonce: YLzxBM
1464.. section: Windows
1465
1466Update Windows installer to use SQLite 3.38.1.
1467
1468..
1469
1470.. bpo: 44549
1471.. date: 2022-03-07-17-46-40
1472.. nonce: SPrGS9
1473.. section: Windows
1474
1475Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and
1476CVE-2019-12900
1477
1478..
1479
1480.. bpo: 46948
1481.. date: 2022-03-07-16-34-11
1482.. nonce: Ufd4tG
1483.. section: Windows
1484
1485Prevent CVE-2022-26488 by ensuring the Add to PATH option in the Windows
1486installer uses the correct path when being repaired.
1487
1488..
1489
1490.. bpo: 46890
1491.. date: 2022-03-17-09-55-02
1492.. nonce: GX-3OO
1493.. section: macOS
1494
1495Fix a regression in the setting of ``sys._base_executable`` in framework
1496builds, and thereby fix a regression in :mod:`venv` virtual environments
1497with such builds.
1498
1499..
1500
1501.. bpo: 46907
1502.. date: 2022-03-13-11-11-31
1503.. nonce: Ql0z1E
1504.. section: macOS
1505
1506Update macOS installer to SQLite 3.38.1.
1507
1508..
1509
1510.. bpo: 40280
1511.. date: 2022-04-03-11-47-45
1512.. nonce: Q_IJik
1513.. section: Tools/Demos
1514
1515Replace Emscripten's limited shell with Katie Bell's browser-ui REPL from
1516python-wasm project.
1517
1518..
1519
1520.. bpo: 40421
1521.. date: 2022-03-25-13-40-46
1522.. nonce: wJREl2
1523.. section: C API
1524
1525Add ``PyFrame_GetBuiltins``, ``PyFrame_GetGenerator`` and
1526``PyFrame_GetGlobals`` C-API functions to access frame object attributes
1527safely from C code.
1528
1529..
1530
1531.. bpo: 46850
1532.. date: 2022-03-22-16-59-34
1533.. nonce: lmEKLy
1534.. section: C API
1535
1536Move the private ``_PyFrameEvalFunction`` type, and private
1537``_PyInterpreterState_GetEvalFrameFunc()`` and
1538``_PyInterpreterState_SetEvalFrameFunc()`` functions to the internal C API.
1539The ``_PyFrameEvalFunction`` callback function type now uses the
1540``_PyInterpreterFrame`` type which is part of the internal C API. Patch by
1541Victor Stinner.
1542
1543..
1544
1545.. bpo: 46850
1546.. date: 2022-03-22-16-48-02
1547.. nonce: 7M5dO7
1548.. section: C API
1549
1550Move the private undocumented ``_PyEval_EvalFrameDefault()`` function to the
1551internal C API. The function now uses the ``_PyInterpreterFrame`` type which
1552is part of the internal C API. Patch by Victor Stinner.
1553
1554..
1555
1556.. bpo: 46850
1557.. date: 2022-03-21-02-26-27
1558.. nonce: hU3c-O
1559.. section: C API
1560
1561Remove the private undocumented function ``_PyEval_CallTracing()`` from the
1562C API. Call the public :func:`sys.call_tracing` function instead. Patch by
1563Victor Stinner.
1564
1565..
1566
1567.. bpo: 46850
1568.. date: 2022-03-21-01-30-14
1569.. nonce: Tfxde5
1570.. section: C API
1571
1572Remove the private undocumented function
1573``_PyEval_GetCoroutineOriginTrackingDepth()`` from the C API. Call the
1574public :func:`sys.get_coroutine_origin_tracking_depth` function instead.
1575Patch by Victor Stinner.
1576
1577..
1578
1579.. bpo: 46850
1580.. date: 2022-03-21-00-41-29
1581.. nonce: rOt771
1582.. section: C API
1583
1584Remove the following private undocumented functions from the C API:
1585
1586* ``_PyEval_GetAsyncGenFirstiter()``
1587* ``_PyEval_GetAsyncGenFinalizer()``
1588* ``_PyEval_SetAsyncGenFirstiter()``
1589* ``_PyEval_SetAsyncGenFinalizer()``
1590
1591Call the public :func:`sys.get_asyncgen_hooks` and
1592:func:`sys.set_asyncgen_hooks` functions instead. Patch by Victor Stinner.
1593
1594..
1595
1596.. bpo: 46987
1597.. date: 2022-03-12-18-37-06
1598.. nonce: LWcwyN
1599.. section: C API
1600
1601Remove private functions ``_PySys_GetObjectId()`` and
1602``_PySys_SetObjectId()``. Patch by Dong-hee Na.
1603
1604..
1605
1606.. bpo: 46906
1607.. date: 2022-03-03-11-12-33
1608.. nonce: -olyBI
1609.. section: C API
1610
1611Add new functions to pack and unpack C double (serialize and deserialize):
1612:c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`,
1613:c:func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and
1614:c:func:`PyFloat_Unpack8`. Patch by Victor Stinner.
1615