1.. bpo: 41180 2.. date: 2021-06-29-23-40-22 3.. nonce: uTWHv_ 4.. release date: 2021-07-10 5.. section: Security 6 7Add auditing events to the :mod:`marshal` module, and stop raising 8``code.__init__`` events for every unmarshalled code object. Directly 9instantiated code objects will continue to raise an event, and audit event 10handlers should inspect or collect the raw marshal data. This reduces a 11significant performance overhead when loading from ``.pyc`` files. 12 13.. 14 15.. bpo: 44562 16.. date: 2021-07-04-23-38-51 17.. nonce: QdeRQo 18.. section: Core and Builtins 19 20Remove uses of :c:func:`PyObject_GC_Del` in error path when initializing 21:class:`types.GenericAlias`. 22 23.. 24 25.. bpo: 41486 26.. date: 2021-07-04-17-41-47 27.. nonce: DiM24a 28.. section: Core and Builtins 29 30Fix a memory consumption and copying performance regression in earlier 3.10 31beta releases if someone used an output buffer larger than 4GiB with 32zlib.decompress on input data that expands that large. 33 34.. 35 36.. bpo: 44553 37.. date: 2021-07-02-22-54-41 38.. nonce: l9YqGg 39.. section: Core and Builtins 40 41Implement GC methods for ``types.Union`` to break reference cycles and 42prevent memory leaks. 43 44.. 45 46.. bpo: 44523 47.. date: 2021-06-29-11-49-29 48.. nonce: 67-ZIP 49.. section: Core and Builtins 50 51Remove the pass-through for :func:`hash` of :class:`weakref.proxy` objects 52to prevent unintended consequences when the original referred object dies 53while the proxy is part of a hashable object. Patch by Pablo Galindo. 54 55.. 56 57.. bpo: 44483 58.. date: 2021-06-22-19-08-19 59.. nonce: eq2f7T 60.. section: Core and Builtins 61 62Fix a crash in ``types.Union`` objects when creating a union of an object 63with bad ``__module__`` field. 64 65.. 66 67.. bpo: 44297 68.. date: 2021-06-19-12-41-13 69.. nonce: F53vHj 70.. section: Core and Builtins 71 72Make sure that the line number is set when entering a comprehension scope. 73Ensures that backtraces inclusing generator expressions show the correct 74line number. 75 76.. 77 78.. bpo: 44456 79.. date: 2021-06-18-22-08-25 80.. nonce: L0Rhko 81.. section: Core and Builtins 82 83Improve the syntax error when mixing positional and keyword patterns. Patch 84by Pablo Galindo. 85 86.. 87 88.. bpo: 44368 89.. date: 2021-06-09-22-56-59 90.. nonce: vgT0Cx 91.. section: Core and Builtins 92 93Improve syntax errors for invalid "as" targets. Patch by Pablo Galindo 94 95.. 96 97.. bpo: 44317 98.. date: 2021-06-06-00-29-14 99.. nonce: xPPhcZ 100.. section: Core and Builtins 101 102Improve tokenizer error with improved locations. Patch by Pablo Galindo. 103 104.. 105 106.. bpo: 43667 107.. date: 2021-05-27-17-34-29 108.. nonce: ND9jP3 109.. section: Core and Builtins 110 111Improve Unicode support in non-UTF locales on Oracle Solaris. This issue 112does not affect other Solaris systems. 113 114.. 115 116.. bpo: 44558 117.. date: 2021-07-04-21-16-53 118.. nonce: cm7Slv 119.. section: Library 120 121Make the implementation consistency of :func:`~operator.indexOf` between C 122and Python versions. Patch by Dong-hee Na. 123 124.. 125 126.. bpo: 34798 127.. date: 2021-06-30-13-29-49 128.. nonce: t7FCa0 129.. section: Library 130 131Break up paragraph about :class:`pprint.PrettyPrinter` construction 132parameters to make it easier to read. 133 134.. 135 136.. bpo: 44516 137.. date: 2021-06-26-12-27-14 138.. nonce: BVyX_y 139.. section: Library 140 141Update vendored pip to 21.1.3 142 143.. 144 145.. bpo: 44468 146.. date: 2021-06-23-19-02-00 147.. nonce: -klV5- 148.. section: Library 149 150:func:`typing.get_type_hints` now finds annotations in classes and base 151classes with unexpected ``__module__``. Previously, it skipped those MRO 152elements. 153 154.. 155 156.. bpo: 43977 157.. date: 2021-06-22-16-45-48 158.. nonce: bamAGF 159.. section: Library 160 161Set the proper :const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` 162flags for subclasses created before a parent has been registered as a 163:class:`collections.abc.Mapping` or :class:`collections.abc.Sequence`. 164 165.. 166 167.. bpo: 44482 168.. date: 2021-06-22-08-43-04 169.. nonce: U9GznK 170.. section: Library 171 172Fix very unlikely resource leak in :mod:`glob` in alternate Python 173implementations. 174 175.. 176 177.. bpo: 44466 178.. date: 2021-06-21-12-43-04 179.. nonce: NSm6mv 180.. section: Library 181 182The :mod:`faulthandler` module now detects if a fatal error occurs during a 183garbage collector collection. Patch by Victor Stinner. 184 185.. 186 187.. bpo: 44404 188.. date: 2021-06-20-19-01-11 189.. nonce: McfrYB 190.. section: Library 191 192:mod:`tkinter`'s ``after()`` method now supports callables without the 193``__name__`` attribute. 194 195.. 196 197.. bpo: 44458 198.. date: 2021-06-20-07-14-46 199.. nonce: myqCQ0 200.. section: Library 201 202``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking collisions 203when bz2, lmza or zlib are statically linked. 204 205.. 206 207.. bpo: 44464 208.. date: 2021-06-19-21-52-27 209.. nonce: U2oa-a 210.. section: Library 211 212Remove exception for flake8 in deprecated importlib.metadata interfaces. 213Sync with importlib_metadata 4.6. 214 215.. 216 217.. bpo: 44446 218.. date: 2021-06-17-22-39-34 219.. nonce: qwdRic 220.. section: Library 221 222Take into account that ``lineno`` might be ``None`` in 223:class:`traceback.FrameSummary`. 224 225.. 226 227.. bpo: 44439 228.. date: 2021-06-17-15-01-51 229.. nonce: 1S7QhT 230.. section: Library 231 232Fix in :meth:`bz2.BZ2File.write` / :meth:`lzma.LZMAFile.write` methods, when 233the input data is an object that supports the buffer protocol, the file 234length may be wrong. 235 236.. 237 238.. bpo: 44434 239.. date: 2021-06-16-16-52-14 240.. nonce: SQS4Pg 241.. section: Library 242 243_thread.start_new_thread() no longer calls PyThread_exit_thread() explicitly 244at the thread exit, the call was redundant. On Linux with the glibc, 245pthread_exit() aborts the whole process if dlopen() fails to open 246libgcc_s.so file (ex: EMFILE error). Patch by Victor Stinner. 247 248.. 249 250.. bpo: 44395 251.. date: 2021-06-12-10-08-14 252.. nonce: PcW6Sx 253.. section: Library 254 255Fix :meth:`~email.message.MIMEPart.as_string` to pass unixfrom properly. 256Patch by Dong-hee Na. 257 258.. 259 260.. bpo: 34266 261.. date: 2021-06-10-21-53-46 262.. nonce: k3fxnm 263.. section: Library 264 265Handle exceptions from parsing the arg of :mod:`pdb`'s run/restart command. 266 267.. 268 269.. bpo: 44077 270.. date: 2021-05-13-19-44-38 271.. nonce: 04b2a4 272.. section: Library 273 274It's now possible to receive the type of service (ToS), a.k.a. 275differentiated services (DS), a.k.a. differenciated services code point 276(DSCP) and excplicit congestion notification (ECN) IP header fields with 277``socket.IP_RECVTOS``. 278 279.. 280 281.. bpo: 43024 282.. date: 2021-01-25-21-24-55 283.. nonce: vAUrIi 284.. section: Library 285 286Improve the help signature of :func:`traceback.print_exception`, 287:func:`traceback.format_exception` and 288:func:`traceback.format_exception_only`. 289 290.. 291 292.. bpo: 30256 293.. date: 2019-09-25-13-54-41 294.. nonce: wBkzox 295.. section: Library 296 297Pass multiprocessing BaseProxy argument ``manager_owned`` through AutoProxy. 298 299.. 300 301.. bpo: 44558 302.. date: 2021-07-03-18-25-17 303.. nonce: 0pTknl 304.. section: Documentation 305 306Match the docstring and python implementation of :func:`~operator.countOf` 307to the behavior of its c implementation. 308 309.. 310 311.. bpo: 38062 312.. date: 2021-06-28-12-13-48 313.. nonce: 9Ehp9O 314.. section: Documentation 315 316Clarify that atexit uses equality comparisons internally. 317 318.. 319 320.. bpo: 40620 321.. date: 2021-06-26-17-41-06 322.. nonce: PAYDrB 323.. section: Documentation 324 325Convert examples in tutorial controlflow.rst section 4.3 to be 326interpreter-demo style. 327 328.. 329 330.. bpo: 13814 331.. date: 2021-06-21-15-46-32 332.. nonce: LDcslu 333.. section: Documentation 334 335In the Design FAQ, answer "Why don't generators support the with statement?" 336 337.. 338 339.. bpo: 41621 340.. date: 2020-08-24-13-35-04 341.. nonce: nqaw9G 342.. section: Documentation 343 344Document that :class:`collections.defaultdict` parameter ``default_factory`` 345defaults to None and is positional-only. 346 347.. 348 349.. bpo: 44287 350.. date: 2021-06-21-17-53-41 351.. nonce: YON57s 352.. section: Tests 353 354Fix asyncio test_popen() of test_windows_utils by using a longer timeout. 355Use military grade battle-tested :data:`test.support.SHORT_TIMEOUT` timeout 356rather than a hardcoded timeout of 10 seconds: it's 30 seconds by default, 357but it is made longer on slow buildbots. Patch by Victor Stinner. 358 359.. 360 361.. bpo: 44451 362.. date: 2021-06-18-15-19-35 363.. nonce: aj5pqE 364.. section: Tests 365 366Reset ``DeprecationWarning`` filters in 367``test.test_importlib.test_metadata_api.APITests.test_entry_points_by_index`` 368to avoid ``StopIteration`` error if ``DeprecationWarnings`` are ignored. 369 370.. 371 372.. bpo: 30256 373.. date: 2019-09-25-18-10-10 374.. nonce: A5i76Q 375.. section: Tests 376 377Add test for nested queues when using ``multiprocessing`` shared objects 378``AutoProxy[Queue]`` inside ``ListProxy`` and ``DictProxy`` 379 380.. 381 382.. bpo: 44535 383.. date: 2021-06-30-02-32-46 384.. nonce: M9iN4- 385.. section: Build 386 387Enable building using a Visual Studio 2022 install on Windows. 388 389.. 390 391.. bpo: 43298 392.. date: 2021-06-19-11-50-03 393.. nonce: 9ircMb 394.. section: Build 395 396Improved error message when building without a Windows SDK installed. 397 398.. 399 400.. bpo: 44582 401.. date: 2021-07-07-21-07-18 402.. nonce: 4Mm6Hh 403.. section: Windows 404 405Accelerate speed of :mod:`mimetypes` initialization using a native 406implementation of the registry scan. 407 408.. 409 410.. bpo: 41299 411.. date: 2021-06-06-16-36-13 412.. nonce: Rg-vb_ 413.. section: Windows 414 415Fix 16ms jitter when using timeouts in :mod:`threading`, such as with 416:meth:`threading.Lock.acquire` or :meth:`threading.Condition.wait`. 417 418.. 419 420.. bpo: 44441 421.. date: 2021-06-23-12-12-04 422.. nonce: 3p14JB 423.. section: C API 424 425:c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to its initial 426value at exit. It must be possible to call :c:func:`PyImport_AppendInittab` 427or :c:func:`PyImport_ExtendInittab` at each Python initialization. Patch by 428Victor Stinner. 429 430.. 431 432.. bpo: 40939 433.. date: 2021-06-22-17-00-06 434.. nonce: CGB0I5 435.. section: C API 436 437Removed documentation for the removed ``PyParser_*`` C API. 438