1.. bpo: 42278 2.. date: 2021-08-29-12-39-44 3.. nonce: jvmQz_ 4.. release date: 2021-09-07 5.. section: Security 6 7Replaced usage of :func:`tempfile.mktemp` with 8:class:`~tempfile.TemporaryDirectory` to avoid a potential race condition. 9 10.. 11 12.. bpo: 44394 13.. date: 2021-06-29-02-45-53 14.. nonce: A220N1 15.. section: Security 16 17Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to get the fix 18for the CVE-2013-0340 "Billion Laughs" vulnerability. This copy is most used 19on Windows and macOS. 20 21.. 22 23.. bpo: 43124 24.. date: 2021-05-08-11-50-46 25.. nonce: 2CTM6M 26.. section: Security 27 28Made the internal ``putcmd`` function in :mod:`smtplib` sanitize input for 29presence of ``\r`` and ``\n`` characters to avoid (unlikely) command 30injection. 31 32.. 33 34.. bpo: 45123 35.. date: 2021-09-06-21-52-45 36.. nonce: 8Eh9iI 37.. section: Core and Builtins 38 39Fix PyAiter_Check to only check for the __anext__ presence (not for 40__aiter__). Rename PyAiter_Check to PyAIter_Check, PyObject_GetAiter -> 41PyObject_GetAIter. 42 43.. 44 45.. bpo: 45018 46.. date: 2021-08-26-18-44-03 47.. nonce: pu8H9L 48.. section: Core and Builtins 49 50Fixed pickling of range iterators that iterated for over 2**32 times. 51 52.. 53 54.. bpo: 45000 55.. date: 2021-08-25-23-17-32 56.. nonce: XjmyLl 57.. section: Core and Builtins 58 59A :exc:`SyntaxError` is now raised when trying to delete :const:`__debug__`. 60Patch by Dong-hee Na. 61 62.. 63 64.. bpo: 44963 65.. date: 2021-08-25-23-07-10 66.. nonce: 5EET8y 67.. section: Core and Builtins 68 69Implement ``send()`` and ``throw()`` methods for ``anext_awaitable`` 70objects. Patch by Pablo Galindo. 71 72.. 73 74.. bpo: 44962 75.. date: 2021-08-23-19-55-08 76.. nonce: J00ftt 77.. section: Core and Builtins 78 79Fix a race in WeakKeyDictionary, WeakValueDictionary and WeakSet when two 80threads attempt to commit the last pending removal. This fixes 81asyncio.create_task and fixes a data loss in asyncio.run where 82shutdown_asyncgens is not run 83 84.. 85 86.. bpo: 44954 87.. date: 2021-08-19-14-43-24 88.. nonce: dLn3lg 89.. section: Core and Builtins 90 91Fixed a corner case bug where the result of ``float.fromhex('0x.8p-1074')`` 92was rounded the wrong way. 93 94.. 95 96.. bpo: 44947 97.. date: 2021-08-18-19-09-28 98.. nonce: mcvGdS 99.. section: Core and Builtins 100 101Refine the syntax error for trailing commas in import statements. Patch by 102Pablo Galindo. 103 104.. 105 106.. bpo: 44698 107.. date: 2021-08-15-10-39-06 108.. nonce: lITKNc 109.. section: Core and Builtins 110 111Restore behaviour of complex exponentiation with integer-valued exponent of 112type :class:`float` or :class:`complex`. 113 114.. 115 116.. bpo: 44885 117.. date: 2021-08-11-15-39-57 118.. nonce: i4noUO 119.. section: Core and Builtins 120 121Correct the ast locations of f-strings with format specs and repeated 122expressions. Patch by Pablo Galindo 123 124.. 125 126.. bpo: 44872 127.. date: 2021-08-09-16-16-03 128.. nonce: OKRlhK 129.. section: Core and Builtins 130 131Use new trashcan macros (Py_TRASHCAN_BEGIN/END) in frameobject.c instead of 132the old ones (Py_TRASHCAN_SAFE_BEGIN/END). 133 134.. 135 136.. bpo: 33930 137.. date: 2021-08-09-14-29-52 138.. nonce: --5LQ- 139.. section: Core and Builtins 140 141Fix segmentation fault with deep recursion when cleaning method objects. 142Patch by Augusto Goulart and Pablo Galindo. 143 144.. 145 146.. bpo: 25782 147.. date: 2021-08-07-21-39-19 148.. nonce: B22lMx 149.. section: Core and Builtins 150 151Fix bug where ``PyErr_SetObject`` hangs when the current exception has a 152cycle in its context chain. 153 154.. 155 156.. bpo: 44856 157.. date: 2021-08-07-01-26-12 158.. nonce: 9rk3li 159.. section: Core and Builtins 160 161Fix reference leaks in the error paths of ``update_bases()`` and 162``__build_class__``. Patch by Pablo Galindo. 163 164.. 165 166.. bpo: 44838 167.. date: 2021-08-05-17-42-03 168.. nonce: r_Lkj_ 169.. section: Core and Builtins 170 171Fixed a bug that was causing the parser to raise an incorrect custom 172:exc:`SyntaxError` for invalid 'if' expressions. Patch by Pablo Galindo. 173 174.. 175 176.. bpo: 44584 177.. date: 2021-07-08-12-18-56 178.. nonce: qKnSqV 179.. section: Core and Builtins 180 181The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is 182deprecated in Python 3.10 and will be removed in Python 3.12. This feature 183requires a debug build of Python. Patch by Victor Stinner. 184 185.. 186 187.. bpo: 39091 188.. date: 2019-12-21-14-18-32 189.. nonce: dOexgQ 190.. section: Core and Builtins 191 192Fix crash when using passing a non-exception to a generator's ``throw()`` 193method. Patch by Noah Oxer 194 195.. 196 197.. bpo: 45081 198.. date: 2021-09-02-12-42-25 199.. nonce: tOjJ1k 200.. section: Library 201 202Fix issue when dataclasses that inherit from ``typing.Protocol`` subclasses 203have wrong ``__init__``. Patch provided by Yurii Karabas. 204 205.. 206 207.. bpo: 41620 208.. date: 2021-08-29-14-49-22 209.. nonce: WJ6PFL 210.. section: Library 211 212:meth:`~unittest.TestCase.run` now always return a 213:class:`~unittest.TestResult` instance. Previously it returned ``None`` if 214the test class or method was decorated with a skipping decorator. 215 216.. 217 218.. bpo: 43913 219.. date: 2021-08-27-23-40-51 220.. nonce: Uo1Gt5 221.. section: Library 222 223Fix bugs in cleaning up classes and modules in :mod:`unittest`: 224 225* Functions registered with :func:`~unittest.addModuleCleanup` were not called unless the user defines ``tearDownModule()`` in their test module. 226* Functions registered with :meth:`~unittest.TestCase.addClassCleanup` were not called if ``tearDownClass`` is set to ``None``. 227* Buffering in :class:`~unittest.TestResult` did not work with functions registered with ``addClassCleanup()`` and ``addModuleCleanup()``. 228* Errors in functions registered with ``addClassCleanup()`` and ``addModuleCleanup()`` were not handled correctly in buffered and debug modes. 229* Errors in ``setUpModule()`` and functions registered with ``addModuleCleanup()`` were reported in wrong order. 230* And several lesser bugs. 231 232.. 233 234.. bpo: 45030 235.. date: 2021-08-27-19-01-23 236.. nonce: tAmBbY 237.. section: Library 238 239Fix integer overflow in pickling and copying the range iterator. 240 241.. 242 243.. bpo: 45001 244.. date: 2021-08-26-16-25-48 245.. nonce: tn_dKp 246.. section: Library 247 248Made email date parsing more robust against malformed input, namely a 249whitespace-only ``Date:`` header. Patch by Wouter Bolsterlee. 250 251.. 252 253.. bpo: 44449 254.. date: 2021-08-20-11-30-52 255.. nonce: 1r2-lS 256.. section: Library 257 258Fix a crash in the signal handler of the :mod:`faulthandler` module: no 259longer modify the reference count of frame objects. Patch by Victor Stinner. 260 261.. 262 263.. bpo: 44955 264.. date: 2021-08-19-15-03-54 265.. nonce: 1mxFQS 266.. section: Library 267 268Method :meth:`~unittest.TestResult.stopTestRun` is now always called in pair 269with method :meth:`~unittest.TestResult.startTestRun` for 270:class:`~unittest.TestResult` objects implicitly created in 271:meth:`~unittest.TestCase.run`. Previously it was not called for test 272methods and classes decorated with a skipping decorator. 273 274.. 275 276.. bpo: 44935 277.. date: 2021-08-17-16-01-44 278.. nonce: roUl0G 279.. section: Library 280 281:mod:`subprocess` on Solaris now also uses :func:`os.posix_spawn()` for 282better performance. 283 284.. 285 286.. bpo: 44911 287.. date: 2021-08-14-00-55-16 288.. nonce: uk3hYk 289.. section: Library 290 291:class:`~unittest.IsolatedAsyncioTestCase` will no longer throw an exception 292while cancelling leaked tasks. Patch by Bar Harel. 293 294.. 295 296.. bpo: 44524 297.. date: 2021-08-10-16-57-10 298.. nonce: dk9QX4 299.. section: Library 300 301Make exception message more useful when subclass from typing special form 302alias. Patch provided by Yurii Karabas. 303 304.. 305 306.. bpo: 38956 307.. date: 2021-08-09-13-17-10 308.. nonce: owWLNv 309.. section: Library 310 311:class:`argparse.BooleanOptionalAction`'s default value is no longer printed 312twice when used with :class:`argparse.ArgumentDefaultsHelpFormatter`. 313 314.. 315 316.. bpo: 44860 317.. date: 2021-08-07-22-51-32 318.. nonce: PTvRrU 319.. section: Library 320 321Fix the ``posix_user`` scheme in :mod:`sysconfig` to not depend on 322:data:`sys.platlibdir`. 323 324.. 325 326.. bpo: 44581 327.. date: 2021-08-06-19-15-52 328.. nonce: oFDBTB 329.. section: Library 330 331Upgrade bundled pip to 21.2.3 and setuptools to 57.4.0 332 333.. 334 335.. bpo: 44849 336.. date: 2021-08-06-13-00-28 337.. nonce: O78F_f 338.. section: Library 339 340Fix the :func:`os.set_inheritable` function on FreeBSD 14 for file 341descriptor opened with the :data:`~os.O_PATH` flag: ignore the 342:data:`~errno.EBADF` error on ``ioctl()``, fallback on the ``fcntl()`` 343implementation. Patch by Victor Stinner. 344 345.. 346 347.. bpo: 44605 348.. date: 2021-08-06-09-43-50 349.. nonce: q4YSBZ 350.. section: Library 351 352The @functools.total_ordering() decorator now works with metaclasses. 353 354.. 355 356.. bpo: 44524 357.. date: 2021-08-05-18-20-17 358.. nonce: 9T1tfe 359.. section: Library 360 361Fixed an issue wherein the ``__name__`` and ``__qualname__`` attributes of 362subscribed specialforms could be ``None``. 363 364.. 365 366.. bpo: 44822 367.. date: 2021-08-04-12-29-00 368.. nonce: zePNXA 369.. section: Library 370 371:mod:`sqlite3` user-defined functions and aggregators returning 372:class:`strings <str>` with embedded NUL characters are no longer truncated. 373Patch by Erlend E. Aasland. 374 375.. 376 377.. bpo: 44801 378.. date: 2021-08-03-20-37-45 379.. nonce: i49Aug 380.. section: Library 381 382Ensure that the :class:`~typing.ParamSpec` variable in Callable can only be 383substituted with a parameters expression (a list of types, an ellipsis, 384ParamSpec or Concatenate). 385 386.. 387 388.. bpo: 27334 389.. date: 2021-05-18-00-17-21 390.. nonce: 32EJZi 391.. section: Library 392 393The :mod:`sqlite3` context manager now performs a rollback (thus releasing 394the database lock) if commit failed. Patch by Luca Citi and Erlend E. 395Aasland. 396 397.. 398 399.. bpo: 41402 400.. date: 2020-07-26-18-17-30 401.. nonce: YRkVkp 402.. section: Library 403 404Fix :meth:`email.message.EmailMessage.set_content` when called with binary 405data and ``7bit`` content transfer encoding. 406 407.. 408 409.. bpo: 32695 410.. date: 2020-07-13-23-46-59 411.. nonce: tTqqXe 412.. section: Library 413 414The *compresslevel* and *preset* keyword arguments of :func:`tarfile.open` 415are now both documented and tested. 416 417.. 418 419.. bpo: 34990 420.. date: 2020-04-24-20-39-38 421.. nonce: 3SmL9M 422.. section: Library 423 424Fixed a Y2k38 bug in the compileall module where it would fail to compile 425files with a modification time after the year 2038. 426 427.. 428 429.. bpo: 38840 430.. date: 2020-01-16-23-41-16 431.. nonce: VzzYZz 432.. section: Library 433 434Fix ``test___all__`` on platforms lacking a shared memory implementation. 435 436.. 437 438.. bpo: 26228 439.. date: 2019-02-26-09-31-59 440.. nonce: wyrHKc 441.. section: Library 442 443pty.spawn no longer hangs on FreeBSD, macOS, and Solaris. 444 445.. 446 447.. bpo: 33349 448.. date: 2018-04-24-14-25-07 449.. nonce: Y_0LIr 450.. section: Library 451 452lib2to3 now recognizes async generators everywhere. 453 454.. 455 456.. bpo: 44957 457.. date: 2021-08-19-15-53-08 458.. nonce: imqrh3 459.. section: Documentation 460 461Promote PEP 604 union syntax by using it where possible. Also, mention ``X | 462Y`` more prominently in section about ``Union`` and mention ``X | None`` at 463all in section about ``Optional``. 464 465.. 466 467.. bpo: 44903 468.. date: 2021-08-13-19-08-03 469.. nonce: aJuvQF 470.. section: Documentation 471 472Removed the othergui.rst file, any references to it, and the list of GUI 473frameworks in the FAQ. In their place I've added links to the Python Wiki 474`page on GUI frameworks <https://wiki.python.org/moin/GuiProgramming>`. 475 476.. 477 478.. bpo: 33479 479.. date: 2021-08-11-18-02-06 480.. nonce: rCe4c5 481.. section: Documentation 482 483Tkinter documentation has been greatly expanded with new "Architecture" and 484"Threading model" sections. 485 486.. 487 488.. bpo: 36700 489.. date: 2021-08-09-19-58-45 490.. nonce: WPNW5f 491.. section: Documentation 492 493:mod:`base64` RFC references were updated to point to :rfc:`4648`; a section 494was added to point users to the new "security considerations" section of the 495RFC. 496 497.. 498 499.. bpo: 44756 500.. date: 2021-08-06-19-36-21 501.. nonce: 1Ngzon 502.. section: Documentation 503 504Reverted automated virtual environment creation on ``make html`` when 505building documentation. It turned out to be disruptive for downstream 506distributors. 507 508.. 509 510.. bpo: 42958 511.. date: 2021-07-15-11-19-03 512.. nonce: gC5IHM 513.. section: Documentation 514 515Updated the docstring and docs of :func:`filecmp.cmp` to be more accurate 516and less confusing especially in respect to *shallow* arg. 517 518.. 519 520.. bpo: 43066 521.. date: 2021-06-24-14-37-16 522.. nonce: Ti7ahX 523.. section: Documentation 524 525Added a warning to :mod:`zipfile` docs: filename arg with a leading slash 526may cause archive to be un-openable on Windows systems. 527 528.. 529 530.. bpo: 39452 531.. date: 2021-06-23-15-21-36 532.. nonce: o_I-6d 533.. section: Documentation 534 535Rewrote ``Doc/library/__main__.rst``. Broadened scope of the document to 536explicitly discuss and differentiate between ``__main__.py`` in packages 537versus the ``__name__ == '__main__'`` expression (and the idioms that 538surround it). 539 540.. 541 542.. bpo: 27752 543.. date: 2021-06-18-18-04-53 544.. nonce: NEByNk 545.. section: Documentation 546 547Documentation of csv.Dialect is more descriptive. 548 549.. 550 551.. bpo: 41576 552.. date: 2020-08-21-22-59-37 553.. nonce: 7a6CQR 554.. section: Documentation 555 556document BaseException in favor of bare except 557 558.. 559 560.. bpo: 39498 561.. date: 2020-01-30-05-18-48 562.. nonce: Nu3sFL 563.. section: Documentation 564 565Add a "Security Considerations" index which links to standard library 566modules that have explicitly documented security considerations. 567 568.. 569 570.. bpo: 33479 571.. date: 2018-05-19-15-59-29 572.. nonce: 4cLlxo 573.. section: Documentation 574 575Remove the unqualified claim that tkinter is threadsafe. It has not been 576true for several years and likely never was. An explanation of what is true 577may be added later, after more discussion, and possibly after patching 578_tkinter.c, 579 580.. 581 582.. bpo: 45052 583.. date: 2021-09-06-19-00-29 584.. nonce: yrOK3J 585.. section: Tests 586 587``WithProcessesTestSharedMemory.test_shared_memory_basics`` test was 588ignored, because ``self.assertEqual(sms.size, sms2.size)`` line was failing. 589It is now removed and test is unskipped. 590 591The main motivation for this line to be removed from the test is that the 592``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is 593decided by the platform. 594 595.. 596 597.. bpo: 45042 598.. date: 2021-08-30-11-54-14 599.. nonce: QMz3X8 600.. section: Tests 601 602Fixes that test classes decorated with 603``@hashlib_helper.requires_hashdigest`` were skipped all the time. 604 605.. 606 607.. bpo: 45011 608.. date: 2021-08-26-14-20-44 609.. nonce: mQZdXU 610.. section: Tests 611 612Made tests relying on the :mod:`_asyncio` C extension module optional to 613allow running on alternative Python implementations. Patch by Serhiy 614Storchaka. 615 616.. 617 618.. bpo: 44949 619.. date: 2021-08-18-18-30-12 620.. nonce: VE5ENv 621.. section: Tests 622 623Fix auto history tests of test_readline: sometimes, the newline character is 624not written at the end, so don't expect it in the output. 625 626.. 627 628.. bpo: 44891 629.. date: 2021-08-13-12-11-06 630.. nonce: T9_mBT 631.. section: Tests 632 633Tests were added to clarify :func:`id` is preserved when ``obj * 1`` is used 634on :class:`str` and :class:`bytes` objects. Patch by Nikita Sobolev. 635 636.. 637 638.. bpo: 44852 639.. date: 2021-08-06-18-36-04 640.. nonce: sUL8YX 641.. section: Tests 642 643Add ability to wholesale silence DeprecationWarnings while running the 644regression test suite. 645 646.. 647 648.. bpo: 40928 649.. date: 2021-08-06-00-07-15 650.. nonce: aIwb6G 651.. section: Tests 652 653Notify users running test_decimal regression tests on macOS of potential 654harmless "malloc can't allocate region" messages spewed by test_decimal. 655 656.. 657 658.. bpo: 45007 659.. date: 2021-08-27-23-50-02 660.. nonce: NIBlVG 661.. section: Windows 662 663Update to OpenSSL 1.1.1l in Windows build 664 665.. 666 667.. bpo: 45007 668.. date: 2021-08-30-00-04-10 669.. nonce: pixqUB 670.. section: macOS 671 672Update macOS installer builds to use OpenSSL 1.1.1l. 673 674.. 675 676.. bpo: 44689 677.. date: 2021-07-20-22-27-01 678.. nonce: mmT_xH 679.. section: macOS 680 681:meth:`ctypes.util.find_library` now works correctly on macOS 11 Big Sur 682even if Python is built on an older version of macOS. Previously, when 683built on older macOS systems, ``find_library`` was not able to find macOS 684system libraries when running on Big Sur due to changes in how system 685libraries are stored. 686