1.. bpo: 43434 2.. date: 2021-05-02-17-50-23 3.. nonce: cy7xz6 4.. release date: 2021-05-03 5.. section: Security 6 7Creating :class:`sqlite3.Connection` objects now also produces 8``sqlite3.connect`` and ``sqlite3.connect/handle`` :ref:`auditing events 9<auditing>`. Previously these events were only produced by 10:func:`sqlite3.connect` calls. Patch by Erlend E. Aasland. 11 12.. 13 14.. bpo: 43998 15.. date: 2021-05-01-13-13-40 16.. nonce: xhmWD7 17.. section: Security 18 19The :mod:`ssl` module sets more secure cipher suites defaults. Ciphers 20without forward secrecy and with SHA-1 MAC are disabled by default. Security 21level 2 prohibits weak RSA, DH, and ECC keys with less than 112 bits of 22security. :class:`~ssl.SSLContext` defaults to minimum protocol version TLS 231.2. Settings are based on Hynek Schlawack's research. 24 25.. 26 27.. bpo: 43882 28.. date: 2021-04-25-07-46-37 29.. nonce: Jpwx85 30.. section: Security 31 32The presence of newline or tab characters in parts of a URL could allow some 33forms of attacks. 34 35Following the controlling specification for URLs defined by WHATWG 36:func:`urllib.parse` now removes ASCII newlines and tabs from URLs, 37preventing such attacks. 38 39.. 40 41.. bpo: 43472 42.. date: 2021-04-21-22-53-31 43.. nonce: gjLBTb 44.. section: Security 45 46Ensures interpreter-level audit hooks receive the 47``cpython.PyInterpreterState_New`` event when called through the 48``_xxsubinterpreters`` module. 49 50.. 51 52.. bpo: 43362 53.. date: 2021-04-18-00-56-44 54.. nonce: __5aiP 55.. section: Security 56 57Fix invalid free in _sha3 module. The issue was introduced in 3.10.0a1. 58Python 3.9 and earlier are not affected. 59 60.. 61 62.. bpo: 43762 63.. date: 2021-04-07-12-57-41 64.. nonce: 7lMtpT 65.. section: Security 66 67Add audit events for :func:`sqlite3.connect/handle`, 68:meth:`sqlite3.Connection.enable_load_extension`, and 69:meth:`sqlite3.Connection.load_extension`. Patch by Erlend E. Aasland. 70 71.. 72 73.. bpo: 43756 74.. date: 2021-04-06-18-07-48 75.. nonce: DLBNqQ 76.. section: Security 77 78Add new audit event ``glob.glob/2`` to incorporate the new *root_dir* and 79*dir_fd* arguments added to :func:`glob.glob` and :func:`glob.iglob`. 80 81.. 82 83.. bpo: 36384 84.. date: 2021-03-30-16-29-51 85.. nonce: sCAmLs 86.. section: Security 87 88:mod:`ipaddress` module no longer accepts any leading zeros in IPv4 address 89strings. Leading zeros are ambiguous and interpreted as octal notation by 90some libraries. For example the legacy function :func:`socket.inet_aton` 91treats leading zeros as octal notatation. glibc implementation of modern 92:func:`~socket.inet_pton` does not accept any leading zeros. For a while the 93:mod:`ipaddress` module used to accept ambiguous leading zeros. 94 95.. 96 97.. bpo: 43075 98.. date: 2021-01-31-05-28-14 99.. nonce: DoAXqO 100.. section: Security 101 102Fix Regular Expression Denial of Service (ReDoS) vulnerability in 103:class:`urllib.request.AbstractBasicAuthHandler`. The ReDoS-vulnerable 104regex has quadratic worst-case complexity and it allows cause a denial of 105service when identifying crafted invalid RFCs. This ReDoS issue is on the 106client side and needs remote attackers to control the HTTP server. 107 108.. 109 110.. bpo: 42800 111.. date: 2021-01-09-17-07-36 112.. nonce: _dtZvW 113.. section: Security 114 115Audit hooks are now fired for frame.f_code, traceback.tb_frame, and 116generator code/frame attribute access. 117 118.. 119 120.. bpo: 37363 121.. date: 2020-07-04-22-14-46 122.. nonce: NDjHNw 123.. section: Security 124 125Add audit events to the :mod:`http.client` module. 126 127.. 128 129.. bpo: 43977 130.. date: 2021-05-02-11-59-00 131.. nonce: R0hSDo 132.. section: Core and Builtins 133 134Prevent classes being both a sequence and a mapping when pattern matching. 135 136.. 137 138.. bpo: 43977 139.. date: 2021-04-29-17-40-25 140.. nonce: FrQhge 141.. section: Core and Builtins 142 143Use :c:member:`~PyTypeObject.tp_flags` on the class object to determine if 144the subject is a sequence or mapping when pattern matching. Avoids the need 145to import :mod:`collections.abc` when pattern matching. 146 147.. 148 149.. bpo: 43892 150.. date: 2021-04-29-16-00-28 151.. nonce: WXIehI 152.. section: Core and Builtins 153 154Restore proper validation of complex literal value patterns when parsing 155:keyword:`!match` blocks. 156 157.. 158 159.. bpo: 43933 160.. date: 2021-04-29-13-49-57 161.. nonce: TueFdQ 162.. section: Core and Builtins 163 164Set frame.f_lineno to the line number of the 'with' kweyword when executing 165the call to ``__exit__``. 166 167.. 168 169.. bpo: 43933 170.. date: 2021-04-29-13-11-44 171.. nonce: mvoV6O 172.. section: Core and Builtins 173 174If the current position in a frame has no line number then set the f_lineno 175attribute to None, instead of -1, to conform to PEP 626. This should not 176normally be possible, but might occur in some unusual circumstances. 177 178.. 179 180.. bpo: 43963 181.. date: 2021-04-28-01-23-38 182.. nonce: u5Y6bS 183.. section: Core and Builtins 184 185Importing the :mod:`_signal` module in a subinterpreter has no longer side 186effects. 187 188.. 189 190.. bpo: 42739 191.. date: 2021-04-27-10-59-10 192.. nonce: PrVkKM 193.. section: Core and Builtins 194 195The internal representation of line number tables is changed to not use 196sentinels, and an explicit length parameter is added to the out of process 197API function ``PyLineTable_InitAddressRange``. This makes the handling of 198line number tables more robust in some circumstances. 199 200.. 201 202.. bpo: 43908 203.. date: 2021-04-26-21-20-41 204.. nonce: 2L51nO 205.. section: Core and Builtins 206 207Make :mod:`re` types immutable. Patch by Erlend E. Aasland. 208 209.. 210 211.. bpo: 43908 212.. date: 2021-04-26-20-59-17 213.. nonce: -COW4- 214.. section: Core and Builtins 215 216Make the :class:`array.array` type immutable. Patch by Erlend E. Aasland. 217 218.. 219 220.. bpo: 43901 221.. date: 2021-04-25-22-50-47 222.. nonce: oKjG5E 223.. section: Core and Builtins 224 225Change class and module objects to lazy-create empty annotations dicts on 226demand. The annotations dicts are stored in the object's __dict__ for 227backwards compatibility. 228 229.. 230 231.. bpo: 43892 232.. date: 2021-04-25-08-35-11 233.. nonce: hr5Ke2 234.. section: Core and Builtins 235 236Match patterns now use new dedicated AST nodes (``MatchValue``, 237``MatchSingleton``, ``MatchSequence``, ``MatchStar``, ``MatchMapping``, 238``MatchClass``) rather than reusing expression AST nodes. ``MatchAs`` and 239``MatchOr`` are now defined as pattern nodes rather than as expression 240nodes. Patch by Nick Coghlan. 241 242.. 243 244.. bpo: 42725 245.. date: 2021-04-25-05-40-51 246.. nonce: WGloYm 247.. section: Core and Builtins 248 249Usage of ``await``/``yield``/``yield from`` and named expressions within an 250annotation is now forbidden when PEP 563 is activated. 251 252.. 253 254.. bpo: 43754 255.. date: 2021-04-24-16-40-23 256.. nonce: 9SzHWG 257.. section: Core and Builtins 258 259When performing structural pattern matching (:pep:`634`), captured names are 260now left unbound until the *entire* pattern has matched successfully. 261 262.. 263 264.. bpo: 42737 265.. date: 2021-04-22-22-48-30 266.. nonce: lsJ7pD 267.. section: Core and Builtins 268 269Annotations for complex targets (everything beside simple names) no longer 270cause any runtime effects with ``from __future__ import annotations``. 271 272.. 273 274.. bpo: 43914 275.. date: 2021-04-22-19-09-58 276.. nonce: 0Ik1AM 277.. section: Core and Builtins 278 279:exc:`SyntaxError` exceptions raised by the interpreter will highlight the 280full error range of the expression that consistutes the syntax error itself, 281instead of just where the problem is detected. Patch by Pablo Galindo. 282 283.. 284 285.. bpo: 38605 286.. date: 2021-04-20-22-17-47 287.. nonce: 9eeCNZ 288.. section: Core and Builtins 289 290Revert making ``from __future__ import annotations`` the default. This 291follows the Steering Council decision to postpone PEP 563 changes to at 292least Python 3.11. See the original email for more information regarding the 293decision: 294https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/. 295Patch by Pablo Galindo. 296 297.. 298 299.. bpo: 43475 300.. date: 2021-04-20-20-10-46 301.. nonce: oV8Mbs 302.. section: Core and Builtins 303 304Hashes of NaN values now depend on object identity. Formerly, they always 305hashed to 0 even though NaN values are not equal to one another. Having the 306same hash for unequal values caused pile-ups in hash tables. 307 308.. 309 310.. bpo: 43859 311.. date: 2021-04-16-01-26-57 312.. nonce: QfqjFL 313.. section: Core and Builtins 314 315Improve the error message for :exc:`IndentationError` exceptions. Patch by 316Pablo Galindo 317 318.. 319 320.. bpo: 41323 321.. date: 2021-04-15-10-19-59 322.. nonce: nsvpSg 323.. section: Core and Builtins 324 325Constant tuple folding in bytecode optimizer now reuses tuple in constant 326table. 327 328.. 329 330.. bpo: 43846 331.. date: 2021-04-14-13-53-08 332.. nonce: 2jO97c 333.. section: Core and Builtins 334 335Data stack usage is much reduced for large literal and call expressions. 336 337.. 338 339.. bpo: 38530 340.. date: 2021-04-14-03-53-06 341.. nonce: rNI_G1 342.. section: Core and Builtins 343 344When printing :exc:`NameError` raised by the interpreter, 345:c:func:`PyErr_Display` will offer suggestions of similar variable names in 346the function that the exception was raised from. Patch by Pablo Galindo 347 348.. 349 350.. bpo: 43823 351.. date: 2021-04-13-03-06-09 352.. nonce: xpuHBi 353.. section: Core and Builtins 354 355Improve syntax errors for invalid dictionary literals. Patch by Pablo 356Galindo. 357 358.. 359 360.. bpo: 43822 361.. date: 2021-04-13-02-32-18 362.. nonce: lej0OO 363.. section: Core and Builtins 364 365Improve syntax errors in the parser for missing commas between expressions. 366Patch by Pablo Galindo. 367 368.. 369 370.. bpo: 43798 371.. date: 2021-04-10-00-01-43 372.. nonce: p_nJFM 373.. section: Core and Builtins 374 375:class:`ast.alias` nodes now include source location metadata attributes 376e.g. lineno, col_offset. 377 378.. 379 380.. bpo: 43797 381.. date: 2021-04-09-19-12-48 382.. nonce: HfRqNP 383.. section: Core and Builtins 384 385Improve ``SyntaxError`` error messages for invalid comparisons. Patch by 386Pablo Galindo. 387 388.. 389 390.. bpo: 43760 391.. date: 2021-04-08-12-20-29 392.. nonce: tBIsD8 393.. section: Core and Builtins 394 395Move the flag for checking whether tracing is enabled to the C stack, from 396the heap. Should speed up dispatch in the interpreter. 397 398.. 399 400.. bpo: 43682 401.. date: 2021-04-08-01-06-22 402.. nonce: eUn4p5 403.. section: Core and Builtins 404 405Static methods (:func:`@staticmethod <staticmethod>`) and class methods 406(:func:`@classmethod <classmethod>`) now inherit the method attributes 407(``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, 408``__annotations__``) and have a new ``__wrapped__`` attribute. Patch by 409Victor Stinner. 410 411.. 412 413.. bpo: 43751 414.. date: 2021-04-07-18-00-05 415.. nonce: 8fHsqQ 416.. section: Core and Builtins 417 418Fixed a bug where ``anext(ait, default)`` would erroneously return None. 419 420.. 421 422.. bpo: 42128 423.. date: 2021-04-05-17-38-08 424.. nonce: 1uVeGK 425.. section: Core and Builtins 426 427:data:`~object.__match_args__` is no longer allowed to be a list. 428 429.. 430 431.. bpo: 43683 432.. date: 2021-04-01-12-30-30 433.. nonce: AjxOx2 434.. section: Core and Builtins 435 436Add GEN_START opcode. Marks start of generator, including async, or 437coroutine and handles sending values to a newly created generator or 438coroutine. 439 440.. 441 442.. bpo: 43105 443.. date: 2021-03-31-20-35-11 444.. nonce: PBVmHm 445.. section: Core and Builtins 446 447Importlib now resolves relative paths when creating module spec objects from 448file locations. 449 450.. 451 452.. bpo: 43682 453.. date: 2021-03-31-16-32-57 454.. nonce: VSF3vg 455.. section: Core and Builtins 456 457Static methods (:func:`@staticmethod <staticmethod>`) are now callable as 458regular functions. Patch by Victor Stinner. 459 460.. 461 462.. bpo: 42609 463.. date: 2020-12-12-14-28-31 464.. nonce: Qcd54b 465.. section: Core and Builtins 466 467Prevented crashes in the AST validator and optimizer when compiling some 468absurdly long expressions like ``"+0"*1000000``. :exc:`RecursionError` is 469now raised instead. 470 471.. 472 473.. bpo: 38530 474.. date: 2019-10-27-20-20-07 475.. nonce: ZyoDNn 476.. section: Core and Builtins 477 478When printing :exc:`AttributeError`, :c:func:`PyErr_Display` will offer 479suggestions of similar attribute names in the object that the exception was 480raised from. Patch by Pablo Galindo 481 482.. 483 484.. bpo: 44015 485.. date: 2021-05-03-03-03-49 486.. nonce: V5936k 487.. section: Library 488 489In @dataclass(), raise a TypeError if KW_ONLY is specified more than once. 490 491.. 492 493.. bpo: 25478 494.. date: 2021-05-02-19-17-20 495.. nonce: AwlwdA 496.. section: Library 497 498Added a *total()* method to collections.Counter() to compute the sum of the 499counts. 500 501.. 502 503.. bpo: 43733 504.. date: 2021-05-01-22-59-20 505.. nonce: gJWwEQ 506.. section: Library 507 508Change :class:`netrc.netrc` to use UTF-8 encoding before using locale 509encoding. 510 511.. 512 513.. bpo: 43979 514.. date: 2021-05-01-01-36-51 515.. nonce: 43oJ9L 516.. section: Library 517 518Removed an unnecessary list comprehension before looping from 519:func:`urllib.parse.parse_qsl`. Patch by Christoph Zwerschke and Dong-hee 520Na. 521 522.. 523 524.. bpo: 43993 525.. date: 2021-04-30-19-23-45 526.. nonce: T7_yoq 527.. section: Library 528 529Update bundled pip to 21.1.1. 530 531.. 532 533.. bpo: 43957 534.. date: 2021-04-27-12-13-51 535.. nonce: 6EaPD- 536.. section: Library 537 538[Enum] Deprecate ``TypeError`` when non-member is used in a containment 539check; In 3.12 ``True`` or ``False`` will be returned instead, and 540containment will return ``True`` if the value is either a member of that 541enum or one of its members' value. 542 543.. 544 545.. bpo: 42904 546.. date: 2021-04-26-23-39-47 547.. nonce: ejjsyR 548.. section: Library 549 550For backwards compatibility with previous minor versions of Python, if 551:func:`typing.get_type_hints` receives no namespace dictionary arguments, 552:func:`typing.get_type_hints` will search through the global then local 553namespaces during evaluation of stringized type annotations (string forward 554references) inside a class. 555 556.. 557 558.. bpo: 43945 559.. date: 2021-04-26-20-52-16 560.. nonce: NgERXO 561.. section: Library 562 563[Enum] Deprecate non-standard mixin format() behavior: in 3.12 the enum 564member, not the member's value, will be used for format() calls. 565 566.. 567 568.. bpo: 41139 569.. date: 2021-04-26-17-47-48 570.. nonce: ROhn1k 571.. section: Library 572 573Deprecate undocumented ``cgi.log()`` API. 574 575.. 576 577.. bpo: 43937 578.. date: 2021-04-25-13-34-13 579.. nonce: isx95l 580.. section: Library 581 582Fixed the :mod:`turtle` module working with non-default root window. 583 584.. 585 586.. bpo: 43930 587.. date: 2021-04-24-14-23-07 588.. nonce: R7ah0m 589.. section: Library 590 591Update bundled pip to 21.1 and setuptools to 56.0.0 592 593.. 594 595.. bpo: 43907 596.. date: 2021-04-23-20-57-20 597.. nonce: 3RJEjv 598.. section: Library 599 600Fix a bug in the pure-Python pickle implementation when using protocol 5, 601where bytearray instances that occur several time in the pickled object 602graph would incorrectly unpickle into repeated copies of the bytearray 603object. 604 605.. 606 607.. bpo: 43926 608.. date: 2021-04-23-17-48-55 609.. nonce: HMUlGU 610.. section: Library 611 612In ``importlib.metadata``, provide a uniform interface to ``Description``, 613allow for any field to be encoded with multiline values, remove continuation 614lines from multiline values, and add a ``.json`` property for easy access to 615the PEP 566 JSON-compatible form. Sync with ``importlib_metadata 4.0``. 616 617.. 618 619.. bpo: 43920 620.. date: 2021-04-23-11-54-38 621.. nonce: cJMQ2D 622.. section: Library 623 624OpenSSL 3.0.0: :meth:`~ssl.SSLContext.load_verify_locations` now returns a 625consistent error message when cadata contains no valid certificate. 626 627.. 628 629.. bpo: 43607 630.. date: 2021-04-22-22-39-58 631.. nonce: 7IYDkG 632.. section: Library 633 634:mod:`urllib` can now convert Windows paths with ``\\?\`` prefixes into URL 635paths. 636 637.. 638 639.. bpo: 43817 640.. date: 2021-04-22-04-12-13 641.. nonce: FQ-XlH 642.. section: Library 643 644Add :func:`inspect.get_annotations`, which safely computes the annotations 645defined on an object. It works around the quirks of accessing the 646annotations from various types of objects, and makes very few assumptions 647about the object passed in. :func:`inspect.get_annotations` can also 648correctly un-stringize stringized annotations. 649 650:func:`inspect.signature`, :func:`inspect.from_callable`, and 651:func:`inspect.from_function` now call :func:`inspect.get_annotations` to 652retrieve annotations. This means :func:`inspect.signature` and 653:func:`inspect.from_callable` can now un-stringize stringized annotations, 654too. 655 656.. 657 658.. bpo: 43284 659.. date: 2021-04-21-14-50-57 660.. nonce: 2QZn2T 661.. section: Library 662 663platform.win32_ver derives the windows version from 664sys.getwindowsversion().platform_version which in turn derives the version 665from kernel32.dll (which can be of a different version than Windows itself). 666Therefore change the platform.win32_ver to determine the version using the 667platform module's _syscmd_ver private function to return an accurate 668version. 669 670.. 671 672.. bpo: 42854 673.. date: 2021-04-19-03-54-29 674.. nonce: Y4M7Tv 675.. section: Library 676 677The :mod:`ssl` module now uses ``SSL_read_ex`` and ``SSL_write_ex`` 678internally. The functions support reading and writing of data larger than 2 679GB. Writing zero-length data no longer fails with a protocol violation 680error. 681 682.. 683 684.. bpo: 42333 685.. date: 2021-04-17-19-31-17 686.. nonce: cgbtZO 687.. section: Library 688 689Port ``_ssl`` extension module to multiphase initialization. 690 691.. 692 693.. bpo: 43880 694.. date: 2021-04-17-13-53-33 695.. nonce: -fC2JD 696.. section: Library 697 698:mod:`ssl` now raises DeprecationWarning for OP_NO_SSL/TLS* options, old TLS 699versions, old protocols, and other features that have been deprecated since 700Python 3.6, 3.7, or OpenSSL 1.1.0. 701 702.. 703 704.. bpo: 41559 705.. date: 2021-04-17-10-49-57 706.. nonce: caIwt9 707.. section: Library 708 709:pep:`612` is now implemented purely in Python; builtin 710``types.GenericAlias`` objects no longer include ``typing.ParamSpec`` in 711``__parameters__`` (with the exception of ``collections.abc.Callable``\ 's 712``GenericAlias``). This means previously invalid uses of ``ParamSpec`` (such 713as ``list[P]``) which worked in earlier versions of Python 3.10 alpha, will 714now raise ``TypeError`` during substitution. 715 716.. 717 718.. bpo: 43867 719.. date: 2021-04-16-16-46-44 720.. nonce: xT9QjF 721.. section: Library 722 723The :mod:`multiprocessing` ``Server`` class now explicitly catches 724:exc:`SystemExit` and closes the client connection in this case. It happens 725when the ``Server.serve_client()`` method reaches the end of file (EOF). 726 727.. 728 729.. bpo: 40443 730.. date: 2021-04-16-02-03-00 731.. nonce: Io6FHL 732.. section: Library 733 734Remove unused imports: pyclbr no longer uses copy, and typing no longer uses 735ast. Patch by Victor Stinner. 736 737.. 738 739.. bpo: 43820 740.. date: 2021-04-12-18-01-10 741.. nonce: YkqYW4 742.. section: Library 743 744Remove an unneeded copy of the namespace passed to 745dataclasses.make_dataclass(). 746 747.. 748 749.. bpo: 43787 750.. date: 2021-04-12-15-15-50 751.. nonce: wCy_Wd 752.. section: Library 753 754Add ``__iter__()`` method to :class:`bz2.BZ2File`, :class:`gzip.GzipFile`, 755and :class:`lzma.LZMAFile`. It makes iterating them about 2x faster. Patch 756by Inada Naoki. 757 758.. 759 760.. bpo: 43680 761.. date: 2021-04-12-11-20-34 762.. nonce: SR0Epv 763.. section: Library 764 765Deprecate io.OpenWrapper and _pyio.OpenWrapper: use io.open and _pyio.open 766instead. Until Python 3.9, _pyio.open was not a static method and 767builtins.open was set to OpenWrapper to not become a bound method when set 768to a class variable. _io.open is a built-in function whereas _pyio.open is a 769Python function. In Python 3.10, _pyio.open() is now a static method, and 770builtins.open() is now io.open(). 771 772.. 773 774.. bpo: 43680 775.. date: 2021-04-12-09-57-37 776.. nonce: o1zEk_ 777.. section: Library 778 779The Python :func:`_pyio.open` function becomes a static method to behave as 780:func:`io.open` built-in function: don't become a bound method when stored 781as a class variable. It becomes possible since static methods are now 782callable in Python 3.10. Moreover, :func:`_pyio.OpenWrapper` becomes a 783simple alias to :func:`_pyio.open`. Patch by Victor Stinner. 784 785.. 786 787.. bpo: 41515 788.. date: 2021-04-12-06-01-10 789.. nonce: YaVReb 790.. section: Library 791 792Fix :exc:`KeyError` raised in :func:`typing.get_type_hints` due to synthetic 793modules that don't appear in ``sys.modules``. 794 795.. 796 797.. bpo: 43776 798.. date: 2021-04-12-00-00-00 799.. nonce: p14y7a 800.. section: Library 801 802When :class:`subprocess.Popen` args are provided as a string or as 803:class:`pathlib.Path`, the Popen instance repr now shows the right thing. 804 805.. 806 807.. bpo: 42248 808.. date: 2021-04-11-21-10-57 809.. nonce: pedB1E 810.. section: Library 811 812[Enum] ensure exceptions raised in ``_missing__`` are released 813 814.. 815 816.. bpo: 43744 817.. date: 2021-04-11-20-52-32 818.. nonce: uf0E68 819.. section: Library 820 821fix issue with enum member name matching the start of a private variable 822name 823 824.. 825 826.. bpo: 43772 827.. date: 2021-04-10-19-14-49 828.. nonce: Bxq0zQ 829.. section: Library 830 831Fixed the return value of ``TypeVar.__ror__``. Patch by Jelle Zijlstra. 832 833.. 834 835.. bpo: 43764 836.. date: 2021-04-10-18-23-09 837.. nonce: Le5KJp 838.. section: Library 839 840Add match_args parameter to @dataclass decorator to allow suppression of 841__match_args__ generation. 842 843.. 844 845.. bpo: 43799 846.. date: 2021-04-10-11-35-50 847.. nonce: 1iV4pX 848.. section: Library 849 850OpenSSL 3.0.0: define ``OPENSSL_API_COMPAT`` 1.1.1 to suppress deprecation 851warnings. Python requires OpenSSL 1.1.1 APIs. 852 853.. 854 855.. bpo: 43478 856.. date: 2021-04-10-03-30-36 857.. nonce: iZcBTq 858.. section: Library 859 860Mocks can no longer be used as the specs for other Mocks. As a result, an 861already-mocked object cannot have an attribute mocked using 862``autospec=True`` or be the subject of a ``create_autospec(...)`` call. This 863can uncover bugs in tests since these Mock-derived Mocks will always pass 864certain tests (e.g. :func:`isinstance`) and builtin assert functions (e.g. 865assert_called_once_with) will unconditionally pass. 866 867.. 868 869.. bpo: 43794 870.. date: 2021-04-09-16-14-22 871.. nonce: -1XPDH 872.. section: Library 873 874Add :data:`ssl.OP_IGNORE_UNEXPECTED_EOF` constants (OpenSSL 3.0.0) 875 876.. 877 878.. bpo: 43785 879.. date: 2021-04-09-14-51-58 880.. nonce: 1mM5xE 881.. section: Library 882 883Improve ``bz2.BZ2File`` performance by removing the RLock from BZ2File. This 884makes BZ2File thread unsafe in the face of multiple simultaneous readers or 885writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` 886have always been. Patch by Inada Naoki. 887 888.. 889 890.. bpo: 43789 891.. date: 2021-04-09-14-08-03 892.. nonce: eaHlAm 893.. section: Library 894 895OpenSSL 3.0.0: Don't call the password callback function a second time when 896first call has signaled an error condition. 897 898.. 899 900.. bpo: 43788 901.. date: 2021-04-09-12-08-01 902.. nonce: YsvInM 903.. section: Library 904 905The header files for :mod:`ssl` error codes are now OpenSSL 906version-specific. Exceptions will now show correct reason and library codes. 907The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's text 908file with error codes. 909 910.. 911 912.. bpo: 43766 913.. date: 2021-04-09-00-16-22 914.. nonce: nYNQP0 915.. section: Library 916 917Implement :pep:`647` in the :mod:`typing` module by adding 918:data:`TypeGuard`. 919 920.. 921 922.. bpo: 25264 923.. date: 2021-04-08-22-11-27 924.. nonce: b33fa0 925.. section: Library 926 927:func:`os.path.realpath` now accepts a *strict* keyword-only argument. When 928set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a 929symlink loop is encountered. 930 931.. 932 933.. bpo: 43780 934.. date: 2021-04-08-20-04-46 935.. nonce: hUOgCh 936.. section: Library 937 938In ``importlib.metadata``, incorporate changes from importlib_metadata 3.10: 939Add mtime-based caching during distribution discovery. Flagged use of dict 940result from ``entry_points()`` as deprecated. 941 942.. 943 944.. bpo: 47383 945.. date: 2021-04-08-19-32-26 946.. nonce: YI1hdL 947.. section: Library 948 949The ``P.args`` and ``P.kwargs`` attributes of :class:`typing.ParamSpec` are 950now instances of the new classes :class:`typing.ParamSpecArgs` and 951:class:`typing.ParamSpecKwargs`, which enables a more useful ``repr()``. 952Patch by Jelle Zijlstra. 953 954.. 955 956.. bpo: 43731 957.. date: 2021-04-08-15-19-20 958.. nonce: nnVd3h 959.. section: Library 960 961Add an ``encoding`` parameter :func:`logging.fileConfig()`. 962 963.. 964 965.. bpo: 43712 966.. date: 2021-04-08-12-25-08 967.. nonce: f8WXCX 968.. section: Library 969 970Add ``encoding`` and ``errors`` parameters to :func:`fileinput.input` and 971:class:`fileinput.FileInput`. 972 973.. 974 975.. bpo: 38659 976.. date: 2021-04-08-11-47-31 977.. nonce: r_HFnU 978.. section: Library 979 980A ``simple_enum`` decorator is added to the ``enum`` module to convert a 981normal class into an Enum. ``test_simple_enum`` added to test simple enums 982against a corresponding normal Enum. Standard library modules updated to 983use ``simple_enum``. 984 985.. 986 987.. bpo: 43764 988.. date: 2021-04-08-09-59-20 989.. nonce: tHjO60 990.. section: Library 991 992Fix an issue where :data:`~object.__match_args__` generation could fail for 993some :mod:`dataclasses`. 994 995.. 996 997.. bpo: 43752 998.. date: 2021-04-06-21-18-29 999.. nonce: K7qmAF 1000.. section: Library 1001 1002Fix :mod:`sqlite3` regression for zero-sized blobs with converters, where 1003``b""`` was returned instead of ``None``. The regression was introduced by 1004GH-24723. Patch by Erlend E. Aasland. 1005 1006.. 1007 1008.. bpo: 43655 1009.. date: 2021-04-04-20-51-19 1010.. nonce: LwGy8R 1011.. section: Library 1012 1013:mod:`tkinter` dialog windows are now recognized as dialogs by window 1014managers on macOS and X Window. 1015 1016.. 1017 1018.. bpo: 43723 1019.. date: 2021-04-03-18-03-44 1020.. nonce: uBhBZS 1021.. section: Library 1022 1023The following ``threading`` methods are now deprecated and should be 1024replaced: 1025 1026- ``currentThread`` => :func:`threading.current_thread` 1027 1028- ``activeCount`` => :func:`threading.active_count` 1029 1030- ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all` 1031 1032- ``Event.isSet`` => :meth:`threading.Event.is_set` 1033 1034- ``Thread.setName`` => :attr:`threading.Thread.name` 1035 1036- ``thread.getName`` => :attr:`threading.Thread.name` 1037 1038- ``Thread.isDaemon`` => :attr:`threading.Thread.daemon` 1039 1040- ``Thread.setDaemon`` => :attr:`threading.Thread.daemon` 1041 1042Patch by Jelle Zijlstra. 1043 1044.. 1045 1046.. bpo: 2135 1047.. date: 2021-04-03-15-24-59 1048.. nonce: xmDAYJ 1049.. section: Library 1050 1051Deprecate find_module() and find_loader() implementations in importlib and 1052zipimport. 1053 1054.. 1055 1056.. bpo: 43534 1057.. date: 2021-03-18-15-46-08 1058.. nonce: vPE9Us 1059.. section: Library 1060 1061:func:`turtle.textinput` and :func:`turtle.numinput` create now a transient 1062window working on behalf of the canvas window. 1063 1064.. 1065 1066.. bpo: 43532 1067.. date: 2021-03-17-19-06-45 1068.. nonce: W2Ntnm 1069.. section: Library 1070 1071Add the ability to specify keyword-only fields to dataclasses. These fields 1072will become keyword-only arguments to the generated __init__. 1073 1074.. 1075 1076.. bpo: 43522 1077.. date: 2021-03-16-22-37-32 1078.. nonce: dhNwOu 1079.. section: Library 1080 1081Fix problem with :attr:`~ssl.SSLContext.hostname_checks_common_name`. 1082OpenSSL does not copy hostflags from *struct SSL_CTX* to *struct SSL*. 1083 1084.. 1085 1086.. bpo: 8978 1087.. date: 2021-03-13-14-02-07 1088.. nonce: CRxG-O 1089.. section: Library 1090 1091Improve error message for :func:`tarfile.open` when :mod:`lzma` / :mod:`bz2` 1092are unavailable. Patch by Anthony Sottile. 1093 1094.. 1095 1096.. bpo: 42967 1097.. date: 2021-03-11-00-31-41 1098.. nonce: 2PeQRw 1099.. section: Library 1100 1101Allow :class:`bytes` ``separator`` argument in ``urllib.parse.parse_qs`` and 1102``urllib.parse.parse_qsl`` when parsing :class:`str` query strings. 1103Previously, this raised a ``TypeError``. 1104 1105.. 1106 1107.. bpo: 43296 1108.. date: 2021-03-01-13-01-33 1109.. nonce: p_gU6T 1110.. section: Library 1111 1112Improve :mod:`sqlite3` error handling: ``sqlite3_value_blob()`` errors that 1113set ``SQLITE_NOMEM`` now raise :exc:`MemoryError`. Patch by Erlend E. 1114Aasland. 1115 1116.. 1117 1118.. bpo: 43312 1119.. date: 2021-02-25-14-43-59 1120.. nonce: 6dg9_2 1121.. section: Library 1122 1123New functions :func:`sysconfig.get_preferred_scheme` and 1124:func:`sysconfig.get_default_scheme` are added to query a platform for its 1125preferred "user", "home", and "prefix" (default) scheme names. 1126 1127.. 1128 1129.. bpo: 43265 1130.. date: 2021-02-19-22-24-33 1131.. nonce: MyAzCH 1132.. section: Library 1133 1134Improve :meth:`sqlite3.Connection.backup` error handling. The error message 1135for non-existent target database names is now ``unknown database <database 1136name>`` instead of ``SQL logic error``. Patch by Erlend E. Aasland. 1137 1138.. 1139 1140.. bpo: 41282 1141.. date: 2021-02-16-13-18-38 1142.. nonce: GK9a0l 1143.. section: Library 1144 1145Install schemes in :mod:`distutils.command.install` are now loaded from 1146:mod:`sysconfig`. 1147 1148.. 1149 1150.. bpo: 41282 1151.. date: 2021-02-15-12-52-23 1152.. nonce: SenEje 1153.. section: Library 1154 1155:mod:`distutils.sysconfig` has been merged to :mod:`sysconfig`. 1156 1157.. 1158 1159.. bpo: 43176 1160.. date: 2021-02-09-07-24-29 1161.. nonce: bocNQn 1162.. section: Library 1163 1164Fixed processing of a dataclass that inherits from a frozen dataclass with 1165no fields. It is now correctly detected as an error. 1166 1167.. 1168 1169.. bpo: 43080 1170.. date: 2021-01-31-00-23-13 1171.. nonce: -fDg4Q 1172.. section: Library 1173 1174:mod:`pprint` now has support for :class:`dataclasses.dataclass`. Patch by 1175Lewis Gaul. 1176 1177.. 1178 1179.. bpo: 39950 1180.. date: 2021-01-22-00-15-37 1181.. nonce: NzLVaR 1182.. section: Library 1183 1184Add `pathlib.Path.hardlink_to()` method that supersedes `link_to()`. The new 1185method has the same argument order as `symlink_to()`. 1186 1187.. 1188 1189.. bpo: 42904 1190.. date: 2021-01-12-23-17-02 1191.. nonce: -4qkTD 1192.. section: Library 1193 1194:func:`typing.get_type_hints` now checks the local namespace of a class when 1195evaluating :pep:`563` annotations inside said class. 1196 1197.. 1198 1199.. bpo: 42269 1200.. date: 2021-01-08-22-32-13 1201.. nonce: W5v8z4 1202.. section: Library 1203 1204Add ``slots`` parameter to ``dataclasses.dataclass`` decorator to 1205automatically generate ``__slots__`` for class. Patch provided by Yurii 1206Karabas. 1207 1208.. 1209 1210.. bpo: 39529 1211.. date: 2020-12-06-20-21-16 1212.. nonce: 9Zrg43 1213.. section: Library 1214 1215Deprecated use of :func:`asyncio.get_event_loop` without running event loop. 1216Emit deprecation warning for :mod:`asyncio` functions which implicitly 1217create a :class:`~asyncio.Future` or :class:`~asyncio.Task` objects if there 1218is no running event loop and no explicit *loop* argument is passed: 1219:func:`~asyncio.ensure_future`, :func:`~asyncio.wrap_future`, 1220:func:`~asyncio.gather`, :func:`~asyncio.shield`, 1221:func:`~asyncio.as_completed` and constructors of :class:`~asyncio.Future`, 1222:class:`~asyncio.Task`, :class:`~asyncio.StreamReader`, 1223:class:`~asyncio.StreamReaderProtocol`. 1224 1225.. 1226 1227.. bpo: 18369 1228.. date: 2020-11-19-09-52-24 1229.. nonce: qzvYH2 1230.. section: Library 1231 1232Certificate and PrivateKey classes were added to the ssl module. 1233Certificates and keys can now be loaded from memory buffer, too. 1234 1235.. 1236 1237.. bpo: 41486 1238.. date: 2020-10-16-15-34-30 1239.. nonce: Mu9Iit 1240.. section: Library 1241 1242Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / 1243:mod:`zlib` modules, and add ``.readall()`` function to 1244``_compression.DecompressReader`` class. These bring some performance 1245improvements. Patch by Ma Lin. 1246 1247.. 1248 1249.. bpo: 31870 1250.. date: 2020-09-15-23-44-07 1251.. nonce: nVwd38 1252.. section: Library 1253 1254The :func:`ssl.get_server_certificate` function now has a *timeout* 1255parameter. 1256 1257.. 1258 1259.. bpo: 41735 1260.. date: 2020-09-07-11-15-15 1261.. nonce: NKqGKy 1262.. section: Library 1263 1264Fix thread locks in zlib module may go wrong in rare case. Patch by Ma Lin. 1265 1266.. 1267 1268.. bpo: 36470 1269.. date: 2020-06-13-23-33-32 1270.. nonce: oi6Kdb 1271.. section: Library 1272 1273Fix dataclasses with ``InitVar``\s and :func:`~dataclasses.replace()`. Patch 1274by Claudiu Popa. 1275 1276.. 1277 1278.. bpo: 40849 1279.. date: 2020-06-02-21-32-33 1280.. nonce: zpeKx3 1281.. section: Library 1282 1283Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag 1284 1285.. 1286 1287.. bpo: 35114 1288.. date: 2020-05-17-14-10-24 1289.. nonce: uLIHfn 1290.. section: Library 1291 1292:func:`ssl.RAND_status` now returns a boolean value (as documented) instead 1293of ``1`` or ``0``. 1294 1295.. 1296 1297.. bpo: 39906 1298.. date: 2020-03-30-00-13-27 1299.. nonce: eaR3fN 1300.. section: Library 1301 1302:meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a 1303*follow_symlinks* keyword-only argument for consistency with corresponding 1304functions in the :mod:`os` module. 1305 1306.. 1307 1308.. bpo: 39899 1309.. date: 2020-03-09-20-36-07 1310.. nonce: 9adF3E 1311.. section: Library 1312 1313:func:`os.path.expanduser()` now refuses to guess Windows home directories 1314if the basename of current user's home directory does not match their 1315username. 1316 1317:meth:`pathlib.Path.expanduser()` and :meth:`~pathlib.Path.home()` now 1318consistently raise :exc:`RuntimeError` exception when a home directory 1319cannot be resolved. Previously a :exc:`KeyError` exception could be raised 1320on Windows when the ``"USERNAME"`` environment variable was unset. 1321 1322.. 1323 1324.. bpo: 36076 1325.. date: 2019-10-16-17-21-53 1326.. nonce: FGeQQT 1327.. section: Library 1328 1329Added SNI support to :func:`ssl.get_server_certificate`. 1330 1331.. 1332 1333.. bpo: 38490 1334.. date: 2019-10-16-08-08-14 1335.. nonce: QbDXEF 1336.. section: Library 1337 1338Covariance, Pearson's correlation, and simple linear regression 1339functionality was added to statistics module. Patch by Tymoteusz Wołodźko. 1340 1341.. 1342 1343.. bpo: 33731 1344.. date: 2019-08-14-13-19-50 1345.. nonce: 9esS0d 1346.. section: Library 1347 1348Provide a locale.localize() function, which converts a normalized number 1349string into a locale format. 1350 1351.. 1352 1353.. bpo: 32745 1354.. date: 2018-08-09-23-47-10 1355.. nonce: iQi9hI 1356.. section: Library 1357 1358Fix a regression in the handling of ctypes' :data:`ctypes.c_wchar_p` type: 1359embedded null characters would cause a :exc:`ValueError` to be raised. Patch 1360by Zackery Spytz. 1361 1362.. 1363 1364.. bpo: 43987 1365.. date: 2021-04-30-04-27-02 1366.. nonce: 1DftVa 1367.. section: Documentation 1368 1369Add "Annotations Best Practices" document as a new HOWTO. 1370 1371.. 1372 1373.. bpo: 43977 1374.. date: 2021-04-29-15-06-03 1375.. nonce: K5aSl1 1376.. section: Documentation 1377 1378Document the new :const:`Py_TPFLAGS_MAPPING` and 1379:const:`Py_TPFLAGS_SEQUENCE` type flags. 1380 1381.. 1382 1383.. bpo: 43959 1384.. date: 2021-04-27-22-22-22 1385.. nonce: n2261q 1386.. section: Documentation 1387 1388The documentation on the PyContextVar C-API was clarified. 1389 1390.. 1391 1392.. bpo: 43938 1393.. date: 2021-04-25-22-44-27 1394.. nonce: nC660q 1395.. section: Documentation 1396 1397Update dataclasses documentation to express that FrozenInstanceError is 1398derived from AttributeError. 1399 1400.. 1401 1402.. bpo: 43778 1403.. date: 2021-04-08-22-42-02 1404.. nonce: MszRnY 1405.. section: Documentation 1406 1407Fix the Sphinx glossary_search extension: create the _static/ sub-directory 1408if it doesn't exist. 1409 1410.. 1411 1412.. bpo: 43755 1413.. date: 2021-04-06-14-55-45 1414.. nonce: 1m0fGq 1415.. section: Documentation 1416 1417Update documentation to reflect that unparenthesized lambda expressions can 1418no longer be the expression part in an ``if`` clause in comprehensions and 1419generator expressions since Python 3.9. 1420 1421.. 1422 1423.. bpo: 43739 1424.. date: 2021-04-06-07-05-49 1425.. nonce: L4HjiX 1426.. section: Documentation 1427 1428Fixing the example code in Doc/extending/extending.rst to declare and 1429initialize the pmodule variable to be of the right type. 1430 1431.. 1432 1433.. bpo: 43961 1434.. date: 2021-04-28-13-21-52 1435.. nonce: gNchls 1436.. section: Tests 1437 1438Fix test_logging.test_namer_rotator_inheritance() on Windows: use 1439:func:`os.replace` rather than :func:`os.rename`. Patch by Victor Stinner. 1440 1441.. 1442 1443.. bpo: 43842 1444.. date: 2021-04-16-14-07-40 1445.. nonce: w60GAH 1446.. section: Tests 1447 1448Fix a race condition in the SMTP test of test_logging. Don't close a file 1449descriptor (socket) from a different thread while asyncore.loop() is polling 1450the file descriptor. Patch by Victor Stinner. 1451 1452.. 1453 1454.. bpo: 43843 1455.. date: 2021-04-14-13-22-44 1456.. nonce: ruIQKD 1457.. section: Tests 1458 1459:mod:`test.libregrtest` now marks a test as ENV_CHANGED (altered the 1460execution environment) if a thread raises an exception but does not catch 1461it. It sets a hook on :func:`threading.excepthook`. Use 1462``--fail-env-changed`` option to mark the test as failed. Patch by Victor 1463Stinner. 1464 1465.. 1466 1467.. bpo: 43811 1468.. date: 2021-04-12-11-14-28 1469.. nonce: vGNbnD 1470.. section: Tests 1471 1472Tests multiple OpenSSL versions on GitHub Actions. Use ccache to speed up 1473testing. 1474 1475.. 1476 1477.. bpo: 43791 1478.. date: 2021-04-09-15-10-38 1479.. nonce: 4KxiXK 1480.. section: Tests 1481 1482OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and 1.1. Tests 1483are failing with TLSV1_ALERT_INTERNAL_ERROR. 1484 1485.. 1486 1487.. bpo: 43567 1488.. date: 2021-03-31-19-50-01 1489.. nonce: vd0a-p 1490.. section: Build 1491 1492Improved generated code refresh (AST/tokens/opcodes/keywords) on Windows. 1493 1494.. 1495 1496.. bpo: 43669 1497.. date: 2021-03-30-14-19-39 1498.. nonce: lWMUYx 1499.. section: Build 1500 1501Implement :pep:`644`. Python now requires OpenSSL 1.1.1 or newer. 1502 1503.. 1504 1505.. bpo: 35306 1506.. date: 2021-04-22-21-37-41 1507.. nonce: 10kSR- 1508.. section: Windows 1509 1510Adds additional arguments to :func:`os.startfile` function. 1511 1512.. 1513 1514.. bpo: 43538 1515.. date: 2021-04-22-20-39-49 1516.. nonce: F0Cg6X 1517.. section: Windows 1518 1519Avoid raising errors from :meth:`pathlib.Path.exists()` when passed an 1520invalid filename. 1521 1522.. 1523 1524.. bpo: 38822 1525.. date: 2021-04-22-19-49-20 1526.. nonce: jgdPmq 1527.. section: Windows 1528 1529Fixed :func:`os.stat` failing on inaccessible directories with a trailing 1530slash, rather than falling back to the parent directory's metadata. This 1531implicitly affected :func:`os.path.exists` and :func:`os.path.isdir`. 1532 1533.. 1534 1535.. bpo: 26227 1536.. date: 2021-04-21-23-37-34 1537.. nonce: QMY_eA 1538.. section: Windows 1539 1540Fixed decoding of host names in :func:`socket.gethostbyaddr` and 1541:func:`socket.gethostbyname_ex`. 1542 1543.. 1544 1545.. bpo: 40432 1546.. date: 2021-04-20-23-07-22 1547.. nonce: 9OFpoq 1548.. section: Windows 1549 1550Updated pegen regeneration script on Windows to find and use Python 3.8 or 1551higher. Prior to this, pegen regeneration already required 3.8 or higher, 1552but the script may have used lower versions of Python. 1553 1554.. 1555 1556.. bpo: 43745 1557.. date: 2021-04-06-12-27-33 1558.. nonce: rdKNda 1559.. section: Windows 1560 1561Actually updates Windows release to OpenSSL 1.1.1k. Earlier releases were 1562mislabelled and actually included 1.1.1i again. 1563 1564.. 1565 1566.. bpo: 43652 1567.. date: 2021-04-03-18-54-31 1568.. nonce: gNmfVN 1569.. section: Windows 1570 1571Update Tcl and Tk to 8.6.11 in Windows installer. 1572 1573.. 1574 1575.. bpo: 43492 1576.. date: 2021-03-15-11-34-33 1577.. nonce: AsYnVX 1578.. section: Windows 1579 1580Upgrade Windows installer to use SQLite 3.35.5. 1581 1582.. 1583 1584.. bpo: 30555 1585.. date: 2017-12-16-12-23-51 1586.. nonce: 3ybjly 1587.. section: Windows 1588 1589Fix ``WindowsConsoleIO`` errors in the presence of fd redirection. Patch by 1590Segev Finer. 1591 1592.. 1593 1594.. bpo: 42119 1595.. date: 2021-05-02-21-03-27 1596.. nonce: Y7BSX_ 1597.. section: macOS 1598 1599Fix check for macOS SDK paths when building Python. Narrow search to match 1600contents of SDKs, namely only files in ``/System/Library``, 1601``/System/IOSSupport``, and ``/usr`` other than ``/usr/local``. Previously, 1602anything under ``/System`` was assumed to be in an SDK which causes problems 1603with the new file system layout in 10.15+ where user file systems may appear 1604to be mounted under ``/System``. Paths in ``/Library`` were also 1605incorrectly treated as SDK locations. 1606 1607.. 1608 1609.. bpo: 43568 1610.. date: 2021-05-02-19-50-52 1611.. nonce: AeLNBd 1612.. section: macOS 1613 1614Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3 1615 1616.. 1617 1618.. bpo: 44009 1619.. date: 2021-05-02-03-45-30 1620.. nonce: uvhmlh 1621.. section: macOS 1622 1623Provide "python3.x-intel64" executable to allow reliably forcing macOS 1624universal2 framework builds to run under Rosetta 2 Intel-64 emulation on 1625Apple Silicon Macs. This can be useful for testing or when universal2 1626wheels are not yet available. 1627 1628.. 1629 1630.. bpo: 43851 1631.. date: 2021-04-15-01-20-45 1632.. nonce: sDI60Y 1633.. section: macOS 1634 1635Build SQLite with ``SQLITE_OMIT_AUTOINIT`` on macOS. Patch by Erlend E. 1636Aasland. 1637 1638.. 1639 1640.. bpo: 43492 1641.. date: 2021-03-15-11-32-23 1642.. nonce: 1ZRcV9 1643.. section: macOS 1644 1645Update macOS installer to use SQLite 3.35.4. 1646 1647.. 1648 1649.. bpo: 42235 1650.. date: 2020-11-01-17-37-16 1651.. nonce: A97_BN 1652.. section: macOS 1653 1654``Mac/BuildScript/build-installer.py`` will now use "--enable-optimizations" 1655and ``--with-lto`` when building on macOS 10.15 or later. 1656 1657.. 1658 1659.. bpo: 37903 1660.. date: 2021-05-02-20-25-53 1661.. nonce: VQ6VTU 1662.. section: IDLE 1663 1664Add mouse actions to the shell sidebar. Left click and optional drag 1665selects one or more lines, as with the editor line number sidebar. Right 1666click after selecting raises a context menu with 'copy with prompts'. This 1667zips together prompts from the sidebar with lines from the selected text. 1668 1669.. 1670 1671.. bpo: 43981 1672.. date: 2021-04-30-17-59-56 1673.. nonce: 3EFl1H 1674.. section: IDLE 1675 1676Fix reference leak in test_squeezer. Patch by Pablo Galindo 1677 1678.. 1679 1680.. bpo: 37892 1681.. date: 2021-04-29-02-40-41 1682.. nonce: bgW2fk 1683.. section: IDLE 1684 1685Indent IDLE Shell input with spaces instead of tabs 1686 1687.. 1688 1689.. bpo: 43655 1690.. date: 2021-04-04-20-52-07 1691.. nonce: HSyaKH 1692.. section: IDLE 1693 1694IDLE dialog windows are now recognized as dialogs by window managers on 1695macOS and X Window. 1696 1697.. 1698 1699.. bpo: 37903 1700.. date: 2019-08-24-23-49-36 1701.. nonce: 4xjast 1702.. section: IDLE 1703 1704IDLE's shell now shows prompts in a separate side-bar. 1705 1706.. 1707 1708.. bpo: 43916 1709.. date: 2021-04-29-17-35-48 1710.. nonce: wvWt23 1711.. section: C API 1712 1713Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow 1714creating type instances. Patch by Victor Stinner. 1715 1716.. 1717 1718.. bpo: 43774 1719.. date: 2021-04-29-10-17-21 1720.. nonce: 5MGfgN 1721.. section: C API 1722 1723Remove the now unused ``PYMALLOC_DEBUG`` macro. Debug hooks on memory 1724allocators are now installed by default if Python is built in debug mode (if 1725``Py_DEBUG`` macro is defined). Moreover, they can now be used on Python 1726build in release mode (ex: using ``PYTHONMALLOC=debug`` environment 1727variable). 1728 1729.. 1730 1731.. bpo: 43962 1732.. date: 2021-04-28-13-13-07 1733.. nonce: 9Jzs5X 1734.. section: C API 1735 1736_PyInterpreterState_IDIncref() now calls _PyInterpreterState_IDInitref() and 1737always increments id_refcount. Previously, calling 1738_xxsubinterpreters.get_current() could create an id_refcount inconsistency 1739when a _xxsubinterpreters.InterpreterID object was deallocated. Patch by 1740Victor Stinner. 1741 1742.. 1743 1744.. bpo: 28254 1745.. date: 2021-04-28-12-33-44 1746.. nonce: a2561e 1747.. section: C API 1748 1749Add new C-API functions to control the state of the garbage collector: 1750:c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`, 1751:c:func:`PyGC_IsEnabled()`, corresponding to the functions in the :mod:`gc` 1752module. 1753 1754.. 1755 1756.. bpo: 43908 1757.. date: 2021-04-22-10-46-40 1758.. nonce: Co3YhZ 1759.. section: C API 1760 1761Introduce :const:`Py_TPFLAGS_IMMUTABLETYPE` flag for immutable type objects, 1762and modify :c:func:`PyType_Ready` to set it for static types. Patch by 1763Erlend E. Aasland. 1764 1765.. 1766 1767.. bpo: 43795 1768.. date: 2021-04-20-15-06-29 1769.. nonce: y0IP4c 1770.. section: C API 1771 1772:c:func:`PyMem_Calloc` is now available in the limited C API 1773(``Py_LIMITED_API``). 1774 1775.. 1776 1777.. bpo: 43868 1778.. date: 2021-04-16-18-15-56 1779.. nonce: twQ7KH 1780.. section: C API 1781 1782:c:func:`PyOS_ReadlineFunctionPointer` is no longer exported by limited C 1783API headers and by ``python3.dll`` on Windows. Like any function that takes 1784``FILE*``, it is not part of the stable ABI. 1785 1786.. 1787 1788.. bpo: 43795 1789.. date: 2021-04-09-18-19-07 1790.. nonce: l0yobT 1791.. section: C API 1792 1793Stable ABI and limited API definitions are generated from a central manifest 1794(:pep:`652`). 1795 1796.. 1797 1798.. bpo: 43753 1799.. date: 2021-04-06-20-52-44 1800.. nonce: xUsHp1 1801.. section: C API 1802 1803Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the *x* object is 1804the *y* object, the same as ``x is y`` in Python. Add also the 1805:c:func:`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` functions to 1806test if an object is, respectively, the ``None`` singleton, the ``True`` 1807singleton or the ``False`` singleton. Patch by Victor Stinner. 1808