1.. date: 2022-12-05-01-39-10 2.. gh-issue: 100001 3.. nonce: uD05Fc 4.. release date: 2022-12-06 5.. section: Security 6 7``python -m http.server`` no longer allows terminal control characters sent 8within a garbage request to be printed to the stderr server log. 9 10This is done by changing the :mod:`http.server` 11:class:`BaseHTTPRequestHandler` ``.log_message`` method to replace control 12characters with a :samp:`\\x{HH}` hex escape before printing. 13 14.. 15 16.. date: 2022-11-11-12-50-28 17.. gh-issue: 87604 18.. nonce: OtwH5L 19.. section: Security 20 21Avoid publishing list of active per-interpreter audit hooks via the 22:mod:`gc` module 23 24.. 25 26.. date: 2022-11-30-11-09-40 27.. gh-issue: 99891 28.. nonce: 9VomwB 29.. section: Core and Builtins 30 31Fix a bug in the tokenizer that could cause infinite recursion when showing 32syntax warnings that happen in the first line of the source. Patch by Pablo 33Galindo 34 35.. 36 37.. date: 2022-11-27-13-50-13 38.. gh-issue: 91054 39.. nonce: oox_kW 40.. section: Core and Builtins 41 42Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to 43register callbacks to receive notification on creation and destruction of 44code objects. 45 46.. 47 48.. date: 2022-11-26-04-00-41 49.. gh-issue: 99729 50.. nonce: A3ovwQ 51.. section: Core and Builtins 52 53Fix an issue that could cause frames to be visible to Python code as they 54are being torn down, possibly leading to memory corruption or hard crashes 55of the interpreter. 56 57.. 58 59.. date: 2022-11-23-18-16-18 60.. gh-issue: 99708 61.. nonce: 7MuaiR 62.. section: Core and Builtins 63 64Fix bug where compiler crashes on an if expression with an empty body block. 65 66.. 67 68.. date: 2022-11-21-11-27-14 69.. gh-issue: 99578 70.. nonce: DcKoBJ 71.. section: Core and Builtins 72 73Fix a reference bug in :func:`!_imp.create_builtin` after the creation of 74the first sub-interpreter for modules ``builtins`` and ``sys``. Patch by 75Victor Stinner. 76 77.. 78 79.. date: 2022-11-19-22-27-52 80.. gh-issue: 99581 81.. nonce: yKYPbf 82.. section: Core and Builtins 83 84Fixed a bug that was causing a buffer overflow if the tokenizer copies a 85line missing the newline character from a file that is as long as the 86available tokenizer buffer. Patch by Pablo galindo 87 88.. 89 90.. date: 2022-11-18-11-24-25 91.. gh-issue: 99553 92.. nonce: F64h-n 93.. section: Core and Builtins 94 95Fix bug where an :exc:`ExceptionGroup` subclass can wrap a 96:exc:`BaseException`. 97 98.. 99 100.. date: 2022-11-16-21-35-30 101.. gh-issue: 99547 102.. nonce: p_c_bp 103.. section: Core and Builtins 104 105Add a function to os.path to check if a path is a junction: isjunction. Add 106similar functionality to pathlib.Path as is_junction. 107 108.. 109 110.. date: 2022-11-12-01-39-57 111.. gh-issue: 99370 112.. nonce: _cu32j 113.. section: Core and Builtins 114 115Fix zip path for venv created from a non-installed python on POSIX 116platforms. 117 118.. 119 120.. date: 2022-11-11-14-04-01 121.. gh-issue: 99377 122.. nonce: -CJvWn 123.. section: Core and Builtins 124 125Add audit events for thread creation and clear operations. 126 127.. 128 129.. date: 2022-11-10-17-09-16 130.. gh-issue: 98686 131.. nonce: bmAKwr 132.. section: Core and Builtins 133 134Remove the ``BINARY_OP_GENERIC`` and ``COMPARE_OP_GENERIC`` 135"specializations". 136 137.. 138 139.. date: 2022-11-10-16-53-40 140.. gh-issue: 99298 141.. nonce: HqRJES 142.. section: Core and Builtins 143 144Remove the remaining error paths for attribute specializations, and refuse 145to specialize attribute accesses on types that haven't had 146:c:func:`PyType_Ready` called on them yet. 147 148.. 149 150.. date: 2022-11-05-22-26-35 151.. gh-issue: 99127 152.. nonce: Btk7ih 153.. section: Core and Builtins 154 155Allow some features of :mod:`syslog` to the main interpreter only. Patch by 156Donghee Na. 157 158.. 159 160.. date: 2022-10-05-11-44-52 161.. gh-issue: 91053 162.. nonce: f5Bo3p 163.. section: Core and Builtins 164 165Optimizing interpreters and JIT compilers may need to invalidate internal 166metadata when functions are modified. This change adds the ability to 167provide a callback that will be invoked each time a function is created, 168modified, or destroyed. 169 170.. 171 172.. date: 2022-09-17-17-08-01 173.. gh-issue: 90994 174.. nonce: f0H2Yd 175.. section: Core and Builtins 176 177Improve error messages when there's a syntax error with call arguments. The 178following three cases are covered: - No value is assigned to a named 179argument, eg ``foo(a=)``. - A value is assigned to a star argument, eg 180``foo(*args=[0])``. - A value is assigned to a double-star keyword argument, 181eg ``foo(**kwarg={'a': 0})``. 182 183.. 184 185.. bpo: 45026 186.. date: 2021-08-29-15-55-19 187.. nonce: z7nTA3 188.. section: Core and Builtins 189 190Optimize the :class:`range` object iterator. It is now smaller, faster 191iteration of ranges containing large numbers. Smaller pickles, faster 192unpickling. 193 194.. 195 196.. bpo: 31718 197.. date: 2020-02-23-23-48-15 198.. nonce: sXko5e 199.. section: Core and Builtins 200 201Raise :exc:`ValueError` instead of :exc:`SystemError` when methods of 202uninitialized :class:`io.IncrementalNewlineDecoder` objects are called. 203Patch by Oren Milman. 204 205.. 206 207.. bpo: 38031 208.. date: 2019-09-04-19-09-49 209.. nonce: Yq4L72 210.. section: Core and Builtins 211 212Fix a possible assertion failure in :class:`io.FileIO` when the opener 213returns an invalid file descriptor. 214 215.. 216 217.. date: 2022-12-05-13-40-15 218.. gh-issue: 100001 219.. nonce: 78ReYp 220.. section: Library 221 222Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so 223that it is technically possible to parse the line and reconstruct what the 224original data was. Without this a \xHH is ambiguous as to if it is a hex 225replacement we put in or the characters r"\x" came through in the original 226request line. 227 228.. 229 230.. date: 2022-12-03-05-58-48 231.. gh-issue: 99957 232.. nonce: jLYYgN 233.. section: Library 234 235Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. 236 237.. 238 239.. date: 2022-11-22-19-31-26 240.. gh-issue: 79033 241.. nonce: MW6kHq 242.. section: Library 243 244Fix :func:`asyncio.Server.wait_closed` to actually do what the docs promise 245-- wait for all existing connections to complete, after closing the server. 246 247.. 248 249.. date: 2022-11-21-17-56-18 250.. gh-issue: 51524 251.. nonce: nTykx8 252.. section: Library 253 254Fix bug when calling trace.CoverageResults with valid infile. 255 256.. 257 258.. date: 2022-11-21-13-49-03 259.. gh-issue: 99645 260.. nonce: 9w1QKq 261.. section: Library 262 263Fix a bug in handling class cleanups in :class:`unittest.TestCase`. Now 264``addClassCleanup()`` uses separate lists for different ``TestCase`` 265subclasses, and ``doClassCleanups()`` only cleans up the particular class. 266 267.. 268 269.. date: 2022-11-21-10-45-54 270.. gh-issue: 99508 271.. nonce: QqVbby 272.. section: Library 273 274Fix ``TypeError`` in ``Lib/importlib/_bootstrap_external.py`` while calling 275``_imp.source_hash()``. 276 277.. 278 279.. date: 2022-11-17-10-56-47 280.. gh-issue: 66285 281.. nonce: KvjlaB 282.. section: Library 283 284Fix :mod:`asyncio` to not share event loop and signal wakeupfd in forked 285processes. Patch by Kumar Aditya. 286 287.. 288 289.. date: 2022-11-15-10-55-24 290.. gh-issue: 97001 291.. nonce: KeQuVF 292.. section: Library 293 294Release the GIL when calling termios APIs to avoid blocking threads. 295 296.. 297 298.. date: 2022-11-15-04-08-25 299.. gh-issue: 92647 300.. nonce: cZcjnJ 301.. section: Library 302 303Use final status of an enum to determine lookup or creation branch of 304functional API. 305 306.. 307 308.. date: 2022-11-14-08-21-56 309.. gh-issue: 99388 310.. nonce: UWSlwp 311.. section: Library 312 313Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a 314custom event loop factory. Patch by Kumar Aditya. 315 316.. 317 318.. date: 2022-11-13-02-06-56 319.. gh-issue: 99341 320.. nonce: 8-OlwB 321.. section: Library 322 323Fix :func:`ast.increment_lineno` to also cover :class:`ast.TypeIgnore` when 324changing line numbers. 325 326.. 327 328.. date: 2022-11-12-12-15-30 329.. gh-issue: 99382 330.. nonce: dKg_rW 331.. section: Library 332 333Check the number of arguments in substitution in user generics containing a 334:class:`~typing.TypeVarTuple` and one or more :class:`~typing.TypeVar`. 335 336.. 337 338.. date: 2022-11-12-12-10-23 339.. gh-issue: 99379 340.. nonce: bcGhxF 341.. section: Library 342 343Fix substitution of :class:`~typing.ParamSpec` followed by 344:class:`~typing.TypeVarTuple` in generic aliases. 345 346.. 347 348.. date: 2022-11-12-12-08-34 349.. gh-issue: 99344 350.. nonce: 7M_u8G 351.. section: Library 352 353Fix substitution of :class:`~typing.TypeVarTuple` and 354:class:`~typing.ParamSpec` together in user generics. 355 356.. 357 358.. date: 2022-11-09-12-36-12 359.. gh-issue: 99284 360.. nonce: 9p4J2l 361.. section: Library 362 363Remove ``_use_broken_old_ctypes_structure_semantics_`` old untested and 364undocumented hack from :mod:`ctypes`. 365 366.. 367 368.. date: 2022-11-09-03-34-29 369.. gh-issue: 99201 370.. nonce: lDJ7xI 371.. section: Library 372 373Fix :exc:`IndexError` when initializing the config variables on Windows if 374``HAVE_DYNAMIC_LOADING`` is not set. 375 376.. 377 378.. date: 2022-11-08-15-54-43 379.. gh-issue: 99240 380.. nonce: MhYwcz 381.. section: Library 382 383Fix double-free bug in Argument Clinic ``str_converter`` by extracting 384memory clean up to a new ``post_parsing`` section. 385 386.. 387 388.. date: 2022-11-08-11-18-51 389.. gh-issue: 64490 390.. nonce: VcBgrN 391.. section: Library 392 393Fix refcount error when arguments are packed to tuple in Argument Clinic. 394 395.. 396 397.. date: 2022-11-02-23-47-07 398.. gh-issue: 99029 399.. nonce: 7uCiIB 400.. section: Library 401 402:meth:`pathlib.PurePath.relative_to` now treats naked Windows drive paths 403as relative. This brings its behaviour in line with other parts of pathlib. 404 405.. 406 407.. date: 2022-10-24-11-01-05 408.. gh-issue: 98253 409.. nonce: HVd5v4 410.. section: Library 411 412The implementation of the typing module is now more resilient to reference 413leaks in binary extension modules. 414 415Previously, a reference leak in a typed C API-based extension module could 416leak internals of the typing module, which could in turn introduce leaks in 417essentially any other package with typed function signatures. Although the 418typing package is not the original source of the problem, such non-local 419dependences exacerbate debugging of large-scale projects, and the 420implementation was therefore changed to reduce harm by providing better 421isolation. 422 423.. 424 425.. date: 2022-10-19-18-31-53 426.. gh-issue: 98458 427.. nonce: vwyq7O 428.. section: Library 429 430Fix infinite loop in unittest when a self-referencing chained exception is 431raised 432 433.. 434 435.. date: 2022-10-19-13-37-23 436.. gh-issue: 93453 437.. nonce: wTB_sH 438.. section: Library 439 440:func:`asyncio.get_event_loop` and many other :mod:`asyncio` functions like 441:func:`asyncio.ensure_future`, :func:`asyncio.shield` or 442:func:`asyncio.gather`, and also the 443:meth:`~asyncio.BaseDefaultEventLoopPolicy.get_event_loop` method of 444:class:`asyncio.BaseDefaultEventLoopPolicy` now raise a :exc:`RuntimeError` 445if called when there is no running event loop and the current event loop was 446not set. Previously they implicitly created and set a new current event 447loop. :exc:`DeprecationWarning` is no longer emitted if there is no running 448event loop but the current event loop was set. 449 450.. 451 452.. date: 2022-10-16-18-52-00 453.. gh-issue: 97966 454.. nonce: humlhz 455.. section: Library 456 457On ``uname_result``, restored expectation that ``_fields`` and ``_asdict`` 458would include all six properties including ``processor``. 459 460.. 461 462.. date: 2022-10-13-22-13-54 463.. gh-issue: 98248 464.. nonce: lwyygy 465.. section: Library 466 467Provide informative error messages in :func:`struct.pack` when its integral 468arguments are not in range. 469 470.. 471 472.. date: 2022-10-08-19-20-33 473.. gh-issue: 98108 474.. nonce: WUObqM 475.. section: Library 476 477``zipfile.Path`` is now pickleable if its initialization parameters were 478pickleable (e.g. for file system paths). 479 480.. 481 482.. date: 2022-10-08-15-41-00 483.. gh-issue: 98098 484.. nonce: DugpWi 485.. section: Library 486 487Created packages from zipfile and test_zipfile modules, separating 488``zipfile.Path`` functionality. 489 490.. 491 492.. date: 2022-10-02-12-38-22 493.. gh-issue: 82836 494.. nonce: OvYLmC 495.. section: Library 496 497Fix :attr:`~ipaddress.IPv4Address.is_private` properties in the 498:mod:`ipaddress` module. Previously non-private networks (0.0.0.0/0) would 499return ``True`` from this method; now they correctly return ``False``. 500 501.. 502 503.. date: 2022-09-14-21-56-15 504.. gh-issue: 96828 505.. nonce: ZoOY5G 506.. section: Library 507 508Add an :const:`~ssl.OP_ENABLE_KTLS` option for enabling the use of the kernel 509TLS (kTLS). Patch by Illia Volochii. 510 511.. 512 513.. date: 2022-08-06-12-18-07 514.. gh-issue: 88863 515.. nonce: NnqsuJ 516.. section: Library 517 518To avoid apparent memory leaks when :func:`asyncio.open_connection` raises, 519break reference cycles generated by local exception and future instances 520(which has exception instance as its member var). Patch by Dong Uk, Kang. 521 522.. 523 524.. date: 2022-04-23-03-46-37 525.. gh-issue: 91078 526.. nonce: 87-hkp 527.. section: Library 528 529:meth:`TarFile.next` now returns ``None`` when called on an empty tarfile. 530 531.. 532 533.. bpo: 47220 534.. date: 2022-04-04-22-54-11 535.. nonce: L9jYu4 536.. section: Library 537 538Document the optional *callback* parameter of :class:`WeakMethod`. Patch by 539Géry Ogam. 540 541.. 542 543.. bpo: 44817 544.. date: 2021-08-03-05-31-00 545.. nonce: wOW_Qn 546.. section: Library 547 548Ignore WinError 53 (ERROR_BAD_NETPATH), 65 (ERROR_NETWORK_ACCESS_DENIED) and 549161 (ERROR_BAD_PATHNAME) when using ntpath.realpath(). 550 551.. 552 553.. bpo: 41260 554.. date: 2020-08-02-23-46-22 555.. nonce: Q2BNzY 556.. section: Library 557 558Rename the *fmt* parameter of the pure Python implementation of 559:meth:`datetime.date.strftime` to *format*. 560 561.. 562 563.. bpo: 15999 564.. date: 2019-08-30-10-48-53 565.. nonce: QqsRRi 566.. section: Library 567 568All built-in functions now accept arguments of any type instead of just 569``bool`` and ``int`` for boolean parameters. 570 571.. 572 573.. date: 2022-12-02-17-08-08 574.. gh-issue: 99931 575.. nonce: wC46hE 576.. section: Documentation 577 578Use `sphinxext-opengraph <https://sphinxext-opengraph.readthedocs.io/>`__ to 579generate `OpenGraph metadata <https://ogp.me/>`__. 580 581.. 582 583.. date: 2022-11-26-21-43-05 584.. gh-issue: 89682 585.. nonce: DhKoTM 586.. section: Documentation 587 588Reworded docstring of the default ``__contains__`` to clarify that it 589returns a :class:`bool`. 590 591.. 592 593.. date: 2022-11-26-15-51-23 594.. gh-issue: 88330 595.. nonce: B_wFq8 596.. section: Documentation 597 598Improved the description of what a resource is in importlib.resources docs. 599 600.. 601 602.. date: 2022-11-16-12-52-23 603.. gh-issue: 92892 604.. nonce: TS-P0j 605.. section: Documentation 606 607Document that calling variadic functions with ctypes requires special care 608on macOS/arm64 (and possibly other platforms). 609 610.. 611 612.. bpo: 41825 613.. date: 2020-09-22-12-32-16 614.. nonce: npcaCb 615.. section: Documentation 616 617Restructured the documentation for the :func:`os.wait* <os.wait>` family of 618functions, and improved the docs for :func:`os.waitid` with more explanation 619of the possible argument constants. 620 621.. 622 623.. date: 2022-12-05-16-12-56 624.. gh-issue: 99892 625.. nonce: sz_eW8 626.. section: Tests 627 628Skip test_normalization() of test_unicodedata if it fails to download 629NormalizationTest.txt file from pythontest.net. Patch by Victor Stinner. 630 631.. 632 633.. date: 2022-12-01-18-55-18 634.. gh-issue: 99934 635.. nonce: Ox3Fqf 636.. section: Tests 637 638Correct test_marsh on (32 bit) x86: test_deterministic sets was failing. 639 640.. 641 642.. date: 2022-11-23-18-32-16 643.. gh-issue: 99741 644.. nonce: q4R7NH 645.. section: Tests 646 647We've implemented multi-phase init (PEP 489/630/687) for the internal (for 648testing) _xxsubinterpreters module. 649 650.. 651 652.. date: 2022-11-21-19-21-30 653.. gh-issue: 99659 654.. nonce: 4gP0nm 655.. section: Tests 656 657Optional big memory tests in ``test_sqlite3`` now catch the correct 658:exc:`sqlite.DataError` exception type in case of too large strings and/or 659blobs passed. 660 661.. 662 663.. date: 2022-11-19-13-34-28 664.. gh-issue: 99593 665.. nonce: 8ZfCkj 666.. section: Tests 667 668Cover the Unicode C API with tests. 669 670.. 671 672.. date: 2022-08-22-15-49-14 673.. gh-issue: 96002 674.. nonce: 4UE9UE 675.. section: Tests 676 677Add functional test for Argument Clinic. 678 679.. 680 681.. date: 2022-11-24-02-58-10 682.. gh-issue: 99086 683.. nonce: DV_4Br 684.. section: Build 685 686Fix ``-Wimplicit-int``, ``-Wstrict-prototypes``, and 687``-Wimplicit-function-declaration`` compiler warnings in 688:program:`configure` checks. 689 690.. 691 692.. date: 2022-11-15-08-40-22 693.. gh-issue: 99337 694.. nonce: 5LoQDE 695.. section: Build 696 697Fix a compilation issue with GCC 12 on macOS. 698 699.. 700 701.. date: 2022-11-09-14-42-48 702.. gh-issue: 99289 703.. nonce: X7wFE1 704.. section: Build 705 706Add a ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` 707options (default: ``-j0``) in ``make install``. Also merged the 708``compileall`` commands into a single command building .pyc files for the 709all optimization levels (0, 1, 2) at once. Patch by Victor Stinner. 710 711.. 712 713.. date: 2022-11-03-08-10-49 714.. gh-issue: 98872 715.. nonce: gdsR8X 716.. section: Build 717 718Fix a possible fd leak in ``Programs/_freeze_module.c`` introduced in Python 7193.11. 720 721.. 722 723.. date: 2022-10-16-12-49-24 724.. gh-issue: 88226 725.. nonce: BsnQ4k 726.. section: Build 727 728Always define ``TARGET_*`` labels in ``Python/ceval.c``, even if 729``USE_COMPUTED_GOTOS`` is disabled. This allows breakpoints to be set at 730those labels in (for instance) ``gdb``. 731 732.. 733 734.. date: 2022-11-23-17-17-16 735.. gh-issue: 99345 736.. nonce: jOa3-f 737.. section: Windows 738 739Use faster initialization functions to detect install location for Windows 740Store package 741 742.. 743 744.. date: 2022-11-21-19-50-18 745.. gh-issue: 98629 746.. nonce: tMmB_B 747.. section: Windows 748 749Fix initialization of :data:`sys.version` and ``sys._git`` on Windows 750 751.. 752 753.. date: 2022-11-16-19-03-21 754.. gh-issue: 99442 755.. nonce: 6Dgk3Q 756.. section: Windows 757 758Fix handling in :ref:`launcher` when ``argv[0]`` does not include a file 759extension. 760 761.. 762 763.. bpo: 40882 764.. date: 2020-06-06-15-10-37 765.. nonce: UvNbdj 766.. section: Windows 767 768Fix a memory leak in :class:`multiprocessing.shared_memory.SharedMemory` on 769Windows. 770 771.. 772 773.. date: 2022-11-25-09-23-20 774.. gh-issue: 87235 775.. nonce: SifjCD 776.. section: macOS 777 778On macOS ``python3 /dev/fd/9 9</path/to/script.py`` failed for any script 779longer than a couple of bytes. 780 781.. 782 783.. date: 2022-11-01-10-32-23 784.. gh-issue: 98940 785.. nonce: W3YzC_ 786.. section: macOS 787 788Fix ``Mac/Extras.install.py`` file filter bug. 789 790.. 791 792.. date: 2022-08-11-09-58-15 793.. gh-issue: 64490 794.. nonce: PjwhM4 795.. section: Tools/Demos 796 797Argument Clinic varargs bugfixes 798 799* Fix out-of-bounds error in :c:func:`!_PyArg_UnpackKeywordsWithVararg`. 800* Fix incorrect check which allowed more than one varargs in clinic.py. 801* Fix miscalculation of ``noptargs`` in generated code. 802* Do not generate ``noptargs`` when there is a vararg argument and no optional argument. 803 804.. 805 806.. date: 2022-12-05-17-30-13 807.. gh-issue: 98680 808.. nonce: FiMCxZ 809.. section: C API 810 811``PyBUF_*`` constants were marked as part of Limited API of Python 3.11+. 812These were available in 3.11.0 with :c:macro:`Py_LIMITED_API` defined for 8133.11, and are necessary to use the buffer API. 814 815.. 816 817.. date: 2022-11-20-09-52-50 818.. gh-issue: 99612 819.. nonce: eBHksg 820.. section: C API 821 822Fix :c:func:`PyUnicode_DecodeUTF8Stateful` for ASCII-only data: 823``*consumed`` was not set. 824 825.. 826 827.. date: 2022-11-02-16-51-24 828.. gh-issue: 47146 829.. nonce: dsYDtI 830.. section: C API 831 832The ``structmember.h`` header is deprecated. Its non-deprecated contents are 833now available just by including ``Python.h``, with a ``Py_`` prefix added if 834it was missing. (Deprecated contents are :c:macro:`T_OBJECT`, 835:c:macro:`T_NONE`, and no-op flags.) Patch by Petr Viktorin, based on 836earlier work by Alexander Belopolsky and Matthias Braun. 837