1.. bpo: 42988 2.. date: 2021-03-24-14-16-56 3.. nonce: P2aNco 4.. release date: 2021-04-05 5.. section: Security 6 7CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module 8which could be abused to read arbitrary files on the disk (directory 9traversal vulnerability). Moreover, even source code of Python modules can 10contain sensitive data like passwords. Vulnerability reported by David 11Schwörer. 12 13.. 14 15.. bpo: 43285 16.. date: 2021-03-13-03-48-14 17.. nonce: g-Hah3 18.. section: Security 19 20:mod:`ftplib` no longer trusts the IP address value returned from the server 21in response to the PASV command by default. This prevents a malicious FTP 22server from using the response to probe IPv4 address and port combinations 23on the client network. 24 25Code that requires the former vulnerable behavior may set a 26``trust_server_pasv_ipv4_address`` attribute on their :class:`ftplib.FTP` 27instances to ``True`` to re-enable it. 28 29.. 30 31.. bpo: 43439 32.. date: 2021-03-08-23-06-07 33.. nonce: 5U3lXm 34.. section: Security 35 36Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and 37:func:`gc.get_referents`. Patch by Pablo Galindo. 38 39.. 40 41.. bpo: 27129 42.. date: 2021-04-03-22-04-46 43.. nonce: u_ehHb 44.. section: Core and Builtins 45 46Update CPython bytecode magic number. 47 48.. 49 50.. bpo: 43672 51.. date: 2021-03-31-09-12-54 52.. nonce: jTT5uG 53.. section: Core and Builtins 54 55Raise ImportWarning when calling find_loader(). 56 57.. 58 59.. bpo: 43660 60.. date: 2021-03-29-19-50-34 61.. nonce: scTgag 62.. section: Core and Builtins 63 64Fix crash that happens when replacing ``sys.stderr`` with a callable that 65can remove the object while an exception is being printed. Patch by Pablo 66Galindo. 67 68.. 69 70.. bpo: 27129 71.. date: 2021-03-29-16-20-29 72.. nonce: BF03A5 73.. section: Core and Builtins 74 75The bytecode interpreter uses instruction, rather byte, offsets internally. 76This reduces the number of EXTENDED_ARG instructions needed and streamlines 77instruction dispatch a bit. 78 79.. 80 81.. bpo: 40645 82.. date: 2021-03-29-11-55-06 83.. nonce: PhaT-B 84.. section: Core and Builtins 85 86Fix reference leak in the :mod:`_hashopenssl` extension. Patch by Pablo 87Galindo. 88 89.. 90 91.. bpo: 42134 92.. date: 2021-03-26-17-30-19 93.. nonce: G4Sjxg 94.. section: Core and Builtins 95 96Calls to find_module() by the import system now raise ImportWarning. 97 98.. 99 100.. bpo: 41064 101.. date: 2021-03-24-00-32-20 102.. nonce: _H0K_g 103.. section: Core and Builtins 104 105Improve the syntax error for invalid usage of double starred elements ('**') 106in f-strings. Patch by Pablo Galindo. 107 108.. 109 110.. bpo: 43575 111.. date: 2021-03-21-12-26-32 112.. nonce: pl-nSg 113.. section: Core and Builtins 114 115Speed up calls to ``map()`` by using the :pep:`590` ``vectorcall`` calling 116convention. Patch by Dong-hee Na. 117 118.. 119 120.. bpo: 42137 121.. date: 2021-03-20-19-54-47 122.. nonce: A8aQvj 123.. section: Core and Builtins 124 125The import system now prefers using ``__spec__`` for ``ModuleType.__repr__`` 126over ``module_repr()``. 127 128.. 129 130.. bpo: 43452 131.. date: 2021-03-20-01-21-37 132.. nonce: tDVJkc 133.. section: Core and Builtins 134 135Added micro-optimizations to ``_PyType_Lookup()`` to improve cache lookup 136performance in the common case of cache hits. 137 138.. 139 140.. bpo: 43555 141.. date: 2021-03-19-22-49-40 142.. nonce: ZmhYSA 143.. section: Core and Builtins 144 145Report the column offset for :exc:`SyntaxError` for invalid line 146continuation characters. Patch by Pablo Galindo. 147 148.. 149 150.. bpo: 43517 151.. date: 2021-03-16-17-12-54 152.. nonce: zAo6Ws 153.. section: Core and Builtins 154 155Fix misdetection of circular imports when using ``from pkg.mod import 156attr``, which caused false positives in non-trivial multi-threaded code. 157 158.. 159 160.. bpo: 43497 161.. date: 2021-03-15-07-50-30 162.. nonce: Uc5ZCJ 163.. section: Core and Builtins 164 165Emit SyntaxWarnings for assertions with tuple constants, this is a 166regression introduced in python3.7 167 168.. 169 170.. bpo: 39316 171.. date: 2021-03-14-16-44-50 172.. nonce: Ns3a_F 173.. section: Core and Builtins 174 175Tracing now has correct line numbers for attribute accesses when the the 176attribute is on a different line from the object. Improves debugging and 177profiling for multi-line method chains. 178 179.. 180 181.. bpo: 35883 182.. date: 2021-03-13-13-57-21 183.. nonce: UyGpdG 184.. section: Core and Builtins 185 186Python no longer fails at startup with a fatal error if a command line 187argument contains an invalid Unicode character. The 188:c:func:`Py_DecodeLocale` function now escapes byte sequences which would be 189decoded as Unicode characters outside the [U+0000; U+10ffff] range. 190 191.. 192 193.. bpo: 43410 194.. date: 2021-03-05-17-23-36 195.. nonce: lCzIg0 196.. section: Core and Builtins 197 198Fix a bug that was causing the parser to crash when emitting syntax errors 199when reading input from stdin. Patch by Pablo Galindo 200 201.. 202 203.. bpo: 43406 204.. date: 2021-03-04-22-53-10 205.. nonce: Na_VpA 206.. section: Core and Builtins 207 208Fix a possible race condition where ``PyErr_CheckSignals`` tries to execute 209a non-Python signal handler. 210 211.. 212 213.. bpo: 42128 214.. date: 2021-03-03-19-04-23 215.. nonce: VouZjn 216.. section: Core and Builtins 217 218Add ``__match_args__`` to :c:type:`structsequence` based classes. Patch by 219Pablo Galindo. 220 221.. 222 223.. bpo: 43390 224.. date: 2021-03-03-17-58-49 225.. nonce: epPpwV 226.. section: Core and Builtins 227 228CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for the VM's 229default signal handlers. This is friendlier to other in-process code that 230an extension module or embedding use could pull in (such as Golang's cgo) 231where tiny thread stacks are the norm and ``sigaltstack()`` has been used to 232provide for signal handlers. This is a no-op change for the vast majority 233of processes that don't use sigaltstack. 234 235.. 236 237.. bpo: 43287 238.. date: 2021-02-22-03-01-02 239.. nonce: aTs6fO 240.. section: Core and Builtins 241 242Speed up calls to ``filter()`` by using the :pep:`590` ``vectorcall`` 243calling convention. Patch by Dong-hee Na. 244 245.. 246 247.. bpo: 37448 248.. date: 2021-02-21-14-19-35 249.. nonce: btl7vO 250.. section: Core and Builtins 251 252Add a radix tree based memory map to track in-use obmalloc arenas. Use to 253replace the old implementation of address_in_range(). The radix tree 254approach makes it easy to increase pool sizes beyond the OS page size. 255Boosting the pool and arena size allows obmalloc to handle a significantly 256higher percentage of requests from its ultra-fast paths. 257 258It also has the advantage of eliminating the memory unsanitary behavior of 259the previous address_in_range(). The old address_in_range() was marked with 260the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and 261_Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed. 262 263To disable the radix tree map, set a preprocessor flag as follows: 264`-DWITH_PYMALLOC_RADIX_TREE=0`. 265 266Co-authored-by: Tim Peters <tim.peters@gmail.com> 267 268.. 269 270.. bpo: 29988 271.. date: 2020-02-03-13-23-10 272.. nonce: 8_UB5w 273.. section: Core and Builtins 274 275Only handle asynchronous exceptions and requests to drop the GIL when 276returning from a call or on the back edges of loops. Makes sure that 277:meth:`__exit__` is always called in with statements, even for interrupts. 278 279.. 280 281.. bpo: 43720 282.. date: 2021-04-03-13-45-51 283.. nonce: FDZ5cZ 284.. section: Library 285 286Document various stdlib deprecations in imp, pkgutil, and importlib.util for 287removal in Python 3.12. 288 289.. 290 291.. bpo: 43433 292.. date: 2021-03-28-23-50-20 293.. nonce: so9j5G 294.. section: Library 295 296:class:`xmlrpc.client.ServerProxy` no longer ignores query and fragment in 297the URL of the server. 298 299.. 300 301.. bpo: 31956 302.. date: 2021-03-28-16-53-25 303.. nonce: Lt_67U 304.. section: Library 305 306The :meth:`~array.array.index` method of :class:`array.array` now has 307optional *start* and *stop* parameters. 308 309.. 310 311.. bpo: 40066 312.. date: 2021-03-25-21-26-30 313.. nonce: 7EBQ3_ 314.. section: Library 315 316Enum: adjust ``repr()`` to show only enum and member name (not value, nor 317angle brackets) and ``str()`` to show only member name. Update and improve 318documentation to match. 319 320.. 321 322.. bpo: 42136 323.. date: 2021-03-25-08-44-26 324.. nonce: rRY9e1 325.. section: Library 326 327Deprecate all module_repr() methods found in importlib as their use is being 328phased out by Python 3.12. 329 330.. 331 332.. bpo: 35930 333.. date: 2021-03-23-17-18-56 334.. nonce: RZ51pM 335.. section: Library 336 337Raising an exception raised in a "future" instance will create reference 338cycles. 339 340.. 341 342.. bpo: 41369 343.. date: 2021-03-21-17-50-42 344.. nonce: -fpmYZ 345.. section: Library 346 347Finish updating the vendored libmpdec to version 2.5.1. Patch by Stefan 348Krah. 349 350.. 351 352.. bpo: 43422 353.. date: 2021-03-21-17-02-52 354.. nonce: POk6cU 355.. section: Library 356 357Revert the _decimal C API which was added in bpo-41324. 358 359.. 360 361.. bpo: 43577 362.. date: 2021-03-21-10-13-17 363.. nonce: m7JnAV 364.. section: Library 365 366Fix deadlock when using :class:`ssl.SSLContext` debug callback with 367:meth:`ssl.SSLContext.sni_callback`. 368 369.. 370 371.. bpo: 43571 372.. date: 2021-03-20-17-40-35 373.. nonce: acAL0W 374.. section: Library 375 376It's now possible to create MPTCP sockets with IPPROTO_MPTCP 377 378.. 379 380.. bpo: 43542 381.. date: 2021-03-20-15-43-25 382.. nonce: 6bt2F6 383.. section: Library 384 385``image/heic`` and ``image/heif`` were added to :mod:`mimetypes`. 386 387.. 388 389.. bpo: 40645 390.. date: 2021-03-19-10-22-17 391.. nonce: 5pXhb- 392.. section: Library 393 394The :mod:`hmac` module now uses OpenSSL's HMAC implementation when digestmod 395argument is a hash name or builtin hash function. 396 397.. 398 399.. bpo: 43510 400.. date: 2021-03-16-17-20-33 401.. nonce: -BeQH_ 402.. section: Library 403 404Implement :pep:`597`: Add ``EncodingWarning`` warning, ``-X 405warn_default_encoding`` option, :envvar:`PYTHONWARNDEFAULTENCODING` 406environment variable and ``encoding="locale"`` argument value. 407 408.. 409 410.. bpo: 43521 411.. date: 2021-03-16-16-05-02 412.. nonce: mRT6fh 413.. section: Library 414 415``ast.unparse`` can now render NaNs and empty sets. 416 417.. 418 419.. bpo: 42914 420.. date: 2021-03-14-21-47-28 421.. nonce: 9U1o33 422.. section: Library 423 424:func:`pprint.pprint` gains a new boolean ``underscore_numbers`` optional 425argument to emit integers with thousands separated by an underscore 426character for improved readability (for example ``1_000_000`` instead of 427``1000000``). 428 429.. 430 431.. bpo: 41361 432.. date: 2021-03-13-08-18-01 433.. nonce: lXDIlr 434.. section: Library 435 436:meth:`~collections.deque.rotate` calls are now slightly faster due to 437faster argument parsing. 438 439.. 440 441.. bpo: 43423 442.. date: 2021-03-11-15-44-18 443.. nonce: rRomRD 444.. section: Library 445 446:func:`subprocess.communicate` no longer raises an IndexError when there is 447an empty stdout or stderr IO buffer during a timeout on Windows. 448 449.. 450 451.. bpo: 27820 452.. date: 2021-03-10-14-07-44 453.. nonce: Wwdy-r 454.. section: Library 455 456Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with 457initial_response_ok=False will fail. 458 459The cause is that SMTP.auth_login _always_ returns a password if provided 460with a challenge string, thus non-compliant with the standard for AUTH 461LOGIN. 462 463Also fixes bug with the test for smtpd. 464 465.. 466 467.. bpo: 43445 468.. date: 2021-03-09-11-36-19 469.. nonce: jnj-UB 470.. section: Library 471 472Add frozen modules to :data:`sys.stdlib_module_names`. For example, add 473``"_frozen_importlib"`` and ``"_frozen_importlib_external"`` names. 474 475.. 476 477.. bpo: 43245 478.. date: 2021-03-08-22-14-37 479.. nonce: nXL-MC 480.. section: Library 481 482Add keyword arguments support to ``ChainMap.new_child()``. 483 484.. 485 486.. bpo: 29982 487.. date: 2021-03-07-23-23-03 488.. nonce: Q9iszT 489.. section: Library 490 491Add optional parameter *ignore_cleanup_errors* to 492:func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup` 493attempts. Contributed by C.A.M. Gerlach. 494 495.. 496 497.. bpo: 43428 498.. date: 2021-03-07-18-54-39 499.. nonce: br0XmX 500.. section: Library 501 502Include changes from `importlib_metadata 3.7 503<https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-7-0>`_: 504 505Performance enhancements to distribution discovery. 506 507``entry_points`` only returns unique distributions. 508 509Introduces new ``EntryPoints`` object for containing a set of entry points 510with convenience methods for selecting entry points by group or name. 511``entry_points`` now returns this object if selection parameters are 512supplied but continues to return a dict object for compatibility. Users are 513encouraged to rely on the selection interface. The dict object result is 514likely to be deprecated in the future. 515 516Added packages_distributions function to return a mapping of packages to the 517distributions that provide them. 518 519.. 520 521.. bpo: 43332 522.. date: 2021-03-07-11-23-20 523.. nonce: weatsh 524.. section: Library 525 526Improves the networking efficiency of :mod:`http.client` when using a proxy 527via :meth:`~HTTPConnection.set_tunnel`. Fewer small send calls are made 528during connection setup. 529 530.. 531 532.. bpo: 43420 533.. date: 2021-03-07-08-03-31 534.. nonce: cee_X5 535.. section: Library 536 537Improve performance of :class:`fractions.Fraction` arithmetics for large 538components. Contributed by Sergey B. Kirpichev. 539 540.. 541 542.. bpo: 43356 543.. date: 2021-03-04-21-51-20 544.. nonce: X7IGBM 545.. section: Library 546 547Allow passing a signal number to ``_thread.interrupt_main()``. 548 549.. 550 551.. bpo: 43399 552.. date: 2021-03-04-17-53-46 553.. nonce: Wn95u- 554.. section: Library 555 556Fix ``ElementTree.extend`` not working on iterators when using the Python 557implementation 558 559.. 560 561.. bpo: 43369 562.. date: 2021-03-02-15-25-28 563.. nonce: F4knlQ 564.. section: Library 565 566Improve :mod:`sqlite3` error handling: If ``sqlite3_column_text()`` and 567``sqlite3_column_blob()`` set ``SQLITE_NOMEM``, :exc:`MemoryError` is now 568raised. Patch by Erlend E. Aasland. 569 570.. 571 572.. bpo: 43368 573.. date: 2021-03-02-13-45-05 574.. nonce: t9XEkQ 575.. section: Library 576 577Fix a regression introduced in GH-24562, where an empty bytestring was 578fetched as ``None`` instead of ``b''`` in :mod:`sqlite3`. Patch by Mariusz 579Felisiak. 580 581.. 582 583.. bpo: 41282 584.. date: 2021-03-02-09-54-22 585.. nonce: xL4h94 586.. section: Library 587 588Fixed stacklevel of ``DeprecationWarning`` emitted from ``import 589distutils``. 590 591.. 592 593.. bpo: 42129 594.. date: 2021-02-28-04-21-35 595.. nonce: V0KifQ 596.. section: Library 597 598``importlib.resources`` now honors namespace packages, merging resources 599from each location in the namespace as introduced in ``importlib_resources`` 6003.2 and including incidental changes through 5.0.3. 601 602.. 603 604.. bpo: 43295 605.. date: 2021-02-22-22-54-40 606.. nonce: h_ffu7 607.. section: Library 608 609:meth:`datetime.datetime.strptime` now raises ``ValueError`` instead of 610``IndexError`` when matching ``'z'`` with the ``%z`` format specifier. 611 612.. 613 614.. bpo: 43125 615.. date: 2021-02-07-19-13-30 616.. nonce: AqNoMa 617.. section: Library 618 619Return empty string if base64mime.body_encode receive empty bytes 620 621.. 622 623.. bpo: 43084 624.. date: 2021-01-31-17-31-13 625.. nonce: i8nLpK 626.. section: Library 627 628:func:`curses.window.enclose` returns now ``True`` or ``False`` (as was 629documented) instead of ``1`` or ``0``. 630 631.. 632 633.. bpo: 42994 634.. date: 2021-01-21-16-58-34 635.. nonce: El0Ksp 636.. section: Library 637 638Add MIME types for opus, AAC, 3gpp and 3gpp2 639 640.. 641 642.. bpo: 14678 643.. date: 2021-01-07-21-25-49 644.. nonce: 1zniCH 645.. section: Library 646 647Add an invalidate_caches() method to the zipimport.zipimporter class to 648support importlib.invalidate_caches(). Patch by Desmond Cheong. 649 650.. 651 652.. bpo: 42782 653.. date: 2020-12-29-13-46-57 654.. nonce: 3r0HFY 655.. section: Library 656 657Fail fast in :func:`shutil.move()` to avoid creating destination directories 658on failure. 659 660.. 661 662.. bpo: 40066 663.. date: 2020-09-23-21-58-34 664.. nonce: f1dr_5 665.. section: Library 666 667Enum's `repr()` and `str()` have changed: `repr()` is now 668*EnumClass.MemberName* and `str()` is *MemberName*. Additionally, stdlib 669Enum's whose contents are available as module attributes, such as 670`RegexFlag.IGNORECASE`, have their `repr()` as *module.name*, e.g. 671`re.IGNORECASE`. 672 673.. 674 675.. bpo: 26053 676.. date: 2020-09-01-10-12-13 677.. nonce: hXikw_ 678.. section: Library 679 680Fixed bug where the :mod:`pdb` interactive run command echoed the args from 681the shell command line, even if those have been overridden at the pdb 682prompt. 683 684.. 685 686.. bpo: 24160 687.. date: 2020-08-28-23-07-53 688.. nonce: MSGnKr 689.. section: Library 690 691Fixed bug where breakpoints did not persist across multiple debugger 692sessions in :mod:`pdb`'s interactive mode. 693 694.. 695 696.. bpo: 40701 697.. date: 2020-05-27-05-42-39 698.. nonce: PBIgW1 699.. section: Library 700 701When the :data:`tempfile.tempdir` global variable is set to a value of type 702bytes, it is now handled consistently. Previously exceptions could be 703raised from some tempfile APIs when the directory did not already exist in 704this situation. Also ensures that the :func:`tempfile.gettempdir()` and 705:func:`tempfile.gettempdirb()` functions *always* return ``str`` and 706``bytes`` respectively. 707 708.. 709 710.. bpo: 39342 711.. date: 2020-01-15-11-15-35 712.. nonce: S8PuJO 713.. section: Library 714 715Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as 716:data:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate validation 717as explained in 718https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html. 719 720.. 721 722.. bpo: 31861 723.. date: 2018-08-24-01-08-09 724.. nonce: -q9RKJ 725.. section: Library 726 727Add builtins.aiter and builtins.anext. Patch by Joshua Bronson (@jab), 728Daniel Pope (@lordmauve), and Justin Wang (@justin39). 729 730.. 731 732.. bpo: 43199 733.. date: 2021-03-13-18-43-54 734.. nonce: ZWA6KX 735.. section: Documentation 736 737Answer "Why is there no goto?" in the Design and History FAQ. 738 739.. 740 741.. bpo: 43407 742.. date: 2021-03-04-22-53-03 743.. nonce: x570l5 744.. section: Documentation 745 746Clarified that a result from :func:`time.monotonic`, 747:func:`time.perf_counter`, :func:`time.process_time`, or 748:func:`time.thread_time` can be compared with the result from any following 749call to the same function - not just the next immediate call. 750 751.. 752 753.. bpo: 43354 754.. date: 2021-03-02-12-55-34 755.. nonce: ezZYkx 756.. section: Documentation 757 758Fix type documentation for ``Fault.faultCode``; the type has to be ``int`` 759instead of ``str``. 760 761.. 762 763.. bpo: 41933 764.. date: 2020-10-05-20-04-43 765.. nonce: Pff94- 766.. section: Documentation 767 768Clarified wording of s * n in the Common Sequence Operations 769 770.. 771 772.. bpo: 37945 773.. date: 2021-03-31-11-38-42 774.. nonce: HTUYhv 775.. section: Tests 776 777Fix test_getsetlocale_issue1813() of test_locale: skip the test if 778``setlocale()`` fails. Patch by Victor Stinner. 779 780.. 781 782.. bpo: 41561 783.. date: 2021-03-18-10-34-42 784.. nonce: pDg4w- 785.. section: Tests 786 787Add workaround for Ubuntu's custom OpenSSL security level policy. 788 789.. 790 791.. bpo: 43179 792.. date: 2021-03-31-12-20-23 793.. nonce: Qbe1OD 794.. section: Build 795 796Introduce and correctly use ALIGNOF_X in place of SIZEOF_X for 797alignment-related code in optimized string routines. Patch by Jessica 798Clarke. 799 800.. 801 802.. bpo: 43631 803.. date: 2021-03-26-09-16-34 804.. nonce: msJyPi 805.. section: Build 806 807Update macOS, Windows, and CI to OpenSSL 1.1.1k. 808 809.. 810 811.. bpo: 43617 812.. date: 2021-03-24-16-55-55 813.. nonce: d69KAv 814.. section: Build 815 816Improve configure.ac: Check for presence of autoconf-archive package and 817remove our copies of M4 macros. 818 819.. 820 821.. bpo: 43466 822.. date: 2021-03-11-00-14-47 823.. nonce: N861Z5 824.. section: Build 825 826The ``configure`` script now supports ``--with-openssl-rpath`` option. 827 828.. 829 830.. bpo: 43372 831.. date: 2021-03-04-17-13-57 832.. nonce: FfqDVL 833.. section: Build 834 835Use ``_freeze_importlib`` to generate code for the ``__hello__`` module. 836This approach ensures the code matches the interpreter version. Previously, 837PYTHON_FOR_REGEN was used to generate the code, which might be wrong. The 838marshal format for code objects has changed with bpo-42246, commit 877df851. 839Update the code and the expected code sizes in ctypes test_frozentable. 840 841.. 842 843.. bpo: 43440 844.. date: 2021-03-09-11-15-41 845.. nonce: igy2Mn 846.. section: Windows 847 848Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch by Erlend E. 849Aasland. 850 851.. 852 853.. bpo: 42225 854.. date: 2021-03-29-16-22-27 855.. nonce: iIeiLg 856.. section: IDLE 857 858Document that IDLE can fail on Unix either from misconfigured IP masquerage 859rules or failure displaying complex colored (non-ascii) characters. 860 861.. 862 863.. bpo: 43688 864.. date: 2021-04-01-09-10-42 865.. nonce: G4gs6k 866.. section: C API 867 868The limited C API is now supported if Python is built in debug mode (if the 869``Py_DEBUG`` macro is defined). In the limited C API, the 870:c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now implemented as 871opaque function calls, rather than accessing directly the 872:c:member:`PyObject.ob_refcnt` member, if Python is built in debug mode and 873the ``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became 874possible to support the limited C API in debug mode because the 875:c:type:`PyObject` structure is the same in release and debug mode since 876Python 3.8 (see :issue:`36465`). 877 878The limited C API is still not supported in the ``--with-trace-refs`` 879special build (``Py_TRACE_REFS`` macro). 880 881Patch by Victor Stinner. 882 883.. 884 885.. bpo: 43244 886.. date: 2021-03-24-01-22-14 887.. nonce: 31-97x 888.. section: C API 889 890Remove the ``pyarena.h`` header file with functions: 891 892* ``PyArena_New()`` 893* ``PyArena_Free()`` 894* ``PyArena_Malloc()`` 895* ``PyArena_AddPyObject()`` 896 897These functions were undocumented, excluded from the limited C API, and were 898only used internally by the compiler. Patch by Victor Stinner. 899 900.. 901 902.. bpo: 43244 903.. date: 2021-03-23-20-53-41 904.. nonce: VK3sLH 905.. section: C API 906 907Remove the compiler and parser functions using ``struct _mod`` type, because 908the public AST C API was removed: 909 910* ``PyAST_Compile()`` 911* ``PyAST_CompileEx()`` 912* ``PyAST_CompileObject()`` 913* ``PyFuture_FromAST()`` 914* ``PyFuture_FromASTObject()`` 915* ``PyParser_ASTFromFile()`` 916* ``PyParser_ASTFromFileObject()`` 917* ``PyParser_ASTFromFilename()`` 918* ``PyParser_ASTFromString()`` 919* ``PyParser_ASTFromStringObject()`` 920 921These functions were undocumented and excluded from the limited C API. Patch 922by Victor Stinner. 923 924.. 925 926.. bpo: 43244 927.. date: 2021-03-19-12-56-11 928.. nonce: VuIyOD 929.. section: C API 930 931Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These 932functions were undocumented and excluded from the limited C API. Most names 933defined by these header files were not prefixed by ``Py`` and so could 934create names conflicts. For example, ``Python-ast.h`` defined a ``Yield`` 935macro which was conflict with the ``Yield`` name used by the Windows 936``<winbase.h>`` header. Use the Python :mod:`ast` module instead. Patch by 937Victor Stinner. 938 939.. 940 941.. bpo: 43541 942.. date: 2021-03-18-12-44-33 943.. nonce: ICigzd 944.. section: C API 945 946Fix a ``PyEval_EvalCodeEx()`` regression: fix reference counting on 947builtins. Patch by Victor Stinner. 948 949.. 950 951.. bpo: 43244 952.. date: 2021-03-17-23-53-14 953.. nonce: kfPqA_ 954.. section: C API 955 956Remove the ``symtable.h`` header file and the undocumented functions: 957 958* ``PyST_GetScope()`` 959* ``PySymtable_Build()`` 960* ``PySymtable_BuildObject()`` 961* ``PySymtable_Free()`` 962* ``Py_SymtableString()`` 963* ``Py_SymtableStringObject()`` 964 965The ``Py_SymtableString()`` function was part the stable ABI by mistake but 966it could not be used, because the ``symtable.h`` header file was excluded 967from the limited C API. 968 969The Python :mod:`symtable` module remains available and is unchanged. 970 971Patch by Victor Stinner. 972 973.. 974 975.. bpo: 43244 976.. date: 2021-03-17-23-20-07 977.. nonce: diyn2C 978.. section: C API 979 980Remove the ``PyAST_Validate()`` function. It is no longer possible to build 981a AST object (``mod_ty`` type) with the public C API. The function was 982already excluded from the limited C API (:pep:`384`). Patch by Victor 983Stinner. 984