1+++++++++++ 2Python News 3+++++++++++ 4 5What's New in Python 3.10.1 final? 6================================== 7 8*Release date: 2021-12-06* 9 10Core and Builtins 11----------------- 12 13- bpo-42268: Fail the configure step if the selected compiler doesn't 14 support memory sanitizer. Patch by Pablo Galindo 15 16- bpo-45727: Refine the custom syntax error that suggests that a comma may 17 be missing to trigger only when the expressions are detected between 18 parentheses or brackets. Patch by Pablo Galindo 19 20- bpo-45614: Fix :mod:`traceback` display for exceptions with invalid module 21 name. 22 23- bpo-45848: Allow the parser to obtain error lines directly from encoded 24 files. Patch by Pablo Galindo 25 26- bpo-45826: Fixed a crash when calling ``.with_traceback(None)`` on 27 ``NameError``. This occurs internally in 28 ``unittest.TestCase.assertRaises()``. 29 30- bpo-45822: Fixed a bug in the parser that was causing it to not respect 31 :pep:`263` coding cookies when no flags are provided. Patch by Pablo 32 Galindo 33 34- bpo-45820: Fix a segfault when the parser fails without reading any input. 35 Patch by Pablo Galindo 36 37- bpo-42540: Fix crash when :func:`os.fork` is called with an active 38 non-default memory allocator. 39 40- bpo-45738: Fix computation of error location for invalid continuation 41 characters in the parser. Patch by Pablo Galindo. 42 43- bpo-45773: Fix a compiler hang when attempting to optimize certain jump 44 patterns. 45 46- bpo-45716: Improve the :exc:`SyntaxError` message when using ``True``, 47 ``None`` or ``False`` as keywords in a function call. Patch by Pablo 48 Galindo. 49 50- bpo-45688: :data:`sys.stdlib_module_names` now contains the macOS-specific 51 module :mod:`_scproxy`. 52 53- bpo-30570: Fixed a crash in ``issubclass()`` from infinite recursion when 54 searching pathological ``__bases__`` tuples. 55 56- bpo-45521: Fix a bug in the obmalloc radix tree code. On 64-bit machines, 57 the bug causes the tree to hold 46-bits of virtual addresses, rather than 58 the intended 48-bits. 59 60- bpo-45494: Fix parser crash when reporting errors involving invalid 61 continuation characters. Patch by Pablo Galindo. 62 63- bpo-45408: Fix a crash in the parser when reporting tokenizer errors that 64 occur at the same time unclosed parentheses are detected. Patch by Pablo 65 Galindo. 66 67- bpo-45385: Fix reference leak from descr_check. Patch by Dong-hee Na. 68 69- bpo-45167: Fix deepcopying of :class:`types.GenericAlias` objects. 70 71- bpo-44219: Release the GIL while performing ``isatty`` system calls on 72 arbitrary file descriptors. In particular, this affects :func:`os.isatty`, 73 :func:`os.device_encoding` and :class:`io.TextIOWrapper`. By extension, 74 :func:`io.open` in text mode is also affected. This change solves a 75 deadlock in :func:`os.isatty`. Patch by Vincent Michel in :issue:`44219`. 76 77- bpo-44959: Added fallback to extension modules with '.sl' suffix on HP-UX 78 79- bpo-44050: Extensions that indicate they use global state (by setting 80 ``m_size`` to -1) can again be used in multiple interpreters. This reverts 81 to behavior of Python 3.8. 82 83- bpo-45121: Fix issue where ``Protocol.__init__`` raises ``RecursionError`` 84 when it's called directly or via ``super()``. Patch provided by Yurii 85 Karabas. 86 87- bpo-45083: When the interpreter renders an exception, its name now has a 88 complete qualname. Previously only the class name was concatenated to the 89 module name, which sometimes resulted in an incorrect full name being 90 displayed. 91 92 (This issue impacted only the C code exception rendering, the 93 :mod:`traceback` module was using qualname already). 94 95- bpo-45056: Compiler now removes trailing unused constants from co_consts. 96 97Library 98------- 99 100- bpo-27946: Fix possible crash when getting an attribute of 101 class:`xml.etree.ElementTree.Element` simultaneously with replacing the 102 ``attrib`` dict. 103 104- bpo-37658: Fix issue when on certain conditions ``asyncio.wait_for()`` may 105 allow a coroutine to complete successfully, but fail to return the result, 106 potentially causing memory leaks or other issues. 107 108- bpo-44649: Handle dataclass(slots=True) with a field that has default a 109 default value, but for which init=False. 110 111- bpo-45803: Added missing kw_only parameter to 112 dataclasses.make_dataclass(). 113 114- bpo-45831: :mod:`faulthandler` can now write ASCII-only strings (like 115 filenames and function names) with a single write() syscall when dumping a 116 traceback. It reduces the risk of getting an unreadable dump when two 117 threads or two processes dump a traceback to the same file (like stderr) 118 at the same time. Patch by Victor Stinner. 119 120- bpo-41735: Fix thread lock in ``zlib.Decompress.flush()`` method before 121 ``PyObject_GetBuffer``. 122 123- bpo-45235: Reverted an argparse bugfix that caused regression in the 124 handling of default arguments for subparsers. This prevented leaf level 125 arguments from taking precedence over root level arguments. 126 127- bpo-45765: In importlib.metadata, fix distribution discovery for an empty 128 path. 129 130- bpo-45757: Fix bug where :mod:`dis` produced an incorrect oparg when 131 :opcode:`EXTENDED_ARG` is followed by an opcode that does not use its 132 argument. 133 134- bpo-45644: In-place JSON file formatting using ``python3 -m json.tool 135 infile infile`` now works correctly, previously it left the file empty. 136 Patch by Chris Wesseling. 137 138- bpo-45679: Fix caching of multi-value :data:`typing.Literal`. 139 ``Literal[True, 2]`` is no longer equal to ``Literal[1, 2]``. 140 141- bpo-45664: Fix :func:`types.resolve_bases` and :func:`types.new_class` for 142 :class:`types.GenericAlias` instance as a base. 143 144- bpo-45663: Fix :func:`dataclasses.is_dataclass` for dataclasses which are 145 subclasses of :class:`types.GenericAlias`. 146 147- bpo-45662: Fix the repr of :data:`dataclasses.InitVar` with a type alias 148 to the built-in class, e.g. ``InitVar[list[int]]``. 149 150- bpo-45438: Fix typing.Signature string representation for generic builtin 151 types. 152 153- bpo-45574: Fix warning about ``print_escape`` being unused. 154 155- bpo-45581: :meth:`sqlite3.connect` now correctly raises :exc:`MemoryError` 156 if the underlying SQLite API signals memory error. Patch by Erlend E. 157 Aasland. 158 159- bpo-45557: pprint.pprint() now handles underscore_numbers correctly. 160 Previously it was always setting it to False. 161 162- bpo-45515: Add references to :mod:`zoneinfo` in the :mod:`datetime` 163 documentation, mostly replacing outdated references to ``dateutil.tz``. 164 Change by Paul Ganssle. 165 166- bpo-45475: Reverted optimization of iterating :class:`gzip.GzipFile`, 167 :class:`bz2.BZ2File`, and :class:`lzma.LZMAFile` (see bpo-43787) because 168 it caused regression when user iterate them without having reference of 169 them. Patch by Inada Naoki. 170 171- bpo-45428: Fix a regression in py_compile when reading filenames from 172 standard input. 173 174- bpo-45467: Fix incremental decoder and stream reader in the 175 "raw-unicode-escape" codec. Previously they failed if the escape sequence 176 was split. 177 178- bpo-45461: Fix incremental decoder and stream reader in the 179 "unicode-escape" codec. Previously they failed if the escape sequence was 180 split. 181 182- bpo-45239: Fixed :func:`email.utils.parsedate_tz` crashing with 183 :exc:`UnboundLocalError` on certain invalid input instead of returning 184 ``None``. Patch by Ben Hoyt. 185 186- bpo-45249: Fix the behaviour of :func:`traceback.print_exc` when 187 displaying the caret when the ``end_offset`` in the exception is set to 0. 188 Patch by Pablo Galindo 189 190- bpo-45416: Fix use of :class:`asyncio.Condition` with explicit 191 :class:`asyncio.Lock` objects, which was a regression due to removal of 192 explicit loop arguments. Patch by Joongi Kim. 193 194- bpo-45419: Correct interfaces on DegenerateFiles.Path. 195 196- bpo-44904: Fix bug in the :mod:`doctest` module that caused it to fail if 197 a docstring included an example with a ``classmethod`` ``property``. Patch 198 by Alex Waygood. 199 200- bpo-45406: Make :func:`inspect.getmodule` catch ``FileNotFoundError`` 201 raised by :'func:`inspect.getabsfile`, and return ``None`` to indicate 202 that the module could not be determined. 203 204- bpo-45262: Prevent use-after-free in asyncio. Make sure the cached running 205 loop holder gets cleared on dealloc to prevent use-after-free in 206 get_running_loop 207 208- bpo-45386: Make :mod:`xmlrpc.client` more robust to C runtimes where the 209 underlying C ``strftime`` function results in a ``ValueError`` when 210 testing for year formatting options. 211 212- bpo-45371: Fix clang rpath issue in :mod:`distutils`. The UnixCCompiler 213 now uses correct clang option to add a runtime library directory (rpath) 214 to a shared library. 215 216- bpo-20028: Improve error message of :class:`csv.Dialect` when 217 initializing. Patch by Vajrasky Kok and Dong-hee Na. 218 219- bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0 220 221- bpo-45329: Fix freed memory access in :class:`pyexpat.xmlparser` when 222 building it with an installed expat library <= 2.2.0. 223 224- bpo-41710: On Unix, if the ``sem_clockwait()`` function is available in 225 the C library (glibc 2.30 and newer), the :meth:`threading.Lock.acquire` 226 method now uses the monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the 227 timeout, rather than using the system clock (:data:`time.CLOCK_REALTIME`), 228 to not be affected by system clock changes. Patch by Victor Stinner. 229 230- bpo-45328: Fixed :class:`http.client.HTTPConnection` to work properly in 231 OSs that don't support the ``TCP_NODELAY`` socket option. 232 233- bpo-1596321: Fix the :func:`threading._shutdown` function when the 234 :mod:`threading` module was imported first from a thread different than 235 the main thread: no longer log an error at Python exit. 236 237- bpo-45274: Fix a race condition in the :meth:`Thread.join() 238 <threading.Thread.join>` method of the :mod:`threading` module. If the 239 function is interrupted by a signal and the signal handler raises an 240 exception, make sure that the thread remains in a consistent state to 241 prevent a deadlock. Patch by Victor Stinner. 242 243- bpo-45238: Fix :meth:`unittest.IsolatedAsyncioTestCase.debug`: it runs now 244 asynchronous methods and callbacks. 245 246- bpo-36674: :meth:`unittest.TestCase.debug` raises now a 247 :class:`unittest.SkipTest` if the class or the test method are decorated 248 with the skipping decorator. 249 250- bpo-45235: Fix an issue where argparse would not preserve values in a 251 provided namespace when using a subparser with defaults. 252 253- bpo-45183: Have zipimport.zipimporter.find_spec() not raise an exception 254 when the underlying zip file has been deleted and the internal cache has 255 been reset via invalidate_cache(). 256 257- bpo-45234: Fixed a regression in :func:`~shutil.copyfile`, 258 :func:`~shutil.copy`, :func:`~shutil.copy2` raising 259 :exc:`FileNotFoundError` when source is a directory, which should raise 260 :exc:`IsADirectoryError` 261 262- bpo-45228: Fix stack buffer overflow in parsing J1939 network address. 263 264- bpo-45192: Fix the ``tempfile._infer_return_type`` function so that the 265 ``dir`` argument of the :mod:`tempfile` functions accepts an object 266 implementing the ``os.PathLike`` protocol. 267 268 Patch by Kyungmin Lee. 269 270- bpo-42135: Fix typo: ``importlib.find_loader`` is really slated for 271 removal in Python 3.12 not 3.10, like the others in GH-25169. 272 273 Patch by Hugo van Kemenade. 274 275- bpo-45160: When tracing a tkinter variable used by a ttk OptionMenu, 276 callbacks are no longer made twice. 277 278- bpo-35474: Calling :func:`mimetypes.guess_all_extensions` with 279 ``strict=False`` no longer affects the result of the following call with 280 ``strict=True``. Also, mutating the returned list no longer affects the 281 global state. 282 283- bpo-45166: :func:`typing.get_type_hints` now works with 284 :data:`~typing.Final` wrapped in :class:`~typing.ForwardRef`. 285 286- bpo-20499: Improve the speed and accuracy of statistics.pvariance(). 287 288- bpo-24444: Fixed an error raised in :mod:`argparse` help display when help 289 for an option is set to 1+ blank spaces or when *choices* arg is an empty 290 container. 291 292- bpo-45021: Fix a potential deadlock at shutdown of forked children when 293 using :mod:`concurrent.futures` module 294 295- bpo-39039: tarfile.open raises :exc:`~tarfile.ReadError` when a zlib error 296 occurs during file extraction. 297 298- bpo-44594: Fix an edge case of :class:`ExitStack` and 299 :class:`AsyncExitStack` exception chaining. They will now match ``with`` 300 block behavior when ``__context__`` is explicitly set to ``None`` when the 301 exception is in flight. 302 303- bpo-44295: Ensure deprecation warning from 304 :func:`assertDictContainsSubset` points at calling code - by Anthony 305 Sottile. 306 307- bpo-43498: Avoid a possible *"RuntimeError: dictionary changed size during 308 iteration"* when adjusting the process count of 309 :class:`ProcessPoolExecutor`. 310 311Documentation 312------------- 313 314- bpo-45640: Properly marked-up grammar tokens in the documentation are now 315 clickable and take you to the definition of a given piece of grammar. 316 Patch by Arthur Milchior. 317 318- bpo-45788: Link doc for sys.prefix to sysconfig doc on installation paths. 319 320- bpo-45772: ``socket.socket`` documentation is corrected to a class from a 321 function. 322 323- bpo-45392: Update the docstring of the :class:`type` built-in to remove a 324 redundant line and to mention keyword arguments for the constructor. 325 326- bpo-45726: Improve documentation for :func:`functools.singledispatch` and 327 :class:`functools.singledispatchmethod`. 328 329- bpo-45680: Amend the docs on ``GenericAlias`` objects to clarify that 330 non-container classes can also implement ``__class_getitem__``. Patch 331 contributed by Alex Waygood. 332 333- bpo-45655: Add a new "relevant PEPs" section to the top of the 334 documentation for the ``typing`` module. Patch by Alex Waygood. 335 336- bpo-45604: Add ``level`` argument to ``multiprocessing.log_to_stderr`` 337 function docs. 338 339- bpo-45250: Update the documentation to note that CPython does not 340 consistently require iterators to define ``__iter__``. 341 342- bpo-45464: Mention in the documentation of :ref:`Built-in Exceptions 343 <bltin-exceptions>` that inheriting from multiple exception types in a 344 single subclass is not recommended due to possible memory layout 345 incompatibility. 346 347- bpo-45449: Add note about :pep:`585` in :mod:`collections.abc`. 348 349- bpo-45516: Add protocol description to the 350 :class:`importlib.abc.Traversable` documentation. 351 352- bpo-20692: Add Programming FAQ entry explaining that int literal attribute 353 access requires either a space after or parentheses around the literal. 354 355- bpo-45216: Remove extra documentation listing methods in ``difflib``. It 356 was rendering twice in pydoc and was outdated in some places. 357 358- bpo-45024: :mod:`collections.abc` documentation has been expanded to 359 explicitly cover how instance and subclass checks work, with additional 360 doctest examples and an exhaustive list of ABCs which test membership 361 purely by presence of the right :term:`special method`\s. Patch by Raymond 362 Hettinger. 363 364- bpo-25381: In the extending chapter of the extending doc, update a 365 paragraph about the global variables containing exception information. 366 367- bpo-43905: Expanded :func:`~dataclasses.astuple` and 368 :func:`~dataclasses.asdict` docs, warning about deepcopy being applied and 369 providing a workaround. 370 371Tests 372----- 373 374- bpo-19460: Add new Test for 375 :class:`email.mime.nonmultipart.MIMENonMultipart`. 376 377- bpo-45835: Fix race condition in test_queue tests with multiple "feeder" 378 threads. 379 380- bpo-45678: Add tests for scenarios in which 381 :class:`functools.singledispatchmethod` is stacked on top of a method that 382 has already been wrapped by two other decorators. Patch by Alex Waygood. 383 384- bpo-45578: Add tests for :func:`dis.distb` 385 386- bpo-45678: Add tests to ensure that ``functools.singledispatchmethod`` 387 correctly wraps the attributes of the target function. 388 389- bpo-45577: Add subtests for all ``pickle`` protocols in ``test_zoneinfo``. 390 391- bpo-45566: Fix ``test_frozen_pickle`` in ``test_dataclasses`` to check all 392 ``pickle`` versions. 393 394- bpo-43592: :mod:`test.libregrtest` now raises the soft resource limit for 395 the maximum number of file descriptors when the default is too low for our 396 test suite as was often the case on macOS. 397 398- bpo-39679: Add more test cases for `@functools.singledispatchmethod` when 399 combined with `@classmethod` or `@staticmethod`. 400 401- bpo-45400: Fix 402 test_name_error_suggestions_do_not_trigger_for_too_many_locals() of 403 test_exceptions if a directory name contains "a1" (like 404 "Python-3.11.0a1"): use a stricter regular expression. Patch by Victor 405 Stinner. 406 407- bpo-40173: Fix :func:`test.support.import_helper.import_fresh_module`. 408 409- bpo-45280: Add a test case for empty :class:`typing.NamedTuple`. 410 411- bpo-45269: Cover case when invalid ``markers`` type is supplied to 412 ``c_make_encoder``. 413 414- bpo-45128: Fix ``test_multiprocessing_fork`` failure due to 415 ``test_logging`` and ``sys.modules`` manipulation. 416 417- bpo-45209: Fix ``UserWarning: resource_tracker`` warning in 418 ``_test_multiprocessing._TestSharedMemory.test_shared_memory_cleaned_after_process_termination`` 419 420- bpo-45195: Fix test_readline.test_nonascii(): sometimes, the newline 421 character is not written at the end, so don't expect it in the output. 422 Patch by Victor Stinner. 423 424- bpo-45156: Fixes infinite loop on :func:`unittest.mock.seal` of mocks 425 created by :func:`~unittest.create_autospec`. 426 427- bpo-45125: Improves pickling tests and docs of ``SharedMemory`` and 428 ``SharableList`` objects. 429 430- bpo-44860: Update ``test_sysconfig.test_user_similar()`` for the 431 posix_user scheme: ``platlib`` doesn't use :data:`sys.platlibdir`. Patch 432 by Victor Stinner. 433 434- bpo-25130: Add calls of :func:`gc.collect` in tests to support PyPy. 435 436Build 437----- 438 439- bpo-44035: CI now verifies that autoconf files have been regenerated with 440 a current and unpatched autoconf package. 441 442- bpo-33393: Update ``config.guess`` to 2021-06-03 and ``config.sub`` to 443 2021-08-14. ``Makefile`` now has an ``update-config`` target to make 444 updating more convenient. 445 446- bpo-45866: ``make regen-all`` now produces the same output when run from a 447 directory other than the source tree: when building Python out of the 448 source tree. pegen now strips directory of the "generated by pygen from 449 <FILENAME>" header Patch by Victor Stinner. 450 451- bpo-41498: Python now compiles on platforms without ``sigset_t``. Several 452 functions in :mod:`signal` are not available when ``sigset_t`` is missing. 453 454 Based on patch by Roman Yurchak for pyodide. 455 456- bpo-45881: ``setup.py`` now uses ``CC`` from environment first to discover 457 multiarch and cross compile paths. 458 459- bpo-43158: ``setup.py`` now uses values from configure script to build the 460 ``_uuid`` extension module. Configure now detects util-linux's 461 ``libuuid``, too. 462 463- bpo-45571: ``Modules/Setup`` now use ``PY_CFLAGS_NODIST`` instead of 464 ``PY_CFLAGS`` to compile shared modules. 465 466- bpo-45561: Run smelly.py tool from $(srcdir). 467 468- bpo-45532: Update :data:`sys.version` to use ``main`` as fallback 469 information. Patch by Jeong YunWon. 470 471- bpo-45536: The ``configure`` script now checks whether OpenSSL headers and 472 libraries provide required APIs. Most common APIs are verified. The check 473 detects outdated or missing OpenSSL. Failures do not stop configure. 474 475- bpo-45221: Fixed regression in handling of ``LDFLAGS`` and ``CPPFLAGS`` 476 options where :meth:`argparse.parse_known_args` could interpret an option 477 as one of the built-in command line argument, for example ``-h`` for help. 478 479- bpo-45405: Prevent ``internal configure error`` when running ``configure`` 480 with recent versions of non-Apple clang. Patch by David Bohman. 481 482- bpo-45220: Avoid building with the Windows 11 SDK previews automatically. 483 This may be overridden by setting the ``DefaultWindowsSDKVersion`` 484 environment variable before building. 485 486- bpo-45067: The ncurses function extended_color_content was introduced in 487 2017 488 489 (https://invisible-island.net/ncurses/NEWS.html#index-t20170401). The 490 491 ncurses-devel package in CentOS 7 had a older version ncurses resulted in 492 compilation error. For compiling ncurses with extended color support, we 493 verify the version of the ncurses library >= 20170401. 494 495Windows 496------- 497 498- bpo-45901: When installed through the Microsoft Store and set as the 499 default app for :file:`*.py` files, command line arguments will now be 500 passed to Python when invoking a script without explicitly launching 501 Python (that is, ``script.py args`` rather than ``python script.py 502 args``). 503 504- bpo-45616: Fix Python Launcher's ability to distinguish between versions 505 3.1 and 3.10 when either one is explicitly requested. Previously, 3.1 506 would be used if 3.10 was requested but not installed, and 3.10 would be 507 used if 3.1 was requested but 3.10 was installed. 508 509- bpo-45732: Updates bundled Tcl/Tk to 8.6.12. 510 511- bpo-45720: Internal reference to :file:`shlwapi.dll` was dropped to help 512 improve startup time. This DLL will no longer be loaded at the start of 513 every Python process. 514 515- bpo-43652: Update Tcl/Tk to 8.6.11, actually this time. The previous 516 update incorrectly included 8.6.10. 517 518- bpo-45337: venv now warns when the created environment may need to be 519 accessed at a different path, due to redirections, links or junctions. It 520 also now correctly installs or upgrades components when the alternate path 521 is required. 522 523macOS 524----- 525 526- bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12. 527 528- bpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey when 529 using the Tk 8.6.11 provided by python.org macOS installers. Patch by Marc 530 Culler of the Tk project. 531 532- bpo-34602: When building CPython on macOS with ``./configure 533 --with-undefined-behavior-sanitizer --with-pydebug``, the stack size is 534 now quadrupled to allow for the entire test suite to pass. 535 536IDLE 537---- 538 539- bpo-45495: Add context keywords 'case' and 'match' to completions list. 540 541- bpo-45296: On Windows, change exit/quit message to suggest Ctrl-D, which 542 works, instead of <Ctrl-Z Return>, which does not work in IDLE. 543 544- bpo-45193: Make completion boxes appear on Ubuntu again. 545 546Tools/Demos 547----------- 548 549- bpo-44786: Fix a warning in regular expression in the c-analyzer script. 550 551C API 552----- 553 554- bpo-39026: Fix Python.h to build C extensions with Xcode: remove a 555 relative include from ``Include/cpython/pystate.h``. 556 557- bpo-45307: Restore the private C API function 558 :func:`_PyImport_FindExtensionObject`. It will be removed in Python 3.11. 559 560- bpo-44687: :meth:`BufferedReader.peek` no longer raises :exc:`ValueError` 561 when the entire file has already been buffered. 562 563- bpo-44751: Remove ``crypt.h`` include from the public ``Python.h`` header. 564 565 566What's New in Python 3.10.0 final? 567================================== 568 569*Release date: 2021-10-04* 570 571Core and Builtins 572----------------- 573 574- bpo-45121: Fix issue where ``Protocol.__init__`` raises ``RecursionError`` 575 when it's called directly or via ``super()``. Patch provided by Yurii 576 Karabas. 577 578Library 579------- 580 581- bpo-45234: Fixed a regression in :func:`~shutil.copyfile`, 582 :func:`~shutil.copy`, :func:`~shutil.copy2` raising 583 :exc:`FileNotFoundError` when source is a directory, which should raise 584 :exc:`IsADirectoryError` 585 586Documentation 587------------- 588 589- bpo-45216: Remove extra documentation listing methods in ``difflib``. It 590 was rendering twice in pydoc and was outdated in some places. 591 592- bpo-45024: :mod:`collections.abc` documentation has been expanded to 593 explicitly cover how instance and subclass checks work, with additional 594 doctest examples and an exhaustive list of ABCs which test membership 595 purely by presence of the right :term:`special method`\s. Patch by Raymond 596 Hettinger. 597 598Tests 599----- 600 601- bpo-45128: Fix ``test_multiprocessing_fork`` failure due to 602 ``test_logging`` and ``sys.modules`` manipulation. 603 604- bpo-44860: Update ``test_sysconfig.test_user_similar()`` for the 605 posix_user scheme: ``platlib`` doesn't use :data:`sys.platlibdir`. Patch 606 by Victor Stinner. 607 608Build 609----- 610 611- bpo-45067: The ncurses function extended_color_content was introduced in 612 2017 613 614 (https://invisible-island.net/ncurses/NEWS.html#index-t20170401). The 615 616 ncurses-devel package in CentOS 7 had a older version ncurses resulted in 617 compilation error. For compiling ncurses with extended color support, we 618 verify the version of the ncurses library >= 20170401. 619 620IDLE 621---- 622 623- bpo-45193: Make completion boxes appear on Ubuntu again. 624 625C API 626----- 627 628- bpo-45307: Restore the private C API function 629 :func:`_PyImport_FindExtensionObject`. It will be removed in Python 3.11. 630 631 632What's New in Python 3.10.0 release candidate 2? 633================================================ 634 635*Release date: 2021-09-07* 636 637Security 638-------- 639 640- bpo-42278: Replaced usage of :func:`tempfile.mktemp` with 641 :class:`~tempfile.TemporaryDirectory` to avoid a potential race condition. 642 643- bpo-44394: Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to 644 get the fix for the CVE-2013-0340 "Billion Laughs" vulnerability. This 645 copy is most used on Windows and macOS. 646 647- bpo-43124: Made the internal ``putcmd`` function in :mod:`smtplib` 648 sanitize input for presence of ``\r`` and ``\n`` characters to avoid 649 (unlikely) command injection. 650 651Core and Builtins 652----------------- 653 654- bpo-45123: Fix PyAiter_Check to only check for the __anext__ presence (not 655 for __aiter__). Rename PyAiter_Check to PyAIter_Check, PyObject_GetAiter 656 -> PyObject_GetAIter. 657 658- bpo-45018: Fixed pickling of range iterators that iterated for over 2**32 659 times. 660 661- bpo-45000: A :exc:`SyntaxError` is now raised when trying to delete 662 :const:`__debug__`. Patch by Dong-hee Na. 663 664- bpo-44963: Implement ``send()`` and ``throw()`` methods for 665 ``anext_awaitable`` objects. Patch by Pablo Galindo. 666 667- bpo-44962: Fix a race in WeakKeyDictionary, WeakValueDictionary and 668 WeakSet when two threads attempt to commit the last pending removal. This 669 fixes asyncio.create_task and fixes a data loss in asyncio.run where 670 shutdown_asyncgens is not run 671 672- bpo-44954: Fixed a corner case bug where the result of 673 ``float.fromhex('0x.8p-1074')`` was rounded the wrong way. 674 675- bpo-44947: Refine the syntax error for trailing commas in import 676 statements. Patch by Pablo Galindo. 677 678- bpo-44698: Restore behaviour of complex exponentiation with integer-valued 679 exponent of type :class:`float` or :class:`complex`. 680 681- bpo-44885: Correct the ast locations of f-strings with format specs and 682 repeated expressions. Patch by Pablo Galindo 683 684- bpo-44872: Use new trashcan macros (Py_TRASHCAN_BEGIN/END) in 685 frameobject.c instead of the old ones (Py_TRASHCAN_SAFE_BEGIN/END). 686 687- bpo-33930: Fix segmentation fault with deep recursion when cleaning method 688 objects. Patch by Augusto Goulart and Pablo Galindo. 689 690- bpo-25782: Fix bug where ``PyErr_SetObject`` hangs when the current 691 exception has a cycle in its context chain. 692 693- bpo-44856: Fix reference leaks in the error paths of ``update_bases()`` 694 and ``__build_class__``. Patch by Pablo Galindo. 695 696- bpo-44838: Fixed a bug that was causing the parser to raise an incorrect 697 custom :exc:`SyntaxError` for invalid 'if' expressions. Patch by Pablo 698 Galindo. 699 700- bpo-44584: The threading debug (:envvar:`PYTHONTHREADDEBUG` environment 701 variable) is deprecated in Python 3.10 and will be removed in Python 3.12. 702 This feature requires a debug build of Python. Patch by Victor Stinner. 703 704- bpo-39091: Fix crash when using passing a non-exception to a generator's 705 ``throw()`` method. Patch by Noah Oxer 706 707Library 708------- 709 710- bpo-45081: Fix issue when dataclasses that inherit from 711 ``typing.Protocol`` subclasses have wrong ``__init__``. Patch provided by 712 Yurii Karabas. 713 714- bpo-41620: :meth:`~unittest.TestCase.run` now always return a 715 :class:`~unittest.TestResult` instance. Previously it returned ``None`` if 716 the test class or method was decorated with a skipping decorator. 717 718- bpo-43913: Fix bugs in cleaning up classes and modules in :mod:`unittest`: 719 720 * Functions registered with :func:`~unittest.addModuleCleanup` were not called unless the user defines ``tearDownModule()`` in their test module. 721 * Functions registered with :meth:`~unittest.TestCase.addClassCleanup` were not called if ``tearDownClass`` is set to ``None``. 722 * Buffering in :class:`~unittest.TestResult` did not work with functions registered with ``addClassCleanup()`` and ``addModuleCleanup()``. 723 * Errors in functions registered with ``addClassCleanup()`` and ``addModuleCleanup()`` were not handled correctly in buffered and debug modes. 724 * Errors in ``setUpModule()`` and functions registered with ``addModuleCleanup()`` were reported in wrong order. 725 * And several lesser bugs. 726 727- bpo-45030: Fix integer overflow in pickling and copying the range 728 iterator. 729 730- bpo-45001: Made email date parsing more robust against malformed input, 731 namely a whitespace-only ``Date:`` header. Patch by Wouter Bolsterlee. 732 733- bpo-44449: Fix a crash in the signal handler of the :mod:`faulthandler` 734 module: no longer modify the reference count of frame objects. Patch by 735 Victor Stinner. 736 737- bpo-44955: Method :meth:`~unittest.TestResult.stopTestRun` is now always 738 called in pair with method :meth:`~unittest.TestResult.startTestRun` for 739 :class:`~unittest.TestResult` objects implicitly created in 740 :meth:`~unittest.TestCase.run`. Previously it was not called for test 741 methods and classes decorated with a skipping decorator. 742 743- bpo-44935: :mod:`subprocess` on Solaris now also uses 744 :func:`os.posix_spawn()` for better performance. 745 746- bpo-44911: :class:`~unittest.IsolatedAsyncioTestCase` will no longer throw 747 an exception while cancelling leaked tasks. Patch by Bar Harel. 748 749- bpo-44524: Make exception message more useful when subclass from typing 750 special form alias. Patch provided by Yurii Karabas. 751 752- bpo-38956: :class:`argparse.BooleanOptionalAction`'s default value is no 753 longer printed twice when used with 754 :class:`argparse.ArgumentDefaultsHelpFormatter`. 755 756- bpo-44860: Fix the ``posix_user`` scheme in :mod:`sysconfig` to not depend 757 on :data:`sys.platlibdir`. 758 759- bpo-44581: Upgrade bundled pip to 21.2.3 and setuptools to 57.4.0 760 761- bpo-44849: Fix the :func:`os.set_inheritable` function on FreeBSD 14 for 762 file descriptor opened with the :data:`~os.O_PATH` flag: ignore the 763 :data:`~errno.EBADF` error on ``ioctl()``, fallback on the ``fcntl()`` 764 implementation. Patch by Victor Stinner. 765 766- bpo-44605: The @functools.total_ordering() decorator now works with 767 metaclasses. 768 769- bpo-44524: Fixed an issue wherein the ``__name__`` and ``__qualname__`` 770 attributes of subscribed specialforms could be ``None``. 771 772- bpo-44822: :mod:`sqlite3` user-defined functions and aggregators returning 773 :class:`strings <str>` with embedded NUL characters are no longer 774 truncated. Patch by Erlend E. Aasland. 775 776- bpo-44801: Ensure that the :class:`~typing.ParamSpec` variable in Callable 777 can only be substituted with a parameters expression (a list of types, an 778 ellipsis, ParamSpec or Concatenate). 779 780- bpo-27334: The :mod:`sqlite3` context manager now performs a rollback 781 (thus releasing the database lock) if commit failed. Patch by Luca Citi 782 and Erlend E. Aasland. 783 784- bpo-41402: Fix :meth:`email.message.EmailMessage.set_content` when called 785 with binary data and ``7bit`` content transfer encoding. 786 787- bpo-32695: The *compresslevel* and *preset* keyword arguments of 788 :func:`tarfile.open` are now both documented and tested. 789 790- bpo-34990: Fixed a Y2k38 bug in the compileall module where it would fail 791 to compile files with a modification time after the year 2038. 792 793- bpo-38840: Fix ``test___all__`` on platforms lacking a shared memory 794 implementation. 795 796- bpo-26228: pty.spawn no longer hangs on FreeBSD, macOS, and Solaris. 797 798- bpo-33349: lib2to3 now recognizes async generators everywhere. 799 800Documentation 801------------- 802 803- bpo-44957: Promote PEP 604 union syntax by using it where possible. Also, 804 mention ``X | Y`` more prominently in section about ``Union`` and mention 805 ``X | None`` at all in section about ``Optional``. 806 807- bpo-44903: Removed the othergui.rst file, any references to it, and the 808 list of GUI frameworks in the FAQ. In their place I've added links to the 809 Python Wiki `page on GUI frameworks 810 <https://wiki.python.org/moin/GuiProgramming>`. 811 812- bpo-33479: Tkinter documentation has been greatly expanded with new 813 "Architecture" and "Threading model" sections. 814 815- bpo-36700: :mod:`base64` RFC references were updated to point to 816 :rfc:`4648`; a section was added to point users to the new "security 817 considerations" section of the RFC. 818 819- bpo-44756: Reverted automated virtual environment creation on ``make 820 html`` when building documentation. It turned out to be disruptive for 821 downstream distributors. 822 823- bpo-42958: Updated the docstring and docs of :func:`filecmp.cmp` to be 824 more accurate and less confusing especially in respect to *shallow* arg. 825 826- bpo-43066: Added a warning to :mod:`zipfile` docs: filename arg with a 827 leading slash may cause archive to be un-openable on Windows systems. 828 829- bpo-39452: Rewrote ``Doc/library/__main__.rst``. Broadened scope of the 830 document to explicitly discuss and differentiate between ``__main__.py`` 831 in packages versus the ``__name__ == '__main__'`` expression (and the 832 idioms that surround it). 833 834- bpo-27752: Documentation of csv.Dialect is more descriptive. 835 836- bpo-41576: document BaseException in favor of bare except 837 838- bpo-39498: Add a "Security Considerations" index which links to standard 839 library modules that have explicitly documented security considerations. 840 841- bpo-33479: Remove the unqualified claim that tkinter is threadsafe. It has 842 not been true for several years and likely never was. An explanation of 843 what is true may be added later, after more discussion, and possibly after 844 patching _tkinter.c, 845 846Tests 847----- 848 849- bpo-45052: ``WithProcessesTestSharedMemory.test_shared_memory_basics`` 850 test was ignored, because ``self.assertEqual(sms.size, sms2.size)`` line 851 was failing. It is now removed and test is unskipped. 852 853 The main motivation for this line to be removed from the test is that the 854 ``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is 855 decided by the platform. 856 857- bpo-45042: Fixes that test classes decorated with 858 ``@hashlib_helper.requires_hashdigest`` were skipped all the time. 859 860- bpo-45011: Made tests relying on the :mod:`_asyncio` C extension module 861 optional to allow running on alternative Python implementations. Patch by 862 Serhiy Storchaka. 863 864- bpo-44949: Fix auto history tests of test_readline: sometimes, the newline 865 character is not written at the end, so don't expect it in the output. 866 867- bpo-44891: Tests were added to clarify :func:`id` is preserved when ``obj 868 * 1`` is used on :class:`str` and :class:`bytes` objects. Patch by Nikita 869 Sobolev. 870 871- bpo-44852: Add ability to wholesale silence DeprecationWarnings while 872 running the regression test suite. 873 874- bpo-40928: Notify users running test_decimal regression tests on macOS of 875 potential harmless "malloc can't allocate region" messages spewed by 876 test_decimal. 877 878Windows 879------- 880 881- bpo-45007: Update to OpenSSL 1.1.1l in Windows build 882 883macOS 884----- 885 886- bpo-45007: Update macOS installer builds to use OpenSSL 1.1.1l. 887 888- bpo-44689: :meth:`ctypes.util.find_library` now works correctly on macOS 889 11 Big Sur even if Python is built on an older version of macOS. 890 Previously, when built on older macOS systems, ``find_library`` was not 891 able to find macOS system libraries when running on Big Sur due to 892 changes in how system libraries are stored. 893 894 895What's New in Python 3.10.0 release candidate 1? 896================================================ 897 898*Release date: 2021-08-02* 899 900Security 901-------- 902 903- bpo-44600: Fix incorrect line numbers while tracing some failed patterns 904 in :ref:`match <match>` statements. Patch by Charles Burkland. 905 906Core and Builtins 907----------------- 908 909- bpo-44792: Improve syntax errors for if expressions. Patch by Miguel Brito 910 911- bpo-34013: Generalize the invalid legacy statement custom error message 912 (like the one generated when "print" is called without parentheses) to 913 include more generic expressions. Patch by Pablo Galindo 914 915- bpo-44732: Rename ``types.Union`` to ``types.UnionType``. 916 917- bpo-44698: Fix undefined behaviour in complex object exponentiation. 918 919- bpo-44653: Support :mod:`typing` types in parameter substitution in the 920 union type. 921 922- bpo-44676: Add ability to serialise ``types.Union`` objects. Patch 923 provided by Yurii Karabas. 924 925- bpo-44633: Parameter substitution of the union type with wrong types now 926 raises ``TypeError`` instead of returning ``NotImplemented``. 927 928- bpo-44662: Add ``__module__`` to ``types.Union``. This also fixes 929 ``types.Union`` issues with ``typing.Annotated``. Patch provided by Yurii 930 Karabas. 931 932- bpo-44655: Include the name of the type in unset __slots__ attribute 933 errors. Patch by Pablo Galindo 934 935- bpo-44655: Don't include a missing attribute with the same name as the 936 failing one when offering suggestions for missing attributes. Patch by 937 Pablo Galindo 938 939- bpo-44646: Fix the hash of the union type: it no longer depends on the 940 order of arguments. 941 942- bpo-44636: Collapse union of equal types. E.g. the result of ``int | int`` 943 is now ``int``. Fix comparison of the union type with non-hashable 944 objects. E.g. ``int | str == {}`` no longer raises a TypeError. 945 946- bpo-44635: Convert ``None`` to ``type(None)`` in the union type 947 constructor. 948 949- bpo-44589: Mapping patterns in ``match`` statements with two or more equal 950 literal keys will now raise a :exc:`SyntaxError` at compile-time. 951 952- bpo-44606: Fix ``__instancecheck__`` and ``__subclasscheck__`` for the 953 union type. 954 955- bpo-42073: The ``@classmethod`` decorator can now wrap other 956 classmethod-like descriptors. 957 958- bpo-44490: :mod:`typing` now searches for type parameters in 959 ``types.Union`` objects. ``get_type_hints`` will also properly resolve 960 annotations with nested ``types.Union`` objects. Patch provided by Yurii 961 Karabas. 962 963- bpo-44490: Add ``__parameters__`` attribute and ``__getitem__`` operator 964 to ``types.Union``. Patch provided by Yurii Karabas. 965 966- bpo-44472: Fix ltrace functionality when exceptions are raised. Patch by 967 Pablo Galindo 968 969Library 970------- 971 972- bpo-44806: Non-protocol subclasses of :class:`typing.Protocol` ignore now 973 the ``__init__`` method inherited from protocol base classes. 974 975- bpo-44793: Fix checking the number of arguments when subscribe a generic 976 type with ``ParamSpec`` parameter. 977 978- bpo-44784: In importlib.metadata tests, override warnings behavior under 979 expected DeprecationWarnings (importlib_metadata 4.6.3). 980 981- bpo-44667: The :func:`tokenize.tokenize` doesn't incorrectly generate a 982 ``NEWLINE`` token if the source doesn't end with a new line character but 983 the last line is a comment, as the function is already generating a ``NL`` 984 token. Patch by Pablo Galindo 985 986- bpo-44752: :mod:`rcompleter` does not call :func:`getattr` on 987 :class:`property` objects to avoid the side-effect of evaluating the 988 corresponding method. 989 990- bpo-44720: ``weakref.proxy`` objects referencing non-iterators now raise 991 ``TypeError`` rather than dereferencing the null ``tp_iternext`` slot and 992 crashing. 993 994- bpo-44704: The implementation of ``collections.abc.Set._hash()`` now 995 matches that of ``frozenset.__hash__()``. 996 997- bpo-44666: Fixed issue in :func:`compileall.compile_file` when 998 ``sys.stdout`` is redirected. Patch by Stefan Hölzl. 999 1000- bpo-42854: Fixed a bug in the :mod:`_ssl` module that was throwing 1001 :exc:`OverflowError` when using :meth:`_ssl._SSLSocket.write` and 1002 :meth:`_ssl._SSLSocket.read` for a big value of the ``len`` parameter. 1003 Patch by Pablo Galindo 1004 1005- bpo-44353: Refactor ``typing.NewType`` from function into callable class. 1006 Patch provided by Yurii Karabas. 1007 1008- bpo-44524: Add missing ``__name__`` and ``__qualname__`` attributes to 1009 ``typing`` module classes. Patch provided by Yurii Karabas. 1010 1011- bpo-40897: Give priority to using the current class constructor in 1012 :func:`inspect.signature`. Patch by Weipeng Hong. 1013 1014- bpo-44648: Fixed wrong error being thrown by :func:`inspect.getsource` 1015 when examining a class in the interactive session. Instead of 1016 :exc:`TypeError`, it should be :exc:`OSError` with appropriate error 1017 message. 1018 1019- bpo-44608: Fix memory leak in :func:`_tkinter._flatten` if it is called 1020 with a sequence or set, but not list or tuple. 1021 1022- bpo-44559: [Enum] module reverted to 3.9; 3.10 changes pushed until 3.11 1023 1024- bpo-41928: Update :func:`shutil.copyfile` to raise 1025 :exc:`FileNotFoundError` instead of confusing :exc:`IsADirectoryError` 1026 when a path ending with a :const:`os.path.sep` does not exist; 1027 :func:`shutil.copy` and :func:`shutil.copy2` are also affected. 1028 1029- bpo-44566: handle StopIteration subclass raised from 1030 @contextlib.contextmanager generator 1031 1032- bpo-41249: Fixes ``TypedDict`` to work with ``typing.get_type_hints()`` 1033 and postponed evaluation of annotations across modules. 1034 1035- bpo-44461: Fix bug with :mod:`pdb`'s handling of import error due to a 1036 package which does not have a ``__main__`` module 1037 1038- bpo-43625: Fix a bug in the detection of CSV file headers by 1039 :meth:`csv.Sniffer.has_header` and improve documentation of same. 1040 1041- bpo-42892: Fixed an exception thrown while parsing a malformed multipart 1042 email by :class:`email.message.EmailMessage`. 1043 1044- bpo-27827: :meth:`pathlib.PureWindowsPath.is_reserved` now identifies a 1045 greater range of reserved filenames, including those with trailing spaces 1046 or colons. 1047 1048- bpo-38741: :mod:`configparser`: using ']' inside a section header will no 1049 longer cut the section name short at the ']' 1050 1051- bpo-27513: :func:`email.utils.getaddresses` now accepts 1052 :class:`email.header.Header` objects along with string values. Patch by 1053 Zackery Spytz. 1054 1055- bpo-29298: Fix ``TypeError`` when required subparsers without ``dest`` do 1056 not receive arguments. Patch by Anthony Sottile. 1057 1058Documentation 1059------------- 1060 1061- bpo-44740: Replaced occurences of uppercase "Web" and "Internet" with 1062 lowercase versions per the 2016 revised Associated Press Style Book. 1063 1064- bpo-44693: Update the definition of __future__ in the glossary by 1065 replacing the confusing word "pseudo-module" with a more accurate 1066 description. 1067 1068- bpo-35183: Add typical examples to os.path.splitext docs 1069 1070- bpo-30511: Clarify that :func:`shutil.make_archive` is not thread-safe due 1071 to reliance on changing the current working directory. 1072 1073- bpo-44561: Update of three expired hyperlinks in 1074 Doc/distributing/index.rst: "Project structure", "Building and packaging 1075 the project", and "Uploading the project to the Python Packaging Index". 1076 1077- bpo-44613: importlib.metadata is no longer provisional. 1078 1079- bpo-44544: List all kwargs for :func:`textwrap.wrap`, 1080 :func:`textwrap.fill`, and :func:`textwrap.shorten`. Now, there are nav 1081 links to attributes of :class:`TextWrap`, which makes navigation much 1082 easier while minimizing duplication in the documentation. 1083 1084- bpo-44453: Fix documentation for the return type of 1085 :func:`sysconfig.get_path`. 1086 1087Tests 1088----- 1089 1090- bpo-44734: Fixed floating point precision issue in turtle tests. 1091 1092- bpo-44708: Regression tests, when run with -w, are now re-running only the 1093 affected test methods instead of re-running the entire test file. 1094 1095- bpo-44647: Added a permanent Unicode-valued environment variable to 1096 regression tests to ensure they handle this use case in the future. If 1097 your test environment breaks because of that, report a bug to us, and 1098 temporarily set PYTHONREGRTEST_UNICODE_GUARD=0 in your test environment. 1099 1100- bpo-44515: Adjust recently added contextlib tests to avoid assuming the 1101 use of a refcounted GC 1102 1103Windows 1104------- 1105 1106- bpo-44572: Avoid consuming standard input in the :mod:`platform` module 1107 1108- bpo-40263: This is a follow-on bug from 1109 https://bugs.python.org/issue26903. Once that is applied we run into an 1110 off-by-one assertion problem. The assert was not correct. 1111 1112macOS 1113----- 1114 1115- bpo-41972: The framework build's user header path in sysconfig is changed 1116 to add a 'pythonX.Y' component to match distutils's behavior. 1117 1118- bpo-34932: Add socket.TCP_KEEPALIVE support for macOS. Patch by Shane 1119 Harvey. 1120 1121Tools/Demos 1122----------- 1123 1124- bpo-44756: In the Makefile for documentation (:file:`Doc/Makefile`), the 1125 ``build`` rule is dependent on the ``venv`` rule. Therefore, ``html``, 1126 ``latex``, and other build-dependent rules are also now dependent on 1127 ``venv``. The ``venv`` rule only performs an action if ``$(VENVDIR)`` does 1128 not exist. :file:`Doc/README.rst` was updated; most users now only need to 1129 type ``make html``. 1130 1131C API 1132----- 1133 1134- bpo-41103: Reverts removal of the old buffer protocol because they are 1135 part of stable ABI. 1136 1137- bpo-42747: The ``Py_TPFLAGS_HAVE_VERSION_TAG`` type flag now does nothing. 1138 The ``Py_TPFLAGS_HAVE_AM_SEND`` flag (which was added in 3.10) is removed. 1139 Both were unnecessary because it is not possible to have type objects with 1140 the relevant fields missing. 1141 1142 1143What's New in Python 3.10.0 beta 4? 1144=================================== 1145 1146*Release date: 2021-07-10* 1147 1148Security 1149-------- 1150 1151- bpo-41180: Add auditing events to the :mod:`marshal` module, and stop 1152 raising ``code.__init__`` events for every unmarshalled code object. 1153 Directly instantiated code objects will continue to raise an event, and 1154 audit event handlers should inspect or collect the raw marshal data. This 1155 reduces a significant performance overhead when loading from ``.pyc`` 1156 files. 1157 1158Core and Builtins 1159----------------- 1160 1161- bpo-44562: Remove uses of :c:func:`PyObject_GC_Del` in error path when 1162 initializing :class:`types.GenericAlias`. 1163 1164- bpo-41486: Fix a memory consumption and copying performance regression in 1165 earlier 3.10 beta releases if someone used an output buffer larger than 1166 4GiB with zlib.decompress on input data that expands that large. 1167 1168- bpo-44553: Implement GC methods for ``types.Union`` to break reference 1169 cycles and prevent memory leaks. 1170 1171- bpo-44523: Remove the pass-through for :func:`hash` of 1172 :class:`weakref.proxy` objects to prevent unintended consequences when the 1173 original referred object dies while the proxy is part of a hashable 1174 object. Patch by Pablo Galindo. 1175 1176- bpo-44483: Fix a crash in ``types.Union`` objects when creating a union of 1177 an object with bad ``__module__`` field. 1178 1179- bpo-44297: Make sure that the line number is set when entering a 1180 comprehension scope. Ensures that backtraces inclusing generator 1181 expressions show the correct line number. 1182 1183- bpo-44456: Improve the syntax error when mixing positional and keyword 1184 patterns. Patch by Pablo Galindo. 1185 1186- bpo-44368: Improve syntax errors for invalid "as" targets. Patch by Pablo 1187 Galindo 1188 1189- bpo-44317: Improve tokenizer error with improved locations. Patch by Pablo 1190 Galindo. 1191 1192- bpo-43667: Improve Unicode support in non-UTF locales on Oracle Solaris. 1193 This issue does not affect other Solaris systems. 1194 1195Library 1196------- 1197 1198- bpo-44558: Make the implementation consistency of 1199 :func:`~operator.indexOf` between C and Python versions. Patch by Dong-hee 1200 Na. 1201 1202- bpo-34798: Break up paragraph about :class:`pprint.PrettyPrinter` 1203 construction parameters to make it easier to read. 1204 1205- bpo-44516: Update vendored pip to 21.1.3 1206 1207- bpo-44468: :func:`typing.get_type_hints` now finds annotations in classes 1208 and base classes with unexpected ``__module__``. Previously, it skipped 1209 those MRO elements. 1210 1211- bpo-43977: Set the proper :const:`Py_TPFLAGS_MAPPING` and 1212 :const:`Py_TPFLAGS_SEQUENCE` flags for subclasses created before a parent 1213 has been registered as a :class:`collections.abc.Mapping` or 1214 :class:`collections.abc.Sequence`. 1215 1216- bpo-44482: Fix very unlikely resource leak in :mod:`glob` in alternate 1217 Python implementations. 1218 1219- bpo-44466: The :mod:`faulthandler` module now detects if a fatal error 1220 occurs during a garbage collector collection. Patch by Victor Stinner. 1221 1222- bpo-44404: :mod:`tkinter`'s ``after()`` method now supports callables 1223 without the ``__name__`` attribute. 1224 1225- bpo-44458: ``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking 1226 collisions when bz2, lmza or zlib are statically linked. 1227 1228- bpo-44464: Remove exception for flake8 in deprecated importlib.metadata 1229 interfaces. Sync with importlib_metadata 4.6. 1230 1231- bpo-44446: Take into account that ``lineno`` might be ``None`` in 1232 :class:`traceback.FrameSummary`. 1233 1234- bpo-44439: Fix in :meth:`bz2.BZ2File.write` / :meth:`lzma.LZMAFile.write` 1235 methods, when the input data is an object that supports the buffer 1236 protocol, the file length may be wrong. 1237 1238- bpo-44434: _thread.start_new_thread() no longer calls 1239 PyThread_exit_thread() explicitly at the thread exit, the call was 1240 redundant. On Linux with the glibc, pthread_exit() aborts the whole 1241 process if dlopen() fails to open libgcc_s.so file (ex: EMFILE error). 1242 Patch by Victor Stinner. 1243 1244- bpo-44395: Fix :meth:`~email.message.MIMEPart.as_string` to pass unixfrom 1245 properly. Patch by Dong-hee Na. 1246 1247- bpo-34266: Handle exceptions from parsing the arg of :mod:`pdb`'s 1248 run/restart command. 1249 1250- bpo-44077: It's now possible to receive the type of service (ToS), a.k.a. 1251 differentiated services (DS), a.k.a. differenciated services code point 1252 (DSCP) and excplicit congestion notification (ECN) IP header fields with 1253 ``socket.IP_RECVTOS``. 1254 1255- bpo-43024: Improve the help signature of 1256 :func:`traceback.print_exception`, :func:`traceback.format_exception` and 1257 :func:`traceback.format_exception_only`. 1258 1259- bpo-30256: Pass multiprocessing BaseProxy argument ``manager_owned`` 1260 through AutoProxy. 1261 1262Documentation 1263------------- 1264 1265- bpo-44558: Match the docstring and python implementation of 1266 :func:`~operator.countOf` to the behavior of its c implementation. 1267 1268- bpo-38062: Clarify that atexit uses equality comparisons internally. 1269 1270- bpo-40620: Convert examples in tutorial controlflow.rst section 4.3 to be 1271 interpreter-demo style. 1272 1273- bpo-13814: In the Design FAQ, answer "Why don't generators support the 1274 with statement?" 1275 1276- bpo-41621: Document that :class:`collections.defaultdict` parameter 1277 ``default_factory`` defaults to None and is positional-only. 1278 1279Tests 1280----- 1281 1282- bpo-44287: Fix asyncio test_popen() of test_windows_utils by using a 1283 longer timeout. Use military grade battle-tested 1284 :data:`test.support.SHORT_TIMEOUT` timeout rather than a hardcoded timeout 1285 of 10 seconds: it's 30 seconds by default, but it is made longer on slow 1286 buildbots. Patch by Victor Stinner. 1287 1288- bpo-44451: Reset ``DeprecationWarning`` filters in 1289 ``test.test_importlib.test_metadata_api.APITests.test_entry_points_by_index`` 1290 to avoid ``StopIteration`` error if ``DeprecationWarnings`` are ignored. 1291 1292- bpo-30256: Add test for nested queues when using ``multiprocessing`` 1293 shared objects ``AutoProxy[Queue]`` inside ``ListProxy`` and ``DictProxy`` 1294 1295Build 1296----- 1297 1298- bpo-44535: Enable building using a Visual Studio 2022 install on Windows. 1299 1300- bpo-43298: Improved error message when building without a Windows SDK 1301 installed. 1302 1303Windows 1304------- 1305 1306- bpo-44582: Accelerate speed of :mod:`mimetypes` initialization using a 1307 native implementation of the registry scan. 1308 1309- bpo-41299: Fix 16ms jitter when using timeouts in :mod:`threading`, such 1310 as with :meth:`threading.Lock.acquire` or 1311 :meth:`threading.Condition.wait`. 1312 1313C API 1314----- 1315 1316- bpo-44441: :c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to 1317 its initial value at exit. It must be possible to call 1318 :c:func:`PyImport_AppendInittab` or :c:func:`PyImport_ExtendInittab` at 1319 each Python initialization. Patch by Victor Stinner. 1320 1321- bpo-40939: Removed documentation for the removed ``PyParser_*`` C API. 1322 1323 1324What's New in Python 3.10.0 beta 3? 1325=================================== 1326 1327*Release date: 2021-06-17* 1328 1329Core and Builtins 1330----------------- 1331 1332- bpo-44409: Fix error location information for tokenizer errors raised on 1333 initialization of the tokenizer. Patch by Pablo Galindo. 1334 1335- bpo-44396: Fix a possible crash in the tokenizer when raising syntax 1336 errors for unclosed strings. Patch by Pablo Galindo. 1337 1338- bpo-44349: Fix an edge case when displaying text from files with encoding 1339 in syntax errors. Patch by Pablo Galindo. 1340 1341- bpo-44335: Fix a regression when identifying incorrect characters in 1342 syntax errors. Patch by Pablo Galindo 1343 1344- bpo-44304: Fix a crash in the :mod:`sqlite3` module that happened when the 1345 garbage collector clears :class:`sqlite.Statement` objects. Patch by Pablo 1346 Galindo 1347 1348- bpo-44305: Improve error message for ``try`` blocks without ``except`` or 1349 ``finally`` blocks. Patch by Pablo Galindo. 1350 1351- bpo-43833: Emit a deprecation warning if the numeric literal is 1352 immediately followed by one of keywords: and, else, for, if, in, is, or. 1353 Raise a syntax error with more informative message if it is immediately 1354 followed by other keyword or identifier. 1355 1356- bpo-11105: When compiling :class:`ast.AST` objects with recursive 1357 references through :func:`compile`, the interpreter doesn't crash anymore 1358 instead it raises a :exc:`RecursionError`. 1359 1360Library 1361------- 1362 1363- bpo-42972: The _thread.RLock type now fully implement the GC protocol: add 1364 a traverse function and the :const:`Py_TPFLAGS_HAVE_GC` flag. Patch by 1365 Victor Stinner. 1366 1367- bpo-44422: The :func:`threading.enumerate` function now uses a reentrant 1368 lock to prevent a hang on reentrant call. Patch by Victor Stinner. 1369 1370- bpo-44389: Fix deprecation of :data:`ssl.OP_NO_TLSv1_3` 1371 1372- bpo-44362: Improve :mod:`ssl` module's deprecation messages, error 1373 reporting, and documentation for deprecations. 1374 1375- bpo-44342: [Enum] Change pickling from by-value to by-name. 1376 1377- bpo-44356: [Enum] Allow multiple data-type mixins if they are all the 1378 same. 1379 1380- bpo-44351: Restore back :func:`parse_makefile` in 1381 :mod:`distutils.sysconfig` because it behaves differently than the similar 1382 implementation in :mod:`sysconfig`. 1383 1384- bpo-44242: Remove missing flag check from Enum creation and move into a 1385 ``verify`` decorator. 1386 1387- bpo-44246: In ``importlib.metadata``, restore compatibility in the result 1388 from ``Distribution.entry_points`` (``EntryPoints``) to honor expectations 1389 in older implementations and issuing deprecation warnings for these cases: 1390 A. ``EntryPoints`` objects are once again mutable, allowing for 1391 ``sort()`` and other list-based mutation operations. Avoid deprecation 1392 warnings by casting to a mutable sequence (e.g. 1393 ``list(dist.entry_points).sort()``). B. ``EntryPoints`` results once again 1394 allow for access by index. To avoid deprecation warnings, cast the 1395 result to a Sequence first (e.g. ``tuple(dist.entry_points)[0]``). 1396 1397- bpo-44246: In importlib.metadata.entry_points, de-duplication of 1398 distributions no longer requires loading the full metadata for 1399 PathDistribution objects, improving entry point loading performance by 1400 ~10x. 1401 1402- bpo-43853: Improved string handling for :mod:`sqlite3` user-defined 1403 functions and aggregates: 1404 1405 * It is now possible to pass strings with embedded null characters to UDFs 1406 * Conversion failures now correctly raise :exc:`MemoryError` 1407 1408 Patch by Erlend E. Aasland. 1409 1410- bpo-43318: Fix a bug where :mod:`pdb` does not always echo cleared 1411 breakpoints. 1412 1413- bpo-37022: :mod:`pdb` now displays exceptions from ``repr()`` with its 1414 ``p`` and ``pp`` commands. 1415 1416Documentation 1417------------- 1418 1419- bpo-44392: Added a new section in the C API documentation for types used 1420 in type hinting. Documented ``Py_GenericAlias`` and 1421 ``Py_GenericAliasType``. 1422 1423- bpo-38291: Mark ``typing.io`` and ``typing.re`` as deprecated since Python 1424 3.8 in the documentation. They were never properly supported by type 1425 checkers. 1426 1427- bpo-44322: Document that SyntaxError args have a details tuple and that 1428 details are adjusted for errors in f-string field replacement expressions. 1429 1430Tests 1431----- 1432 1433- bpo-44363: Account for address sanitizer in test_capi. test_capi now 1434 passes when run GCC address sanitizer. 1435 1436- bpo-43921: Fix test_ssl.test_wrong_cert_tls13(): use 1437 ``suppress_ragged_eofs=False``, since ``read()`` can raise 1438 :exc:`ssl.SSLEOFError` on Windows. Patch by Victor Stinner. 1439 1440- bpo-43921: Fix test_pha_required_nocert() of test_ssl: catch two more EOF 1441 cases (when the ``recv()`` method returns an empty string). Patch by 1442 Victor Stinner. 1443 1444Build 1445----- 1446 1447- bpo-44381: The Windows build now accepts :envvar:`EnableControlFlowGuard` 1448 set to ``guard`` to enable CFG. 1449 1450IDLE 1451---- 1452 1453- bpo-40128: Mostly fix completions on macOS when not using tcl/tk 8.6.11 1454 (as with 3.9). The added update_idletask call should be harmless and 1455 possibly helpful otherwise. 1456 1457- bpo-33962: Move the indent space setting from the Font tab to the new 1458 Windows tab. Patch by Mark Roseman and Terry Jan Reedy. 1459 1460- bpo-40468: Split the settings dialog General tab into Windows and Shell/ED 1461 tabs. Move help sources, which extend the Help menu, to the Extensions 1462 tab. Make space for new options and shorten the dialog. The latter makes 1463 the dialog better fit small screens. 1464 1465C API 1466----- 1467 1468- bpo-43795: The list in :ref:`stable-abi-list` now shows the public name 1469 :c:struct:`PyFrameObject` rather than ``_frame``. The non-existing entry 1470 ``_node`` no longer appears in the list. 1471 1472- bpo-44378: :c:func:`Py_IS_TYPE` no longer uses :c:func:`Py_TYPE` to avoid 1473 a compiler warning: no longer cast ``const PyObject*`` to ``PyObject*``. 1474 Patch by Victor Stinner. 1475 1476 1477What's New in Python 3.10.0 beta 2? 1478=================================== 1479 1480*Release date: 2021-05-31* 1481 1482Security 1483-------- 1484 1485- bpo-44022: mod:`http.client` now avoids infinitely reading potential HTTP 1486 headers after a ``100 Continue`` status response from the server. 1487 1488Core and Builtins 1489----------------- 1490 1491- bpo-43667: Improve Unicode support in non-UTF locales on Oracle Solaris. 1492 This issue does not affect other Solaris systems. 1493 1494- bpo-44232: Fix a regression in :func:`type` when a metaclass raises an 1495 exception. The C function :c:func:`type_new` must properly report the 1496 exception when a metaclass constructor raises an exception and the winner 1497 class is not the metaclass. Patch by Victor Stinner. 1498 1499- bpo-44201: Avoid side effects of checking for specialized syntax errors in 1500 the REPL that was causing it to ask for extra tokens after a syntax error 1501 had been detected. Patch by Pablo Galindo 1502 1503- bpo-44184: Fix a crash at Python exit when a deallocator function removes 1504 the last strong reference to a heap type. Patch by Victor Stinner. 1505 1506- bpo-44180: The parser doesn't report generic syntax errors that happen in 1507 a position further away that the one it reached in the first pass. Patch 1508 by Pablo Galindo 1509 1510- bpo-44168: Fix error message in the parser involving keyword arguments 1511 with invalid expressions. Patch by Pablo Galindo 1512 1513- bpo-44143: Fixed a crash in the parser that manifest when raising 1514 tokenizer errors when an existing exception was present. Patch by Pablo 1515 Galindo. 1516 1517- bpo-44114: Fix incorrect dictkeys_reversed and dictitems_reversed function 1518 signatures in C code, which broke webassembly builds. 1519 1520- bpo-43149: Corrent the syntax error message regarding multiple exception 1521 types to not refer to "exception groups". Patch by Pablo Galindo 1522 1523- bpo-44056: Syntax errors when default ``except`` is not the last 1524 ``except`` are reported with the correct location. Patch by Mark Shannon. 1525 1526- bpo-43822: The parser will prioritize tokenizer errors over custom syntax 1527 errors when raising exceptions. Patch by Pablo Galindo. 1528 1529- bpo-28146: Fix a confusing error message in :func:`str.format`. 1530 1531Library 1532------- 1533 1534- bpo-44254: On Mac, give turtledemo button text a color that works on both 1535 light or dark background. Programmers cannot control the latter. 1536 1537- bpo-38693: Prefer f-strings to ``.format`` in importlib.resources. 1538 1539- bpo-33693: Importlib.metadata now prefers f-strings to .format. 1540 1541- bpo-44241: Incorporate minor tweaks from importlib_metadata 4.1: 1542 SimplePath protocol, support for Metadata 2.2. 1543 1544- bpo-44210: Make importlib.metadata._meta.PackageMetadata public. 1545 1546- bpo-43643: Declare readers.MultiplexedPath.name as a property per the 1547 spec. 1548 1549- bpo-33433: For IPv4 mapped IPv6 addresses (:rfc:`4291` Section 2.5.5.2), 1550 the :mod:`ipaddress.IPv6Address.is_private` check is deferred to the 1551 mapped IPv4 address. This solves a bug where public mapped IPv4 addresses 1552 were considered private by the IPv6 check. 1553 1554- bpo-44145: :mod:`hmac` computations were not releasing the GIL while 1555 calling the OpenSSL ``HMAC_Update`` C API (a new feature in 3.9). This 1556 unintentionally prevented parallel computation as other :mod:`hashlib` 1557 algorithms support. 1558 1559- bpo-37788: Fix a reference leak when a Thread object is never joined. 1560 1561- bpo-38908: Subclasses of ``typing.Protocol`` which only have data 1562 variables declared will now raise a ``TypeError`` when checked with 1563 ``isinstance`` unless they are decorated with :func:`runtime_checkable`. 1564 Previously, these checks passed silently. Patch provided by Yurii Karabas. 1565 1566- bpo-44098: ``typing.ParamSpec`` will no longer be found in the 1567 ``__parameters__`` of most :mod:`typing` generics except in valid use 1568 locations specified by :pep:`612`. This prevents incorrect usage like 1569 ``typing.List[P][int]``. This change means incorrect usage which may have 1570 passed silently in 3.10 beta 1 and earlier will now error. 1571 1572- bpo-44089: Allow subclassing ``csv.Error`` in 3.10 (it was allowed in 3.9 1573 and earlier but was disallowed in early versions of 3.10). 1574 1575- bpo-44059: Register the SerenityOS Browser in the :mod:`webbrowser` 1576 module. 1577 1578- bpo-36515: The :mod:`hashlib` module no longer does unaligned memory 1579 accesses when compiled for ARM platforms. 1580 1581- bpo-44018: random.seed() no longer mutates bytearray inputs. 1582 1583- bpo-38352: Add ``IO``, ``BinaryIO``, ``TextIO``, ``Match``, and 1584 ``Pattern`` to ``typing.__all__``. Patch by Jelle Zijlstra. 1585 1586- bpo-43972: When :class:`http.server.SimpleHTTPRequestHandler` sends a 1587 ``301 (Moved Permanently)`` for a directory path not ending with `/`, add 1588 a ``Content-Length: 0`` header. This improves the behavior for certain 1589 clients. 1590 1591- bpo-28528: Fix a bug in :mod:`pdb` where :meth:`~pdb.Pdb.checkline` raises 1592 :exc:`AttributeError` if it is called after :meth:`~pdb.Pdb.reset`. 1593 1594- bpo-43650: Fix :exc:`MemoryError` in :func:`shutil.unpack_archive` which 1595 fails inside :func:`shutil._unpack_zipfile` on large files. Patch by Igor 1596 Bolshakov. 1597 1598- bpo-41730: ``DeprecationWarning`` is now raised when importing 1599 :mod:`tkinter.tix`, which has been deprecated in documentation since 1600 Python 3.6. 1601 1602Documentation 1603------------- 1604 1605- bpo-42392: Document the deprecation and removal of the ``loop`` parameter 1606 for many functions and classes in :mod:`asyncio`. 1607 1608- bpo-44195: Corrected references to ``TraversableResources`` in docs. There 1609 is no ``TraversableReader``. 1610 1611- bpo-41963: Document that ``ConfigParser`` strips off comments when reading 1612 configuration files. 1613 1614- bpo-44072: Correct where in the numeric ABC hierarchy ``**`` support is 1615 added, i.e., in numbers.Complex, not numbers.Integral. 1616 1617- bpo-43558: Add the remark to :mod:`dataclasses` documentation that the 1618 :meth:`__init__` of any base class has to be called in 1619 :meth:`__post_init__`, along with a code example. 1620 1621- bpo-44025: Clarify when '_' in match statements is a keyword, and when 1622 not. 1623 1624Tests 1625----- 1626 1627- bpo-31904: Ignore error string case in test_py_compile 1628 ``test_file_not_exists()``. 1629 1630- bpo-42083: Add test to check that ``PyStructSequence_NewType`` accepts a 1631 ``PyStructSequence_Desc`` with ``doc`` field set to ``NULL``. 1632 1633- bpo-35753: Fix crash in doctest when doctest parses modules that include 1634 unwrappable functions by skipping those functions. 1635 1636Build 1637----- 1638 1639- bpo-41282: Fix broken ``make install`` that caused standard library 1640 extension modules to be unnecessarily and incorrectly rebuilt during the 1641 install phase of cpython. 1642 1643Windows 1644------- 1645 1646- bpo-42686: Build :mod:`sqlite3` with math functions enabled. Patch by 1647 Erlend E. Aasland. 1648 1649macOS 1650----- 1651 1652- bpo-43109: Allow --with-lto configure option to work with Apple-supplied 1653 Xcode or Command Line Tools. 1654 1655IDLE 1656---- 1657 1658- bpo-41611: Avoid uncaught exceptions in 1659 ``AutoCompleteWindow.winconfig_event()``. 1660 1661- bpo-41611: Fix IDLE sometimes freezing upon tab-completion on macOS. 1662 1663- bpo-44010: Highlight the new :ref:`match <match>` statement's :ref:`soft 1664 keywords <soft-keywords>`: :keyword:`match`, :keyword:`case <match>`, and 1665 :keyword:`_ <wildcard-patterns>`. However, this highlighting is not 1666 perfect and will be incorrect in some rare cases, including some ``_``-s 1667 in ``case`` patterns. 1668 1669- bpo-44026: Include interpreter's typo fix suggestions in message line for 1670 NameErrors and AttributeErrors. Patch by E. Paine. 1671 1672Tools/Demos 1673----------- 1674 1675- bpo-44074: Make patchcheck automatically detect the correct base branch 1676 name (previously it was hardcoded to 'master') 1677 1678C API 1679----- 1680 1681- bpo-43795: The undocumented function :c:func:`Py_FrozenMain` is removed 1682 from the Limited API. 1683 1684- bpo-43795: :c:func:`PyCodec_Unregister` is now properly exported as a 1685 function in the Windows Stable ABI DLL. 1686 1687 1688What's New in Python 3.10.0 beta 1? 1689=================================== 1690 1691*Release date: 2021-05-03* 1692 1693Security 1694-------- 1695 1696- bpo-43434: Creating :class:`sqlite3.Connection` objects now also produces 1697 ``sqlite3.connect`` and ``sqlite3.connect/handle`` :ref:`auditing events 1698 <auditing>`. Previously these events were only produced by 1699 :func:`sqlite3.connect` calls. Patch by Erlend E. Aasland. 1700 1701- bpo-43998: The :mod:`ssl` module sets more secure cipher suites defaults. 1702 Ciphers without forward secrecy and with SHA-1 MAC are disabled by 1703 default. Security level 2 prohibits weak RSA, DH, and ECC keys with less 1704 than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum 1705 protocol version TLS 1.2. Settings are based on Hynek Schlawack's 1706 research. 1707 1708- bpo-43882: The presence of newline or tab characters in parts of a URL 1709 could allow some forms of attacks. 1710 1711 Following the controlling specification for URLs defined by WHATWG 1712 :func:`urllib.parse` now removes ASCII newlines and tabs from URLs, 1713 preventing such attacks. 1714 1715- bpo-43472: Ensures interpreter-level audit hooks receive the 1716 ``cpython.PyInterpreterState_New`` event when called through the 1717 ``_xxsubinterpreters`` module. 1718 1719- bpo-43362: Fix invalid free in _sha3 module. The issue was introduced in 1720 3.10.0a1. Python 3.9 and earlier are not affected. 1721 1722- bpo-43762: Add audit events for :func:`sqlite3.connect/handle`, 1723 :meth:`sqlite3.Connection.enable_load_extension`, and 1724 :meth:`sqlite3.Connection.load_extension`. Patch by Erlend E. Aasland. 1725 1726- bpo-43756: Add new audit event ``glob.glob/2`` to incorporate the new 1727 *root_dir* and *dir_fd* arguments added to :func:`glob.glob` and 1728 :func:`glob.iglob`. 1729 1730- bpo-36384: :mod:`ipaddress` module no longer accepts any leading zeros in 1731 IPv4 address strings. Leading zeros are ambiguous and interpreted as octal 1732 notation by some libraries. For example the legacy function 1733 :func:`socket.inet_aton` treats leading zeros as octal notatation. glibc 1734 implementation of modern :func:`~socket.inet_pton` does not accept any 1735 leading zeros. For a while the :mod:`ipaddress` module used to accept 1736 ambiguous leading zeros. 1737 1738- bpo-43075: Fix Regular Expression Denial of Service (ReDoS) vulnerability 1739 in :class:`urllib.request.AbstractBasicAuthHandler`. The ReDoS-vulnerable 1740 regex has quadratic worst-case complexity and it allows cause a denial of 1741 service when identifying crafted invalid RFCs. This ReDoS issue is on the 1742 client side and needs remote attackers to control the HTTP server. 1743 1744- bpo-42800: Audit hooks are now fired for frame.f_code, traceback.tb_frame, 1745 and generator code/frame attribute access. 1746 1747- bpo-37363: Add audit events to the :mod:`http.client` module. 1748 1749Core and Builtins 1750----------------- 1751 1752- bpo-43977: Prevent classes being both a sequence and a mapping when 1753 pattern matching. 1754 1755- bpo-43977: Use :c:member:`~PyTypeObject.tp_flags` on the class object to 1756 determine if the subject is a sequence or mapping when pattern matching. 1757 Avoids the need to import :mod:`collections.abc` when pattern matching. 1758 1759- bpo-43892: Restore proper validation of complex literal value patterns 1760 when parsing :keyword:`!match` blocks. 1761 1762- bpo-43933: Set frame.f_lineno to the line number of the 'with' kweyword 1763 when executing the call to ``__exit__``. 1764 1765- bpo-43933: If the current position in a frame has no line number then set 1766 the f_lineno attribute to None, instead of -1, to conform to PEP 626. This 1767 should not normally be possible, but might occur in some unusual 1768 circumstances. 1769 1770- bpo-43963: Importing the :mod:`_signal` module in a subinterpreter has no 1771 longer side effects. 1772 1773- bpo-42739: The internal representation of line number tables is changed to 1774 not use sentinels, and an explicit length parameter is added to the out of 1775 process API function ``PyLineTable_InitAddressRange``. This makes the 1776 handling of line number tables more robust in some circumstances. 1777 1778- bpo-43908: Make :mod:`re` types immutable. Patch by Erlend E. Aasland. 1779 1780- bpo-43908: Make the :class:`array.array` type immutable. Patch by Erlend 1781 E. Aasland. 1782 1783- bpo-43901: Change class and module objects to lazy-create empty 1784 annotations dicts on demand. The annotations dicts are stored in the 1785 object's __dict__ for backwards compatibility. 1786 1787- bpo-43892: Match patterns now use new dedicated AST nodes (``MatchValue``, 1788 ``MatchSingleton``, ``MatchSequence``, ``MatchStar``, ``MatchMapping``, 1789 ``MatchClass``) rather than reusing expression AST nodes. ``MatchAs`` and 1790 ``MatchOr`` are now defined as pattern nodes rather than as expression 1791 nodes. Patch by Nick Coghlan. 1792 1793- bpo-42725: Usage of ``await``/``yield``/``yield from`` and named 1794 expressions within an annotation is now forbidden when PEP 563 is 1795 activated. 1796 1797- bpo-43754: When performing structural pattern matching (:pep:`634`), 1798 captured names are now left unbound until the *entire* pattern has matched 1799 successfully. 1800 1801- bpo-42737: Annotations for complex targets (everything beside simple 1802 names) no longer cause any runtime effects with ``from __future__ import 1803 annotations``. 1804 1805- bpo-43914: :exc:`SyntaxError` exceptions raised by the interpreter will 1806 highlight the full error range of the expression that consistutes the 1807 syntax error itself, instead of just where the problem is detected. Patch 1808 by Pablo Galindo. 1809 1810- bpo-38605: Revert making ``from __future__ import annotations`` the 1811 default. This follows the Steering Council decision to postpone PEP 563 1812 changes to at least Python 3.11. See the original email for more 1813 information regarding the decision: 1814 https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/. 1815 Patch by Pablo Galindo. 1816 1817- bpo-43475: Hashes of NaN values now depend on object identity. Formerly, 1818 they always hashed to 0 even though NaN values are not equal to one 1819 another. Having the same hash for unequal values caused pile-ups in hash 1820 tables. 1821 1822- bpo-43859: Improve the error message for :exc:`IndentationError` 1823 exceptions. Patch by Pablo Galindo 1824 1825- bpo-41323: Constant tuple folding in bytecode optimizer now reuses tuple 1826 in constant table. 1827 1828- bpo-43846: Data stack usage is much reduced for large literal and call 1829 expressions. 1830 1831- bpo-38530: When printing :exc:`NameError` raised by the interpreter, 1832 :c:func:`PyErr_Display` will offer suggestions of similar variable names 1833 in the function that the exception was raised from. Patch by Pablo Galindo 1834 1835- bpo-43823: Improve syntax errors for invalid dictionary literals. Patch by 1836 Pablo Galindo. 1837 1838- bpo-43822: Improve syntax errors in the parser for missing commas between 1839 expressions. Patch by Pablo Galindo. 1840 1841- bpo-43798: :class:`ast.alias` nodes now include source location metadata 1842 attributes e.g. lineno, col_offset. 1843 1844- bpo-43797: Improve ``SyntaxError`` error messages for invalid comparisons. 1845 Patch by Pablo Galindo. 1846 1847- bpo-43760: Move the flag for checking whether tracing is enabled to the C 1848 stack, from the heap. Should speed up dispatch in the interpreter. 1849 1850- bpo-43682: Static methods (:func:`@staticmethod <staticmethod>`) and class 1851 methods (:func:`@classmethod <classmethod>`) now inherit the method 1852 attributes (``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, 1853 ``__annotations__``) and have a new ``__wrapped__`` attribute. Patch by 1854 Victor Stinner. 1855 1856- bpo-43751: Fixed a bug where ``anext(ait, default)`` would erroneously 1857 return None. 1858 1859- bpo-42128: :data:`~object.__match_args__` is no longer allowed to be a 1860 list. 1861 1862- bpo-43683: Add GEN_START opcode. Marks start of generator, including 1863 async, or coroutine and handles sending values to a newly created 1864 generator or coroutine. 1865 1866- bpo-43105: Importlib now resolves relative paths when creating module spec 1867 objects from file locations. 1868 1869- bpo-43682: Static methods (:func:`@staticmethod <staticmethod>`) are now 1870 callable as regular functions. Patch by Victor Stinner. 1871 1872- bpo-42609: Prevented crashes in the AST validator and optimizer when 1873 compiling some absurdly long expressions like ``"+0"*1000000``. 1874 :exc:`RecursionError` is now raised instead. 1875 1876- bpo-38530: When printing :exc:`AttributeError`, :c:func:`PyErr_Display` 1877 will offer suggestions of similar attribute names in the object that the 1878 exception was raised from. Patch by Pablo Galindo 1879 1880Library 1881------- 1882 1883- bpo-44015: In @dataclass(), raise a TypeError if KW_ONLY is specified more 1884 than once. 1885 1886- bpo-25478: Added a *total()* method to collections.Counter() to compute 1887 the sum of the counts. 1888 1889- bpo-43733: Change :class:`netrc.netrc` to use UTF-8 encoding before using 1890 locale encoding. 1891 1892- bpo-43979: Removed an unnecessary list comprehension before looping from 1893 :func:`urllib.parse.parse_qsl`. Patch by Christoph Zwerschke and Dong-hee 1894 Na. 1895 1896- bpo-43993: Update bundled pip to 21.1.1. 1897 1898- bpo-43957: [Enum] Deprecate ``TypeError`` when non-member is used in a 1899 containment check; In 3.12 ``True`` or ``False`` will be returned instead, 1900 and containment will return ``True`` if the value is either a member of 1901 that enum or one of its members' value. 1902 1903- bpo-42904: For backwards compatibility with previous minor versions of 1904 Python, if :func:`typing.get_type_hints` receives no namespace dictionary 1905 arguments, :func:`typing.get_type_hints` will search through the global 1906 then local namespaces during evaluation of stringized type annotations 1907 (string forward references) inside a class. 1908 1909- bpo-43945: [Enum] Deprecate non-standard mixin format() behavior: in 3.12 1910 the enum member, not the member's value, will be used for format() calls. 1911 1912- bpo-41139: Deprecate undocumented ``cgi.log()`` API. 1913 1914- bpo-43937: Fixed the :mod:`turtle` module working with non-default root 1915 window. 1916 1917- bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0 1918 1919- bpo-43907: Fix a bug in the pure-Python pickle implementation when using 1920 protocol 5, where bytearray instances that occur several time in the 1921 pickled object graph would incorrectly unpickle into repeated copies of 1922 the bytearray object. 1923 1924- bpo-43926: In ``importlib.metadata``, provide a uniform interface to 1925 ``Description``, allow for any field to be encoded with multiline values, 1926 remove continuation lines from multiline values, and add a ``.json`` 1927 property for easy access to the PEP 566 JSON-compatible form. Sync with 1928 ``importlib_metadata 4.0``. 1929 1930- bpo-43920: OpenSSL 3.0.0: :meth:`~ssl.SSLContext.load_verify_locations` 1931 now returns a consistent error message when cadata contains no valid 1932 certificate. 1933 1934- bpo-43607: :mod:`urllib` can now convert Windows paths with ``\\?\`` 1935 prefixes into URL paths. 1936 1937- bpo-43817: Add :func:`inspect.get_annotations`, which safely computes the 1938 annotations defined on an object. It works around the quirks of accessing 1939 the annotations from various types of objects, and makes very few 1940 assumptions about the object passed in. :func:`inspect.get_annotations` 1941 can also correctly un-stringize stringized annotations. 1942 1943 :func:`inspect.signature`, :func:`inspect.from_callable`, and 1944 :func:`inspect.from_function` now call :func:`inspect.get_annotations` to 1945 retrieve annotations. This means :func:`inspect.signature` and 1946 :func:`inspect.from_callable` can now un-stringize stringized annotations, 1947 too. 1948 1949- bpo-43284: platform.win32_ver derives the windows version from 1950 sys.getwindowsversion().platform_version which in turn derives the version 1951 from kernel32.dll (which can be of a different version than Windows 1952 itself). Therefore change the platform.win32_ver to determine the version 1953 using the platform module's _syscmd_ver private function to return an 1954 accurate version. 1955 1956- bpo-42854: The :mod:`ssl` module now uses ``SSL_read_ex`` and 1957 ``SSL_write_ex`` internally. The functions support reading and writing of 1958 data larger than 2 GB. Writing zero-length data no longer fails with a 1959 protocol violation error. 1960 1961- bpo-42333: Port ``_ssl`` extension module to multiphase initialization. 1962 1963- bpo-43880: :mod:`ssl` now raises DeprecationWarning for OP_NO_SSL/TLS* 1964 options, old TLS versions, old protocols, and other features that have 1965 been deprecated since Python 3.6, 3.7, or OpenSSL 1.1.0. 1966 1967- bpo-41559: :pep:`612` is now implemented purely in Python; builtin 1968 ``types.GenericAlias`` objects no longer include ``typing.ParamSpec`` in 1969 ``__parameters__`` (with the exception of ``collections.abc.Callable``\ 's 1970 ``GenericAlias``). This means previously invalid uses of ``ParamSpec`` 1971 (such as ``list[P]``) which worked in earlier versions of Python 3.10 1972 alpha, will now raise ``TypeError`` during substitution. 1973 1974- bpo-43867: The :mod:`multiprocessing` ``Server`` class now explicitly 1975 catches :exc:`SystemExit` and closes the client connection in this case. 1976 It happens when the ``Server.serve_client()`` method reaches the end of 1977 file (EOF). 1978 1979- bpo-40443: Remove unused imports: pyclbr no longer uses copy, and typing 1980 no longer uses ast. Patch by Victor Stinner. 1981 1982- bpo-43820: Remove an unneeded copy of the namespace passed to 1983 dataclasses.make_dataclass(). 1984 1985- bpo-43787: Add ``__iter__()`` method to :class:`bz2.BZ2File`, 1986 :class:`gzip.GzipFile`, and :class:`lzma.LZMAFile`. It makes iterating 1987 them about 2x faster. Patch by Inada Naoki. 1988 1989- bpo-43680: Deprecate io.OpenWrapper and _pyio.OpenWrapper: use io.open and 1990 _pyio.open instead. Until Python 3.9, _pyio.open was not a static method 1991 and builtins.open was set to OpenWrapper to not become a bound method when 1992 set to a class variable. _io.open is a built-in function whereas 1993 _pyio.open is a Python function. In Python 3.10, _pyio.open() is now a 1994 static method, and builtins.open() is now io.open(). 1995 1996- bpo-43680: The Python :func:`_pyio.open` function becomes a static method 1997 to behave as :func:`io.open` built-in function: don't become a bound 1998 method when stored as a class variable. It becomes possible since static 1999 methods are now callable in Python 3.10. Moreover, 2000 :func:`_pyio.OpenWrapper` becomes a simple alias to :func:`_pyio.open`. 2001 Patch by Victor Stinner. 2002 2003- bpo-41515: Fix :exc:`KeyError` raised in :func:`typing.get_type_hints` due 2004 to synthetic modules that don't appear in ``sys.modules``. 2005 2006- bpo-43776: When :class:`subprocess.Popen` args are provided as a string or 2007 as :class:`pathlib.Path`, the Popen instance repr now shows the right 2008 thing. 2009 2010- bpo-42248: [Enum] ensure exceptions raised in ``_missing__`` are released 2011 2012- bpo-43744: fix issue with enum member name matching the start of a private 2013 variable name 2014 2015- bpo-43772: Fixed the return value of ``TypeVar.__ror__``. Patch by Jelle 2016 Zijlstra. 2017 2018- bpo-43764: Add match_args parameter to @dataclass decorator to allow 2019 suppression of __match_args__ generation. 2020 2021- bpo-43799: OpenSSL 3.0.0: define ``OPENSSL_API_COMPAT`` 1.1.1 to suppress 2022 deprecation warnings. Python requires OpenSSL 1.1.1 APIs. 2023 2024- bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a 2025 result, an already-mocked object cannot have an attribute mocked using 2026 ``autospec=True`` or be the subject of a ``create_autospec(...)`` call. 2027 This can uncover bugs in tests since these Mock-derived Mocks will always 2028 pass certain tests (e.g. :func:`isinstance`) and builtin assert functions 2029 (e.g. assert_called_once_with) will unconditionally pass. 2030 2031- bpo-43794: Add :data:`ssl.OP_IGNORE_UNEXPECTED_EOF` constants (OpenSSL 2032 3.0.0) 2033 2034- bpo-43785: Improve ``bz2.BZ2File`` performance by removing the RLock from 2035 BZ2File. This makes BZ2File thread unsafe in the face of multiple 2036 simultaneous readers or writers, just like its equivalent classes in 2037 :mod:`gzip` and :mod:`lzma` have always been. Patch by Inada Naoki. 2038 2039- bpo-43789: OpenSSL 3.0.0: Don't call the password callback function a 2040 second time when first call has signaled an error condition. 2041 2042- bpo-43788: The header files for :mod:`ssl` error codes are now OpenSSL 2043 version-specific. Exceptions will now show correct reason and library 2044 codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's 2045 text file with error codes. 2046 2047- bpo-43766: Implement :pep:`647` in the :mod:`typing` module by adding 2048 :data:`TypeGuard`. 2049 2050- bpo-25264: :func:`os.path.realpath` now accepts a *strict* keyword-only 2051 argument. When set to ``True``, :exc:`OSError` is raised if a path doesn't 2052 exist or a symlink loop is encountered. 2053 2054- bpo-43780: In ``importlib.metadata``, incorporate changes from 2055 importlib_metadata 3.10: Add mtime-based caching during distribution 2056 discovery. Flagged use of dict result from ``entry_points()`` as 2057 deprecated. 2058 2059- bpo-47383: The ``P.args`` and ``P.kwargs`` attributes of 2060 :class:`typing.ParamSpec` are now instances of the new classes 2061 :class:`typing.ParamSpecArgs` and :class:`typing.ParamSpecKwargs`, which 2062 enables a more useful ``repr()``. Patch by Jelle Zijlstra. 2063 2064- bpo-43731: Add an ``encoding`` parameter :func:`logging.fileConfig()`. 2065 2066- bpo-43712: Add ``encoding`` and ``errors`` parameters to 2067 :func:`fileinput.input` and :class:`fileinput.FileInput`. 2068 2069- bpo-38659: A ``simple_enum`` decorator is added to the ``enum`` module to 2070 convert a normal class into an Enum. ``test_simple_enum`` added to test 2071 simple enums against a corresponding normal Enum. Standard library 2072 modules updated to use ``simple_enum``. 2073 2074- bpo-43764: Fix an issue where :data:`~object.__match_args__` generation 2075 could fail for some :mod:`dataclasses`. 2076 2077- bpo-43752: Fix :mod:`sqlite3` regression for zero-sized blobs with 2078 converters, where ``b""`` was returned instead of ``None``. The regression 2079 was introduced by GH-24723. Patch by Erlend E. Aasland. 2080 2081- bpo-43655: :mod:`tkinter` dialog windows are now recognized as dialogs by 2082 window managers on macOS and X Window. 2083 2084- bpo-43723: The following ``threading`` methods are now deprecated and 2085 should be replaced: 2086 2087 - ``currentThread`` => :func:`threading.current_thread` 2088 2089 - ``activeCount`` => :func:`threading.active_count` 2090 2091 - ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all` 2092 2093 - ``Event.isSet`` => :meth:`threading.Event.is_set` 2094 2095 - ``Thread.setName`` => :attr:`threading.Thread.name` 2096 2097 - ``thread.getName`` => :attr:`threading.Thread.name` 2098 2099 - ``Thread.isDaemon`` => :attr:`threading.Thread.daemon` 2100 2101 - ``Thread.setDaemon`` => :attr:`threading.Thread.daemon` 2102 2103 Patch by Jelle Zijlstra. 2104 2105- bpo-2135: Deprecate find_module() and find_loader() implementations in 2106 importlib and zipimport. 2107 2108- bpo-43534: :func:`turtle.textinput` and :func:`turtle.numinput` create now 2109 a transient window working on behalf of the canvas window. 2110 2111- bpo-43532: Add the ability to specify keyword-only fields to dataclasses. 2112 These fields will become keyword-only arguments to the generated __init__. 2113 2114- bpo-43522: Fix problem with 2115 :attr:`~ssl.SSLContext.hostname_checks_common_name`. OpenSSL does not copy 2116 hostflags from *struct SSL_CTX* to *struct SSL*. 2117 2118- bpo-8978: Improve error message for :func:`tarfile.open` when :mod:`lzma` 2119 / :mod:`bz2` are unavailable. Patch by Anthony Sottile. 2120 2121- bpo-42967: Allow :class:`bytes` ``separator`` argument in 2122 ``urllib.parse.parse_qs`` and ``urllib.parse.parse_qsl`` when parsing 2123 :class:`str` query strings. Previously, this raised a ``TypeError``. 2124 2125- bpo-43296: Improve :mod:`sqlite3` error handling: ``sqlite3_value_blob()`` 2126 errors that set ``SQLITE_NOMEM`` now raise :exc:`MemoryError`. Patch by 2127 Erlend E. Aasland. 2128 2129- bpo-43312: New functions :func:`sysconfig.get_preferred_scheme` and 2130 :func:`sysconfig.get_default_scheme` are added to query a platform for its 2131 preferred "user", "home", and "prefix" (default) scheme names. 2132 2133- bpo-43265: Improve :meth:`sqlite3.Connection.backup` error handling. The 2134 error message for non-existent target database names is now ``unknown 2135 database <database name>`` instead of ``SQL logic error``. Patch by Erlend 2136 E. Aasland. 2137 2138- bpo-41282: Install schemes in :mod:`distutils.command.install` are now 2139 loaded from :mod:`sysconfig`. 2140 2141- bpo-41282: :mod:`distutils.sysconfig` has been merged to :mod:`sysconfig`. 2142 2143- bpo-43176: Fixed processing of a dataclass that inherits from a frozen 2144 dataclass with no fields. It is now correctly detected as an error. 2145 2146- bpo-43080: :mod:`pprint` now has support for 2147 :class:`dataclasses.dataclass`. Patch by Lewis Gaul. 2148 2149- bpo-39950: Add `pathlib.Path.hardlink_to()` method that supersedes 2150 `link_to()`. The new method has the same argument order as `symlink_to()`. 2151 2152- bpo-42904: :func:`typing.get_type_hints` now checks the local namespace of 2153 a class when evaluating :pep:`563` annotations inside said class. 2154 2155- bpo-42269: Add ``slots`` parameter to ``dataclasses.dataclass`` decorator 2156 to automatically generate ``__slots__`` for class. Patch provided by Yurii 2157 Karabas. 2158 2159- bpo-39529: Deprecated use of :func:`asyncio.get_event_loop` without 2160 running event loop. Emit deprecation warning for :mod:`asyncio` functions 2161 which implicitly create a :class:`~asyncio.Future` or 2162 :class:`~asyncio.Task` objects if there is no running event loop and no 2163 explicit *loop* argument is passed: :func:`~asyncio.ensure_future`, 2164 :func:`~asyncio.wrap_future`, :func:`~asyncio.gather`, 2165 :func:`~asyncio.shield`, :func:`~asyncio.as_completed` and constructors of 2166 :class:`~asyncio.Future`, :class:`~asyncio.Task`, 2167 :class:`~asyncio.StreamReader`, :class:`~asyncio.StreamReaderProtocol`. 2168 2169- bpo-18369: Certificate and PrivateKey classes were added to the ssl 2170 module. Certificates and keys can now be loaded from memory buffer, too. 2171 2172- bpo-41486: Use a new output buffer management code for :mod:`bz2` / 2173 :mod:`lzma` / :mod:`zlib` modules, and add ``.readall()`` function to 2174 ``_compression.DecompressReader`` class. These bring some performance 2175 improvements. Patch by Ma Lin. 2176 2177- bpo-31870: The :func:`ssl.get_server_certificate` function now has a 2178 *timeout* parameter. 2179 2180- bpo-41735: Fix thread locks in zlib module may go wrong in rare case. 2181 Patch by Ma Lin. 2182 2183- bpo-36470: Fix dataclasses with ``InitVar``\s and 2184 :func:`~dataclasses.replace()`. Patch by Claudiu Popa. 2185 2186- bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag 2187 2188- bpo-35114: :func:`ssl.RAND_status` now returns a boolean value (as 2189 documented) instead of ``1`` or ``0``. 2190 2191- bpo-39906: :meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now 2192 accept a *follow_symlinks* keyword-only argument for consistency with 2193 corresponding functions in the :mod:`os` module. 2194 2195- bpo-39899: :func:`os.path.expanduser()` now refuses to guess Windows home 2196 directories if the basename of current user's home directory does not 2197 match their username. 2198 2199 :meth:`pathlib.Path.expanduser()` and :meth:`~pathlib.Path.home()` now 2200 consistently raise :exc:`RuntimeError` exception when a home directory 2201 cannot be resolved. Previously a :exc:`KeyError` exception could be raised 2202 on Windows when the ``"USERNAME"`` environment variable was unset. 2203 2204- bpo-36076: Added SNI support to :func:`ssl.get_server_certificate`. 2205 2206- bpo-38490: Covariance, Pearson's correlation, and simple linear regression 2207 functionality was added to statistics module. Patch by Tymoteusz Wołodźko. 2208 2209- bpo-33731: Provide a locale.localize() function, which converts a 2210 normalized number string into a locale format. 2211 2212- bpo-32745: Fix a regression in the handling of ctypes' 2213 :data:`ctypes.c_wchar_p` type: embedded null characters would cause a 2214 :exc:`ValueError` to be raised. Patch by Zackery Spytz. 2215 2216Documentation 2217------------- 2218 2219- bpo-43987: Add "Annotations Best Practices" document as a new HOWTO. 2220 2221- bpo-43977: Document the new :const:`Py_TPFLAGS_MAPPING` and 2222 :const:`Py_TPFLAGS_SEQUENCE` type flags. 2223 2224- bpo-43959: The documentation on the PyContextVar C-API was clarified. 2225 2226- bpo-43938: Update dataclasses documentation to express that 2227 FrozenInstanceError is derived from AttributeError. 2228 2229- bpo-43778: Fix the Sphinx glossary_search extension: create the _static/ 2230 sub-directory if it doesn't exist. 2231 2232- bpo-43755: Update documentation to reflect that unparenthesized lambda 2233 expressions can no longer be the expression part in an ``if`` clause in 2234 comprehensions and generator expressions since Python 3.9. 2235 2236- bpo-43739: Fixing the example code in Doc/extending/extending.rst to 2237 declare and initialize the pmodule variable to be of the right type. 2238 2239Tests 2240----- 2241 2242- bpo-43961: Fix test_logging.test_namer_rotator_inheritance() on Windows: 2243 use :func:`os.replace` rather than :func:`os.rename`. Patch by Victor 2244 Stinner. 2245 2246- bpo-43842: Fix a race condition in the SMTP test of test_logging. Don't 2247 close a file descriptor (socket) from a different thread while 2248 asyncore.loop() is polling the file descriptor. Patch by Victor Stinner. 2249 2250- bpo-43843: :mod:`test.libregrtest` now marks a test as ENV_CHANGED 2251 (altered the execution environment) if a thread raises an exception but 2252 does not catch it. It sets a hook on :func:`threading.excepthook`. Use 2253 ``--fail-env-changed`` option to mark the test as failed. Patch by Victor 2254 Stinner. 2255 2256- bpo-43811: Tests multiple OpenSSL versions on GitHub Actions. Use ccache 2257 to speed up testing. 2258 2259- bpo-43791: OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and 2260 1.1. Tests are failing with TLSV1_ALERT_INTERNAL_ERROR. 2261 2262Build 2263----- 2264 2265- bpo-43567: Improved generated code refresh (AST/tokens/opcodes/keywords) 2266 on Windows. 2267 2268- bpo-43669: Implement :pep:`644`. Python now requires OpenSSL 1.1.1 or 2269 newer. 2270 2271Windows 2272------- 2273 2274- bpo-35306: Adds additional arguments to :func:`os.startfile` function. 2275 2276- bpo-43538: Avoid raising errors from :meth:`pathlib.Path.exists()` when 2277 passed an invalid filename. 2278 2279- bpo-38822: Fixed :func:`os.stat` failing on inaccessible directories with 2280 a trailing slash, rather than falling back to the parent directory's 2281 metadata. This implicitly affected :func:`os.path.exists` and 2282 :func:`os.path.isdir`. 2283 2284- bpo-26227: Fixed decoding of host names in :func:`socket.gethostbyaddr` 2285 and :func:`socket.gethostbyname_ex`. 2286 2287- bpo-40432: Updated pegen regeneration script on Windows to find and use 2288 Python 3.8 or higher. Prior to this, pegen regeneration already required 2289 3.8 or higher, but the script may have used lower versions of Python. 2290 2291- bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. Earlier 2292 releases were mislabelled and actually included 1.1.1i again. 2293 2294- bpo-43652: Update Tcl and Tk to 8.6.11 in Windows installer. 2295 2296- bpo-43492: Upgrade Windows installer to use SQLite 3.35.5. 2297 2298- bpo-30555: Fix ``WindowsConsoleIO`` errors in the presence of fd 2299 redirection. Patch by Segev Finer. 2300 2301macOS 2302----- 2303 2304- bpo-42119: Fix check for macOS SDK paths when building Python. Narrow 2305 search to match contents of SDKs, namely only files in 2306 ``/System/Library``, ``/System/IOSSupport``, and ``/usr`` other than 2307 ``/usr/local``. Previously, anything under ``/System`` was assumed to be 2308 in an SDK which causes problems with the new file system layout in 10.15+ 2309 where user file systems may appear to be mounted under ``/System``. Paths 2310 in ``/Library`` were also incorrectly treated as SDK locations. 2311 2312- bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3 2313 2314- bpo-44009: Provide "python3.x-intel64" executable to allow reliably 2315 forcing macOS universal2 framework builds to run under Rosetta 2 Intel-64 2316 emulation on Apple Silicon Macs. This can be useful for testing or when 2317 universal2 wheels are not yet available. 2318 2319- bpo-43851: Build SQLite with ``SQLITE_OMIT_AUTOINIT`` on macOS. Patch by 2320 Erlend E. Aasland. 2321 2322- bpo-43492: Update macOS installer to use SQLite 3.35.4. 2323 2324- bpo-42235: ``Mac/BuildScript/build-installer.py`` will now use 2325 "--enable-optimizations" and ``--with-lto`` when building on macOS 10.15 2326 or later. 2327 2328IDLE 2329---- 2330 2331- bpo-37903: Add mouse actions to the shell sidebar. Left click and 2332 optional drag selects one or more lines, as with the editor line number 2333 sidebar. Right click after selecting raises a context menu with 'copy 2334 with prompts'. This zips together prompts from the sidebar with lines 2335 from the selected text. 2336 2337- bpo-43981: Fix reference leak in test_squeezer. Patch by Pablo Galindo 2338 2339- bpo-37892: Indent IDLE Shell input with spaces instead of tabs 2340 2341- bpo-43655: IDLE dialog windows are now recognized as dialogs by window 2342 managers on macOS and X Window. 2343 2344- bpo-37903: IDLE's shell now shows prompts in a separate side-bar. 2345 2346C API 2347----- 2348 2349- bpo-43916: Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag 2350 to disallow creating type instances. Patch by Victor Stinner. 2351 2352- bpo-43774: Remove the now unused ``PYMALLOC_DEBUG`` macro. Debug hooks on 2353 memory allocators are now installed by default if Python is built in debug 2354 mode (if ``Py_DEBUG`` macro is defined). Moreover, they can now be used on 2355 Python build in release mode (ex: using ``PYTHONMALLOC=debug`` environment 2356 variable). 2357 2358- bpo-43962: _PyInterpreterState_IDIncref() now calls 2359 _PyInterpreterState_IDInitref() and always increments id_refcount. 2360 Previously, calling _xxsubinterpreters.get_current() could create an 2361 id_refcount inconsistency when a _xxsubinterpreters.InterpreterID object 2362 was deallocated. Patch by Victor Stinner. 2363 2364- bpo-28254: Add new C-API functions to control the state of the garbage 2365 collector: :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`, 2366 :c:func:`PyGC_IsEnabled()`, corresponding to the functions in the 2367 :mod:`gc` module. 2368 2369- bpo-43908: Introduce :const:`Py_TPFLAGS_IMMUTABLETYPE` flag for immutable 2370 type objects, and modify :c:func:`PyType_Ready` to set it for static 2371 types. Patch by Erlend E. Aasland. 2372 2373- bpo-43795: :c:func:`PyMem_Calloc` is now available in the limited C API 2374 (``Py_LIMITED_API``). 2375 2376- bpo-43868: :c:func:`PyOS_ReadlineFunctionPointer` is no longer exported by 2377 limited C API headers and by ``python3.dll`` on Windows. Like any function 2378 that takes ``FILE*``, it is not part of the stable ABI. 2379 2380- bpo-43795: Stable ABI and limited API definitions are generated from a 2381 central manifest (:pep:`652`). 2382 2383- bpo-43753: Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the 2384 *x* object is the *y* object, the same as ``x is y`` in Python. Add also 2385 the :c:func:`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` 2386 functions to test if an object is, respectively, the ``None`` singleton, 2387 the ``True`` singleton or the ``False`` singleton. Patch by Victor 2388 Stinner. 2389 2390 2391What's New in Python 3.10.0 alpha 7? 2392==================================== 2393 2394*Release date: 2021-04-05* 2395 2396Security 2397-------- 2398 2399- bpo-42988: CVE-2021-3426: Remove the ``getfile`` feature of the 2400 :mod:`pydoc` module which could be abused to read arbitrary files on the 2401 disk (directory traversal vulnerability). Moreover, even source code of 2402 Python modules can contain sensitive data like passwords. Vulnerability 2403 reported by David Schwörer. 2404 2405- bpo-43285: :mod:`ftplib` no longer trusts the IP address value returned 2406 from the server in response to the PASV command by default. This prevents 2407 a malicious FTP server from using the response to probe IPv4 address and 2408 port combinations on the client network. 2409 2410 Code that requires the former vulnerable behavior may set a 2411 ``trust_server_pasv_ipv4_address`` attribute on their :class:`ftplib.FTP` 2412 instances to ``True`` to re-enable it. 2413 2414- bpo-43439: Add audit hooks for :func:`gc.get_objects`, 2415 :func:`gc.get_referrers` and :func:`gc.get_referents`. Patch by Pablo 2416 Galindo. 2417 2418Core and Builtins 2419----------------- 2420 2421- bpo-27129: Update CPython bytecode magic number. 2422 2423- bpo-43672: Raise ImportWarning when calling find_loader(). 2424 2425- bpo-43660: Fix crash that happens when replacing ``sys.stderr`` with a 2426 callable that can remove the object while an exception is being printed. 2427 Patch by Pablo Galindo. 2428 2429- bpo-27129: The bytecode interpreter uses instruction, rather byte, offsets 2430 internally. This reduces the number of EXTENDED_ARG instructions needed 2431 and streamlines instruction dispatch a bit. 2432 2433- bpo-40645: Fix reference leak in the :mod:`_hashopenssl` extension. Patch 2434 by Pablo Galindo. 2435 2436- bpo-42134: Calls to find_module() by the import system now raise 2437 ImportWarning. 2438 2439- bpo-41064: Improve the syntax error for invalid usage of double starred 2440 elements ('**') in f-strings. Patch by Pablo Galindo. 2441 2442- bpo-43575: Speed up calls to ``map()`` by using the :pep:`590` 2443 ``vectorcall`` calling convention. Patch by Dong-hee Na. 2444 2445- bpo-42137: The import system now prefers using ``__spec__`` for 2446 ``ModuleType.__repr__`` over ``module_repr()``. 2447 2448- bpo-43452: Added micro-optimizations to ``_PyType_Lookup()`` to improve 2449 cache lookup performance in the common case of cache hits. 2450 2451- bpo-43555: Report the column offset for :exc:`SyntaxError` for invalid 2452 line continuation characters. Patch by Pablo Galindo. 2453 2454- bpo-43517: Fix misdetection of circular imports when using ``from pkg.mod 2455 import attr``, which caused false positives in non-trivial multi-threaded 2456 code. 2457 2458- bpo-43497: Emit SyntaxWarnings for assertions with tuple constants, this 2459 is a regression introduced in python3.7 2460 2461- bpo-39316: Tracing now has correct line numbers for attribute accesses 2462 when the the attribute is on a different line from the object. Improves 2463 debugging and profiling for multi-line method chains. 2464 2465- bpo-35883: Python no longer fails at startup with a fatal error if a 2466 command line argument contains an invalid Unicode character. The 2467 :c:func:`Py_DecodeLocale` function now escapes byte sequences which would 2468 be decoded as Unicode characters outside the [U+0000; U+10ffff] range. 2469 2470- bpo-43410: Fix a bug that was causing the parser to crash when emitting 2471 syntax errors when reading input from stdin. Patch by Pablo Galindo 2472 2473- bpo-43406: Fix a possible race condition where ``PyErr_CheckSignals`` 2474 tries to execute a non-Python signal handler. 2475 2476- bpo-42128: Add ``__match_args__`` to :c:type:`structsequence` based 2477 classes. Patch by Pablo Galindo. 2478 2479- bpo-43390: CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for 2480 the VM's default signal handlers. This is friendlier to other in-process 2481 code that an extension module or embedding use could pull in (such as 2482 Golang's cgo) where tiny thread stacks are the norm and ``sigaltstack()`` 2483 has been used to provide for signal handlers. This is a no-op change for 2484 the vast majority of processes that don't use sigaltstack. 2485 2486- bpo-43287: Speed up calls to ``filter()`` by using the :pep:`590` 2487 ``vectorcall`` calling convention. Patch by Dong-hee Na. 2488 2489- bpo-37448: Add a radix tree based memory map to track in-use obmalloc 2490 arenas. Use to replace the old implementation of address_in_range(). The 2491 radix tree approach makes it easy to increase pool sizes beyond the OS 2492 page size. Boosting the pool and arena size allows obmalloc to handle a 2493 significantly higher percentage of requests from its ultra-fast paths. 2494 2495 It also has the advantage of eliminating the memory unsanitary behavior of 2496 the previous address_in_range(). The old address_in_range() was marked 2497 with the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and 2498 _Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed. 2499 2500 To disable the radix tree map, set a preprocessor flag as follows: 2501 `-DWITH_PYMALLOC_RADIX_TREE=0`. 2502 2503 Co-authored-by: Tim Peters <tim.peters@gmail.com> 2504 2505- bpo-29988: Only handle asynchronous exceptions and requests to drop the 2506 GIL when returning from a call or on the back edges of loops. Makes sure 2507 that :meth:`__exit__` is always called in with statements, even for 2508 interrupts. 2509 2510Library 2511------- 2512 2513- bpo-43720: Document various stdlib deprecations in imp, pkgutil, and 2514 importlib.util for removal in Python 3.12. 2515 2516- bpo-43433: :class:`xmlrpc.client.ServerProxy` no longer ignores query and 2517 fragment in the URL of the server. 2518 2519- bpo-31956: The :meth:`~array.array.index` method of :class:`array.array` 2520 now has optional *start* and *stop* parameters. 2521 2522- bpo-40066: Enum: adjust ``repr()`` to show only enum and member name (not 2523 value, nor angle brackets) and ``str()`` to show only member name. Update 2524 and improve documentation to match. 2525 2526- bpo-42136: Deprecate all module_repr() methods found in importlib as their 2527 use is being phased out by Python 3.12. 2528 2529- bpo-35930: Raising an exception raised in a "future" instance will create 2530 reference cycles. 2531 2532- bpo-41369: Finish updating the vendored libmpdec to version 2.5.1. Patch 2533 by Stefan Krah. 2534 2535- bpo-43422: Revert the _decimal C API which was added in bpo-41324. 2536 2537- bpo-43577: Fix deadlock when using :class:`ssl.SSLContext` debug callback 2538 with :meth:`ssl.SSLContext.sni_callback`. 2539 2540- bpo-43571: It's now possible to create MPTCP sockets with IPPROTO_MPTCP 2541 2542- bpo-43542: ``image/heic`` and ``image/heif`` were added to 2543 :mod:`mimetypes`. 2544 2545- bpo-40645: The :mod:`hmac` module now uses OpenSSL's HMAC implementation 2546 when digestmod argument is a hash name or builtin hash function. 2547 2548- bpo-43510: Implement :pep:`597`: Add ``EncodingWarning`` warning, ``-X 2549 warn_default_encoding`` option, :envvar:`PYTHONWARNDEFAULTENCODING` 2550 environment variable and ``encoding="locale"`` argument value. 2551 2552- bpo-43521: ``ast.unparse`` can now render NaNs and empty sets. 2553 2554- bpo-42914: :func:`pprint.pprint` gains a new boolean 2555 ``underscore_numbers`` optional argument to emit integers with thousands 2556 separated by an underscore character for improved readability (for example 2557 ``1_000_000`` instead of ``1000000``). 2558 2559- bpo-41361: :meth:`~collections.deque.rotate` calls are now slightly faster 2560 due to faster argument parsing. 2561 2562- bpo-43423: :func:`subprocess.communicate` no longer raises an IndexError 2563 when there is an empty stdout or stderr IO buffer during a timeout on 2564 Windows. 2565 2566- bpo-27820: Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN 2567 with initial_response_ok=False will fail. 2568 2569 The cause is that SMTP.auth_login _always_ returns a password if provided 2570 with a challenge string, thus non-compliant with the standard for AUTH 2571 LOGIN. 2572 2573 Also fixes bug with the test for smtpd. 2574 2575- bpo-43445: Add frozen modules to :data:`sys.stdlib_module_names`. For 2576 example, add ``"_frozen_importlib"`` and ``"_frozen_importlib_external"`` 2577 names. 2578 2579- bpo-43245: Add keyword arguments support to ``ChainMap.new_child()``. 2580 2581- bpo-29982: Add optional parameter *ignore_cleanup_errors* to 2582 :func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup` 2583 attempts. Contributed by C.A.M. Gerlach. 2584 2585- bpo-43428: Include changes from `importlib_metadata 3.7 2586 <https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-7-0>`_: 2587 2588 Performance enhancements to distribution discovery. 2589 2590 ``entry_points`` only returns unique distributions. 2591 2592 Introduces new ``EntryPoints`` object for containing a set of entry points 2593 with convenience methods for selecting entry points by group or name. 2594 ``entry_points`` now returns this object if selection parameters are 2595 supplied but continues to return a dict object for compatibility. Users 2596 are encouraged to rely on the selection interface. The dict object result 2597 is likely to be deprecated in the future. 2598 2599 Added packages_distributions function to return a mapping of packages to 2600 the distributions that provide them. 2601 2602- bpo-43332: Improves the networking efficiency of :mod:`http.client` when 2603 using a proxy via :meth:`~HTTPConnection.set_tunnel`. Fewer small send 2604 calls are made during connection setup. 2605 2606- bpo-43420: Improve performance of :class:`fractions.Fraction` arithmetics 2607 for large components. Contributed by Sergey B. Kirpichev. 2608 2609- bpo-43356: Allow passing a signal number to ``_thread.interrupt_main()``. 2610 2611- bpo-43399: Fix ``ElementTree.extend`` not working on iterators when using 2612 the Python implementation 2613 2614- bpo-43369: Improve :mod:`sqlite3` error handling: If 2615 ``sqlite3_column_text()`` and ``sqlite3_column_blob()`` set 2616 ``SQLITE_NOMEM``, :exc:`MemoryError` is now raised. Patch by Erlend E. 2617 Aasland. 2618 2619- bpo-43368: Fix a regression introduced in GH-24562, where an empty 2620 bytestring was fetched as ``None`` instead of ``b''`` in :mod:`sqlite3`. 2621 Patch by Mariusz Felisiak. 2622 2623- bpo-41282: Fixed stacklevel of ``DeprecationWarning`` emitted from 2624 ``import distutils``. 2625 2626- bpo-42129: ``importlib.resources`` now honors namespace packages, merging 2627 resources from each location in the namespace as introduced in 2628 ``importlib_resources`` 3.2 and including incidental changes through 2629 5.0.3. 2630 2631- bpo-43295: :meth:`datetime.datetime.strptime` now raises ``ValueError`` 2632 instead of ``IndexError`` when matching ``'z'`` with the ``%z`` format 2633 specifier. 2634 2635- bpo-43125: Return empty string if base64mime.body_encode receive empty 2636 bytes 2637 2638- bpo-43084: :func:`curses.window.enclose` returns now ``True`` or ``False`` 2639 (as was documented) instead of ``1`` or ``0``. 2640 2641- bpo-42994: Add MIME types for opus, AAC, 3gpp and 3gpp2 2642 2643- bpo-14678: Add an invalidate_caches() method to the zipimport.zipimporter 2644 class to support importlib.invalidate_caches(). Patch by Desmond Cheong. 2645 2646- bpo-42782: Fail fast in :func:`shutil.move()` to avoid creating 2647 destination directories on failure. 2648 2649- bpo-40066: Enum's `repr()` and `str()` have changed: `repr()` is now 2650 *EnumClass.MemberName* and `str()` is *MemberName*. Additionally, stdlib 2651 Enum's whose contents are available as module attributes, such as 2652 `RegexFlag.IGNORECASE`, have their `repr()` as *module.name*, e.g. 2653 `re.IGNORECASE`. 2654 2655- bpo-26053: Fixed bug where the :mod:`pdb` interactive run command echoed 2656 the args from the shell command line, even if those have been overridden 2657 at the pdb prompt. 2658 2659- bpo-24160: Fixed bug where breakpoints did not persist across multiple 2660 debugger sessions in :mod:`pdb`'s interactive mode. 2661 2662- bpo-40701: When the :data:`tempfile.tempdir` global variable is set to a 2663 value of type bytes, it is now handled consistently. Previously 2664 exceptions could be raised from some tempfile APIs when the directory did 2665 not already exist in this situation. Also ensures that the 2666 :func:`tempfile.gettempdir()` and :func:`tempfile.gettempdirb()` functions 2667 *always* return ``str`` and ``bytes`` respectively. 2668 2669- bpo-39342: Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as 2670 :data:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate 2671 validation as explained in 2672 https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html. 2673 2674- bpo-31861: Add builtins.aiter and builtins.anext. Patch by Joshua Bronson 2675 (@jab), Daniel Pope (@lordmauve), and Justin Wang (@justin39). 2676 2677Documentation 2678------------- 2679 2680- bpo-43199: Answer "Why is there no goto?" in the Design and History FAQ. 2681 2682- bpo-43407: Clarified that a result from :func:`time.monotonic`, 2683 :func:`time.perf_counter`, :func:`time.process_time`, or 2684 :func:`time.thread_time` can be compared with the result from any 2685 following call to the same function - not just the next immediate call. 2686 2687- bpo-43354: Fix type documentation for ``Fault.faultCode``; the type has to 2688 be ``int`` instead of ``str``. 2689 2690- bpo-41933: Clarified wording of s * n in the Common Sequence Operations 2691 2692Tests 2693----- 2694 2695- bpo-37945: Fix test_getsetlocale_issue1813() of test_locale: skip the test 2696 if ``setlocale()`` fails. Patch by Victor Stinner. 2697 2698- bpo-41561: Add workaround for Ubuntu's custom OpenSSL security level 2699 policy. 2700 2701Build 2702----- 2703 2704- bpo-43179: Introduce and correctly use ALIGNOF_X in place of SIZEOF_X for 2705 alignment-related code in optimized string routines. Patch by Jessica 2706 Clarke. 2707 2708- bpo-43631: Update macOS, Windows, and CI to OpenSSL 1.1.1k. 2709 2710- bpo-43617: Improve configure.ac: Check for presence of autoconf-archive 2711 package and remove our copies of M4 macros. 2712 2713- bpo-43466: The ``configure`` script now supports ``--with-openssl-rpath`` 2714 option. 2715 2716- bpo-43372: Use ``_freeze_importlib`` to generate code for the 2717 ``__hello__`` module. This approach ensures the code matches the 2718 interpreter version. Previously, PYTHON_FOR_REGEN was used to generate 2719 the code, which might be wrong. The marshal format for code objects has 2720 changed with bpo-42246, commit 877df851. Update the code and the expected 2721 code sizes in ctypes test_frozentable. 2722 2723Windows 2724------- 2725 2726- bpo-43440: Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch 2727 by Erlend E. Aasland. 2728 2729IDLE 2730---- 2731 2732- bpo-42225: Document that IDLE can fail on Unix either from misconfigured 2733 IP masquerage rules or failure displaying complex colored (non-ascii) 2734 characters. 2735 2736C API 2737----- 2738 2739- bpo-43688: The limited C API is now supported if Python is built in debug 2740 mode (if the ``Py_DEBUG`` macro is defined). In the limited C API, the 2741 :c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now implemented 2742 as opaque function calls, rather than accessing directly the 2743 :c:member:`PyObject.ob_refcnt` member, if Python is built in debug mode 2744 and the ``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became 2745 possible to support the limited C API in debug mode because the 2746 :c:type:`PyObject` structure is the same in release and debug mode since 2747 Python 3.8 (see :issue:`36465`). 2748 2749 The limited C API is still not supported in the ``--with-trace-refs`` 2750 special build (``Py_TRACE_REFS`` macro). 2751 2752 Patch by Victor Stinner. 2753 2754- bpo-43244: Remove the ``pyarena.h`` header file with functions: 2755 2756 * ``PyArena_New()`` 2757 * ``PyArena_Free()`` 2758 * ``PyArena_Malloc()`` 2759 * ``PyArena_AddPyObject()`` 2760 2761 These functions were undocumented, excluded from the limited C API, and 2762 were only used internally by the compiler. Patch by Victor Stinner. 2763 2764- bpo-43244: Remove the compiler and parser functions using ``struct _mod`` 2765 type, because the public AST C API was removed: 2766 2767 * ``PyAST_Compile()`` 2768 * ``PyAST_CompileEx()`` 2769 * ``PyAST_CompileObject()`` 2770 * ``PyFuture_FromAST()`` 2771 * ``PyFuture_FromASTObject()`` 2772 * ``PyParser_ASTFromFile()`` 2773 * ``PyParser_ASTFromFileObject()`` 2774 * ``PyParser_ASTFromFilename()`` 2775 * ``PyParser_ASTFromString()`` 2776 * ``PyParser_ASTFromStringObject()`` 2777 2778 These functions were undocumented and excluded from the limited C API. 2779 Patch by Victor Stinner. 2780 2781- bpo-43244: Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header 2782 files. These functions were undocumented and excluded from the limited C 2783 API. Most names defined by these header files were not prefixed by ``Py`` 2784 and so could create names conflicts. For example, ``Python-ast.h`` defined 2785 a ``Yield`` macro which was conflict with the ``Yield`` name used by the 2786 Windows ``<winbase.h>`` header. Use the Python :mod:`ast` module instead. 2787 Patch by Victor Stinner. 2788 2789- bpo-43541: Fix a ``PyEval_EvalCodeEx()`` regression: fix reference 2790 counting on builtins. Patch by Victor Stinner. 2791 2792- bpo-43244: Remove the ``symtable.h`` header file and the undocumented 2793 functions: 2794 2795 * ``PyST_GetScope()`` 2796 * ``PySymtable_Build()`` 2797 * ``PySymtable_BuildObject()`` 2798 * ``PySymtable_Free()`` 2799 * ``Py_SymtableString()`` 2800 * ``Py_SymtableStringObject()`` 2801 2802 The ``Py_SymtableString()`` function was part the stable ABI by mistake 2803 but it could not be used, because the ``symtable.h`` header file was 2804 excluded from the limited C API. 2805 2806 The Python :mod:`symtable` module remains available and is unchanged. 2807 2808 Patch by Victor Stinner. 2809 2810- bpo-43244: Remove the ``PyAST_Validate()`` function. It is no longer 2811 possible to build a AST object (``mod_ty`` type) with the public C API. 2812 The function was already excluded from the limited C API (:pep:`384`). 2813 Patch by Victor Stinner. 2814 2815 2816What's New in Python 3.10.0 alpha 6? 2817==================================== 2818 2819*Release date: 2021-03-01* 2820 2821Security 2822-------- 2823 2824- bpo-42967: Fix web cache poisoning vulnerability by defaulting the query 2825 args separator to ``&``, and allowing the user to choose a custom 2826 separator. 2827 2828Core and Builtins 2829----------------- 2830 2831- bpo-43321: Fix ``SystemError`` raised when ``PyArg_Parse*()`` is used with 2832 ``#`` but without ``PY_SSIZE_T_CLEAN`` defined. 2833 2834- bpo-36346: ``PyArg_Parse*()`` functions now emits ``DeprecationWarning`` 2835 when ``u`` or ``Z`` format is used. See :pep:`623` for detail. 2836 2837- bpo-43277: Add a new :c:func:`PySet_CheckExact` function to the C-API to 2838 check if an object is an instance of :class:`set` but not an instance of a 2839 subtype. Patch by Pablo Galindo. 2840 2841- bpo-42990: The :data:`types.FunctionType` constructor now inherits the 2842 current builtins if the *globals* dictionary has no ``"__builtins__"`` 2843 key, rather than using ``{"None": None}`` as builtins: same behavior as 2844 :func:`eval` and :func:`exec` functions. Defining a function with ``def 2845 function(...): ...`` in Python is not affected, globals cannot be 2846 overridden with this syntax: it also inherits the current builtins. Patch 2847 by Victor Stinner. 2848 2849- bpo-42990: Functions have a new ``__builtins__`` attribute which is used 2850 to look for builtin symbols when a function is executed, instead of 2851 looking into ``__globals__['__builtins__']``. Patch by Mark Shannon and 2852 Victor Stinner. 2853 2854- bpo-43149: Improve the error message in the parser for exception groups 2855 without parentheses. Patch by Pablo Galindo. 2856 2857- bpo-43121: Fixed an incorrect :exc:`SyntaxError` message for missing comma 2858 in literals. Patch by Pablo Galindo. 2859 2860- bpo-42819: :mod:`readline`: Explicitly disable bracketed paste in the 2861 interactive interpreter, even if it's set in the inputrc, is enabled by 2862 default (eg GNU Readline 8.1), or a user calls 2863 ``readline.read_init_file()``. The Python REPL has not implemented 2864 bracketed paste support. Also, bracketed mode writes the ``"\x1b[?2004h"`` 2865 escape sequence into stdout which causes test failures in applications 2866 that don't support it. It can still be explicitly enabled by calling 2867 ``readline.parse_and_bind("set enable-bracketed-paste on")``. Patch by 2868 Dustin Rodrigues. 2869 2870- bpo-42808: Simple calls to ``type(object)`` are now faster due to the 2871 ``vectorcall`` calling convention. Patch by Dennis Sweeney. 2872 2873- bpo-42217: Make the compiler merges same co_code and co_linetable objects 2874 in a module like already did for co_consts. 2875 2876- bpo-41972: Substring search functions such as ``str1 in str2`` and 2877 ``str2.find(str1)`` now sometimes use the "Two-Way" string comparison 2878 algorithm to avoid quadratic behavior on long strings. 2879 2880- bpo-42128: Implement :pep:`634` (structural pattern matching). Patch by 2881 Brandt Bucher. 2882 2883- bpo-40692: In the :class:`concurrent.futures.ProcessPoolExecutor`, 2884 validate that :func:`multiprocess.synchronize` is available on a given 2885 platform and rely on that check in the :mod:`concurrent.futures` test 2886 suite so we can run tests that are unrelated to 2887 :class:`ProcessPoolExecutor` on those platforms. 2888 2889- bpo-38302: If :func:`object.__ipow__` returns :const:`NotImplemented`, the 2890 operator will correctly fall back to :func:`object.__pow__` and 2891 :func:`object.__rpow__` as expected. 2892 2893Library 2894------- 2895 2896- bpo-43316: The ``python -m gzip`` command line application now properly 2897 fails when detecting an unsupported extension. It exits with a non-zero 2898 exit code and prints an error message to stderr. 2899 2900- bpo-43317: Set the chunk size for the ``gzip`` module main function to 2901 io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes 2902 constant that was used previously. 2903 2904- bpo-43146: Handle None in single-arg versions of 2905 :func:`~traceback.print_exception` and 2906 :func:`~traceback.format_exception`. 2907 2908- bpo-43260: Fix TextIOWrapper can not flush internal buffer forever after 2909 very large text is written. 2910 2911- bpo-43258: Prevent needless allocation of :mod:`sqlite3` aggregate 2912 function context when no rows match an aggregate query. Patch by Erlend E. 2913 Aasland. 2914 2915- bpo-43251: Improve :mod:`sqlite3` error handling: 2916 ``sqlite3_column_name()`` failures now result in :exc:`MemoryError`. Patch 2917 by Erlend E. Aasland. 2918 2919- bpo-40956: Fix segfault in :meth:`sqlite3.Connection.backup` if no 2920 argument was provided. The regression was introduced by GH-23838. Patch by 2921 Erlend E. Aasland. 2922 2923- bpo-43172: The readline module now passes its tests when built directly 2924 against libedit. Existing irreconcilable API differences remain in 2925 :func:`readline.get_begidx` and :func:`readline.get_endidx` behavior based 2926 on libreadline vs libedit use. 2927 2928- bpo-43163: Fix a bug in :mod:`codeop` that was causing it to not ask for 2929 more input when multi-line snippets have unclosed parentheses. Patch by 2930 Pablo Galindo 2931 2932- bpo-43162: deprecate unsupported ability to access enum members as 2933 attributes of other enum members 2934 2935- bpo-43146: Fix recent regression in None argument handling in 2936 :mod:`~traceback` module functions. 2937 2938- bpo-43102: The namedtuple __new__ method had its __builtins__ set to None 2939 instead of an actual dictionary. This created problems for introspection 2940 tools. 2941 2942- bpo-43106: Added :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, 2943 :data:`~os.O_SYMLINK` and :data:`~os.O_NOFOLLOW_ANY` for macOS. Patch by 2944 Dong-hee Na. 2945 2946- bpo-42960: Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to 2947 the :mod:`resource` module. 2948 2949- bpo-42151: Make the pure Python implementation of 2950 :mod:`xml.etree.ElementTree` behave the same as the C implementation 2951 (:mod:`_elementree`) regarding default attribute values (by not setting 2952 ``specified_attributes=1``). 2953 2954- bpo-29753: In ctypes, now packed bitfields are calculated properly and the 2955 first item of packed bitfields is now shrank correctly. 2956 2957Documentation 2958------------- 2959 2960- bpo-27646: Clarify that 'yield from <expr>' works with any iterable, not 2961 just iterators. 2962 2963- bpo-36346: Update some deprecated unicode APIs which are documented as 2964 "will be removed in 4.0" to "3.12". See :pep:`623` for detail. 2965 2966Tests 2967----- 2968 2969- bpo-43288: Fix test_importlib to correctly skip Unicode file tests if the 2970 filesystem does not support them. 2971 2972Build 2973----- 2974 2975- bpo-43174: Windows build now uses ``/utf-8`` compiler option. 2976 2977- bpo-43103: Add a new configure ``--without-static-libpython`` option to 2978 not build the ``libpythonMAJOR.MINOR.a`` static library and not install 2979 the ``python.o`` object file. 2980 2981- bpo-13501: The configure script can now use *libedit* instead of 2982 *readline* with the command line option ``--with-readline=editline``. 2983 2984- bpo-42603: Make configure script use pkg-config to detect the location of 2985 Tcl/Tk headers and libraries, used to build tkinter. 2986 2987 On macOS, a Tcl/Tk configuration provided by pkg-config will be preferred 2988 over Tcl/Tk frameworks installed in ``/{System/,}Library/Frameworks``. If 2989 both exist and the latter is preferred, the appropriate ``--with-tcltk-*`` 2990 configuration options need to be explicitly set. 2991 2992- bpo-39448: Add the "regen-frozen" makefile target that regenerates the 2993 code for the frozen ``__hello__`` module. 2994 2995Windows 2996------- 2997 2998- bpo-43155: :c:func:`PyCMethod_New` is now present in ``python3.lib``. 2999 3000macOS 3001----- 3002 3003- bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. 3004 3005IDLE 3006---- 3007 3008- bpo-43283: Document why printing to IDLE's Shell is often slower than 3009 printing to a system terminal and that it can be made faster by 3010 pre-formatting a single string before printing. 3011 3012C API 3013----- 3014 3015- bpo-43278: Always put compiler and system information on the first line of 3016 the REPL welcome message. 3017 3018- bpo-43270: Remove the private ``_PyErr_OCCURRED()`` macro: use the public 3019 :c:func:`PyErr_Occurred` function instead. 3020 3021- bpo-35134: Move odictobject.h, parser_interface.h, picklebufobject.h, 3022 pydebug.h, and pyfpe.h into the cpython/ directory. They must not be 3023 included directly, as they are already included by Python.h: :ref:`Include 3024 Files <api-includes>`. 3025 3026- bpo-35134: Move pyarena.h, pyctype.h, and pytime.h into the cpython/ 3027 directory. They must not be included directly, as they are already 3028 included by Python.h: :ref:`Include Files <api-includes>`. 3029 3030- bpo-40170: :c:func:`PyExceptionClass_Name` is now always declared as a 3031 function, in order to hide implementation details. The macro accessed 3032 :c:member:`PyTypeObject.tp_name` directly. Patch by Erlend E. Aasland. 3033 3034- bpo-43239: The :c:func:`PyCFunction_New` function is now exported in the 3035 ABI when compiled with ``-fvisibility=hidden``. 3036 3037- bpo-40170: :c:func:`PyIter_Check` is now always declared as a function, in 3038 order to hide implementation details. The macro accessed 3039 :c:member:`PyTypeObject.tp_iternext` directly. Patch by Erlend E. Aasland. 3040 3041- bpo-40170: Convert :c:func:`PyDescr_IsData` macro to a function to hide 3042 implementation details: The macro accessed 3043 :c:member:`PyTypeObject.tp_descr_set` directly. Patch by Erlend E. 3044 Aasland. 3045 3046- bpo-43181: Convert :c:func:`PyObject_TypeCheck` macro to a static inline 3047 function. Patch by Erlend E. Aasland. 3048 3049 3050What's New in Python 3.10.0 alpha 5? 3051==================================== 3052 3053*Release date: 2021-02-02* 3054 3055Security 3056-------- 3057 3058- bpo-42938: Avoid static buffers when computing the repr of 3059 :class:`ctypes.c_double` and :class:`ctypes.c_longdouble` values. 3060 3061Core and Builtins 3062----------------- 3063 3064- bpo-42990: Refactor the ``PyEval_`` family of functions. 3065 3066 * An new function ``_PyEval_Vector`` is added to simplify calls to Python from C. 3067 * ``_PyEval_EvalCodeWithName`` is removed 3068 * ``PyEval_EvalCodeEx`` is retained as part of the API, but is not used internally 3069 3070- bpo-38631: Replace :c:func:`Py_FatalError` calls in the compiler with 3071 regular :exc:`SystemError` exceptions. Patch by Victor Stinner. 3072 3073- bpo-42997: Improve error message for missing ":" before blocks. Patch by 3074 Pablo Galindo. 3075 3076- bpo-43017: Improve error message in the parser when using un-parenthesised 3077 tuples in comprehensions. Patch by Pablo Galindo. 3078 3079- bpo-42986: Fix parser crash when reporting syntax errors in f-string with 3080 newlines. Patch by Pablo Galindo. 3081 3082- bpo-40176: Syntax errors for unterminated string literals now point to the 3083 start of the string instead of reporting EOF/EOL. 3084 3085- bpo-42927: The inline cache for ``LOAD_ATTR`` now also optimizes access to 3086 attributes defined by ``__slots__``. This makes reading such attribute up 3087 to 30% faster. 3088 3089- bpo-42864: Improve error messages in the parser when parentheses are not 3090 closed. Patch by Pablo Galindo. 3091 3092- bpo-42924: Fix ``bytearray`` repetition incorrectly copying data from the 3093 start of the buffer, even if the data is offset within the buffer (e.g. 3094 after reassigning a slice at the start of the ``bytearray`` to a shorter 3095 byte string). 3096 3097- bpo-42882: Fix the :c:func:`_PyUnicode_FromId` function 3098 (_Py_IDENTIFIER(var) API) when :c:func:`Py_Initialize` / 3099 :c:func:`Py_Finalize` is called multiple times: preserve 3100 ``_PyRuntime.unicode_ids.next_index`` value. 3101 3102- bpo-42827: Fix a crash when working out the error line of a 3103 :exc:`SyntaxError` in some multi-line expressions. 3104 3105- bpo-42823: frame.f_lineno is correct even if frame.f_trace is set to True 3106 3107- bpo-37324: Remove deprecated aliases to 3108 :ref:`collections-abstract-base-classes` from the :mod:`collections` 3109 module. 3110 3111- bpo-41994: Fixed possible leak in ``import`` when ``sys.modules`` is not a 3112 ``dict``. 3113 3114- bpo-27772: In string formatting, preceding the *width* field by ``'0'`` no 3115 longer affects the default alignment for strings. 3116 3117Library 3118------- 3119 3120- bpo-43108: Fixed a reference leak in the :mod:`curses` module. Patch by 3121 Pablo Galindo 3122 3123- bpo-43077: Update the bundled pip to 21.0.1 and setuptools to 52.0.0. 3124 3125- bpo-41282: Deprecate ``distutils`` in documentation and add warning on 3126 import. 3127 3128- bpo-43014: Improve performance of :mod:`tokenize` by 20-30%. Patch by 3129 Anthony Sottile. 3130 3131- bpo-42323: Fix :func:`math.nextafter` for NaN on AIX. 3132 3133- bpo-42955: Add :data:`sys.stdlib_module_names`, containing the list of the 3134 standard library module names. Patch by Victor Stinner. 3135 3136- bpo-42944: Fix ``random.Random.sample`` when ``counts`` argument is not 3137 ``None``. 3138 3139- bpo-42934: Use :class:`~traceback.TracebackException`'s new ``compact`` 3140 param in :class:`~unittest.TestResult` to reduce time and memory consumed 3141 by traceback formatting. 3142 3143- bpo-42931: Add :func:`randbytes` to ``random.__all__``. 3144 3145- bpo-38250: [Enum] Flags consisting of a single bit are now considered 3146 canonical, and will be the only flags returned from listing and iterating 3147 over a Flag class or a Flag member. Multi-bit flags are considered 3148 aliases; they will be returned from lookups and operations that result in 3149 their value. Iteration for both Flag and Flag members is in definition 3150 order. 3151 3152- bpo-42877: Added the ``compact`` parameter to the constructor of 3153 :class:`traceback.TracebackException` to reduce time and memory for use 3154 cases that only need to call :func:`TracebackException.format` and 3155 :func:`TracebackException.format_exception_only`. 3156 3157- bpo-42923: The :c:func:`Py_FatalError` function and the 3158 :mod:`faulthandler` module now dump the list of extension modules on a 3159 fatal error. 3160 3161- bpo-42848: Removed recursion from :class:`~traceback.TracebackException` 3162 to allow it to handle long exception chains. 3163 3164- bpo-42901: [Enum] move member creation from ``EnumMeta.__new__`` to 3165 ``_proto_member.__set_name__``, allowing members to be created and visible 3166 in ``__init_subclass__``. 3167 3168- bpo-42780: Fix os.set_inheritable() for O_PATH file descriptors on Linux. 3169 3170- bpo-42866: Fix a reference leak in the ``getcodec()`` function of CJK 3171 codecs. Patch by Victor Stinner. 3172 3173- bpo-42846: Convert the 6 CJK codec extension modules (_codecs_cn, 3174 _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw) to the 3175 multiphase initialization API (:pep:`489`). Patch by Victor Stinner. 3176 3177- bpo-42851: remove __init_subclass__ support for Enum members 3178 3179- bpo-42834: Make internal caches of the ``_json`` module compatible with 3180 subinterpreters. 3181 3182- bpo-41748: Fix HTMLParser parsing rules for element attributes containing 3183 commas with spaces. Patch by Karl Dubost. 3184 3185- bpo-40810: Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland. 3186 3187- bpo-1635741: Convert the _multibytecodec extension module (CJK codecs) to 3188 multi-phase initialization (:pep:`489`). Patch by Erlend E. Aasland. 3189 3190- bpo-42802: The distutils ``bdist_wininst`` command deprecated in Python 3191 3.8 has been removed. The distutils ``bdist_wheel`` command is now 3192 recommended to distribute binary packages on Windows. 3193 3194- bpo-24464: The undocumented built-in function 3195 ``sqlite3.enable_shared_cache`` is now deprecated, scheduled for removal 3196 in Python 3.12. Its use is strongly discouraged by the SQLite3 3197 documentation. Patch by Erlend E. Aasland. 3198 3199- bpo-42384: Make pdb populate sys.path[0] exactly the same as regular 3200 python execution. 3201 3202- bpo-42383: Fix pdb: previously pdb would fail to restart the debugging 3203 target if it was specified using a relative path and the current directory 3204 changed. 3205 3206- bpo-42005: Fix CLI of :mod:`cProfile` and :mod:`profile` to catch 3207 :exc:`BrokenPipeError`. 3208 3209- bpo-41604: Don't decrement the reference count of the previous user_ptr 3210 when set_panel_userptr fails. 3211 3212- bpo-41149: Allow executing callables that have a boolean value of 3213 ``False`` when passed to :class:`Threading.thread` as the target. Patch 3214 contributed by Barney Stratford. 3215 3216- bpo-38307: Add an 'end_lineno' attribute to the Class and Function objects 3217 that appear in the tree returned by pyclbr functions. This and the 3218 existing 'lineno' attribute define the extent of class and def statements. 3219 Patch by Aviral Srivastava. 3220 3221- bpo-39273: The ``BUTTON5_*`` constants are now exposed in the 3222 :mod:`curses` module if available. 3223 3224- bpo-33289: Correct call to :mod:`tkinter.colorchooser` to return RGB 3225 triplet of ints instead of floats. Patch by Cheryl Sabella. 3226 3227Documentation 3228------------- 3229 3230- bpo-40304: Fix doc for type(name, bases, dict). Patch by Boris 3231 Verkhovskiy and Éric Araujo. 3232 3233- bpo-42811: Updated importlib.utils.resolve_name() doc to use 3234 __spec__.parent instead of __package__. (Thanks Yair Frid.) 3235 3236Tests 3237----- 3238 3239- bpo-40823: Use :meth:`unittest.TestLoader().loadTestsFromTestCase` instead 3240 of :meth:`unittest.makeSuite` in :mod:`sqlite3` tests. Patch by Erlend E. 3241 Aasland. 3242 3243- bpo-40810: In :mod:`sqlite3`, fix ``CheckTraceCallbackContent`` for SQLite 3244 pre 3.7.15. 3245 3246Build 3247----- 3248 3249- bpo-43031: Pass ``--timeout=$(TESTTIMEOUT)`` option to the default profile 3250 task ``./python -m test --pgo`` command. 3251 3252- bpo-36143: ``make regen-all`` now also runs ``regen-keyword``. Patch by 3253 Victor Stinner. 3254 3255- bpo-42874: Removed the grep -q and -E flags in the tzpath validation 3256 section of the configure script to better accommodate users of some 3257 platforms (specifically Solaris 10). 3258 3259- bpo-31904: Add library search path by wr-cc in add_cross_compiling_paths() 3260 for VxWorks. 3261 3262- bpo-42856: Add ``--with-wheel-pkg-dir=PATH`` option to the ``./configure`` 3263 script. If specified, the :mod:`ensurepip` module looks for ``setuptools`` 3264 and ``pip`` wheel packages in this directory: if both are present, these 3265 wheel packages are used instead of ensurepip bundled wheel packages. 3266 3267 Some Linux distribution packaging policies recommend against bundling 3268 dependencies. For example, Fedora installs wheel packages in the 3269 ``/usr/share/python-wheels/`` directory and don't install the 3270 ``ensurepip._bundled`` package. 3271 3272Windows 3273------- 3274 3275- bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i 3276 3277- bpo-42584: Upgrade Windows installer to use SQLite 3.34.0. 3278 3279macOS 3280----- 3281 3282- bpo-42504: Ensure that the value of 3283 sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') is always a string, 3284 even in when the value is parsable as an integer. 3285 3286IDLE 3287---- 3288 3289- bpo-43008: Make IDLE invoke :func:`sys.excepthook` in normal, 2-process 3290 mode. Patch by Ken Hilton. 3291 3292- bpo-33065: Fix problem debugging user classes with __repr__ method. 3293 3294- bpo-23544: Disable Debug=>Stack Viewer when user code is running or 3295 Debugger is active, to prevent hang or crash. Patch by Zackery Spytz. 3296 3297- bpo-32631: Finish zzdummy example extension module: make menu entries 3298 work; add docstrings and tests with 100% coverage. 3299 3300C API 3301----- 3302 3303- bpo-42979: When Python is built in debug mode (with C assertions), calling 3304 a type slot like ``sq_length`` (``__len__()`` in Python) now fails with a 3305 fatal error if the slot succeeded with an exception set, or failed with no 3306 exception set. The error message contains the slot, the type name, and the 3307 current exception (if an exception is set). Patch by Victor Stinner. 3308 3309- bpo-43030: Fixed a compiler warning in :c:func:`Py_UNICODE_ISSPACE()` on 3310 platforms with signed ``wchar_t``. 3311 3312 3313What's New in Python 3.10.0 alpha 4? 3314==================================== 3315 3316*Release date: 2021-01-04* 3317 3318Core and Builtins 3319----------------- 3320 3321- bpo-42814: Fix undefined behavior in ``Objects/genericaliasobject.c``. 3322 3323- bpo-42806: Fix the column offsets for f-strings :mod:`ast` nodes 3324 surrounded by parentheses and for nodes that spawn multiple lines. Patch 3325 by Pablo Galindo. 3326 3327- bpo-40631: Fix regression where a single parenthesized starred expression 3328 was a valid assignment target. 3329 3330- bpo-27794: Improve the error message for failed writes/deletes to property 3331 objects. When possible, the attribute name is now shown. Patch provided by 3332 Yurii Karabas. 3333 3334- bpo-42745: Make the type attribute lookup cache per-interpreter. Patch by 3335 Victor Stinner. 3336 3337- bpo-42246: Jumps to jumps are not eliminated when it would break PEP 626. 3338 3339- bpo-42246: Make sure that the ``f_lasti`` and ``f_lineno`` attributes of a 3340 frame are set correctly when an exception is raised or re-raised. Required 3341 for PEP 626. 3342 3343- bpo-32381: The coding cookie (ex: ``# coding: latin1``) is now ignored in 3344 the command passed to the :option:`-c` command line option. Patch by 3345 Victor Stinner. 3346 3347- bpo-30858: Improve error location in expressions that contain assignments. 3348 Patch by Pablo Galindo and Lysandros Nikolaou. 3349 3350- bpo-42615: Remove jump commands made redundant by the deletion of 3351 unreachable bytecode blocks 3352 3353- bpo-42639: Make the :mod:`atexit` module state per-interpreter. It is now 3354 safe have more than one :mod:`atexit` module instance. Patch by Dong-hee 3355 Na and Victor Stinner. 3356 3357- bpo-32381: Fix encoding name when running a ``.pyc`` file on Windows: 3358 :c:func:`PyRun_SimpleFileExFlags()` now uses the correct encoding to 3359 decode the filename. 3360 3361- bpo-42195: The ``__args__`` of the parameterized generics for 3362 :data:`typing.Callable` and :class:`collections.abc.Callable` are now 3363 consistent. The ``__args__`` for :class:`collections.abc.Callable` are 3364 now flattened while :data:`typing.Callable`'s have not changed. To allow 3365 this change, :class:`types.GenericAlias` can now be subclassed and 3366 ``collections.abc.Callable``'s ``__class_getitem__`` will now return a 3367 subclass of ``types.GenericAlias``. Tests for typing were also updated to 3368 not subclass things like ``Callable[..., T]`` as that is not a valid base 3369 class. Finally, both ``Callable``\ s no longer validate their 3370 ``argtypes``, in ``Callable[[argtypes], resulttype]`` to prepare for 3371 :pep:`612`. Patch by Ken Jin. 3372 3373- bpo-40137: Convert functools module to use 3374 :c:func:`PyType_FromModuleAndSpec`. 3375 3376- bpo-40077: Convert :mod:`array` to use heap types, and establish module 3377 state for these. 3378 3379- bpo-42008: Fix _random.Random() seeding. 3380 3381- bpo-1635741: Port the :mod:`pyexpat` extension module to multi-phase 3382 initialization (:pep:`489`). 3383 3384- bpo-40521: Make the Unicode dictionary of interned strings compatible with 3385 subinterpreters. Patch by Victor Stinner. 3386 3387- bpo-39465: Make :c:func:`_PyUnicode_FromId` function compatible with 3388 subinterpreters. Each interpreter now has an array of identifier objects 3389 (interned strings decoded from UTF-8). Patch by Victor Stinner. 3390 3391Library 3392------- 3393 3394- bpo-42257: Handle empty string in variable executable in 3395 platform.libc_ver() 3396 3397- bpo-42772: randrange() now raises a TypeError when step is specified 3398 without a stop argument. Formerly, it silently ignored the step argument. 3399 3400- bpo-42759: Fixed equality comparison of :class:`tkinter.Variable` and 3401 :class:`tkinter.font.Font`. Objects which belong to different Tcl 3402 interpreters are now always different, even if they have the same name. 3403 3404- bpo-42756: Configure LMTP Unix-domain socket to use socket global default 3405 timeout when a timeout is not explicitly provided. 3406 3407- bpo-23328: Allow / character in username, password fields on _PROXY 3408 envars. 3409 3410- bpo-42740: :func:`typing.get_args` and :func:`typing.get_origin` now 3411 support :pep:`604` union types and :pep:`612` additions to ``Callable``. 3412 3413- bpo-42655: :mod:`subprocess` *extra_groups* is now correctly passed into 3414 setgroups() system call. 3415 3416- bpo-42727: ``EnumMeta.__prepare__`` now accepts ``**kwds`` to properly 3417 support ``__init_subclass__`` 3418 3419- bpo-38308: Add optional *weights* to *statistics.harmonic_mean()*. 3420 3421- bpo-42721: When simple query dialogs (:mod:`tkinter.simpledialog`), 3422 message boxes (:mod:`tkinter.messagebox`) or color choose dialog 3423 (:mod:`tkinter.colorchooser`) are created without arguments *master* and 3424 *parent*, and the default root window is not yet created, and 3425 :func:`~tkinter.NoDefaultRoot` was not called, a new temporal hidden root 3426 window will be created automatically. It will not be set as the default 3427 root window and will be destroyed right after closing the dialog window. 3428 It will help to use these simple dialog windows in programs which do not 3429 need other GUI. 3430 3431- bpo-25246: Optimized :meth:`collections.deque.remove`. 3432 3433- bpo-35728: Added a root parameter to :func:`tkinter.font.nametofont`. 3434 3435- bpo-15303: :mod:`tkinter` supports now widgets with boolean value False. 3436 3437- bpo-42681: Fixed range checks for color and pair numbers in :mod:`curses`. 3438 3439- bpo-42685: Improved placing of simple query windows in Tkinter (such as 3440 :func:`tkinter.simpledialog.askinteger`). They are now centered at the 3441 center of the parent window if it is specified and shown, otherwise at the 3442 center of the screen. 3443 3444- bpo-9694: Argparse help no longer uses the confusing phrase, "optional 3445 arguments". It uses "options" instead. 3446 3447- bpo-1635741: Port the :mod:`_thread` extension module to the multiphase 3448 initialization API (:pep:`489`) and convert its static types to heap 3449 types. 3450 3451- bpo-37961: Fix crash in :func:`tracemalloc.Traceback.__repr__` (regressed 3452 in Python 3.9). 3453 3454- bpo-42630: :mod:`tkinter` functions and constructors which need a default 3455 root window raise now :exc:`RuntimeError` with descriptive message instead 3456 of obscure :exc:`AttributeError` or :exc:`NameError` if it is not created 3457 yet or cannot be created automatically. 3458 3459- bpo-42639: :func:`atexit._run_exitfuncs` now logs callback exceptions 3460 using :data:`sys.unraisablehook`, rather than logging them directly into 3461 :data:`sys.stderr` and raise the last exception. 3462 3463- bpo-42644: ``logging.disable`` will now validate the types and value of 3464 its parameter. It also now accepts strings representing the levels (as 3465 does ``loging.setLevel``) instead of only the numerical values. 3466 3467- bpo-42639: At Python exit, if a callback registered with 3468 :func:`atexit.register` fails, its exception is now logged. Previously, 3469 only some exceptions were logged, and the last exception was always 3470 silently ignored. 3471 3472- bpo-36541: Fixed lib2to3.pgen2 to be able to parse PEP-570 positional only 3473 argument syntax. 3474 3475- bpo-42382: In ``importlib.metadata``: - ``EntryPoint`` objects now expose 3476 a ``.dist`` object referencing the ``Distribution`` when constructed from 3477 a ``Distribution``. - Add support for package discovery under package 3478 normalization rules. - The object returned by ``metadata()`` now has a 3479 formally-defined protocol called ``PackageMetadata`` with declared support 3480 for the ``.get_all()`` method. - Synced with importlib_metadata 3.3. 3481 3482- bpo-41877: A check is added against misspellings of autospect, auto_spec 3483 and set_spec being passed as arguments to patch, patch.object and 3484 create_autospec. 3485 3486- bpo-39717: [tarfile] update nested exception raising to use ``from None`` 3487 or ``from e`` 3488 3489- bpo-41877: AttributeError for suspected misspellings of assertions on 3490 mocks are now pointing out that the cause are misspelled assertions and 3491 also what to do if the misspelling is actually an intended attribute name. 3492 The unittest.mock document is also updated to reflect the current set of 3493 recognised misspellings. 3494 3495- bpo-41559: Implemented :pep:`612`: added ``ParamSpec`` and ``Concatenate`` 3496 to :mod:`typing`. Patch by Ken Jin. 3497 3498- bpo-42385: StrEnum: fix _generate_next_value_ to return a str 3499 3500- bpo-31904: Define THREAD_STACK_SIZE for VxWorks. 3501 3502- bpo-34750: [Enum] `_EnumDict.update()` is now supported 3503 3504- bpo-42517: Enum: private names do not become members / do not generate 3505 errors -- they remain normal attributes 3506 3507- bpo-42678: ``Enum``: call ``__init_subclass__`` after members have been 3508 added 3509 3510- bpo-28964: :func:`ast.literal_eval` adds line number information (if 3511 available) in error message for malformed nodes. 3512 3513- bpo-42470: :func:`random.sample` no longer warns on a sequence which is 3514 also a set. 3515 3516- bpo-31904: :func:`posixpath.expanduser` returns the input *path* unchanged 3517 if user home directory is None on VxWorks. 3518 3519- bpo-42388: Fix subprocess.check_output(..., input=None) behavior when 3520 text=True to be consistent with that of the documentation and 3521 universal_newlines=True. 3522 3523- bpo-34463: Fixed discrepancy between :mod:`traceback` and the interpreter 3524 in formatting of SyntaxError with lineno not set (:mod:`traceback` was 3525 changed to match interpreter). 3526 3527- bpo-42393: Raise :exc:`OverflowError` instead of silent truncation in 3528 :meth:`socket.ntohs` and :meth:`socket.htons`. Silent truncation was 3529 deprecated in Python 3.7. Patch by Erlend E. Aasland 3530 3531- bpo-42222: Harmonized :func:`random.randrange` argument handling to match 3532 :func:`range`. 3533 3534 * The integer test and conversion in ``randrange()`` now uses 3535 :func:`operator.index`. 3536 * Non-integer arguments to ``randrange()`` are deprecated. 3537 * The ``ValueError`` is deprecated in favor of a ``TypeError``. 3538 * It now runs a little faster than before. 3539 3540 (Contributed by Raymond Hettinger and Serhiy Storchaka.) 3541 3542- bpo-42163: Restore compatibility for ``uname_result`` around deepcopy and 3543 _replace. 3544 3545- bpo-42090: ``zipfile.Path.joinpath`` now accepts arbitrary arguments, same 3546 as ``pathlib.Path.joinpath``. 3547 3548- bpo-1635741: Port the _csv module to the multi-phase initialization API 3549 (:pep:`489`). 3550 3551- bpo-42059: :class:`typing.TypedDict` types created using the alternative 3552 call-style syntax now correctly respect the ``total`` keyword argument 3553 when setting their ``__required_keys__`` and ``__optional_keys__`` class 3554 attributes. 3555 3556- bpo-41960: Add ``globalns`` and ``localns`` parameters to the 3557 :func:`inspect.signature` and :meth:`inspect.Signature.from_callable`. 3558 3559- bpo-41907: fix ``format()`` behavior for ``IntFlag`` 3560 3561- bpo-41891: Ensure asyncio.wait_for waits for task completion 3562 3563- bpo-24792: Fixed bug where :mod:`zipimporter` sometimes reports an 3564 incorrect cause of import errors. 3565 3566- bpo-31904: Fix site and sysconfig modules for VxWorks RTOS which has no 3567 home directories. 3568 3569- bpo-41462: Add :func:`os.set_blocking()` support for VxWorks RTOS. 3570 3571- bpo-40219: Lowered :class:`tkinter.ttk.LabeledScale` dummy widget to 3572 prevent hiding part of the content label. 3573 3574- bpo-37193: Fixed memory leak in ``socketserver.ThreadingMixIn`` introduced 3575 in Python 3.7. 3576 3577- bpo-39068: Fix initialization race condition in :func:`a85encode` and 3578 :func:`b85encode` in :mod:`base64`. Patch by Brandon Stansbury. 3579 3580Documentation 3581------------- 3582 3583- bpo-17140: Add documentation for the 3584 :class:`multiprocessing.pool.ThreadPool` class. 3585 3586- bpo-34398: Prominently feature listings from the glossary in documentation 3587 search results. Patch by Ammar Askar. 3588 3589Tests 3590----- 3591 3592- bpo-42794: Update test_nntplib to use official group name of news.aioe.org 3593 for testing. Patch by Dong-hee Na. 3594 3595- bpo-31904: Skip some asyncio tests on VxWorks. 3596 3597- bpo-42641: Enhance ``test_select.test_select()``: it now takes 500 ms 3598 rather than 10 seconds. Use Python rather than a shell to make the test 3599 more portable. 3600 3601- bpo-31904: Skip some tests in _test_all_chown_common() on VxWorks. 3602 3603- bpo-42199: Fix bytecode helper assertNotInBytecode. 3604 3605- bpo-41443: Add more attribute checking in test_posix.py 3606 3607- bpo-31904: Disable os.popen and impacted tests on VxWorks 3608 3609- bpo-41439: Port test_ssl and test_uuid to VxWorks RTOS. 3610 3611Build 3612----- 3613 3614- bpo-42692: Fix __builtin_available check on older compilers. Patch by 3615 Joshua Root. 3616 3617- bpo-27640: Added ``--disable-test-modules`` option to the ``configure`` 3618 script: don't build nor install test modules. Patch by Xavier de Gaye, 3619 Thomas Petazzoni and Peixing Xin. 3620 3621- bpo-42604: Now all platforms use a value for the "EXT_SUFFIX" build 3622 variable derived from SOABI (for instance in freeBSD, "EXT_SUFFIX" is now 3623 ".cpython-310d.so" instead of ".so"). Previously only Linux, Mac and 3624 VxWorks were using a value for "EXT_SUFFIX" that included "SOABI". 3625 3626- bpo-42598: Fix implicit function declarations in configure which could 3627 have resulted in incorrect configuration checks. Patch contributed by 3628 Joshua Root. 3629 3630- bpo-31904: Enable libpython3.so for VxWorks. 3631 3632- bpo-29076: Add fish shell support to macOS installer. 3633 3634macOS 3635----- 3636 3637- bpo-42361: Update macOS installer build to use Tcl/Tk 8.6.11 (rc2, 3638 expected to be final release). 3639 3640- bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i. 3641 3642- bpo-42584: Update macOS installer to use SQLite 3.34.0. 3643 3644Tools/Demos 3645----------- 3646 3647- bpo-42726: Fixed Python 3 compatibility issue with gdb/libpython.py 3648 handling of attribute dictionaries. 3649 3650- bpo-42613: Fix ``freeze.py`` tool to use the prope config and library 3651 directories. Patch by Victor Stinner. 3652 3653C API 3654----- 3655 3656- bpo-42591: Export the :c:func:`Py_FrozenMain` function: fix a Python 3.9.0 3657 regression. Python 3.9 uses ``-fvisibility=hidden`` and the function was 3658 not exported explicitly and so not exported. 3659 3660- bpo-32381: Remove the private :c:func:`_Py_fopen` function which is no 3661 longer needed. Use :c:func:`_Py_wfopen` or :c:func:`_Py_fopen_obj` 3662 instead. Patch by Victor Stinner. 3663 3664- bpo-1635741: Port :mod:`resource` extension module to module state 3665 3666- bpo-42111: Update the ``xxlimited`` module to be a better example of how 3667 to use the limited C API. 3668 3669- bpo-40052: Fix an alignment build warning/error in function 3670 ``PyVectorcall_Function()``. Patch by Andreas Schneider, Antoine Pitrou 3671 and Petr Viktorin. 3672 3673 3674What's New in Python 3.10.0 alpha 3? 3675==================================== 3676 3677*Release date: 2020-12-07* 3678 3679Security 3680-------- 3681 3682- bpo-40791: Add ``volatile`` to the accumulator variable in 3683 ``hmac.compare_digest``, making constant-time-defeating optimizations less 3684 likely. 3685 3686Core and Builtins 3687----------------- 3688 3689- bpo-42576: ``types.GenericAlias`` will now raise a ``TypeError`` when 3690 attempting to initialize with a keyword argument. Previously, this would 3691 cause the interpreter to crash if the interpreter was compiled with debug 3692 symbols. This does not affect interpreters compiled for release. Patch by 3693 Ken Jin. 3694 3695- bpo-42536: Several built-in and standard library types now ensure that 3696 their internal result tuples are always tracked by the :term:`garbage 3697 collector <garbage collection>`: 3698 3699 - :meth:`collections.OrderedDict.items() <collections.OrderedDict>` 3700 3701 - :meth:`dict.items` 3702 3703 - :func:`enumerate` 3704 3705 - :func:`functools.reduce` 3706 3707 - :func:`itertools.combinations` 3708 3709 - :func:`itertools.combinations_with_replacement` 3710 3711 - :func:`itertools.permutations` 3712 3713 - :func:`itertools.product` 3714 3715 - :func:`itertools.zip_longest` 3716 3717 - :func:`zip` 3718 3719 Previously, they could have become untracked by a prior garbage 3720 collection. Patch by Brandt Bucher. 3721 3722- bpo-42500: Improve handling of exceptions near recursion limit. Converts a 3723 number of Fatal Errors in RecursionErrors. 3724 3725- bpo-42246: PEP 626: After a return, the f_lineno attribute of a frame is 3726 always the last line executed. 3727 3728- bpo-42435: Speed up comparison of bytes objects with non-bytes objects 3729 when option :option:`-b` is specified. Speed up comparison of bytarray 3730 objects with non-buffer object. 3731 3732- bpo-1635741: Port the ``_warnings`` extension module to the multi-phase 3733 initialization API (:pep:`489`). Patch by Victor Stinner. 3734 3735- bpo-41686: On Windows, the ``SIGINT`` event, ``_PyOS_SigintEvent()``, is 3736 now created even if Python is configured to not install signal handlers 3737 (if :c:member:`PyConfig.install_signal_handlers` equals to 0, or 3738 ``Py_InitializeEx(0)``). 3739 3740- bpo-42381: Allow assignment expressions in set literals and set 3741 comprehensions as per PEP 572. Patch by Pablo Galindo. 3742 3743- bpo-42202: Change function parameters annotations internal representation 3744 to tuple of strings. Patch provided by Yurii Karabas. 3745 3746- bpo-42374: Fix a regression introduced by the new parser, where an 3747 unparenthesized walrus operator was not allowed within generator 3748 expressions. 3749 3750- bpo-42316: Allow an unparenthesized walrus in subscript indexes. 3751 3752- bpo-42349: Make sure that the compiler front-end produces a well-formed 3753 control flow graph. Be be more aggressive in the compiler back-end, as it 3754 is now safe to do so. 3755 3756- bpo-42296: On Windows, fix a regression in signal handling which prevented 3757 to interrupt a program using CTRL+C. The signal handler can be run in a 3758 thread different than the Python thread, in which case the test deciding 3759 if the thread can handle signals is wrong. 3760 3761- bpo-42332: :class:`types.GenericAlias` objects can now be the targets of 3762 weakrefs. 3763 3764- bpo-42282: Optimise constant subexpressions that appear as part of named 3765 expressions (previously the AST optimiser did not descend into named 3766 expressions). Patch by Nick Coghlan. 3767 3768- bpo-42266: Fixed a bug with the LOAD_ATTR opcode cache that was not 3769 respecting monkey-patching a class-level attribute to make it a 3770 descriptor. Patch by Pablo Galindo. 3771 3772- bpo-40077: Convert :mod:`queue` to use heap types. 3773 3774- bpo-42246: Improved accuracy of line tracing events and f_lineno attribute 3775 of Frame objects. See PEP 626 for details. 3776 3777- bpo-40077: Convert :mod:`mmap` to use heap types. 3778 3779- bpo-42233: Allow ``GenericAlias`` objects to use :ref:`union type 3780 expressions <types-union>`. This allows expressions like ``list[int] | 3781 dict[float, str]`` where previously a ``TypeError`` would have been 3782 thrown. This also fixes union type expressions not de-duplicating 3783 ``GenericAlias`` objects. (Contributed by Ken Jin in :issue:`42233`.) 3784 3785- bpo-26131: The import system triggers a `ImportWarning` when it falls back 3786 to using `load_module()`. 3787 3788Library 3789------- 3790 3791- bpo-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed. 3792 Replace the special purpose getallmatchingheaders with generic get_all 3793 method and add relevant tests. 3794 3795 Original Patch by Martin Panter. Modified by Senthil Kumaran. 3796 3797- bpo-42562: Fix issue when dis failed to parse function that has no line 3798 numbers. Patch provided by Yurii Karabas. 3799 3800- bpo-17735: :func:`inspect.findsource` now raises :exc:`OSError` instead of 3801 :exc:`IndexError` when :attr:`co_lineno` of a code object is greater than 3802 the file length. This can happen, for example, when a file is edited after 3803 it was imported. PR by Irit Katriel. 3804 3805- bpo-42116: Fix handling of trailing comments by :func:`inspect.getsource`. 3806 3807- bpo-42532: Remove unexpected call of ``__bool__`` when passing a 3808 ``spec_arg`` argument to a Mock. 3809 3810- bpo-38200: Added itertools.pairwise() 3811 3812- bpo-41818: Fix test_master_read() so that it succeeds on all platforms 3813 that either raise OSError or return b"" upon reading from master. 3814 3815- bpo-42487: ChainMap.__iter__ no longer calls __getitem__ on underlying 3816 maps 3817 3818- bpo-42482: :class:`~traceback.TracebackException` no longer holds a 3819 reference to the exception's traceback object. Consequently, instances of 3820 TracebackException for equivalent but non-equal exceptions now compare as 3821 equal. 3822 3823- bpo-41818: Make test_openpty() avoid unexpected success due to number of 3824 rows and/or number of columns being == 0. 3825 3826- bpo-42392: Remove loop parameter from ``asyncio.subprocess`` and 3827 ``asyncio.tasks`` functions. Patch provided by Yurii Karabas. 3828 3829- bpo-42392: Remove loop parameter from ``asyncio.open_connection`` and 3830 ``asyncio.start_server`` functions. Patch provided by Yurii Karabas. 3831 3832- bpo-28468: Add :func:`platform.freedesktop_os_release` function to parse 3833 freedesktop.org ``os-release`` files. 3834 3835- bpo-42299: Removed the ``formatter`` module, which was deprecated in 3836 Python 3.4. It is somewhat obsolete, little used, and not tested. It was 3837 originally scheduled to be removed in Python 3.6, but such removals were 3838 delayed until after Python 2.7 EOL. Existing users should copy whatever 3839 classes they use into their code. Patch by Dong-hee Na and and Terry J. 3840 Reedy. 3841 3842- bpo-26131: Deprecate zipimport.zipimporter.load_module() in favour of 3843 exec_module(). 3844 3845- bpo-41818: Updated tests for the pty library. test_basic() has been 3846 changed to test_openpty(); this additionally checks if slave termios and 3847 slave winsize are being set properly by pty.openpty(). In order to add 3848 support for FreeBSD, NetBSD, OpenBSD, and Darwin, this also adds 3849 test_master_read(), which demonstrates that pty.spawn() should not depend 3850 on an OSError to exit from its copy loop. 3851 3852- bpo-42392: Remove loop parameter from ``__init__`` in all 3853 ``asyncio.locks`` and ``asyncio.Queue`` classes. Patch provided by Yurii 3854 Karabas. 3855 3856- bpo-15450: Make :class:`filecmp.dircmp` respect subclassing. Now the 3857 :attr:`filecmp.dircmp.subdirs` behaves as expected when subclassing 3858 dircmp. 3859 3860- bpo-42413: The exception :exc:`socket.timeout` is now an alias of 3861 :exc:`TimeoutError`. 3862 3863- bpo-31904: Support signal module on VxWorks. 3864 3865- bpo-42406: We fixed an issue in `pickle.whichmodule` in which importing 3866 `multiprocessing` could change the how pickle identifies which module an 3867 object belongs to, potentially breaking the unpickling of those objects. 3868 3869- bpo-42403: Simplify the :mod:`importlib` external bootstrap code: 3870 ``importlib._bootstrap_external`` now uses regular imports to import 3871 builtin modules. When it is imported, the builtin :func:`__import__()` 3872 function is already fully working and so can be used to import builtin 3873 modules like :mod:`sys`. Patch by Victor Stinner. 3874 3875- bpo-1635741: Convert _sre module types to heap types (PEP 384). Patch by 3876 Erlend E. Aasland. 3877 3878- bpo-42375: subprocess module update for DragonFlyBSD support. 3879 3880- bpo-41713: Port the ``_signal`` extension module to the multi-phase 3881 initialization API (:pep:`489`). Patch by Victor Stinner and Mohamed 3882 Koubaa. 3883 3884- bpo-37205: :func:`time.time()`, :func:`time.perf_counter()` and 3885 :func:`time.monotonic()` functions can no longer fail with a Python fatal 3886 error, instead raise a regular Python exception on failure. 3887 3888- bpo-42328: Fixed :meth:`tkinter.ttk.Style.map`. The function accepts now 3889 the representation of the default state as empty sequence (as returned by 3890 ``Style.map()``). The structure of the result is now the same on all 3891 platform and does not depend on the value of ``wantobjects``. 3892 3893- bpo-42345: Fix various issues with ``typing.Literal`` parameter handling 3894 (flatten, deduplicate, use type to cache key). Patch provided by Yurii 3895 Karabas. 3896 3897- bpo-37205: :func:`time.perf_counter()` on Windows and 3898 :func:`time.monotonic()` on macOS are now system-wide. Previously, they 3899 used an offset computed at startup to reduce the precision loss caused by 3900 the float type. Use :func:`time.perf_counter_ns()` and 3901 :func:`time.monotonic_ns()` added in Python 3.7 to avoid this precision 3902 loss. 3903 3904- bpo-42318: Fixed support of non-BMP characters in :mod:`tkinter` on macOS. 3905 3906- bpo-42350: Fix the :class:`threading.Thread` class at fork: do nothing if 3907 the thread is already stopped (ex: fork called at Python exit). 3908 Previously, an error was logged in the child process. 3909 3910- bpo-42333: Port _ssl extension module to heap types. 3911 3912- bpo-42014: The ``onerror`` callback from ``shutil.rmtree`` now receives 3913 correct function when ``os.open`` fails. 3914 3915- bpo-42237: Fix `os.sendfile()` on illumos. 3916 3917- bpo-42308: Add :data:`threading.__excepthook__` to allow retrieving the 3918 original value of :func:`threading.excepthook` in case it is set to a 3919 broken or a different value. Patch by Mario Corchero. 3920 3921- bpo-42131: Implement PEP 451/spec methods on zipimport.zipimporter: 3922 find_spec(), create_module(), and exec_module(). 3923 3924 This also allows for the documented deprecation of find_loader(), 3925 find_module(), and load_module(). 3926 3927- bpo-41877: Mock objects which are not unsafe will now raise an 3928 AttributeError if an attribute with the prefix asert, aseert, or assrt is 3929 accessed, in addition to this already happening for the prefixes assert or 3930 assret. 3931 3932- bpo-42264: ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete 3933 since Python 3.3, when it was made an alias to :class:`str`. It is now 3934 deprecated, scheduled for removal in Python 3.12. 3935 3936- bpo-42251: Added :func:`threading.gettrace` and 3937 :func:`threading.getprofile` to retrieve the functions set by 3938 :func:`threading.settrace` and :func:`threading.setprofile` respectively. 3939 Patch by Mario Corchero. 3940 3941- bpo-42249: Fixed writing binary Plist files larger than 4 GiB. 3942 3943- bpo-42236: On Unix, the :func:`os.device_encoding` function now returns 3944 ``'UTF-8'`` rather than the device encoding if the :ref:`Python UTF-8 Mode 3945 <utf8-mode>` is enabled. 3946 3947- bpo-41754: webbrowser: Ignore *NotADirectoryError* when calling 3948 ``xdg-settings``. 3949 3950- bpo-42183: Fix a stack overflow error for asyncio Task or Future repr(). 3951 3952 The overflow occurs under some circumstances when a Task or Future 3953 recursively returns itself. 3954 3955- bpo-42140: Improve asyncio.wait function to create the futures set just 3956 one time. 3957 3958- bpo-42133: Update various modules in the stdlib to fall back on 3959 `__spec__.loader` when `__loader__` isn't defined on a module. 3960 3961- bpo-26131: The `load_module()` methods found in importlib now trigger a 3962 DeprecationWarning. 3963 3964- bpo-39825: Windows: Change ``sysconfig.get_config_var('EXT_SUFFIX')`` to 3965 the expected full ``platform_tag.extension`` format. Previously it was 3966 hard-coded to ``.pyd``, now it is compatible with ``distutils.sysconfig`` 3967 and will result in something like ``.cp38-win_amd64.pyd``. This brings 3968 windows into conformance with the other platforms. 3969 3970- bpo-26389: The :func:`traceback.format_exception`, 3971 :func:`traceback.format_exception_only`, and 3972 :func:`traceback.print_exception` functions can now take an exception 3973 object as a positional-only argument. 3974 3975- bpo-41889: Enum: fix regression involving inheriting a multiply-inherited 3976 enum 3977 3978- bpo-41861: Convert :mod:`sqlite3` to use heap types (PEP 384). Patch by 3979 Erlend E. Aasland. 3980 3981- bpo-40624: Added support for the XPath ``!=`` operator in xml.etree 3982 3983- bpo-28850: Fix :meth:`pprint.PrettyPrinter.format` overrides being ignored 3984 for contents of small containers. The :func:`pprint._safe_repr` function 3985 was removed. 3986 3987- bpo-41625: Expose the :c:func:`splice` as :func:`os.splice` in the 3988 :mod:`os` module. Patch by Pablo Galindo 3989 3990- bpo-34215: Clarify the error message for 3991 :exc:`asyncio.IncompleteReadError` when ``expected`` is ``None``. 3992 3993- bpo-41543: Add async context manager support for contextlib.nullcontext. 3994 3995- bpo-21041: :attr:`pathlib.PurePath.parents` now supports negative 3996 indexing. Patch contributed by Yaroslav Pankovych. 3997 3998- bpo-41332: Added missing connect_accepted_socket() method to 3999 ``asyncio.AbstractEventLoop``. 4000 4001- bpo-12800: Extracting a symlink from a tarball should succeed and 4002 overwrite the symlink if it already exists. The fix is to remove the 4003 existing file or symlink before extraction. Based on patch by Chris AtLee, 4004 Jeffrey Kintscher, and Senthil Kumaran. 4005 4006- bpo-40968: :mod:`urllib.request` and :mod:`http.client` now send 4007 ``http/1.1`` ALPN extension during TLS handshake when no custom context is 4008 supplied. 4009 4010- bpo-41001: Add func:`os.eventfd` to provide a low level interface for 4011 Linux's event notification file descriptor. 4012 4013- bpo-40816: Add AsyncContextDecorator to contextlib to support async 4014 context manager as a decorator. 4015 4016- bpo-40550: Fix time-of-check/time-of-action issue in 4017 subprocess.Popen.send_signal. 4018 4019- bpo-39411: Add an ``is_async`` identifier to :mod:`pyclbr`'s ``Function`` 4020 objects. Patch by Batuhan Taskaya 4021 4022- bpo-35498: Add slice support to :attr:`pathlib.PurePath.parents`. 4023 4024Documentation 4025------------- 4026 4027- bpo-42238: Tentative to deprecate ``make suspicious`` by first removing it 4028 from the CI and documentation builds, but keeping it around for manual 4029 uses. 4030 4031- bpo-42153: Fix the URL for the IMAP protocol documents. 4032 4033- bpo-41028: Language and version switchers, previously maintained in every 4034 cpython branches, are now handled by docsbuild-script. 4035 4036Tests 4037----- 4038 4039- bpo-41473: Re-enable test_gdb on gdb 9.2 and newer: 4040 https://bugzilla.redhat.com/show_bug.cgi?id=1866884 bug is fixed in gdb 4041 10.1. 4042 4043- bpo-42553: Fix ``test_asyncio.test_call_later()`` race condition: don't 4044 measure asyncio performance in the ``call_later()`` unit test. The test 4045 failed randomly on the CI. 4046 4047- bpo-31904: Fix test_netrc on VxWorks: create temporary directories using 4048 temp_cwd(). 4049 4050- bpo-31904: skip test_getaddrinfo_ipv6_scopeid_symbolic and 4051 test_getnameinfo_ipv6_scopeid_symbolic on VxWorks 4052 4053- bpo-31904: skip test_test of test_mailcap on VxWorks 4054 4055- bpo-31904: add shell requirement for test_pipes 4056 4057- bpo-31904: skip some tests related to fifo on VxWorks 4058 4059- bpo-31904: Fix test_doctest.py failures for VxWorks. 4060 4061- bpo-40754: Include ``_testinternalcapi`` module in Windows installer for 4062 test suite 4063 4064- bpo-41561: test_ssl: skip test_min_max_version_mismatch when TLS 1.0 is 4065 not available 4066 4067- bpo-31904: Fix os module failures for VxWorks RTOS. 4068 4069- bpo-31904: Fix fifo test cases for VxWorks RTOS. 4070 4071Build 4072----- 4073 4074- bpo-31904: remove libnet dependency from detect_socket() for VxWorks 4075 4076- bpo-42398: Fix a race condition in "make regen-all" when make -jN option 4077 is used to run jobs in parallel. The clinic.py script now only use atomic 4078 write to write files. Moveover, generated files are now left unchanged if 4079 the content does not change, to not change the file modification time. 4080 4081- bpo-41617: Fix building ``pycore_bitutils.h`` internal header on old clang 4082 version without ``__builtin_bswap16()`` (ex: Xcode 4.6.3 on Mac OS X 4083 10.7). Patch by Joshua Root and Victor Stinner. 4084 4085- bpo-38823: It is no longer possible to build the ``_ctypes`` extension 4086 module without :c:type:`wchar_t` type: remove ``CTYPES_UNICODE`` macro. 4087 Anyway, the :c:type:`wchar_t` type is required to build Python. Patch by 4088 Victor Stinner. 4089 4090- bpo-42087: Support was removed for AIX 5.3 and below. See :issue:`40680`. 4091 4092- bpo-40998: Addressed three compiler warnings found by undefined behavior 4093 sanitizer (ubsan). 4094 4095Windows 4096------- 4097 4098- bpo-42120: Remove macro definition of ``copysign`` (to ``_copysign``) in 4099 headers. 4100 4101- bpo-38506: The Windows launcher now properly handles Python 3.10 when 4102 listing installed Python versions. 4103 4104macOS 4105----- 4106 4107- bpo-42504: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11 4108 4109- bpo-41116: Ensure distutils.unixxcompiler.find_library_file can find 4110 system provided libraries on macOS 11. 4111 4112- bpo-41100: Add support for macOS 11 and Apple Silicon systems. 4113 4114 It is now possible to build "Universal 2" binaries using 4115 "--enable-universalsdk --with-universal-archs=universal2". 4116 4117 Binaries build on later macOS versions can be deployed back to older 4118 versions (tested up to macOS 10.9), when using the correct deployment 4119 target. This is tested using Xcode 11 and later. 4120 4121- bpo-42232: Added Darwin specific madvise options to mmap module. 4122 4123- bpo-38443: The ``--enable-universalsdk`` and ``--with-universal-archs`` 4124 options for the configure script now check that the specified 4125 architectures can be used. 4126 4127IDLE 4128---- 4129 4130- bpo-42508: Keep IDLE running on macOS. Remove obsolete workaround that 4131 prevented running files with shortcuts when using new universal2 4132 installers built on macOS 11. 4133 4134- bpo-42426: Fix reporting offset of the RE error in searchengine. 4135 4136- bpo-42415: Get docstrings for IDLE calltips more often by using 4137 inspect.getdoc. 4138 4139Tools/Demos 4140----------- 4141 4142- bpo-42212: The smelly.py script now also checks the Python dynamic library 4143 and extension modules, not only the Python static library. Make also the 4144 script more verbose: explain what it does. 4145 4146- bpo-36310: Allow :file:`Tools/i18n/pygettext.py` to detect calls to 4147 ``gettext`` in f-strings. 4148 4149C API 4150----- 4151 4152- bpo-42423: The :c:func:`PyType_FromSpecWithBases` and 4153 :c:func:`PyType_FromModuleAndSpec` functions now accept a single class as 4154 the *bases* argument. 4155 4156- bpo-1635741: Port :mod:`select` extension module to multiphase 4157 initialization (:pep:`489`). 4158 4159- bpo-1635741: Port _posixsubprocess extension module to multiphase 4160 initialization (:pep:`489`). 4161 4162- bpo-1635741: Port _posixshmem extension module to multiphase 4163 initialization (:pep:`489`) 4164 4165- bpo-1635741: Port _struct extension module to multiphase initialization 4166 (:pep:`489`) 4167 4168- bpo-1635741: Port :mod:`spwd` extension module to multiphase 4169 initialization (:pep:`489`) 4170 4171- bpo-1635741: Port :mod:`gc` extension module to multiphase initialization 4172 (:pep:`489`) 4173 4174- bpo-1635741: Port _queue extension module to multiphase initialization 4175 (:pep:`489`) 4176 4177- bpo-39573: Convert :c:func:`Py_TYPE` and :c:func:`Py_SIZE` back to macros 4178 to allow using them as an l-value. Many third party C extension modules 4179 rely on the ability of using Py_TYPE() and Py_SIZE() to set an object type 4180 and size: ``Py_TYPE(obj) = type;`` and ``Py_SIZE(obj) = size;``. 4181 4182- bpo-1635741: Port :mod:`symtable` extension module to multiphase 4183 initialization (:pep:`489`) 4184 4185- bpo-1635741: Port :mod:`grp` and :mod:`pwd` extension modules to 4186 multiphase initialization (:pep:`489`) 4187 4188- bpo-1635741: Port _random extension module to multiphase initialization 4189 (:pep:`489`) 4190 4191- bpo-1635741: Port _hashlib extension module to multiphase initialization 4192 (:pep:`489`) 4193 4194- bpo-41713: Removed the undocumented ``PyOS_InitInterrupts()`` function. 4195 Initializing Python already implicitly installs signal handlers: see 4196 :c:member:`PyConfig.install_signal_handlers`. Patch by Victor Stinner. 4197 4198- bpo-40170: The ``Py_TRASHCAN_BEGIN`` macro no longer accesses PyTypeObject 4199 attributes, but now can get the condition by calling the new private 4200 :c:func:`_PyTrash_cond()` function which hides implementation details. 4201 4202- bpo-42260: :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, 4203 :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`, 4204 :c:func:`Py_GetPythonHome` and :c:func:`Py_GetProgramName` functions now 4205 return ``NULL`` if called before :c:func:`Py_Initialize` (before Python is 4206 initialized). Use the new :ref:`Python Initialization Configuration API 4207 <init-config>` to get the :ref:`Python Path Configuration. 4208 <init-path-config>`. Patch by Victor Stinner. 4209 4210- bpo-42260: The :c:func:`PyConfig_Read` function now only parses 4211 :c:member:`PyConfig.argv` arguments once: :c:member:`PyConfig.parse_argv` 4212 is set to ``2`` after arguments are parsed. Since Python arguments are 4213 strippped from :c:member:`PyConfig.argv`, parsing arguments twice would 4214 parse the application options as Python options. 4215 4216- bpo-42262: Added :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to 4217 increment the reference count of an object and return the object. Patch by 4218 Victor Stinner. 4219 4220- bpo-42260: When :c:func:`Py_Initialize` is called twice, the second call 4221 now updates more :mod:`sys` attributes for the configuration, rather than 4222 only :data:`sys.argv`. Patch by Victor Stinner. 4223 4224- bpo-41832: The :c:func:`PyType_FromModuleAndSpec` function now accepts 4225 NULL ``tp_doc`` slot. 4226 4227- bpo-1635741: Added :c:func:`PyModule_AddObjectRef` function: similar to 4228 :c:func:`PyModule_AddObject` but don't steal a reference to the value on 4229 success. Patch by Victor Stinner. 4230 4231- bpo-42171: The :c:data:`METH_FASTCALL` calling convention is added to the 4232 limited API. The functions :c:func:`PyModule_AddType`, 4233 :c:func:`PyType_FromModuleAndSpec`, :c:func:`PyType_GetModule` and 4234 :c:func:`PyType_GetModuleState` are added to the limited API on Windows. 4235 4236- bpo-42085: Add dedicated entry to PyAsyncMethods for sending values 4237 4238- bpo-41073: :c:func:`PyType_GetSlot()` can now accept static types. 4239 4240- bpo-30459: :c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and 4241 :c:func:`PyCell_SET` macros can no longer be used as l-value or r-value. 4242 For example, ``x = PyList_SET_ITEM(a, b, c)`` and ``PyList_SET_ITEM(a, b, 4243 c) = x`` now fail with a compiler error. It prevents bugs like ``if 4244 (PyList_SET_ITEM (a, b, c) < 0) ...`` test. Patch by Zackery Spytz and 4245 Victor Stinner. 4246 4247 4248What's New in Python 3.10.0 alpha 2? 4249==================================== 4250 4251*Release date: 2020-11-03* 4252 4253Security 4254-------- 4255 4256- bpo-42103: Prevented potential DoS attack via CPU and RAM exhaustion when 4257 processing malformed Apple Property List files in binary format. 4258 4259- bpo-42051: The :mod:`plistlib` module no longer accepts entity 4260 declarations in XML plist files to avoid XML vulnerabilities. This should 4261 not affect users as entity declarations are not used in regular plist 4262 files. 4263 4264Core and Builtins 4265----------------- 4266 4267- bpo-42236: If the ``nl_langinfo(CODESET)`` function returns an empty 4268 string, Python now uses UTF-8 as the filesystem encoding. Patch by Victor 4269 Stinner. 4270 4271- bpo-42218: Fixed a bug in the PEG parser that was causing crashes in debug 4272 mode. Now errors are checked in left-recursive rules to avoid cases where 4273 such errors do not get handled in time and appear as long-distance crashes 4274 in other places. 4275 4276- bpo-42214: Fixed a possible crash in the PEG parser when checking for the 4277 '!=' token in the ``barry_as_flufl`` rule. Patch by Pablo Galindo. 4278 4279- bpo-42206: Propagate and raise the errors caused by 4280 :c:func:`PyAST_Validate` in the parser. 4281 4282- bpo-41796: The :mod:`ast` module internal state is now per interpreter. 4283 Patch by Victor Stinner. 4284 4285- bpo-42143: Fix handling of errors during creation of ``PyFunctionObject``, 4286 which resulted in operations on uninitialized memory. Patch by Yonatan 4287 Goldschmidt. 4288 4289- bpo-41659: Fix a bug in the parser, where a curly brace following a 4290 `primary` didn't fail immediately. This led to invalid expressions like `a 4291 {b}` to throw a :exc:`SyntaxError` with a wrong offset, or invalid 4292 expressions ending with a curly brace like `a {` to not fail immediately 4293 in the REPL. 4294 4295- bpo-42150: Fix possible buffer overflow in the new parser when checking 4296 for continuation lines. Patch by Pablo Galindo. 4297 4298- bpo-42123: Run the parser two times. On the first run, disable all the 4299 rules that only generate better error messages to gain performance. If 4300 there's a parse failure, run the parser a second time with those enabled. 4301 4302- bpo-42093: The ``LOAD_ATTR`` instruction now uses new "per opcode cache" 4303 mechanism and it is about 36% faster now. Patch by Pablo Galindo and Yury 4304 Selivanov. 4305 4306- bpo-42030: Support for the legacy AIX-specific shared library loading 4307 support has been removed. All versions of AIX since 4.3 have supported and 4308 defaulted to using the common Unix mechanism instead. 4309 4310- bpo-41984: The garbage collector now tracks all user-defined classes. 4311 Patch by Brandt Bucher. 4312 4313- bpo-41993: Fixed potential issues with removing not completely initialized 4314 module from ``sys.modules`` when import fails. 4315 4316- bpo-41979: Star-unpacking is now allowed for with item's targets in the 4317 PEG parser. 4318 4319- bpo-41974: Removed special methods ``__int__``, ``__float__``, 4320 ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__rfloordiv__``, 4321 ``__rmod__`` and ``__rdivmod__`` of the :class:`complex` class. They 4322 always raised a :exc:`TypeError`. 4323 4324- bpo-41902: Micro optimization when compute 4325 :c:member:`~PySequenceMethods.sq_item` and 4326 :c:member:`~PyMappingMethods.mp_subscript` of :class:`range`. Patch by 4327 Dong-hee Na. 4328 4329- bpo-41894: When loading a native module and a load failure occurs, prevent 4330 a possible UnicodeDecodeError when not running in a UTF-8 locale by 4331 decoding the load error message using the current locale's encoding. 4332 4333- bpo-41902: Micro optimization for range.index if step is 1. Patch by 4334 Dong-hee Na. 4335 4336- bpo-41435: Add `sys._current_exceptions()` function to retrieve a 4337 dictionary mapping each thread's identifier to the topmost exception 4338 currently active in that thread at the time the function is called. 4339 4340- bpo-38605: Enable ``from __future__ import annotations`` (:pep:`563`) by 4341 default. The values found in :attr:`__annotations__` dicts are now 4342 strings, e.g. ``{"x": "int"}`` instead of ``{"x": int}``. 4343 4344Library 4345------- 4346 4347- bpo-35455: On Solaris, :func:`~time.thread_time` is now implemented with 4348 ``gethrvtime()`` because ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` is not 4349 always available. Patch by Jakub Kulik. 4350 4351- bpo-42233: The :func:`repr` of :mod:`typing` types containing 4352 :ref:`Generic Alias Types <types-genericalias>` previously did not show 4353 the parameterized types in the ``GenericAlias``. They have now been 4354 changed to do so. 4355 4356- bpo-29566: ``binhex.binhex()`` consistently writes macOS 9 line endings. 4357 4358- bpo-26789: The :class:`logging.FileHandler` class now keeps a reference to 4359 the builtin :func:`open` function to be able to open or reopen the file 4360 during Python finalization. Fix errors like: ``NameError: name 'open' is 4361 not defined``. Patch by Victor Stinner. 4362 4363- bpo-42157: Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an 4364 internal PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` 4365 structure was moved to the internal C API. Patch by Victor Stinner. 4366 4367- bpo-42157: Convert the :mod:`unicodedata` extension module to the 4368 multiphase initialization API (:pep:`489`) and convert the 4369 ``unicodedata.UCD`` static type to a heap type. Patch by Mohamed Koubaa 4370 and Victor Stinner. 4371 4372- bpo-42146: Fix memory leak in :func:`subprocess.Popen` in case an uid 4373 (gid) specified in `user` (`group`, `extra_groups`) overflows `uid_t` 4374 (`gid_t`). 4375 4376- bpo-42103: :exc:`~plistlib.InvalidFileException` and :exc:`RecursionError` 4377 are now the only errors caused by loading malformed binary Plist file 4378 (previously ValueError and TypeError could be raised in some specific 4379 cases). 4380 4381- bpo-41490: In ``importlib.resources``, ``.path`` method is more aggressive 4382 about releasing handles to zipfile objects early, enabling use-cases like 4383 certifi to leave the context open but delete the underlying zip file. 4384 4385- bpo-41052: Pickling heap types implemented in C with protocols 0 and 1 4386 raises now an error instead of producing incorrect data. 4387 4388- bpo-42089: In ``importlib.metadata.PackageNotFoundError``, make reference 4389 to the package metadata being missing to improve the user experience. 4390 4391- bpo-41491: plistlib: fix parsing XML plists with hexadecimal integer 4392 values 4393 4394- bpo-42065: Fix an incorrectly formatted error from 4395 :meth:`_codecs.charmap_decode` when called with a mapped value outside the 4396 range of valid Unicode code points. PR by Max Bernstein. 4397 4398- bpo-41966: Fix pickling pure Python :class:`datetime.time` subclasses. 4399 Patch by Dean Inwood. 4400 4401- bpo-19270: :meth:`sched.scheduler.cancel()` will now cancel the correct 4402 event, if two events with same priority are scheduled for the same time. 4403 Patch by Bar Harel. 4404 4405- bpo-28660: :func:`textwrap.wrap` now attempts to break long words after 4406 hyphens when ``break_long_words=True`` and ``break_on_hyphens=True``. 4407 4408- bpo-35823: Use ``vfork()`` instead of ``fork()`` for 4409 :func:`subprocess.Popen` on Linux to improve performance in cases where it 4410 is deemed safe. 4411 4412- bpo-42043: Add support for ``zipfile.Path`` inheritance. 4413 ``zipfile.Path.is_file()`` now returns False for non-existent names. 4414 ``zipfile.Path`` objects now expose a ``.filename`` attribute and rely on 4415 that to resolve ``.name`` and ``.parent`` when the ``Path`` object is at 4416 the root of the zipfile. 4417 4418- bpo-42021: Fix possible ref leaks in :mod:`sqlite3` module init. 4419 4420- bpo-39101: Fixed tests using IsolatedAsyncioTestCase from hanging on 4421 BaseExceptions. 4422 4423- bpo-41976: Fixed a bug that was causing :func:`ctypes.util.find_library` 4424 to return ``None`` when triying to locate a library in an environment when 4425 gcc>=9 is available and ``ldconfig`` is not. Patch by Pablo Galindo 4426 4427- bpo-41943: Fix bug where TestCase.assertLogs doesn't correctly filter 4428 messages by level. 4429 4430- bpo-41923: Implement :pep:`613`, introducing :data:`typing.TypeAlias` 4431 annotation. 4432 4433- bpo-41905: A new function in abc: *update_abstractmethods* to re-calculate 4434 an abstract class's abstract status. In addition, *dataclass* has been 4435 changed to call this function. 4436 4437- bpo-23706: Added *newline* parameter to ``pathlib.Path.write_text()``. 4438 4439- bpo-41876: Tkinter font class repr uses font name 4440 4441- bpo-41831: ``str()`` for the ``type`` attribute of the ``tkinter.Event`` 4442 object always returns now the numeric code returned by Tk instead of the 4443 name of the event type. 4444 4445- bpo-39337: :func:`encodings.normalize_encoding` now ignores non-ASCII 4446 characters. 4447 4448- bpo-41747: Ensure all methods that generated from 4449 :func:`dataclasses.dataclass` objects now have the proper ``__qualname__`` 4450 attribute referring to the class they belong to. Patch by Batuhan Taskaya. 4451 4452- bpo-30681: Handle exceptions caused by unparsable date headers when using 4453 email "default" policy. Patch by Tim Bell, Georges Toth 4454 4455- bpo-41586: Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module. Allow 4456 setting pipesize on subprocess.Popen. 4457 4458- bpo-41229: Add ``contextlib.aclosing`` for deterministic cleanup of async 4459 generators which is analogous to ``contextlib.closing`` for non-async 4460 generators. Patch by Joongi Kim and John Belmonte. 4461 4462- bpo-16396: Allow ``ctypes.wintypes`` to be imported on non-Windows 4463 systems. 4464 4465- bpo-4356: Add a key function to the bisect module. 4466 4467- bpo-40592: :func:`shutil.which` now ignores empty entries in 4468 :envvar:`PATHEXT` instead of treating them as a match. 4469 4470- bpo-40492: Fix ``--outfile`` for :mod:`cProfile` / :mod:`profile` not 4471 writing the output file in the original directory when the program being 4472 profiled changes the working directory. PR by Anthony Sottile. 4473 4474- bpo-34204: The :mod:`shelve` module now uses 4475 :data:`pickle.DEFAULT_PROTOCOL` by default instead of :mod:`pickle` 4476 protocol ``3``. 4477 4478- bpo-27321: Fixed KeyError exception when flattening an email to a string 4479 attempts to replace a non-existent Content-Transfer-Encoding header. 4480 4481- bpo-38976: The :mod:`http.cookiejar` module now supports the parsing of 4482 cookies in CURL-style cookiejar files through MozillaCookieJar on all 4483 platforms. Previously, such cookie entries would be silently ignored when 4484 loading a cookiejar with such entries. 4485 4486 Additionally, the HTTP Only attribute is persisted in the object, and will 4487 be correctly written to file if the MozillaCookieJar object is 4488 subsequently dumped. 4489 4490Documentation 4491------------- 4492 4493- bpo-42061: Document __format__ functionality for IP addresses. 4494 4495- bpo-41910: Document the default implementation of `object.__eq__`. 4496 4497- bpo-42010: Clarify that subscription expressions are also valid for 4498 certain :term:`classes <class>` and :term:`types <type>` in the standard 4499 library, and for user-defined classes and types if the classmethod 4500 :meth:`__class_getitem__` is provided. 4501 4502- bpo-41805: Documented :ref:`generic alias type <types-genericalias>` and 4503 :data:`types.GenericAlias`. Also added an entry in glossary for 4504 :term:`generic types <generic type>`. 4505 4506- bpo-39693: Fix tarfile's extractfile documentation 4507 4508- bpo-39416: Document some restrictions on the default string 4509 representations of numeric classes. 4510 4511Tests 4512----- 4513 4514- bpo-41739: Fix test_logging.test_race_between_set_target_and_flush(): the 4515 test now waits until all threads complete to avoid leaking running 4516 threads. 4517 4518- bpo-41970: Avoid a test failure in ``test_lib2to3`` if the module has 4519 already imported at the time the test executes. Patch by Pablo Galindo. 4520 4521- bpo-41944: Tests for CJK codecs no longer call ``eval()`` on content 4522 received via HTTP. 4523 4524- bpo-41306: Fixed a failure in ``test_tk.test_widgets.ScaleTest`` happening 4525 when executing the test with Tk 8.6.10. 4526 4527Build 4528----- 4529 4530- bpo-38980: Add ``-fno-semantic-interposition`` to both the compile and 4531 link line when building with ``--enable-optimizations``. Patch by Victor 4532 Stinner and Pablo Galindo. 4533 4534Windows 4535------- 4536 4537- bpo-38439: Updates the icons for IDLE in the Windows Store package. 4538 4539- bpo-38252: Use 8-byte step to detect ASCII sequence in 64-bit Windows 4540 build. 4541 4542- bpo-39107: Update Tcl and Tk to 8.6.10 in Windows installer. 4543 4544- bpo-41557: Update Windows installer to use SQLite 3.33.0. 4545 4546- bpo-38324: Avoid Unicode errors when accessing certain locale data on 4547 Windows. 4548 4549macOS 4550----- 4551 4552- bpo-41471: Ignore invalid prefix lengths in system proxy excludes. 4553 4554IDLE 4555---- 4556 4557- bpo-33987: Mostly finish using ttk widgets, mainly for editor, settings, 4558 and searches. Some patches by Mark Roseman. 4559 4560- bpo-40511: Typing opening and closing parentheses inside the parentheses 4561 of a function call will no longer cause unnecessary "flashing" off and on 4562 of an existing open call-tip, e.g. when typed in a string literal. 4563 4564- bpo-38439: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created 4565 by Andrew Clover. Remove the low-color gif variations from the .ico file. 4566 4567C API 4568----- 4569 4570- bpo-42157: The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule 4571 API ``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. 4572 Patch by Victor Stinner. 4573 4574- bpo-42015: Fix potential crash in deallocating method objects when 4575 dynamically allocated `PyMethodDef`'s lifetime is managed through the 4576 ``self`` argument of a `PyCFunction`. 4577 4578- bpo-40423: The :mod:`subprocess` module and ``os.closerange`` will now use 4579 the ``close_range(low, high, flags)`` syscall when it is available for 4580 more efficient closing of ranges of descriptors. 4581 4582- bpo-41845: :c:func:`PyObject_GenericGetDict` is available again in the 4583 limited API when targeting 3.10 or later. 4584 4585- bpo-40422: Add `_Py_closerange` function to provide performant closing of 4586 a range of file descriptors. 4587 4588- bpo-41986: :c:data:`Py_FileSystemDefaultEncodeErrors` and 4589 :c:data:`Py_UTF8Mode` are available again in limited API. 4590 4591- bpo-41756: Add `PyIter_Send` function to allow sending value into 4592 generator/coroutine/iterator without raising StopIteration exception to 4593 signal return. 4594 4595- bpo-41784: Added ``PyUnicode_AsUTF8AndSize`` to the limited C API. 4596 4597 4598What's New in Python 3.10.0 alpha 1? 4599==================================== 4600 4601*Release date: 2020-10-05* 4602 4603Security 4604-------- 4605 4606- bpo-41304: Fixes `python3x._pth` being ignored on Windows, caused by the 4607 fix for :issue:`29778` (CVE-2020-15801). 4608 4609- bpo-41162: Audit hooks are now cleared later during finalization to avoid 4610 missing events. 4611 4612- bpo-29778: Ensure :file:`python3.dll` is loaded from correct locations 4613 when Python is embedded (CVE-2020-15523). 4614 4615- bpo-41004: The __hash__() methods of ipaddress.IPv4Interface and 4616 ipaddress.IPv6Interface incorrectly generated constant hash values of 32 4617 and 128 respectively. This resulted in always causing hash collisions. The 4618 fix uses hash() to generate hash values for the tuple of (address, mask 4619 length, network address). 4620 4621- bpo-39603: Prevent http header injection by rejecting control characters 4622 in http.client.putrequest(...). 4623 4624Core and Builtins 4625----------------- 4626 4627- bpo-41909: Fixed stack overflow in :func:`issubclass` and 4628 :func:`isinstance` when getting the ``__bases__`` attribute leads to 4629 infinite recursion. 4630 4631- bpo-41922: Speed up calls to ``reversed()`` by using the :pep:`590` 4632 ``vectorcall`` calling convention. Patch by Dong-hee Na. 4633 4634- bpo-41873: Calls to ``float()`` are now faster due to the ``vectorcall`` 4635 calling convention. Patch by Dennis Sweeney. 4636 4637- bpo-41870: Speed up calls to ``bool()`` by using the :pep:`590` 4638 ``vectorcall`` calling convention. Patch by Dong-hee Na. 4639 4640- bpo-1635741: Port the :mod:`_bisect` module to the multi-phase 4641 initialization API (:pep:`489`). 4642 4643- bpo-39934: Correctly count control blocks in 'except' in compiler. Ensures 4644 that a syntax error, rather a fatal error, occurs for deeply nested, named 4645 exception handlers. 4646 4647- bpo-41780: Fix :meth:`__dir__` of :class:`types.GenericAlias`. Patch by 4648 Batuhan Taskaya. 4649 4650- bpo-1635741: Port the :mod:`_lsprof` extension module to multi-phase 4651 initialization (:pep:`489`). 4652 4653- bpo-1635741: Port the :mod:`cmath` extension module to multi-phase 4654 initialization (:pep:`489`). 4655 4656- bpo-1635741: Port the :mod:`_scproxy` extension module to multi-phase 4657 initialization (:pep:`489`). 4658 4659- bpo-1635741: Port the :mod:`termios` extension module to multi-phase 4660 initialization (:pep:`489`). 4661 4662- bpo-1635741: Convert the :mod:`_sha256` extension module types to heap 4663 types. 4664 4665- bpo-41690: Fix a possible stack overflow in the parser when parsing 4666 functions and classes with a huge amount of arguments. Patch by Pablo 4667 Galindo. 4668 4669- bpo-1635741: Port the :mod:`_overlapped` extension module to multi-phase 4670 initialization (:pep:`489`). 4671 4672- bpo-1635741: Port the :mod:`_curses_panel` extension module to multi-phase 4673 initialization (:pep:`489`). 4674 4675- bpo-1635741: Port the :mod:`_opcode` extension module to multi-phase 4676 initialization (:pep:`489`). 4677 4678- bpo-41681: Fixes the wrong error description in the error raised by using 4679 2 `,` in format string in f-string and :meth:`str.format`. 4680 4681- bpo-41675: The implementation of :func:`signal.siginterrupt` now uses 4682 :c:func:`sigaction` (if it is available in the system) instead of the 4683 deprecated :c:func:`siginterrupt`. Patch by Pablo Galindo. 4684 4685- bpo-41670: Prevent line trace being skipped on platforms not compiled with 4686 ``USE_COMPUTED_GOTOS``. Fixes issue where some lines nested within a 4687 try-except block were not being traced on Windows. 4688 4689- bpo-41654: Fix a crash that occurred when destroying subclasses of 4690 :class:`MemoryError`. Patch by Pablo Galindo. 4691 4692- bpo-1635741: Port the :mod:`zlib` extension module to multi-phase 4693 initialization (:pep:`489`). 4694 4695- bpo-41631: The ``_ast`` module uses again a global state. Using a module 4696 state per module instance is causing subtle practical problems. For 4697 example, the Mercurial project replaces the ``__import__()`` function to 4698 implement lazy import, whereas Python expected that ``import _ast`` always 4699 return a fully initialized ``_ast`` module. 4700 4701- bpo-40077: Convert :mod:`_operator` to use :c:func:`PyType_FromSpec`. 4702 4703- bpo-1653741: Port :mod:`_sha3` to multi-phase init. Convert static types 4704 to heap types. 4705 4706- bpo-1635741: Port the :mod:`_blake2` extension module to the multi-phase 4707 initialization API (:pep:`489`). 4708 4709- bpo-41533: Free the stack allocated in ``va_build_stack`` if 4710 ``do_mkstack`` fails and the stack is not a ``small_stack``. 4711 4712- bpo-41531: Fix a bug that was dropping keys when compiling dict literals 4713 with more than 0xFFFF elements. Patch by Pablo Galindo. 4714 4715- bpo-41525: The output of ``python --help`` contains now only ASCII 4716 characters. 4717 4718- bpo-1635741: Port the :mod:`_sha1`, :mod:`_sha512`, and :mod:`_md5` 4719 extension modules to multi-phase initialization API (:pep:`489`). 4720 4721- bpo-41431: Optimize ``dict_merge()`` for copying dict (e.g. ``dict(d)`` 4722 and ``{}.update(d)``). 4723 4724- bpo-41428: Implement PEP 604. This supports (int | str) etc. in place of 4725 Union[str, int]. 4726 4727- bpo-41340: Removed fallback implementation for ``strdup``. 4728 4729- bpo-38156: Handle interrupts that come after EOF correctly in 4730 ``PyOS_StdioReadline``. 4731 4732- bpo-41342: :func:`round` with integer argument is now faster (9--60%). 4733 4734- bpo-41334: Constructors :func:`str`, :func:`bytes` and :func:`bytearray` 4735 are now faster (around 30--40% for small objects). 4736 4737- bpo-41295: Resolve a regression in CPython 3.8.4 where defining 4738 "__setattr__" in a multi-inheritance setup and calling up the hierarchy 4739 chain could fail if builtins/extension types were involved in the base 4740 types. 4741 4742- bpo-41323: Bytecode optimizations are performed directly on the control 4743 flow graph. This will result in slightly more compact code objects in some 4744 circumstances. 4745 4746- bpo-41247: Always cache the running loop holder when running 4747 ``asyncio.set_running_loop``. 4748 4749- bpo-41252: Fix incorrect refcounting in _ssl.c's 4750 ``_servername_callback()``. 4751 4752- bpo-1635741: Port :mod:`multiprocessing` to multi-phase initialization 4753 4754- bpo-1635741: Port :mod:`winapi` to multiphase initialization 4755 4756- bpo-41215: Use non-NULL default values in the PEG parser keyword list to 4757 overcome a bug that was preventing Python from being properly compiled 4758 when using the XLC compiler. Patch by Pablo Galindo. 4759 4760- bpo-41218: Python 3.8.3 had a regression where compiling with 4761 ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension 4762 with CO_COROUTINE. Now only list comprehension making use of async/await 4763 will tagged as so. 4764 4765- bpo-1635741: Port :mod:`faulthandler` to multiphase initialization. 4766 4767- bpo-1635741: Port :mod:`sha256` to multiphase initialization 4768 4769- bpo-41175: Guard against a NULL pointer dereference within bytearrayobject 4770 triggered by the ``bytearray() + bytearray()`` operation. 4771 4772- bpo-41100: add arm64 to the allowable Mac OS arches in mpdecimal.h 4773 4774- bpo-41094: Fix decoding errors with audit when open files with non-ASCII 4775 names on non-UTF-8 locale. 4776 4777- bpo-39960: The "hackcheck" that prevents sneaking around a type's 4778 __setattr__() by calling the superclass method was rewritten to allow C 4779 implemented heap types. 4780 4781- bpo-41084: Prefix the error message with 'f-string: ', when parsing an 4782 f-string expression which throws a :exc:`SyntaxError`. 4783 4784- bpo-40521: Empty frozensets are no longer singletons. 4785 4786- bpo-41076: Pre-feed the parser with the location of the f-string 4787 expression, not the f-string itself, which allows us to skip the shifting 4788 of the AST node locations after the parsing is completed. 4789 4790- bpo-41056: Fixes a reference to deallocated stack space during startup 4791 when constructing sys.path involving a relative symlink when code was 4792 supplied via -c. (discovered via Coverity) 4793 4794- bpo-41061: Fix incorrect expressions and asserts in hashtable code and 4795 tests. 4796 4797- bpo-41052: Opt out serialization/deserialization for _random.Random 4798 4799- bpo-40939: Rename `PyPegen*` functions to `PyParser*`, so that we can 4800 remove the old set of `PyParser*` functions that were using the old 4801 parser, but keep everything backwards-compatible. 4802 4803- bpo-35975: Stefan Behnel reported that cf_feature_version is used even 4804 when PyCF_ONLY_AST is not set. This is against the intention and against 4805 the documented behavior, so it's been fixed. 4806 4807- bpo-40939: Remove the remaining files from the old parser and the 4808 :mod:`symbol` module. 4809 4810- bpo-40077: Convert :mod:`_bz2` to use :c:func:`PyType_FromSpec`. 4811 4812- bpo-41006: The ``encodings.latin_1`` module is no longer imported at 4813 startup. Now it is only imported when it is the filesystem encoding or the 4814 stdio encoding. 4815 4816- bpo-40636: :func:`zip` now supports :pep:`618`'s ``strict`` parameter, 4817 which raises a :exc:`ValueError` if the arguments are exhausted at 4818 different lengths. Patch by Brandt Bucher. 4819 4820- bpo-1635741: Port :mod:`_gdbm` to multiphase initialization. 4821 4822- bpo-40985: Fix a bug that caused the :exc:`SyntaxError` text to be empty 4823 when a file ends with a line ending in a line continuation character (i.e. 4824 backslash). The error text should contain the text of the last line. 4825 4826- bpo-40958: Fix a possible buffer overflow in the PEG parser when gathering 4827 information for emitting syntax errors. Patch by Pablo Galindo. 4828 4829- bpo-1635741: Port :mod:`_dbm` to multiphase initialization. 4830 4831- bpo-40957: Fix refleak in _Py_fopen_obj() when PySys_Audit() fails 4832 4833- bpo-40950: Add a state to the :mod:`nis` module (:pep:`3121`) and apply 4834 the multiphase initialization. Patch by Dong-hee Na. 4835 4836- bpo-40947: The Python :ref:`Path Configuration <init-path-config>` now 4837 takes :c:member:`PyConfig.platlibdir` in account. 4838 4839- bpo-40939: Remove the old parser, the :mod:`parser` module and all 4840 associated support code, command-line options and environment variables. 4841 Patch by Pablo Galindo. 4842 4843- bpo-40847: Fix a bug where a line with only a line continuation character 4844 is not considered a blank line at tokenizer level. In such cases, more 4845 than a single `NEWLINE` token was emitted. The old parser was working 4846 around the issue, but the new parser threw a :exc:`SyntaxError` for valid 4847 input due to this. For example, an empty line following a line 4848 continuation character was interpreted as a :exc:`SyntaxError`. 4849 4850- bpo-40890: Each dictionary view now has a ``mapping`` attribute that 4851 provides a :class:`types.MappingProxyType` wrapping the original 4852 dictionary. Patch contributed by Dennis Sweeney. 4853 4854- bpo-40889: Improved the performance of symmetric difference operations on 4855 dictionary item views. Patch by Dennis Sweeney. 4856 4857- bpo-40904: Fix possible segfault in the new PEG parser when parsing 4858 f-string containing yield statements with no value (:code:`f"{yield}"`). 4859 Patch by Pablo Galindo 4860 4861- bpo-40903: Fixed a possible segfault in the new PEG parser when producing 4862 error messages for invalid assignments of the form :code:`p=p=`. Patch by 4863 Pablo Galindo 4864 4865- bpo-40880: Fix invalid memory read in the new parser when checking 4866 newlines in string literals. Patch by Pablo Galindo. 4867 4868- bpo-40883: Fix memory leak in when parsing f-strings in the new parser. 4869 Patch by Pablo Galindo 4870 4871- bpo-40870: Raise :exc:`ValueError` when validating custom AST's where the 4872 constants ``True``, ``False`` and ``None`` are used within a 4873 :class:`ast.Name` node. 4874 4875- bpo-40854: Allow overriding :data:`sys.platlibdir` via a new 4876 :envvar:`PYTHONPLATLIBDIR` environment variable. 4877 4878- bpo-40826: Fix GIL usage in :c:func:`PyOS_Readline`: lock the GIL to set 4879 an exception and pass the Python thread state when checking if there is a 4880 pending signal. 4881 4882- bpo-1635741: Port :mod:`fcntl` to multiphase initialization. 4883 4884- bpo-19468: Delete unnecessary instance check in importlib.reload(). Patch 4885 by Furkan Önder. 4886 4887- bpo-40824: Unexpected errors in calling the ``__iter__`` method are no 4888 longer masked by ``TypeError`` in the :keyword:`in` operator and functions 4889 :func:`~operator.contains`, :func:`~operator.indexOf` and 4890 :func:`~operator.countOf` of the :mod:`operator` module. 4891 4892- bpo-40792: Attributes ``start``, ``stop`` and ``step`` of the 4893 :class:`range` object now always has exact type :class:`int`. Previously, 4894 they could have been an instance of a subclass of ``int``. 4895 4896- bpo-40780: Fix a corner case where g-style string formatting of a float 4897 failed to remove trailing zeros. 4898 4899- bpo-38964: When there's a :exc:`SyntaxError` in the expression part of an 4900 fstring, the filename attribute of the :exc:`SyntaxError` gets correctly 4901 set to the name of the file the fstring resides in. 4902 4903- bpo-40750: Support the "-d" debug flag in the new PEG parser. Patch by 4904 Pablo Galindo 4905 4906- bpo-40217: Instances of types created with 4907 :c:func:`PyType_FromSpecWithBases` will no longer automatically visit 4908 their class object when traversing references in the garbage collector. 4909 The user is expected to manually visit the object's class. Patch by Pablo 4910 Galindo. 4911 4912- bpo-39573: :c:func:`Py_TYPE()` is changed to the inline static function. 4913 Patch by Dong-hee Na. 4914 4915- bpo-40696: Fix a hang that can arise after :meth:`generator.throw` due to 4916 a cycle in the exception context chain. 4917 4918- bpo-40521: Each interpreter now its has own free lists, singletons and 4919 caches: 4920 4921 * Free lists: float, tuple, list, dict, frame, context, 4922 asynchronous generator, MemoryError. 4923 * Singletons: empty tuple, empty bytes string, empty Unicode string, 4924 single byte character, single Unicode (latin1) character. 4925 * Slice cache. 4926 4927 They are no longer shared by all interpreters. 4928 4929- bpo-40679: Certain :exc:`TypeError` messages about missing or extra 4930 arguments now include the function's :term:`qualified name`. Patch by 4931 Dennis Sweeney. 4932 4933- bpo-29590: Make the stack trace correct after calling 4934 :meth:`generator.throw` on a generator that has yielded from a ``yield 4935 from``. 4936 4937- bpo-4022: Improve performance of generators by not raising internal 4938 StopIteration. 4939 4940- bpo-1635741: Port :mod:`mmap` to multiphase initialization. 4941 4942- bpo-1635741: Port :mod:`_lzma` to multiphase initialization. 4943 4944- bpo-37999: Builtin and extension functions that take integer arguments no 4945 longer accept :class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\ 4946 s and other objects that can be converted to integers only with a loss 4947 (e.g. that have the :meth:`~object.__int__` method but do not have the 4948 :meth:`~object.__index__` method). 4949 4950- bpo-29882: Add :meth:`int.bit_count()`, counting the number of ones in the 4951 binary representation of an integer. Patch by Niklas Fiekas. 4952 4953- bpo-36982: Use ncurses extended color functions when available to support 4954 terminals with 256 colors, and add the new function 4955 :func:`curses.has_extended_color_support` to indicate whether extended 4956 color support is provided by the underlying ncurses library. 4957 4958- bpo-19569: Add the private macros ``_Py_COMP_DIAG_PUSH``, 4959 ``_Py_COMP_DIAG_IGNORE_DEPR_DECLS``, and ``_Py_COMP_DIAG_POP``. 4960 4961- bpo-26680: The int type now supports the x.is_integer() method for 4962 compatibility with float. 4963 4964Library 4965------- 4966 4967- bpo-41900: C14N 2.0 serialisation in xml.etree.ElementTree failed for 4968 unprefixed attributes when a default namespace was defined. 4969 4970- bpo-41887: Strip leading spaces and tabs on :func:`ast.literal_eval`. Also 4971 document stripping of spaces and tabs for :func:`eval`. 4972 4973- bpo-41773: Note in documentation that :func:`random.choices` doesn't 4974 support non-finite weights, raise :exc:`ValueError` when given non-finite 4975 weights. 4976 4977- bpo-41840: Fix a bug in the :mod:`symtable` module that was causing 4978 module-scope global variables to not be reported as both local and global. 4979 Patch by Pablo Galindo. 4980 4981- bpo-41842: Add :func:`codecs.unregister` function to unregister a codec 4982 search function. 4983 4984- bpo-40564: In ``zipfile.Path``, mutate the passed ZipFile object type 4985 instead of making a copy. Prevents issues when both the local copy and the 4986 caller’s copy attempt to close the same file handle. 4987 4988- bpo-40670: More reliable validation of statements in 4989 :class:`timeit.Timer`. It now accepts "empty" statements (only whitespaces 4990 and comments) and rejects misindentent statements. 4991 4992- bpo-41833: The :class:`threading.Thread` constructor now uses the target 4993 name if the *target* argument is specified but the *name* argument is 4994 omitted. 4995 4996- bpo-41817: fix `tkinter.EventType` Enum so all members are strings, and 4997 none are tuples 4998 4999- bpo-41810: :data:`types.EllipsisType`, :data:`types.NotImplementedType` 5000 and :data:`types.NoneType` have been reintroduced, providing a new set of 5001 types readily interpretable by static type checkers. 5002 5003- bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch 5004 contributed by Peter David McCormick. 5005 5006- bpo-41816: StrEnum added: it ensures that all members are already strings 5007 or string candidates 5008 5009- bpo-41517: fix bug allowing Enums to be extended via multiple inheritance 5010 5011- bpo-39587: use the correct mix-in data type when constructing Enums 5012 5013- bpo-41792: Add is_typeddict function to typing.py to check if a type is a 5014 TypedDict class 5015 5016 Previously there was no way to check that without using private API. See 5017 the `relevant issue in python/typing 5018 <https://github.com/python/typing/issues/751>` 5019 5020- bpo-41789: Honor `object` overrides in `Enum` class creation 5021 (specifically, `__str__`, `__repr__`, `__format__`, and `__reduce_ex__`). 5022 5023- bpo-32218: `enum.Flag` and `enum.IntFlag` members are now iterable 5024 5025- bpo-39651: Fix a race condition in the ``call_soon_threadsafe()`` method 5026 of ``asyncio.ProactorEventLoop``: do nothing if the self-pipe socket has 5027 been closed. 5028 5029- bpo-1635741: Port the ``mashal`` extension module to the multi-phase 5030 initialization API (:pep:`489`). 5031 5032- bpo-1635741: Port the ``_string`` extension module to the multi-phase 5033 initialization API (:pep:`489`). 5034 5035- bpo-41732: Added an :term:`iterator` to :class:`memoryview`. 5036 5037- bpo-41720: Fixed :meth:`turtle.Vec2D.__rmul__` for arguments which are not 5038 int or float. 5039 5040- bpo-41696: Fix handling of debug mode in :func:`asyncio.run`. This allows 5041 setting ``PYTHONASYNCIODEBUG`` or ``-X dev`` to enable asyncio debug mode 5042 when using :func:`asyncio.run`. 5043 5044- bpo-41687: Fix implementation of sendfile to be compatible with Solaris. 5045 5046- bpo-41662: No longer override exceptions raised in ``__len__()`` of a 5047 sequence of parameters in :mod:`sqlite3` with 5048 :exc:`~sqlite3.ProgrammingError`. 5049 5050- bpo-39010: Restarting a ``ProactorEventLoop`` on Windows no longer logs 5051 spurious ``ConnectionResetErrors``. 5052 5053- bpo-41638: :exc:`~sqlite3.ProgrammingError` message for absent parameter 5054 in :mod:`sqlite3` contains now the name of the parameter instead of its 5055 index when parameters are supplied as a dict. 5056 5057- bpo-41662: Fixed crash when mutate list of parameters during iteration in 5058 :mod:`sqlite3`. 5059 5060- bpo-41513: Improved the accuracy of math.hypot(). Internally, each step 5061 is computed with extra precision so that the result is now almost always 5062 correctly rounded. 5063 5064- bpo-41609: The pdb whatis command correctly reports instance methods as 5065 'Method' rather than 'Function'. 5066 5067- bpo-39994: Fixed pprint's handling of dict subclasses that override 5068 __repr__. 5069 5070- bpo-32751: When cancelling the task due to a timeout, 5071 :meth:`asyncio.wait_for` will now wait until the cancellation is complete 5072 also in the case when *timeout* is <= 0, like it does with positive 5073 timeouts. 5074 5075- bpo-37658: :meth:`asyncio.wait_for` now properly handles races between 5076 cancellation of itself and the completion of the wrapped awaitable. 5077 5078- bpo-40782: Change the method asyncio.AbstractEventLoop.run_in_executor to 5079 not be a coroutine. 5080 5081- bpo-41520: Fix :mod:`codeop` regression that prevented turning compile 5082 warnings into errors. 5083 5084- bpo-41528: turtle uses math module functions to convert degrees to radians 5085 and vice versa and to calculate vector norm 5086 5087- bpo-41513: Minor algorithmic improvement to math.hypot() and math.dist() 5088 giving small gains in speed and accuracy. 5089 5090- bpo-41503: Fixed a race between setTarget and flush in 5091 logging.handlers.MemoryHandler. 5092 5093- bpo-41497: Fix potential UnicodeDecodeError in dis module. 5094 5095- bpo-41467: On Windows, fix asyncio ``recv_into()`` return value when the 5096 socket/pipe is closed (:exc:`BrokenPipeError`): return ``0`` rather than 5097 an empty byte string (``b''``). 5098 5099- bpo-41425: Make tkinter doc example runnable. 5100 5101- bpo-41421: Make an algebraic simplification to random.paretovariate(). It 5102 now is slightly less subject to round-off error and is slightly faster. 5103 Inputs that used to cause ZeroDivisionError now cause an OverflowError 5104 instead. 5105 5106- bpo-41440: Add :func:`os.cpu_count()` support for VxWorks RTOS. 5107 5108- bpo-41316: Fix the :mod:`tarfile` module to write only basename of TAR 5109 file to GZIP compression header. 5110 5111- bpo-41384: Raise TclError instead of TypeError when an unknown option is 5112 passed to tkinter.OptionMenu. 5113 5114- bpo-41317: Use add_done_callback() in asyncio.loop.sock_accept() to 5115 unsubscribe reader early on cancellation. 5116 5117- bpo-41364: Reduce import overhead of :mod:`uuid`. 5118 5119- bpo-35328: Set the environment variable ``VIRTUAL_ENV_PROMPT`` at 5120 :mod:`venv` activation. 5121 5122- bpo-41341: Recursive evaluation of `typing.ForwardRef` in 5123 `get_type_hints`. 5124 5125- bpo-41344: Prevent creating :class:`shared_memory.SharedMemory` objects 5126 with :code:`size=0`. 5127 5128- bpo-41333: :meth:`collections.OrderedDict.pop` is now 2 times faster. 5129 5130- bpo-41288: Unpickling invalid NEWOBJ_EX opcode with the C implementation 5131 raises now UnpicklingError instead of crashing. 5132 5133- bpo-39017: Avoid infinite loop when reading specially crafted TAR files 5134 using the tarfile module (CVE-2019-20907). 5135 5136- bpo-41273: Speed up any transport using ``_ProactorReadPipeTransport`` by 5137 calling ``recv_into`` instead of ``recv``, thus not creating a new buffer 5138 for each ``recv`` call in the transport's read loop. 5139 5140- bpo-41235: Fix the error handling in 5141 :meth:`ssl.SSLContext.load_dh_params`. 5142 5143- bpo-41207: In distutils.spawn, restore expectation that DistutilsExecError 5144 is raised when the command is not found. 5145 5146- bpo-29727: Register :class:`array.array` as a 5147 :class:`~collections.abc.MutableSequence`. Patch by Pablo Galindo. 5148 5149- bpo-39168: Remove the ``__new__`` method of :class:`typing.Generic`. 5150 5151- bpo-41194: Fix a crash in the ``_ast`` module: it can no longer be loaded 5152 more than once. It now uses a global state rather than a module state. 5153 5154- bpo-41195: Add read-only ssl.SSLContext.security_level attribute to 5155 retrieve the context's security level. 5156 5157- bpo-41193: The ``write_history()`` atexit function of the readline 5158 completer now ignores any :exc:`OSError` to ignore error if the filesystem 5159 is read-only, instead of only ignoring :exc:`FileNotFoundError` and 5160 :exc:`PermissionError`. 5161 5162- bpo-41182: selector: use DefaultSelector based upon implementation 5163 5164- bpo-41161: The decimal module now requires libmpdec-2.5.0. Users of 5165 --with-system-libmpdec should update their system library. 5166 5167- bpo-40874: The decimal module now requires libmpdec-2.5.0. 5168 5169- bpo-41138: Fixed the :mod:`trace` module CLI for Python source files with 5170 non-UTF-8 encoding. 5171 5172- bpo-31082: Use the term "iterable" in the docstring for 5173 :func:`functools.reduce`. 5174 5175- bpo-40521: Remove freelist from collections.deque(). 5176 5177- bpo-31938: Fix default-value signatures of several functions in the 5178 :mod:`select` module - by Anthony Sottile. 5179 5180- bpo-41068: Fixed reading files with non-ASCII names from ZIP archive 5181 directly after writing them. 5182 5183- bpo-41058: :func:`pdb.find_function` now correctly determines the source 5184 file encoding. 5185 5186- bpo-41056: Invalid file descriptor values are now prevented from being 5187 passed to os.fpathconf. (discovered by Coverity) 5188 5189- bpo-41056: Fix a NULL pointer dereference within the ssl module during a 5190 MemoryError in the keylog callback. (discovered by Coverity) 5191 5192- bpo-41056: Fixed an instance where a MemoryError within the zoneinfo 5193 module might not be reported or not reported at its source. (found by 5194 Coverity) 5195 5196- bpo-41048: :func:`mimetypes.read_mime_types` function reads the rule file 5197 using UTF-8 encoding, not the locale encoding. Patch by Srinivas Reddy 5198 Thatiparthy. 5199 5200- bpo-41043: Fixed the use of :func:`~glob.glob` in the stdlib: literal part 5201 of the path is now always correctly escaped. 5202 5203- bpo-41025: Fixed an issue preventing the C implementation of 5204 :class:`zoneinfo.ZoneInfo` from being subclassed. 5205 5206- bpo-35018: Add the :class:`xml.sax.handler.LexicalHandler` class that is 5207 present in other SAX XML implementations. 5208 5209- bpo-41002: Improve performance of HTTPResponse.read with a given amount. 5210 Patch by Bruce Merry. 5211 5212- bpo-40448: :mod:`ensurepip` now disables the use of `pip` cache when 5213 installing the bundled versions of `pip` and `setuptools`. Patch by 5214 Krzysztof Konopko. 5215 5216- bpo-40967: Removed :meth:`asyncio.Task.current_task` and 5217 :meth:`asyncio.Task.all_tasks`. Patch contributed by Rémi Lapeyre. 5218 5219- bpo-40924: Ensure ``importlib.resources.path`` returns an extant path for 5220 the SourceFileLoader's resource reader. Avoids the regression identified 5221 in master while a long-term solution is devised. 5222 5223- bpo-40955: Fix a minor memory leak in :mod:`subprocess` module when 5224 extra_groups was specified. 5225 5226- bpo-40855: The standard deviation and variance functions in the statistics 5227 module were ignoring their mu and xbar arguments. 5228 5229- bpo-40939: Use the new PEG parser when generating the stdlib 5230 :mod:`keyword` module. 5231 5232- bpo-23427: Add :data:`sys.orig_argv` attribute: the list of the original 5233 command line arguments passed to the Python executable. 5234 5235- bpo-33689: Ignore empty or whitespace-only lines in .pth files. This 5236 matches the documentated behavior. Before, empty lines caused the 5237 site-packages dir to appear multiple times in sys.path. By Ido Michael, 5238 contributors Malcolm Smith and Tal Einat. 5239 5240- bpo-40884: Added a `defaults` parameter to :class:`logging.Formatter`, to 5241 allow specifying default values for custom fields. Patch by Asaf Alon and 5242 Bar Harel. 5243 5244- bpo-40876: Clarify error message in the :mod:`csv` module. 5245 5246- bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. 5247 5248- bpo-40807: Stop codeop._maybe_compile, used by code.InteractiveInterpreter 5249 (and IDLE). from emitting each warning three times. 5250 5251- bpo-32604: Fix reference leak in the :mod:`select` module when the module 5252 is imported in a subinterpreter. 5253 5254- bpo-39791: Built-in loaders (SourceFileLoader and ZipImporter) now supply 5255 ``TraversableResources`` implementations for ``ResourceReader``, and the 5256 fallback function has been removed. 5257 5258- bpo-39314: :class:`rlcompleter.Completer` and the standard Python shell 5259 now close the parenthesis for functions that take no arguments. Patch 5260 contributed by Rémi Lapeyre. 5261 5262- bpo-17005: The topological sort functionality that was introduced 5263 initially in the :mod:`functools` module has been moved to a new 5264 :mod:`graphlib` module to better accommodate the new tools and keep the 5265 original scope of the :mod:`functools` module. Patch by Pablo Galindo 5266 5267- bpo-40834: Fix truncate when sending str object 5268 with_xxsubinterpreters.channel_send. 5269 5270- bpo-40755: Add rich comparisons to collections.Counter(). 5271 5272- bpo-26407: Unexpected errors in calling the ``__iter__`` method are no 5273 longer masked by ``TypeError`` in :func:`csv.reader`, 5274 :func:`csv.writer.writerow` and :meth:`csv.writer.writerows`. 5275 5276- bpo-39384: Fixed email.contentmanager to allow set_content() to set a null 5277 string. 5278 5279- bpo-40744: The :mod:`sqlite3` module uses SQLite API functions that 5280 require SQLite v3.7.3 or higher. This patch removes support for older 5281 SQLite versions, and explicitly requires SQLite 3.7.3 both at build, 5282 compile and runtime. Patch by Sergey Fedoseev and Erlend E. Aasland. 5283 5284- bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time 5285 to avoid errors on some compilers. 5286 5287- bpo-38488: Update ensurepip to install pip 20.1.1 and setuptools 47.1.0. 5288 5289- bpo-40792: The result of :func:`operator.index` now always has exact type 5290 :class:`int`. Previously, the result could have been an instance of a 5291 subclass of ``int``. 5292 5293- bpo-40767: :mod:`webbrowser` now properly finds the default browser in 5294 pure Wayland systems by checking the WAYLAND_DISPLAY environment variable. 5295 Patch contributed by Jérémy Attali. 5296 5297- bpo-40791: :func:`hashlib.compare_digest` uses OpenSSL's 5298 ``CRYPTO_memcmp()`` function when OpenSSL is available. 5299 5300- bpo-40795: :mod:`ctypes` module: If ctypes fails to convert the result of 5301 a callback or if a ctypes callback function raises an exception, 5302 sys.unraisablehook is now called with an exception set. Previously, the 5303 error was logged into stderr by :c:func:`PyErr_Print`. 5304 5305- bpo-16995: Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` 5306 to support the Base32 Encoding with Extended Hex Alphabet. 5307 5308- bpo-30008: Fix :mod:`ssl` code to be compatible with OpenSSL 1.1.x builds 5309 that use ``no-deprecated`` and ``--api=1.1.0``. 5310 5311- bpo-30064: Fix asyncio ``loop.sock_*`` race condition issue 5312 5313- bpo-40759: Deprecate the :mod:`symbol` module. 5314 5315- bpo-40756: The second argument (extra) of ``LoggerAdapter.__init__`` now 5316 defaults to None. 5317 5318- bpo-37129: Add a new :data:`os.RWF_APPEND` flag for :func:`os.pwritev`. 5319 5320- bpo-40737: Fix possible reference leak for :mod:`sqlite3` initialization. 5321 5322- bpo-40726: Handle cases where the ``end_lineno`` is ``None`` on 5323 :func:`ast.increment_lineno`. 5324 5325- bpo-40698: :mod:`distutils` upload creates SHA2-256 and Blake2b-256 5326 digests. MD5 digests is skipped if platform blocks MD5. 5327 5328- bpo-40695: :mod:`hashlib` no longer falls back to builtin hash 5329 implementations when OpenSSL provides a hash digest and the algorithm is 5330 blocked by security policy. 5331 5332- bpo-9216: func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP 5333 constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle 5334 strict security policy better. 5335 5336- bpo-40614: :func:`ast.parse` will not parse self documenting expressions 5337 in f-strings when passed ``feature_version`` is less than ``(3, 8)``. 5338 5339- bpo-40626: Add h5 file extension as MIME Type application/x-hdf5, as per 5340 HDF Group recommendation for HDF5 formatted data files. Patch contributed 5341 by Mark Schwab. 5342 5343- bpo-25920: On macOS, when building Python for macOS 10.4 and older, which 5344 wasn't the case for python.org macOS installer, :func:`socket.getaddrinfo` 5345 no longer uses an internal lock to prevent race conditions when calling 5346 ``getaddrinfo()`` which is thread-safe since macOS 10.5. Python 3.9 5347 requires macOS 10.6 or newer. The internal lock caused random hang on fork 5348 when another thread was calling :func:`socket.getaddrinfo`. The lock was 5349 also used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD 5350 older than 4. 5351 5352- bpo-40671: Prepare ``_hashlib`` for :pep:`489` and use 5353 :c:func:`PyModule_AddType`. 5354 5355- bpo-32309: Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is 5356 mainly used for running IO-bound functions in a separate thread to avoid 5357 blocking the event loop, and essentially works as a high-level version of 5358 :meth:`~asyncio.loop.run_in_executor` that can directly take keyword 5359 arguments. 5360 5361- bpo-36543: Restored the deprecated :mod:`xml.etree.cElementTree` module. 5362 5363- bpo-40611: :data:`~mmap.MAP_POPULATE` constant has now been added to the 5364 list of exported :mod:`mmap` module flags. 5365 5366- bpo-39881: PEP 554 for use in the test suite. (Patch By Joannah Nanjekye) 5367 5368- bpo-13097: ``ctypes`` now raises an ``ArgumentError`` when a callback is 5369 invoked with more than 1024 arguments. 5370 5371- bpo-39385: A new test assertion context-manager, 5372 :func:`unittest.assertNoLogs` will ensure a given block of code emits no 5373 log messages using the logging module. Contributed by Kit Yan Choi. 5374 5375- bpo-23082: Updated the error message and docs of PurePath.relative_to() to 5376 better reflect the function behaviour. 5377 5378- bpo-40318: Use SQLite3 trace v2 API, if it is available. 5379 5380- bpo-40105: ZipFile truncates files to avoid corruption when a shorter 5381 comment is provided in append ("a") mode. Patch by Jan Mazur. 5382 5383- bpo-40084: Fix ``Enum.__dir__``: dir(Enum.member) now includes attributes 5384 as well as methods. 5385 5386- bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than 5387 OSError when peer closes connection during TLS negotiation 5388 5389- bpo-39728: fix default `_missing_` so a duplicate `ValueError` is not set 5390 as the `__context__` of the original `ValueError` 5391 5392- bpo-39244: Fixed :class:`multiprocessing.context.get_all_start_methods` to 5393 properly return the default method first on macOS. 5394 5395- bpo-39040: Fix parsing of invalid mime headers parameters by collapsing 5396 whitespace between encoded words in a bare-quote-string. 5397 5398- bpo-38731: Add ``--quiet`` option to command-line interface of 5399 :mod:`py_compile`. Patch by Gregory Schevchenko. 5400 5401- bpo-35714: :exc:`struct.error` is now raised if there is a null character 5402 in a :mod:`struct` format string. 5403 5404- bpo-38144: Added the *root_dir* and *dir_fd* parameters in 5405 :func:`glob.glob`. 5406 5407- bpo-26543: Fix :meth:`IMAP4.noop()` when debug mode is enabled (ex: 5408 ``imaplib.Debug = 3``). 5409 5410- bpo-12178: :func:`csv.writer` now correctly escapes *escapechar* when 5411 input contains *escapechar*. Patch by Catalin Iacob, Berker Peksag, and 5412 Itay Elbirt. 5413 5414- bpo-36290: AST nodes are now raising :exc:`TypeError` on conflicting 5415 keyword arguments. Patch contributed by Rémi Lapeyre. 5416 5417- bpo-33944: Added site.py site-packages tracing in verbose mode. 5418 5419- bpo-35078: Refactor formatweekday, formatmonthname methods in 5420 LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to 5421 call the base class methods.This enables customizable CSS classes for 5422 LocaleHTMLCalendar. Patch by Srinivas Reddy Thatiparthy 5423 5424- bpo-29620: :func:`~unittest.TestCase.assertWarns` no longer raises a 5425 ``RuntimeException`` when accessing a module's ``__warningregistry__`` 5426 causes importation of a new module, or when a new module is imported in 5427 another thread. Patch by Kernc. 5428 5429- bpo-31844: Remove ``ParserBase.error()`` method from the private and 5430 undocumented ``_markupbase`` module. :class:`html.parser.HTMLParser` is 5431 the only subclass of ``ParserBase`` and its ``error()`` implementation was 5432 deprecated in Python 3.4 and removed in Python 3.5. 5433 5434- bpo-34226: Fix `cgi.parse_multipart` without content_length. Patch by 5435 Roger Duran 5436 5437- bpo-33660: Fix pathlib.PosixPath to resolve a relative path located on the 5438 root directory properly. 5439 5440- bpo-28557: Improve the error message for a misbehaving ``rawio.readinto`` 5441 5442- bpo-26680: The d.is_integer() method is added to the Decimal type, for 5443 compatibility with other number types. 5444 5445- bpo-26680: The x.is_integer() method is incorporated into the abstract 5446 types of the numeric tower, Real, Rational and Integral, with appropriate 5447 default implementations. 5448 5449Documentation 5450------------- 5451 5452- bpo-41428: Add documentation for :pep:`604` (Allow writing union types as 5453 ``X | Y``). 5454 5455- bpo-41774: In Programming FAQ "Sequences (Tuples/Lists)" section, add "How 5456 do you remove multiple items from a list". 5457 5458- bpo-35293: Fix RemovedInSphinx40Warning when building the documentation. 5459 Patch by Dong-hee Na. 5460 5461- bpo-37149: Change Shipman tkinter doc link from archive.org to TkDocs. 5462 (The doc has been removed from the NMT server.) The new link responds 5463 much faster and includes a short explanatory note. 5464 5465- bpo-41726: Update the refcounts info of ``PyType_FromModuleAndSpec``. 5466 5467- bpo-41624: Fix the signature of :class:`typing.Coroutine`. 5468 5469- bpo-40204: Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable 5470 ``c_warn_on_allowed_pre_v3`` option to make the documentation compatible 5471 with Sphinx 2 and Sphinx 3. 5472 5473- bpo-41045: Add documentation for debug feature of f-strings. 5474 5475- bpo-41314: Changed the release when ``from __future__ import annotations`` 5476 becomes the default from ``4.0`` to ``3.10`` (following a change in PEP 5477 563). 5478 5479- bpo-40979: Refactored typing.rst, arranging more than 70 classes, 5480 functions, and decorators into new sub-sections. 5481 5482- bpo-40552: Fix in tutorial section 4.2. Code snippet is now correct. 5483 5484- bpo-39883: Make code, examples, and recipes in the Python documentation be 5485 licensed under the more permissive BSD0 license in addition to the 5486 existing Python 2.0 license. 5487 5488- bpo-37703: Updated Documentation to comprehensively elaborate on the 5489 behaviour of gather.cancel() 5490 5491Tests 5492----- 5493 5494- bpo-41939: Fix test_site.test_license_exists_at_url(): call 5495 ``urllib.request.urlcleanup()`` to reset the global 5496 ``urllib.request._opener``. Patch by Victor Stinner. 5497 5498- bpo-41731: Make test_cmd_line_script pass with option '-vv'. 5499 5500- bpo-41602: Add tests for SIGINT handling in the runpy module. 5501 5502- bpo-41521: :mod:`test.support`: Rename ``blacklist`` parameter of 5503 :func:`~test.support.check__all__` to ``not_exported``. 5504 5505- bpo-41477: Make ctypes optional in test_genericalias. 5506 5507- bpo-41085: Fix integer overflow in the :meth:`array.array.index` method on 5508 64-bit Windows for index larger than ``2**31``. 5509 5510- bpo-41069: :data:`test.support.TESTFN` and the current directory for tests 5511 when run via ``test.regrtest`` contain now non-ascii characters if 5512 possible. 5513 5514- bpo-38377: On Linux, skip tests using multiprocessing if the current user 5515 cannot create a file in ``/dev/shm/`` directory. Add the 5516 :func:`~test.support.skip_if_broken_multiprocessing_synchronize` function 5517 to the :mod:`test.support` module. 5518 5519- bpo-41009: Fix use of ``support.require_{linux|mac|freebsd}_version()`` 5520 decorators as class decorator. 5521 5522- bpo-41003: Fix ``test_copyreg`` when ``numpy`` is installed: 5523 ``test.pickletester`` now saves/restores warnings filters when importing 5524 ``numpy``, to ignore filters installed by ``numpy``. 5525 5526- bpo-40964: Disable remote :mod:`imaplib` tests, host cyrus.andrew.cmu.edu 5527 is blocking incoming connections. 5528 5529- bpo-40927: Fix test_binhex when run twice: it now uses 5530 import_fresh_module() to ensure that it raises DeprecationWarning each 5531 time. 5532 5533- bpo-17258: Skip some :mod:`multiprocessing` tests when MD5 hash digest is 5534 blocked. 5535 5536- bpo-31904: Increase LOOPBACK_TIMEOUT to 10 for VxWorks RTOS. 5537 5538- bpo-38169: Increase code coverage for SharedMemory and ShareableList 5539 5540- bpo-34401: Make test_gdb properly run on HP-UX. Patch by Michael Osipov. 5541 5542Build 5543----- 5544 5545- bpo-38249: Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable() 5546 if only the compiler is able to use it. Patch by Dong-hee Na. 5547 5548- bpo-41617: Fix ``pycore_bitutils.h`` header file to support old clang 5549 versions: ``__builtin_bswap16()`` is not available in LLVM clang 3.0. 5550 5551- bpo-40204: Pin Sphinx version to 2.3.1 in ``Doc/Makefile``. 5552 5553- bpo-36020: The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` 5554 are now required to build Python. 5555 5556- bpo-40684: ``make install`` now uses the ``PLATLIBDIR`` variable for the 5557 destination ``lib-dynload/`` directory when ``./configure 5558 --with-platlibdir`` is used. 5559 5560- bpo-40683: Fixed an issue where the :mod:`zoneinfo` module and its tests 5561 were not included when Python is installed with ``make``. 5562 5563Windows 5564------- 5565 5566- bpo-41744: Fixes automatic import of props file when using the Nuget 5567 package. 5568 5569- bpo-41627: The user site directory for 32-bit now includes a ``-32`` 5570 suffix to distinguish it from the 64-bit interpreter's directory. 5571 5572- bpo-41526: Fixed layout of final page of the installer by removing the 5573 special thanks to Mark Hammond (with his permission). 5574 5575- bpo-41492: Fixes the description that appears in UAC prompts. 5576 5577- bpo-40948: Improve post-install message to direct people to the "py" 5578 command. 5579 5580- bpo-41412: The installer will now fail to install on Windows 7 and Windows 5581 8. Further, the UCRT dependency is now always downloaded on demand. 5582 5583- bpo-40741: Update Windows release to include SQLite 3.32.3. 5584 5585- bpo-41142: :mod:`msilib` now supports creating CAB files with non-ASCII 5586 file path and adding files with non-ASCII file path to them. 5587 5588- bpo-41074: Fixed support of non-ASCII names in functions 5589 :func:`msilib.OpenDatabase` and :func:`msilib.init_database` and non-ASCII 5590 SQL in method :meth:`msilib.Database.OpenView`. 5591 5592- bpo-41039: Stable ABI redirection DLL (python3.dll) now uses ``#pragma 5593 comment(linker)`` for re-exporting. 5594 5595- bpo-40164: Updates Windows OpenSSL to 1.1.1g 5596 5597- bpo-39631: Changes the registered MIME type for ``.py`` files on Windows 5598 to ``text/x-python`` instead of ``text/plain``. 5599 5600- bpo-40677: Manually define IO_REPARSE_TAG_APPEXECLINK in case some old 5601 Windows SDK doesn't have it. 5602 5603- bpo-37556: Extend py.exe help to mention overrides via venv, shebang, 5604 environmental variables & ini files. 5605 5606macOS 5607----- 5608 5609- bpo-41557: Update macOS installer to use SQLite 3.33.0. 5610 5611- bpo-39580: Avoid opening Finder window if running installer from the 5612 command line. Patch contributed by Rick Heil. 5613 5614- bpo-41100: Fix configure error when building on macOS 11. Note that the 5615 current Python release was released shortly after the first developer 5616 preview of macOS 11 (Big Sur); there are other known issues with building 5617 and running on the developer preview. Big Sur is expected to be fully 5618 supported in a future bugfix release of Python 3.8.x and with 3.9.0. 5619 5620- bpo-40741: Update macOS installer to use SQLite 3.32.3. 5621 5622- bpo-41005: fixed an XDG settings issue not allowing macos to open browser 5623 in webbrowser.py 5624 5625- bpo-40741: Update macOS installer to use SQLite 3.32.2. 5626 5627IDLE 5628---- 5629 5630- bpo-41775: Use 'IDLE Shell' as shell title 5631 5632- bpo-35764: Rewrite the Calltips doc section. 5633 5634- bpo-40181: In calltips, stop reminding that '/' marks the end of 5635 positional-only arguments. 5636 5637- bpo-41468: Improve IDLE run crash error message (which users should never 5638 see). 5639 5640- bpo-41373: Save files loaded with no line ending, as when blank, or 5641 different line endings, by setting its line ending to the system default. 5642 Fix regression in 3.8.4 and 3.9.0b4. 5643 5644- bpo-41300: Save files with non-ascii chars. Fix regression released in 5645 3.9.0b4 and 3.8.4. 5646 5647- bpo-37765: Add keywords to module name completion list. Rewrite 5648 Completions section of IDLE doc. 5649 5650- bpo-41152: The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is 5651 now always UTF-8. 5652 5653- bpo-41144: Make Open Module open a special module such as os.path. 5654 5655- bpo-39885: Make context menu Cut and Copy work again when right-clicking 5656 within a selection. 5657 5658- bpo-40723: Make test_idle pass when run after import. 5659 5660C API 5661----- 5662 5663- bpo-41936: Removed undocumented macros ``Py_ALLOW_RECURSION`` and 5664 ``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the 5665 :c:type:`PyInterpreterState` structure. 5666 5667- bpo-41692: The ``PyUnicode_InternImmortal()`` function is now deprecated 5668 and will be removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` 5669 instead. Patch by Victor Stinner. 5670 5671- bpo-41842: Add :c:func:`PyCodec_Unregister` function to unregister a codec 5672 search function. 5673 5674- bpo-41834: Remove the ``_Py_CheckRecursionLimit`` variable: it has been 5675 replaced by ``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` 5676 structure. Patch by Victor Stinner. 5677 5678- bpo-41689: Types created with :c:func:`PyType_FromSpec` now make any 5679 signature in their ``tp_doc`` slot accessible from ``__text_signature__``. 5680 5681- bpo-41524: Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented 5682 pointers beyond the end of a string. 5683 5684- bpo-41324: Add a minimal decimal capsule API. The API supports fast 5685 conversions between Decimals up to 38 digits and their triple 5686 representation as a C struct. 5687 5688- bpo-30155: Add :c:func:`PyDateTime_DATE_GET_TZINFO` and 5689 :c:func:`PyDateTime_TIME_GET_TZINFO` macros for accessing the ``tzinfo`` 5690 attributes of :class:`datetime.datetime` and :class:`datetime.time` 5691 objects. 5692 5693- bpo-40170: Revert :c:func:`PyType_HasFeature` change: it reads again 5694 directly the :c:member:`PyTypeObject.tp_flags` member when the limited C 5695 API is not used, rather than always calling :c:func:`PyType_GetFlags` 5696 which hides implementation details. 5697 5698- bpo-41123: Remove ``PyUnicode_AsUnicodeCopy``. 5699 5700- bpo-41123: Removed ``PyLong_FromUnicode()``. 5701 5702- bpo-41123: Removed ``PyUnicode_GetMax()``. 5703 5704- bpo-41123: Removed ``Py_UNICODE_str*`` functions manipulating 5705 ``Py_UNICODE*`` strings. 5706 5707- bpo-41103: ``PyObject_AsCharBuffer()``, ``PyObject_AsReadBuffer()``, 5708 ``PyObject_CheckReadBuffer()``, and ``PyObject_AsWriteBuffer()`` are 5709 removed. Please migrate to new buffer protocol; 5710 :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release`. 5711 5712- bpo-36346: Raises DeprecationWarning for ``PyUnicode_FromUnicode(NULL, 5713 size)`` and ``PyUnicode_FromStringAndSize(NULL, size)`` with ``size > 0``. 5714 5715- bpo-36346: Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, 5716 ``PyUnicode_WSTR_LENGTH``, ``PyUnicode_FromUnicode``, 5717 ``PyUnicode_AsUnicode``, and ``PyUnicode_AsUnicodeAndSize`` as deprecated 5718 in C. Remove ``Py_UNICODE_MATCH`` which was deprecated and broken since 5719 Python 3.3. 5720 5721- bpo-40989: The :c:func:`PyObject_INIT` and :c:func:`PyObject_INIT_VAR` 5722 macros become aliases to, respectively, :c:func:`PyObject_Init` and 5723 :c:func:`PyObject_InitVar` functions. 5724 5725- bpo-36020: On Windows, ``#include "pyerrors.h"`` no longer defines 5726 ``snprintf`` and ``vsnprintf`` macros. 5727 5728- bpo-40943: The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use 5729 :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use 5730 ``#``: ``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and 5731 ``Z#``. See :ref:`Parsing arguments and building values <arg-parsing>` and 5732 the :pep:`353`. 5733 5734- bpo-40910: Export explicitly the :c:func:`Py_GetArgcArgv` function to the 5735 C API and document the function. Previously, it was exported implicitly 5736 which no longer works since Python is built with ``-fvisibility=hidden``. 5737 5738- bpo-40724: Allow defining buffer slots in type specs. 5739 5740- bpo-40679: Fix a ``_PyEval_EvalCode()`` crash if *qualname* argument is 5741 NULL. 5742 5743- bpo-40839: Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had 5744 been allowed for historical reason. It is no longer allowed. 5745 5746- bpo-40826: :c:func:`PyOS_InterruptOccurred` now fails with a fatal error 5747 if it is called with the GIL released. 5748 5749- bpo-40792: The result of :c:func:`PyNumber_Index` now always has exact 5750 type :class:`int`. Previously, the result could have been an instance of a 5751 subclass of ``int``. 5752 5753- bpo-39573: Convert :c:func:`Py_REFCNT` and :c:func:`Py_SIZE` macros to 5754 static inline functions. They cannot be used as l-value anymore: use 5755 :c:func:`Py_SET_REFCNT` and :c:func:`Py_SET_SIZE` to set an object 5756 reference count and size. This change is backward incompatible on purpose, 5757 to prepare the C API for an opaque :c:type:`PyObject` structure. 5758 5759- bpo-40703: The PyType_FromSpec*() functions no longer overwrite the type's 5760 "__module__" attribute if it is set via "Py_tp_members" or "Py_tp_getset". 5761 5762- bpo-39583: Remove superfluous "extern C" declarations from 5763 ``Include/cpython/*.h``. 5764 5765 5766What's New in Python 3.9.0 beta 1? 5767================================== 5768 5769*Release date: 2020-05-19* 5770 5771Security 5772-------- 5773 5774- bpo-40501: :mod:`uuid` no longer uses :mod:`ctypes` to load 5775 :file:`libuuid` or :file:`rpcrt4.dll` at runtime. 5776 5777Core and Builtins 5778----------------- 5779 5780- bpo-40663: Correctly generate annotations where parentheses are omitted 5781 but required (e.g: ``Type[(str, int, *other))]``. 5782 5783- bpo-40596: Fixed :meth:`str.isidentifier` for non-canonicalized strings 5784 containing non-BMP characters on Windows. 5785 5786- bpo-40593: Improved syntax errors for invalid characters in source code. 5787 5788- bpo-40585: Fixed a bug when using :func:`codeop.compile_command` that was 5789 causing exceptions to be swallowed with the new parser. Patch by Pablo 5790 Galindo 5791 5792- bpo-40566: Apply :pep:`573` to :mod:`abc`. 5793 5794- bpo-40502: Initialize ``n->n_col_offset``. (Patch by Joannah Nanjekye) 5795 5796- bpo-40527: Fix command line argument parsing: no longer write errors 5797 multiple times into stderr. 5798 5799- bpo-1635741: Port :mod:`errno` to multiphase initialization (:pep:`489`). 5800 5801- bpo-40523: Add pass-throughs for :func:`hash` and :func:`reversed` to 5802 :class:`weakref.proxy` objects. Patch by Pablo Galindo. 5803 5804- bpo-1635741: Port :mod:`syslog` to multiphase initialization (:pep:`489`). 5805 5806- bpo-40246: Reporting a specialised error message for invalid string 5807 prefixes, which was introduced in :issue:`40246`, is being reverted due to 5808 backwards compatibility concerns for strings that immediately follow a 5809 reserved keyword without whitespace between them. Constructs like 5810 `bg="#d00" if clear else"#fca"` were failing to parse, which is not an 5811 acceptable breakage on such short notice. 5812 5813- bpo-40417: Fix imp module deprecation warning when PyImport_ReloadModule 5814 is called. Patch by Robert Rouhani. 5815 5816- bpo-40408: Fixed support of nested type variables in GenericAlias (e.g. 5817 ``list[list[T]]``). 5818 5819- bpo-1635741: Port _stat module to multiphase initialization (:pep:`489`). 5820 5821- bpo-29587: Enable implicit exception chaining when calling 5822 :meth:`generator.throw`. 5823 5824- bpo-40328: Add tools for generating mappings headers for CJKCodecs. 5825 5826- bpo-40228: Setting frame.f_lineno is now robust w.r.t. changes in the 5827 source-to-bytecode compiler 5828 5829- bpo-38880: Added the ability to list interpreters associated with channel 5830 ends in the internal subinterpreters module. 5831 5832- bpo-37986: Improve performance of :c:func:`PyLong_FromDouble` for values 5833 that fit into :c:type:`long`. 5834 5835Library 5836------- 5837 5838- bpo-40662: Fixed :func:`ast.get_source_segment` for ast nodes that have 5839 incomplete location information. Patch by Irit Katriel. 5840 5841- bpo-40665: Convert :mod:`bisect` to use Argument Clinic. 5842 5843- bpo-40536: Added the :func:`~zoneinfo.available_timezones` function to the 5844 :mod:`zoneinfo` module. Patch by Paul Ganssle. 5845 5846- bpo-40645: The :class:`hmac.HMAC` exposes internal implementation details. 5847 The attributes ``digest_cons``, ``inner``, and ``outer`` are deprecated 5848 and will be removed in the future. 5849 5850- bpo-40645: The internal module ``_hashlib`` wraps and exposes OpenSSL's 5851 HMAC API. The new code will be used in Python 3.10 after the internal 5852 implementation details of the pure Python HMAC module are no longer part 5853 of the public API. 5854 5855- bpo-40637: Builtin hash modules can now be disabled or selectively enabled 5856 with ``configure --with-builtin-hashlib-hashes=sha3,blake1`` or 5857 ``--without-builtin-hashlib-hashes``. 5858 5859- bpo-37630: The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF 5860 from OpenSSL when available. 5861 5862- bpo-40479: The :mod:`hashlib` now compiles with OpenSSL 3.0.0-alpha2. 5863 5864- bpo-40257: Revert changes to :func:`inspect.getdoc`. 5865 5866- bpo-40607: When cancelling a task due to timeout, :meth:`asyncio.wait_for` 5867 will now propagate the exception if an error happens during cancellation. 5868 Patch by Roman Skurikhin. 5869 5870- bpo-40612: Fix edge cases in SyntaxError formatting. If the offset is <= 5871 0, no caret is printed. If the offset is > line length, the caret is 5872 printed pointing just after the last character. 5873 5874- bpo-40597: If text content lines are longer than policy.max_line_length, 5875 always use a content-encoding to make sure they are wrapped. 5876 5877- bpo-40571: Added functools.cache() as a simpler, more discoverable way to 5878 access the unbounded cache variant of lru_cache(maxsize=None). 5879 5880- bpo-40503: :pep:`615`, the :mod:`zoneinfo` module. Adds support for the 5881 IANA time zone database. 5882 5883- bpo-40397: Removed attributes ``__args__`` and ``__parameters__`` from 5884 special generic aliases like ``typing.List`` (not subscripted). 5885 5886- bpo-40549: Convert posixmodule.c ("posix" or "nt" module) to the 5887 multiphase initialization (PEP 489). 5888 5889- bpo-31033: Add a ``msg`` argument to :meth:`Future.cancel` and 5890 :meth:`Task.cancel`. 5891 5892- bpo-40541: Added an optional *counts* parameter to random.sample(). 5893 5894- bpo-40515: The :mod:`ssl` and :mod:`hashlib` modules now actively check 5895 that OpenSSL is build with thread support. Python 3.7.0 made thread 5896 support mandatory and no longer works safely with a no-thread builds. 5897 5898- bpo-31033: When a :class:`asyncio.Task` is cancelled, the exception 5899 traceback now chains all the way back to where the task was first 5900 interrupted. 5901 5902- bpo-40504: :func:`functools.lru_cache` objects can now be the targets of 5903 weakrefs. 5904 5905- bpo-40559: Fix possible memory leak in the C implementation of 5906 :class:`asyncio.Task`. 5907 5908- bpo-40480: ``fnmatch.fnmatch()`` could take exponential time in the 5909 presence of multiple ``*`` pattern characters. This was repaired by 5910 generating more elaborate regular expressions to avoid futile 5911 backtracking. 5912 5913- bpo-40495: :mod:`compileall` is now able to use hardlinks to prevent 5914 duplicates in a case when ``.pyc`` files for different optimization levels 5915 have the same content. 5916 5917- bpo-40457: The ssl module now support OpenSSL builds without TLS 1.0 and 5918 1.1 methods. 5919 5920- bpo-40355: Improve error reporting in :func:`ast.literal_eval` in the 5921 presence of malformed :class:`ast.Dict` nodes instead of silently ignoring 5922 any non-conforming elements. Patch by Curtis Bucher. 5923 5924- bpo-40465: Deprecated the optional *random* argument to 5925 *random.shuffle()*. 5926 5927- bpo-40459: :func:`platform.win32_ver` now produces correct *ptype* strings 5928 instead of empty strings. 5929 5930- bpo-39435: The first argument of :func:`pickle.loads` is now 5931 positional-only. 5932 5933- bpo-39305: Update :mod:`nntplib` to merge :class:`nntplib.NNTP` and 5934 :class:`nntplib._NNTPBase`. Patch by Dong-hee Na. 5935 5936- bpo-32494: Update :mod:`dbm.gnu` to use gdbm_count if possible when 5937 calling :func:`len`. Patch by Dong-hee Na. 5938 5939- bpo-40453: Add ``isolated=True`` keyword-only parameter to 5940 ``_xxsubinterpreters.create()``. An isolated subinterpreter cannot spawn 5941 threads, spawn a child process or call ``os.fork()``. 5942 5943- bpo-40286: Remove ``_random.Random.randbytes()``: the C implementation of 5944 ``randbytes()``. Implement the method in Python to ease subclassing: 5945 ``randbytes()`` now directly reuses ``getrandbits()``. 5946 5947- bpo-40394: Added default arguments to 5948 :meth:`difflib.SequenceMatcher.find_longest_match()`. 5949 5950- bpo-39995: Fix a race condition in concurrent.futures._ThreadWakeup: 5951 access to _ThreadWakeup is now protected with the shutdown lock. 5952 5953- bpo-30966: ``Process.shutdown(wait=True)`` of :mod:`concurrent.futures` 5954 now closes explicitly the result queue. 5955 5956- bpo-30966: Add a new :meth:`~multiprocessing.SimpleQueue.close` method to 5957 the :class:`~multiprocessing.SimpleQueue` class to explicitly close the 5958 queue. 5959 5960- bpo-39966: Revert bpo-25597. :class:`unittest.mock.MagicMock` with wraps' 5961 set uses default return values for magic methods. 5962 5963- bpo-39791: Added ``files()`` function to importlib.resources with support 5964 for subdirectories in package data, matching backport in 5965 importlib_resources 1.5. 5966 5967- bpo-40375: :meth:`imaplib.IMAP4.unselect` is added. Patch by Dong-hee Na. 5968 5969- bpo-40389: ``repr()`` now returns ``typing.Optional[T]`` when called for 5970 ``typing.Union`` of two types, one of which is ``NoneType``. 5971 5972- bpo-40291: Add support for CAN_J1939 sockets (available on Linux 5.4+) 5973 5974- bpo-40273: :class:`types.MappingProxyType` is now reversible. 5975 5976- bpo-39075: The repr for :class:`types.SimpleNamespace` is now insertion 5977 ordered rather than alphabetical. 5978 5979- bpo-40192: On AIX, :func:`~time.thread_time` is now implemented with 5980 ``thread_cputime()`` which has nanosecond resolution, rather than 5981 ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` which has a resolution of 10 5982 ms. Patch by Batuhan Taskaya. 5983 5984- bpo-40025: Raise TypeError when _generate_next_value_ is defined after 5985 members. Patch by Ethan Onstott. 5986 5987- bpo-39058: In the argparse module, the repr for Namespace() and other 5988 argument holders now displayed in the order attributes were added. 5989 Formerly, it displayed in alphabetical order even though argument order is 5990 preserved the user visible parts of the module. 5991 5992- bpo-24416: The ``isocalendar()`` methods of :class:`datetime.date` and 5993 :class:`datetime.datetime` now return a :term:`named tuple` instead of a 5994 :class:`tuple`. 5995 5996Documentation 5997------------- 5998 5999- bpo-34790: Add version of removal for explicit passing of coros to 6000 `asyncio.wait()`'s documentation 6001 6002- bpo-40561: Provide docstrings for webbrowser open functions. 6003 6004- bpo-40499: Mention that :func:`asyncio.wait` requires a non-empty set of 6005 awaitables. 6006 6007- bpo-39705: Tutorial example for sorted() in the Loop Techniques section is 6008 given a better explanation. Also a new example is included to explain 6009 sorted()'s basic behavior. 6010 6011- bpo-39435: Fix an incorrect signature for :func:`pickle.loads` in the docs 6012 6013Tests 6014----- 6015 6016- bpo-40055: distutils.tests now saves/restores warnings filters to leave 6017 them unchanged. Importing tests imports docutils which imports 6018 pkg_resources which adds a warnings filter. 6019 6020- bpo-40436: test_gdb and test.pythoninfo now check gdb command exit code. 6021 6022Build 6023----- 6024 6025- bpo-40653: Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling 6026 issue. 6027 6028- bpo-40514: Add ``--with-experimental-isolated-subinterpreters`` build 6029 option to ``configure``: better isolate subinterpreters, experimental 6030 build mode. 6031 6032Windows 6033------- 6034 6035- bpo-40650: Include winsock2.h in pytime.c for timeval. 6036 6037- bpo-40458: Increase reserved stack space to prevent overflow crash on 6038 Windows. 6039 6040- bpo-39148: Add IPv6 support to :mod:`asyncio` datagram endpoints in 6041 ProactorEventLoop. Change the raised exception for unknown address 6042 families to ValueError as it's not coming from Windows API. 6043 6044macOS 6045----- 6046 6047- bpo-34956: When building Python on macOS from source, ``_tkinter`` now 6048 links with non-system Tcl and Tk frameworks if they are installed in 6049 ``/Library/Frameworks``, as had been the case on older releases of macOS. 6050 If a macOS SDK is explicitly configured, by using 6051 ``--enable-universalsdk=`` or ``-isysroot``, only the SDK itself is 6052 searched. The default behavior can still be overridden with 6053 ``--with-tcltk-includes`` and ``--with-tcltk-libs``. 6054 6055- bpo-35569: Expose RFC 3542 IPv6 socket options. 6056 6057Tools/Demos 6058----------- 6059 6060- bpo-40479: Update multissltest helper to test with latest OpenSSL 1.0.2, 6061 1.1.0, 1.1.1, and 3.0.0-alpha. 6062 6063- bpo-40431: Fix a syntax typo in ``turtledemo`` that now raises a 6064 ``SyntaxError``. 6065 6066- bpo-40163: Fix multissltest tool. OpenSSL has changed download URL for old 6067 releases. The multissltest tool now tries to download from current and old 6068 download URLs. 6069 6070C API 6071----- 6072 6073- bpo-39465: Remove the ``_PyUnicode_ClearStaticStrings()`` function from 6074 the C API. 6075 6076- bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks now 6077 that we allow subtypes of PyCFunction, as well as PyCMethod_CheckExact() 6078 and PyCMethod_Check() for the new PyCMethod subtype. 6079 6080- bpo-40545: Declare ``_PyErr_GetTopmostException()`` with ``PyAPI_FUNC()`` 6081 to properly export the function in the C API. The function remains private 6082 (``_Py``) prefix. 6083 6084- bpo-40412: Nullify inittab_copy during finalization, preventing future 6085 interpreter initializations in an embedded situation from crashing. Patch 6086 by Gregory Szorc. 6087 6088- bpo-40429: The :c:func:`PyThreadState_GetFrame` function now returns a 6089 strong reference to the frame. 6090 6091- bpo-40428: Remove the following functions from the C API. Call 6092 :c:func:`PyGC_Collect` explicitly to free all free lists. 6093 6094 * ``PyAsyncGen_ClearFreeLists()`` 6095 * ``PyContext_ClearFreeList()`` 6096 * ``PyDict_ClearFreeList()`` 6097 * ``PyFloat_ClearFreeList()`` 6098 * ``PyFrame_ClearFreeList()`` 6099 * ``PyList_ClearFreeList()`` 6100 * ``PySet_ClearFreeList()`` 6101 * ``PyTuple_ClearFreeList()`` 6102 6103- bpo-40421: New :c:func:`PyFrame_GetBack` function: get the frame next 6104 outer frame. 6105 6106- bpo-40421: New :c:func:`PyFrame_GetCode` function: return a borrowed 6107 reference to the frame code. 6108 6109- bpo-40217: Ensure that instances of types created with 6110 :c:func:`PyType_FromSpecWithBases` will visit its class object when 6111 traversing references in the garbage collector (implemented as an 6112 extension of the provided :c:member:`~PyTypeObject.tp_traverse`). Patch by 6113 Pablo Galindo. 6114 6115- bpo-38787: Module C state is now accessible from C-defined heap type 6116 methods (:pep:`573`). Patch by Marcel Plch and Petr Viktorin. 6117 6118 6119What's New in Python 3.9.0 alpha 6? 6120=================================== 6121 6122*Release date: 2020-04-27* 6123 6124Security 6125-------- 6126 6127- bpo-40121: Fixes audit events raised on creating a new socket. 6128 6129- bpo-39073: Disallow CR or LF in email.headerregistry.Address arguments to 6130 guard against header injection attacks. 6131 6132- bpo-39503: CVE-2020-8492: The 6133 :class:`~urllib.request.AbstractBasicAuthHandler` class of the 6134 :mod:`urllib.request` module uses an inefficient regular expression which 6135 can be exploited by an attacker to cause a denial of service. Fix the 6136 regex to prevent the catastrophic backtracking. Vulnerability reported by 6137 Ben Caller and Matt Schwager. 6138 6139Core and Builtins 6140----------------- 6141 6142- bpo-40313: Improve the performance of bytes.hex(). 6143 6144- bpo-40334: Switch to a new parser, based on PEG. For more details see PEP 6145 617. To temporarily switch back to the old parser, use ``-X oldparser`` or 6146 ``PYTHONOLDPARSER=1``. In Python 3.10 we will remove the old parser 6147 completely, including the ``parser`` module (already deprecated) and 6148 anything that depends on it. 6149 6150- bpo-40267: Fix the tokenizer to display the correct error message, when 6151 there is a SyntaxError on the last input character and no newline follows. 6152 It used to be `unexpected EOF while parsing`, while it should be `invalid 6153 syntax`. 6154 6155- bpo-39522: Correctly unparse explicit ``u`` prefix for strings when 6156 postponed evaluation for annotations activated. Patch by Batuhan Taskaya. 6157 6158- bpo-40246: Report a specialized error message, `invalid string prefix`, 6159 when the tokenizer encounters a string with an invalid prefix. 6160 6161- bpo-40082: Fix the signal handler: it now always uses the main 6162 interpreter, rather than trying to get the current Python thread state. 6163 6164- bpo-37388: str.encode() and str.decode() no longer check the encoding and 6165 errors in development mode or in debug mode during Python finalization. 6166 The codecs machinery can no longer work on very late calls to str.encode() 6167 and str.decode(). 6168 6169- bpo-40077: Fix possible refleaks in :mod:`_json`, memo of PyScannerObject 6170 should be traversed. 6171 6172- bpo-37207: Speed up calls to ``dict()`` by using the :pep:`590` 6173 ``vectorcall`` calling convention. 6174 6175- bpo-40141: Add column and line information to ``ast.keyword`` nodes. Patch 6176 by Pablo Galindo. 6177 6178- bpo-1635741: Port :mod:`resource` to multiphase initialization 6179 (:pep:`489`). 6180 6181- bpo-1635741: Port :mod:`math` to multiphase initialization (:pep:`489`). 6182 6183- bpo-1635741: Port _uuid module to multiphase initialization (:pep:`489`). 6184 6185- bpo-40077: Convert json module to use :c:func:`PyType_FromSpec`. 6186 6187- bpo-40067: Improve the error message for multiple star expressions in an 6188 assignment. Patch by Furkan Onder 6189 6190- bpo-1635741: Port _functools module to multiphase initialization (PEP 6191 489). Patch by Paulo Henrique Silva. 6192 6193- bpo-1635741: Port operator module to multiphase initialization (PEP 489). 6194 Patch by Paulo Henrique Silva. 6195 6196- bpo-20526: Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is 6197 a borrowed reference, not a strong reference: ``PyThreadState_Clear()`` 6198 must not call ``Py_CLEAR(tstate->frame)``. 6199 6200- bpo-1635741: Port time module to multiphase initialization (:pep:`489`). 6201 Patch by Paulo Henrique Silva. 6202 6203- bpo-1635741: Port _weakref extension module to multiphase initialization 6204 (:pep:`489`). 6205 6206- bpo-40020: Fix a leak and subsequent crash in parsetok.c caused by realloc 6207 misuse on a rare codepath. 6208 6209- bpo-39939: Added str.removeprefix and str.removesuffix methods and 6210 corresponding bytes, bytearray, and collections.UserString methods to 6211 remove affixes from a string if present. See :pep:`616` for a full 6212 description. Patch by Dennis Sweeney. 6213 6214- bpo-39481: Implement PEP 585. This supports list[int], tuple[str, ...] 6215 etc. 6216 6217- bpo-32894: Support unparsing of infinity numbers in postponed annotations. 6218 Patch by Batuhan Taşkaya. 6219 6220- bpo-37207: Speed up calls to ``list()`` by using the :pep:`590` 6221 ``vectorcall`` calling convention. Patch by Mark Shannon. 6222 6223Library 6224------- 6225 6226- bpo-40398: :func:`typing.get_args` now always returns an empty tuple for 6227 special generic aliases. 6228 6229- bpo-40396: Functions :func:`typing.get_origin`, :func:`typing.get_args` 6230 and :func:`typing.get_type_hints` support now generic aliases like 6231 ``list[int]``. 6232 6233- bpo-38061: Optimize the :mod:`subprocess` module on FreeBSD using 6234 ``closefrom()``. A single ``close(fd)`` syscall is cheap, but when 6235 ``sysconf(_SC_OPEN_MAX)`` is high, the loop calling ``close(fd)`` on each 6236 file descriptor can take several milliseconds. 6237 6238 The workaround on FreeBSD to improve performance was to load and mount the 6239 fdescfs kernel module, but this is not enabled by default. 6240 6241 Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans 6242 (kevans) and Kubilay Kocak (koobs): 6243 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 6244 6245- bpo-38061: On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls 6246 ``closefrom(fd_low)`` if *fd_high* is greater than or equal to 6247 ``sysconf(_SC_OPEN_MAX)``. 6248 6249 Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans 6250 (kevans) and Kubilay Kocak (koobs): 6251 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 6252 6253- bpo-40360: The :mod:`lib2to3` module is pending deprecation due to 6254 :pep:`617`. 6255 6256- bpo-40138: Fix the Windows implementation of :func:`os.waitpid` for exit 6257 code larger than ``INT_MAX >> 8``. The exit status is now interpreted as 6258 an unsigned number. 6259 6260- bpo-39942: Set "__main__" as the default module name when "__name__" is 6261 missing in :class:`typing.TypeVar`. Patch by Weipeng Hong. 6262 6263- bpo-40275: The :mod:`logging` package is now imported lazily in 6264 :mod:`unittest` only when the :meth:`~unittest.TestCase.assertLogs` 6265 assertion is used. 6266 6267- bpo-40275: The :mod:`asyncio` package is now imported lazily in 6268 :mod:`unittest` only when the :class:`~unittest.IsolatedAsyncioTestCase` 6269 class is used. 6270 6271- bpo-40330: In :meth:`ShareableList.__setitem__`, check the size of a new 6272 string item after encoding it to utf-8, not before. 6273 6274- bpo-40148: Added :meth:`pathlib.Path.with_stem()` to create a new Path 6275 with the stem replaced. 6276 6277- bpo-40325: Deprecated support for set objects in random.sample(). 6278 6279- bpo-40257: Improved help for the :mod:`typing` module. Docstrings are now 6280 shown for all special forms and special generic aliases (like ``Union`` 6281 and ``List``). Using ``help()`` with generic alias like ``List[int]`` will 6282 show the help for the correspondent concrete type (``list`` in this case). 6283 6284- bpo-40257: func:`inspect.getdoc` no longer returns docstring inherited 6285 from the type of the object or from parent class if it is a class if it is 6286 not defined in the object itself. In :mod:`pydoc` the documentation string 6287 is now shown not only for class, function, method etc, but for any object 6288 that has its own ``__doc__`` attribute. 6289 6290- bpo-40287: Fixed ``SpooledTemporaryFile.seek()`` to return the position. 6291 6292- bpo-40290: Added zscore() to statistics.NormalDist(). 6293 6294- bpo-40282: Allow ``random.getrandbits(0)`` to succeed and to return 0. 6295 6296- bpo-40286: Add :func:`random.randbytes` function and 6297 :meth:`random.Random.randbytes` method to generate random bytes. 6298 6299- bpo-40277: :func:`collections.namedtuple` now provides a human-readable 6300 repr for its field accessors. 6301 6302- bpo-40270: The included copy of sqlite3 on Windows is now compiled with 6303 the json extension. This allows the use of functions such as 6304 ``json_object``. 6305 6306- bpo-29255: Wait in `KqueueSelector.select` when no fds are registered 6307 6308- bpo-40260: Ensure :mod:`modulefinder` uses :func:`io.open_code` and 6309 respects coding comments. 6310 6311- bpo-40234: Allow again to spawn daemon threads in subinterpreters (revert 6312 change which denied them). 6313 6314- bpo-39207: Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are 6315 now spawned on demand, only when there are no available idle workers to 6316 reuse. This optimizes startup overhead and reduces the amount of lost CPU 6317 time to idle workers. Patch by Kyle Stanley. 6318 6319- bpo-40091: Fix a hang at fork in the logging module: the new private 6320 _at_fork_reinit() method is now used to reinitialize locks at fork in the 6321 child process. 6322 6323- bpo-40149: Implement traverse and clear slots in _abc._abc_data type. 6324 6325- bpo-40208: Remove deprecated :meth:`symtable.SymbolTable.has_exec`. 6326 6327- bpo-40196: Fix a bug in the :mod:`symtable` module that was causing 6328 incorrectly report global variables as local. Patch by Pablo Galindo. 6329 6330- bpo-40190: Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`. 6331 6332- bpo-40182: Removed the ``_field_types`` attribute of the 6333 :class:`typing.NamedTuple` class. 6334 6335- bpo-36517: Multiple inheritance with :class:`typing.NamedTuple` now raises 6336 an error instead of silently ignoring other types. 6337 6338- bpo-40126: Fixed reverting multiple patches in unittest.mock. Patcher's 6339 ``__exit__()`` is now never called if its ``__enter__()`` is failed. 6340 Returning true from ``__exit__()`` silences now the exception. 6341 6342- bpo-40094: CGIHTTPRequestHandler of http.server now logs the CGI script 6343 exit code, rather than the CGI script exit status of os.waitpid(). For 6344 example, if the script is killed by signal 11, it now logs: "CGI script 6345 exit code -11." 6346 6347- bpo-40108: Improve the error message when triying to import a module using 6348 :mod:`runpy` and incorrently use the ".py" extension at the end of the 6349 module name. Patch by Pablo Galindo. 6350 6351- bpo-40094: Add :func:`os.waitstatus_to_exitcode` function: convert a wait 6352 status to an exit code. 6353 6354- bpo-40089: Fix threading._after_fork(): if fork was not called by a thread 6355 spawned by threading.Thread, threading._after_fork() now creates a 6356 _MainThread instance for _main_thread, instead of a _DummyThread instance. 6357 6358- bpo-40089: Add a private ``_at_fork_reinit()`` method to 6359 :class:`_thread.Lock`, :class:`_thread.RLock`, :class:`threading.RLock` 6360 and :class:`threading.Condition` classes: reinitialize the lock at fork in 6361 the child process, reset the lock to the unlocked state. Rename also the 6362 private ``_reset_internal_locks()`` method of :class:`threading.Event` to 6363 ``_at_fork_reinit()``. 6364 6365- bpo-25780: Expose :data:`~socket.CAN_RAW_JOIN_FILTERS` in the 6366 :mod:`socket` module. 6367 6368- bpo-39503: :class:`~urllib.request.AbstractBasicAuthHandler` of 6369 :mod:`urllib.request` now parses all WWW-Authenticate HTTP headers and 6370 accepts multiple challenges per header: use the realm of the first Basic 6371 challenge. 6372 6373- bpo-39812: Removed daemon threads from :mod:`concurrent.futures` by adding 6374 an internal `threading._register_atexit()`, which calls registered 6375 functions prior to joining all non-daemon threads. This allows for 6376 compatibility with subinterpreters, which don't support daemon threads. 6377 6378- bpo-40050: Fix ``importlib._bootstrap_external``: avoid creating a new 6379 ``winreg`` builtin module if it's already available in 6380 :data:`sys.modules`, and remove redundant imports. 6381 6382- bpo-40014: Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails 6383 because the group list is too small, retry with a larger group list. On 6384 failure, the glibc implementation of ``getgrouplist()`` sets ``ngroups`` 6385 to the total number of groups. For other implementations, double the group 6386 list size. 6387 6388- bpo-40017: Add :data:`time.CLOCK_TAI` constant if the operating system 6389 support it. 6390 6391- bpo-40016: In re docstring, clarify the relationship between inline and 6392 argument compile flags. 6393 6394- bpo-39953: Update internal table of OpenSSL error codes in the ``ssl`` 6395 module. 6396 6397- bpo-36144: Added :pep:`584` operators to 6398 :class:`weakref.WeakValueDictionary`. 6399 6400- bpo-36144: Added :pep:`584` operators to 6401 :class:`weakref.WeakKeyDictionary`. 6402 6403- bpo-38891: Fix linear runtime behaviour of the `__getitem__` and 6404 `__setitem__` methods in 6405 :class:`multiprocessing.shared_memory.ShareableList`. This avoids 6406 quadratic performance when iterating a `ShareableList`. Patch by Thomas 6407 Krennwallner. 6408 6409- bpo-39682: Remove undocumented support for *closing* a `pathlib.Path` 6410 object via its context manager. The context manager magic methods remain, 6411 but they are now a no-op, making `Path` objects immutable. 6412 6413- bpo-36144: Added :pep:`584` operators (``|`` and ``|=``) to 6414 :class:`collections.ChainMap`. 6415 6416- bpo-39011: Normalization of line endings in ElementTree attributes was 6417 removed, as line endings which were replaced by entity numbers should be 6418 preserved in original form. 6419 6420- bpo-38410: Properly handle :func:`sys.audit` failures in 6421 :func:`sys.set_asyncgen_hooks`. 6422 6423- bpo-36541: lib2to3 now recognizes named assignment expressions (the walrus 6424 operator, ``:=``) 6425 6426- bpo-35967: In platform, delay the invocation of 'uname -p' until the 6427 processor attribute is requested. 6428 6429- bpo-35113: :meth:`inspect.getsource` now returns correct source code for 6430 inner class with same name as module level class. Decorators are also 6431 returned as part of source of the class. Patch by Karthikeyan 6432 Singaravelan. 6433 6434- bpo-33262: Deprecate passing None as an argument for 6435 :func:`shlex.split()`'s ``s`` parameter. Patch by Zackery Spytz. 6436 6437- bpo-31758: Prevent crashes when using an uninitialized 6438 ``_elementtree.XMLParser`` object. Patch by Oren Milman. 6439 6440Documentation 6441------------- 6442 6443- bpo-27635: The pickle documentation incorrectly claimed that ``__new__`` 6444 isn't called by default when unpickling. 6445 6446- bpo-39879: Updated :ref:`datamodel` docs to include :func:`dict` insertion 6447 order preservation. Patch by Furkan Onder and Samy Lahfa. 6448 6449- bpo-38387: Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. 6450 6451- bpo-13743: Some methods within xml.dom.minidom.Element class are now 6452 better documented. 6453 6454Tests 6455----- 6456 6457- bpo-31904: Set expected default encoding in test_c_locale_coercion.py for 6458 VxWorks RTOS. 6459 6460- bpo-40162: Update Travis CI configuration to OpenSSL 1.1.1f. 6461 6462- bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines. 6463 6464- bpo-40094: Add :func:`test.support.wait_process` function. 6465 6466- bpo-40003: ``test.bisect_cmd`` now copies Python command line options like 6467 ``-O`` or ``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used 6468 with ``-w``/``--verbose2`` option. 6469 6470- bpo-39380: Add the encoding in :class:`ftplib.FTP` and 6471 :class:`ftplib.FTP_TLS` to the constructor as keyword-only and change the 6472 default from ``latin-1`` to ``utf-8`` to follow :rfc:`2640`. 6473 6474- bpo-39793: Use the same domain when testing ``make_msgid``. Patch by 6475 Batuhan Taskaya. 6476 6477- bpo-1812: Fix newline handling in doctest.testfile when loading from a 6478 package whose loader has a get_data method. Patch by Peter Donis. 6479 6480Build 6481----- 6482 6483- bpo-38360: Support single-argument form of macOS -isysroot flag. 6484 6485- bpo-40158: Fix CPython MSBuild Properties in NuGet Package 6486 (build/native/python.props) 6487 6488- bpo-38527: Fix configure check on Solaris for "float word ordering": 6489 sometimes, the correct "grep" command was not being used. Patch by Arnon 6490 Yaari. 6491 6492Windows 6493------- 6494 6495- bpo-40164: Updates Windows to OpenSSL 1.1.1f 6496 6497- bpo-8901: Ignore the Windows registry when the ``-E`` option is used. 6498 6499macOS 6500----- 6501 6502- bpo-38329: python.org macOS installers now update the Current version 6503 symlink of /Library/Frameworks/Python.framework/Versions for 3.9 installs. 6504 Previously, Current was only updated for Python 2.x installs. This should 6505 make it easier to embed Python 3 into other macOS applications. 6506 6507- bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. 6508 6509IDLE 6510---- 6511 6512- bpo-38439: Add a 256×256 pixel IDLE icon to support more modern 6513 environments. Created by Andrew Clover. Delete the unused macOS idle.icns 6514 icon file. 6515 6516- bpo-38689: IDLE will no longer freeze when inspect.signature fails when 6517 fetching a calltip. 6518 6519Tools/Demos 6520----------- 6521 6522- bpo-40385: Removed the checkpyc.py tool. Please see compileall without 6523 force mode as a potential alternative. 6524 6525- bpo-40179: Fixed translation of ``#elif`` in Argument Clinic. 6526 6527- bpo-40094: Fix ``which.py`` script exit code: it now uses 6528 :func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status 6529 into an exit code. 6530 6531C API 6532----- 6533 6534- bpo-40241: Move the :c:type:`PyGC_Head` structure to the internal C API. 6535 6536- bpo-40170: Convert :c:func:`PyObject_IS_GC` macro to a function to hide 6537 implementation details. 6538 6539- bpo-40241: Add the functions :c:func:`PyObject_GC_IsTracked` and 6540 :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if 6541 Python objects are being currently tracked or have been already finalized 6542 by the garbage collector respectively. Patch by Pablo Galindo. 6543 6544- bpo-40170: The :c:func:`PyObject_NEW` macro becomes an alias to the 6545 :c:func:`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro 6546 becomes an alias to the :c:func:`PyObject_NewVar` macro, to hide 6547 implementation details. They no longer access directly the 6548 :c:member:`PyTypeObject.tp_basicsize` member. 6549 6550- bpo-40170: :c:func:`PyType_HasFeature` now always calls 6551 :c:func:`PyType_GetFlags` to hide implementation details. Previously, it 6552 accessed directly the :c:member:`PyTypeObject.tp_flags` member when the 6553 limited C API was not used. 6554 6555- bpo-40170: Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a 6556 function to hide implementation details: the macro accessed directly to 6557 the :c:member:`PyTypeObject.tp_weaklistoffset` member. 6558 6559- bpo-40170: Convert :c:func:`PyObject_CheckBuffer` macro to a function to 6560 hide implementation details: the macro accessed directly the 6561 :c:member:`PyTypeObject.tp_as_buffer` member. 6562 6563- bpo-40170: Always declare :c:func:`PyIndex_Check` as an opaque function to 6564 hide implementation details: remove ``PyIndex_Check()`` macro. The macro 6565 accessed directly the :c:member:`PyTypeObject.tp_as_number` member. 6566 6567- bpo-39947: Add :c:func:`PyThreadState_GetID` function: get the unique 6568 identifier of a Python thread state. 6569 6570 6571What's New in Python 3.9.0 alpha 5? 6572=================================== 6573 6574*Release date: 2020-03-23* 6575 6576Security 6577-------- 6578 6579- bpo-38576: Disallow control characters in hostnames in http.client, 6580 addressing CVE-2019-18348. Such potentially malicious header injection 6581 URLs now cause a InvalidURL to be raised. 6582 6583Core and Builtins 6584----------------- 6585 6586- bpo-40010: Optimize pending calls in multithreaded applications. If a 6587 thread different than the main thread schedules a pending call 6588 (:c:func:`Py_AddPendingCall`), the bytecode evaluation loop is no longer 6589 interrupted at each bytecode instruction to check for pending calls which 6590 cannot be executed. Only the main thread can execute pending calls. 6591 6592 Previously, the bytecode evaluation loop was interrupted at each 6593 instruction until the main thread executes pending calls. 6594 6595- bpo-1635741: Port _weakref extension module to multiphase initialization 6596 (:pep:`489`). 6597 6598- bpo-1635741: Port _collections module to multiphase initialization 6599 (:pep:`489`). 6600 6601- bpo-40010: Optimize signal handling in multithreaded applications. If a 6602 thread different than the main thread gets a signal, the bytecode 6603 evaluation loop is no longer interrupted at each bytecode instruction to 6604 check for pending signals which cannot be handled. Only the main thread of 6605 the main interpreter can handle signals. 6606 6607 Previously, the bytecode evaluation loop was interrupted at each 6608 instruction until the main thread handles signals. 6609 6610- bpo-39984: If :c:func:`Py_AddPendingCall` is called in a subinterpreter, 6611 the function is now scheduled to be called from the subinterpreter, rather 6612 than being called from the main interpreter. Each subinterpreter now has 6613 its own list of scheduled calls. 6614 6615- bpo-1635741: Port _heapq module to multiphase initialization. 6616 6617- bpo-1635741: Port itertools module to multiphase initialization 6618 (:pep:`489`). 6619 6620- bpo-37207: Speed up calls to ``frozenset()`` by using the :pep:`590` 6621 ``vectorcall`` calling convention. Patch by Dong-hee Na. 6622 6623- bpo-39984: subinterpreters: Move 6624 ``_PyRuntimeState.ceval.tracing_possible`` to 6625 ``PyInterpreterState.ceval.tracing_possible``: each interpreter now has 6626 its own variable. 6627 6628- bpo-37207: Speed up calls to ``set()`` by using the :pep:`590` 6629 ``vectorcall`` calling convention. Patch by Dong-hee Na. 6630 6631- bpo-1635741: Port _statistics module to multiphase initialization 6632 (:pep:`489`). 6633 6634- bpo-39968: Use inline function to replace extension modules' 6635 get_module_state macros. 6636 6637- bpo-39965: Correctly raise ``SyntaxError`` if *await* is used inside 6638 non-async functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the 6639 asyncio REPL). Patch by Pablo Galindo. 6640 6641- bpo-39562: Allow executing asynchronous comprehensions on the top level 6642 when the ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan 6643 Taskaya. 6644 6645- bpo-37207: Speed up calls to ``tuple()`` by using the :pep:`590` 6646 ``vectorcall`` calling convention. Patch by Dong-hee Na. 6647 6648- bpo-38373: Changed list overallocation strategy. It no longer 6649 overallocates if the new size is closer to overallocated size than to the 6650 old size and adds padding. 6651 6652- bpo-39926: Update Unicode database to Unicode version 13.0.0. 6653 6654- bpo-19466: Clear the frames of daemon threads earlier during the Python 6655 shutdown to call objects destructors. So "unclosed file" resource warnings 6656 are now emitted for daemon threads in a more reliable way. 6657 6658- bpo-38894: Fix a bug that was causing incomplete results when calling 6659 ``pathlib.Path.glob`` in the presence of symlinks that point to files 6660 where the user does not have read access. Patch by Pablo Galindo and Matt 6661 Wozniski. 6662 6663- bpo-39877: Fix :c:func:`PyEval_RestoreThread` random crash at exit with 6664 daemon threads. It now accesses the ``_PyRuntime`` variable directly 6665 instead of using ``tstate->interp->runtime``, since ``tstate`` can be a 6666 dangling pointer after :c:func:`Py_Finalize` has been called. Moreover, 6667 the daemon thread now exits before trying to take the GIL. 6668 6669- bpo-39871: Fix a possible :exc:`SystemError` in 6670 ``math.{atan2,copysign,remainder}()`` when the first argument cannot be 6671 converted to a :class:`float`. Patch by Zackery Spytz. 6672 6673- bpo-39776: Fix race condition where threads created by PyGILState_Ensure() 6674 could get a duplicate id. 6675 6676 This affects consumers of tstate->id like the contextvar caching 6677 machinery, which could return invalid cached objects under heavy thread 6678 load (observed in embedded scenarios). 6679 6680- bpo-39778: Fixed a crash due to incorrect handling of weak references in 6681 ``collections.OrderedDict`` classes. Patch by Pablo Galindo. 6682 6683- bpo-1635741: Port audioop extension module to multiphase initialization 6684 (:pep:`489`). 6685 6686- bpo-39702: Relax :term:`decorator` grammar restrictions to allow any valid 6687 expression (:pep:`614`). 6688 6689- bpo-38091: Tweak import deadlock detection code to not deadlock itself. 6690 6691- bpo-1635741: Port _locale extension module to multiphase initialization 6692 (:pep:`489`). 6693 6694- bpo-39087: Optimize :c:func:`PyUnicode_AsUTF8` and 6695 :c:func:`PyUnicode_AsUTF8AndSize` slightly when they need to create 6696 internal UTF-8 cache. 6697 6698- bpo-39520: Fix unparsing of ext slices with no items (``foo[:,]``). Patch 6699 by Batuhan Taskaya. 6700 6701- bpo-39220: Do not optimize annotations if 'from __future__ import 6702 annotations' is used. Patch by Pablo Galindo. 6703 6704- bpo-35712: Using :data:`NotImplemented` in a boolean context has been 6705 deprecated. Patch contributed by Josh Rosenberg. 6706 6707- bpo-22490: Don't leak environment variable ``__PYVENV_LAUNCHER__`` into 6708 the interpreter session on macOS. 6709 6710Library 6711------- 6712 6713- bpo-39830: Add :class:`zipfile.Path` to ``__all__`` in the :mod:`zipfile` 6714 module. 6715 6716- bpo-40000: Improved error messages for validation of ``ast.Constant`` 6717 nodes. Patch by Batuhan Taskaya. 6718 6719- bpo-39999: ``__module__`` of the AST node classes is now set to "ast" 6720 instead of "_ast". Added docstrings for dummy AST node classes and 6721 deprecated attributes. 6722 6723- bpo-39991: :func:`uuid.getnode` now skips IPv6 addresses with the same 6724 string length than a MAC address (17 characters): only use MAC addresses. 6725 6726- bpo-39988: Deprecated ``ast.AugLoad`` and ``ast.AugStore`` node classes 6727 because they are no longer used. 6728 6729- bpo-39656: Ensure ``bin/python3.#`` is always present in virtual 6730 environments on POSIX platforms - by Anthony Sottile. 6731 6732- bpo-39969: Deprecated ``ast.Param`` node class because it's no longer 6733 used. Patch by Batuhan Taskaya. 6734 6735- bpo-39360: Ensure all workers exit when finalizing a 6736 :class:`multiprocessing.Pool` implicitly via the module finalization 6737 handlers of multiprocessing. This fixes a deadlock situation that can be 6738 experienced when the Pool is not properly finalized via the context 6739 manager or a call to ``multiprocessing.Pool.terminate``. Patch by Batuhan 6740 Taskaya and Pablo Galindo. 6741 6742- bpo-35370: sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() 6743 now properly report :c:func:`PySys_Audit` error if "sys.setprofile" or 6744 "sys.settrace" audit event is denied. 6745 6746- bpo-39936: AIX: Fix _aix_support module when the subprocess is not 6747 available, when building Python from scratch. It now uses new private 6748 _bootsubprocess module, rather than having two implementations depending 6749 if subprocess is available or not. So _aix_support.aix_platform() result 6750 is now the same if subprocess is available or not. 6751 6752- bpo-36144: :class:`collections.OrderedDict` now implements ``|`` and 6753 ``|=`` (:pep:`584`). 6754 6755- bpo-39652: The column name found in ``sqlite3.Cursor.description`` is now 6756 truncated on the first '[' only if the PARSE_COLNAMES option is set. 6757 6758- bpo-39915: Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call 6759 objects in the order of awaited arguments instead of using 6760 :attr:`unittest.mock.Mock.call_args` which has the last value of the call. 6761 Patch by Karthikeyan Singaravelan. 6762 6763- bpo-36144: Updated :data:`os.environ` and :data:`os.environb` to support 6764 :pep:`584`'s merge (``|``) and update (``|=``) operators. 6765 6766- bpo-38662: The ``ensurepip`` module now invokes ``pip`` via the ``runpy`` 6767 module. Hence it is no longer tightly coupled with the internal API of the 6768 bundled ``pip`` version, allowing easier updates to a newer ``pip`` 6769 version both internally and for distributors. 6770 6771- bpo-38075: Fix the :meth:`random.Random.seed` method when a :class:`bool` 6772 is passed as the seed. 6773 6774- bpo-39916: More reliable use of ``os.scandir()`` in ``Path.glob()``. It no 6775 longer emits a ResourceWarning when interrupted. 6776 6777- bpo-39850: :mod:`multiprocessing` now supports abstract socket addresses 6778 (if abstract sockets are supported in the running platform). When creating 6779 arbitrary addresses (like when default-constructing 6780 :class:`multiprocessing.connection.Listener` objects) abstract sockets are 6781 preferred to avoid the case when the temporary-file-generated address is 6782 too large for an AF_UNIX socket address. Patch by Pablo Galindo. 6783 6784- bpo-36287: :func:`ast.dump()` no longer outputs optional fields and 6785 attributes with default values. The default values for optional fields and 6786 attributes of AST nodes are now set as class attributes (e.g. 6787 ``Constant.kind`` is set to ``None``). 6788 6789- bpo-39889: Fixed :func:`ast.unparse` for extended slices containing a 6790 single element (e.g. ``a[i:j,]``). Remove redundant tuples when index with 6791 a tuple (e.g. ``a[i, j]``). 6792 6793- bpo-39828: Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by 6794 Dong-hee Na. 6795 6796- bpo-13487: Avoid a possible *"RuntimeError: dictionary changed size during 6797 iteration"* from :func:`inspect.getmodule` when it tried to loop through 6798 :attr:`sys.modules`. 6799 6800- bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode". 6801 The "U" mode of open() is kept in Python 3.9 to ease transition from 6802 Python 2.7, but will be removed in Python 3.10. 6803 6804- bpo-28577: The hosts method on 32-bit prefix length IPv4Networks and 6805 128-bit prefix IPv6Networks now returns a list containing the single 6806 Address instead of an empty list. 6807 6808- bpo-39826: Add getConnection method to logging HTTPHandler to enable 6809 custom connections. 6810 6811- bpo-39763: Reimplement :func:`distutils.spawn.spawn` function with the 6812 :mod:`subprocess` module. 6813 6814- bpo-39794: Add --without-decimal-contextvar build option. This enables a 6815 thread-local rather than a coroutine local context. 6816 6817- bpo-36144: :class:`collections.defaultdict` now implements ``|`` 6818 (:pep:`584`). 6819 6820- bpo-39517: Fix runpy.run_path() when using pathlike objects 6821 6822- bpo-39775: Change ``inspect.Signature.parameters`` back to 6823 ``collections.OrderedDict``. This was changed to ``dict`` in Python 6824 3.9.0a4. 6825 6826- bpo-39678: Refactor queue_manager in 6827 :class:`concurrent.futures.ProcessPoolExecutor` to make it easier to 6828 maintain. 6829 6830- bpo-39764: Fix AttributeError when calling get_stack on a PyAsyncGenObject 6831 Task 6832 6833- bpo-39769: The :func:`compileall.compile_dir` function's *ddir* parameter 6834 and the compileall command line flag `-d` no longer write the wrong 6835 pathname to the generated pyc file for submodules beneath the root of the 6836 directory tree being compiled. This fixes a regression introduced with 6837 Python 3.5. 6838 6839- bpo-36144: :class:`types.MappingProxyType` objects now support the merge 6840 (``|``) operator from :pep:`584`. 6841 6842- bpo-38691: The :mod:`importlib` module now ignores the 6843 :envvar:`PYTHONCASEOK` environment variable when the :option:`-E` or 6844 :option:`-I` command line options are being used. 6845 6846- bpo-39719: Remove :meth:`tempfile.SpooledTemporaryFile.softspace` as files 6847 no longer have the ``softspace`` attribute in Python 3. Patch by Shantanu. 6848 6849- bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct 6850 performance degradation as found in zipp 3.0. 6851 6852- bpo-39638: Keep ASDL signatures in the docstrings for ``AST`` nodes. Patch 6853 by Batuhan Taskaya 6854 6855- bpo-39639: Deprecated ``ast.Suite`` node class because it's no longer 6856 used. Patch by Batuhan Taskaya. 6857 6858- bpo-39609: Add thread_name_prefix to default asyncio executor 6859 6860- bpo-39548: Fix handling of header in 6861 :class:`urllib.request.AbstractDigestAuthHandler` when the optional 6862 ``qop`` parameter is not present. 6863 6864- bpo-39509: HTTP status codes ``103 EARLY_HINTS`` and ``425 TOO_EARLY`` are 6865 added to :class:`http.HTTPStatus`. Patch by Dong-hee Na. 6866 6867- bpo-39507: Adding HTTP status 418 "I'm a Teapot" to HTTPStatus in http 6868 library. Patch by Ross Rhodes. 6869 6870- bpo-39495: Remove default value from *attrs* parameter of 6871 :meth:`xml.etree.ElementTree.TreeBuilder.start` for consistency between 6872 Python and C implementations. 6873 6874- bpo-38971: Open issue in the BPO indicated a desire to make the 6875 implementation of codecs.open() at parity with io.open(), which implements 6876 a try/except to assure file stream gets closed before an exception is 6877 raised. 6878 6879- bpo-38641: Added starred expressions support to ``return`` and ``yield`` 6880 statements for ``lib2to3``. Patch by Vlad Emelianov. 6881 6882- bpo-37534: When using minidom module to generate XML documents the ability 6883 to add Standalone Document Declaration is added. All the changes are made 6884 to generate a document in compliance with Extensible Markup Language (XML) 6885 1.0 (Fifth Edition) W3C Recommendation (available here: 6886 https://www.w3.org/TR/xml/#sec-prolog-dtd). 6887 6888- bpo-34788: Add support for scoped IPv6 addresses to :mod:`ipaddress`. 6889 Patch by Oleksandr Pavliuk. 6890 6891- bpo-34822: Simplified AST for subscription. Simple indices are now 6892 represented by their value, extended slices are represented as tuples. 6893 :mod:`ast` classes ``Index`` and ``ExtSlice`` are considered deprecated 6894 and will be removed in future Python versions. In the meantime, 6895 ``Index(value)`` now returns a ``value`` itself, ``ExtSlice(slices)`` 6896 returns ``Tuple(slices, Load())``. 6897 6898Documentation 6899------------- 6900 6901- bpo-39868: Updated the Language Reference for :pep:`572`. 6902 6903- bpo-13790: Change 'string' to 'specification' in format doc. 6904 6905- bpo-17422: The language reference no longer restricts default class 6906 namespaces to dicts only. 6907 6908- bpo-39530: Fix misleading documentation about mixed-type numeric 6909 comparisons. 6910 6911- bpo-39718: Update :mod:`token` documentation to reflect additions in 6912 Python 3.8 6913 6914- bpo-39677: Changed operand name of **MAKE_FUNCTION** from *argc* to 6915 *flags* for module :mod:`dis` 6916 6917Tests 6918----- 6919 6920- bpo-40019: test_gdb now skips tests if it detects that gdb failed to read 6921 debug information because the Python binary is optimized. 6922 6923- bpo-27807: ``test_site.test_startup_imports()`` is now skipped if a path 6924 of :data:`sys.path` contains a ``.pth`` file. 6925 6926- bpo-26067: Do not fail test_shutil test_chown test when uid or gid of user 6927 cannot be resolved to a name. 6928 6929- bpo-39855: test_subprocess.test_user() now skips the test on an user name 6930 if the user name doesn't exist. For example, skip the test if the user 6931 "nobody" doesn't exist on Linux. 6932 6933Build 6934----- 6935 6936- bpo-39761: Fix build with DTrace but without additional DFLAGS. 6937 6938- bpo-39763: setup.py now uses a basic implementation of the 6939 :mod:`subprocess` module if the :mod:`subprocess` module is not available: 6940 before required C extension modules are built. 6941 6942- bpo-1294959: Add ``--with-platlibdir`` option to the configure script: 6943 name of the platform-specific library directory, stored in the new 6944 :attr:`sys.platlibdir` attribute. It is used to build the path of 6945 platform-specific extension modules and the path of the standard library. 6946 It is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is 6947 equal to ``"lib64"`` on 64-bit platforms. Patch by Jan Matějek, Matěj 6948 Cepl, Charalampos Stratakis and Victor Stinner. 6949 6950Windows 6951------- 6952 6953- bpo-39930: Ensures the required :file:`vcruntime140.dll` is included in 6954 install packages. 6955 6956- bpo-39847: Avoid hang when computer is hibernated whilst waiting for a 6957 mutex (for lock-related objects from :mod:`threading`) around 49-day 6958 uptime. 6959 6960- bpo-38597: :mod:`distutils` will no longer statically link 6961 :file:`vcruntime140.dll` when a redistributable version is unavailable. 6962 All future releases of CPython will include a copy of this DLL to ensure 6963 distributed extensions can continue to load. 6964 6965- bpo-38380: Update Windows builds to use SQLite 3.31.1 6966 6967- bpo-39789: Update Windows release build machines to Visual Studio 2019 6968 (MSVC 14.2). 6969 6970- bpo-34803: Package for nuget.org now includes repository reference and 6971 bundled icon image. 6972 6973macOS 6974----- 6975 6976- bpo-38380: Update macOS builds to use SQLite 3.31.1 6977 6978IDLE 6979---- 6980 6981- bpo-27115: For 'Go to Line', use a Query box subclass with IDLE standard 6982 behavior and improved error checking. 6983 6984- bpo-39885: Since clicking to get an IDLE context menu moves the cursor, 6985 any text selection should be and now is cleared. 6986 6987- bpo-39852: Edit "Go to line" now clears any selection, preventing 6988 accidental deletion. It also updates Ln and Col on the status bar. 6989 6990- bpo-39781: Selecting code context lines no longer causes a jump. 6991 6992Tools/Demos 6993----------- 6994 6995- bpo-36184: Port python-gdb.py to FreeBSD. python-gdb.py now checks for 6996 "take_gil" function name to check if a frame tries to acquire the GIL, 6997 instead of checking for "pthread_cond_timedwait" which is specific to 6998 Linux and can be a different condition than the GIL. 6999 7000- bpo-38080: Added support to fix ``getproxies`` in the 7001 :mod:`lib2to3.fixes.fix_urllib` module. Patch by José Roberto Meza 7002 Cabrera. 7003 7004C API 7005----- 7006 7007- bpo-40024: Add :c:func:`PyModule_AddType` helper function: add a type to a 7008 module. Patch by Dong-hee Na. 7009 7010- bpo-39946: Remove ``_PyRuntime.getframe`` hook and remove 7011 ``_PyThreadState_GetFrame`` macro which was an alias to 7012 ``_PyRuntime.getframe``. They were only exposed by the internal C API. 7013 Remove also ``PyThreadFrameGetter`` type. 7014 7015- bpo-39947: Add :c:func:`PyThreadState_GetFrame` function: get the current 7016 frame of a Python thread state. 7017 7018- bpo-37207: Add _PyArg_NoKwnames helper function. Patch by Dong-hee Na. 7019 7020- bpo-39947: Add :c:func:`PyThreadState_GetInterpreter`: get the interpreter 7021 of a Python thread state. 7022 7023- bpo-39947: Add :c:func:`PyInterpreterState_Get` function to the limited C 7024 API. 7025 7026- bpo-35370: If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile` 7027 or :c:func:`PyEval_SetTrace`, log the error as an unraisable exception. 7028 7029- bpo-39947: Move the static inline function flavor of 7030 Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() to the internal C API: 7031 they access PyThreadState attributes. The limited C API provides regular 7032 functions which hide implementation details. 7033 7034- bpo-39947: Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer 7035 access PyThreadState attributes, but call new private _PyTrash_begin() and 7036 _PyTrash_end() functions which hide implementation details. 7037 7038- bpo-39884: :c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now 7039 include the method name in the SystemError "bad call flags" error message 7040 to ease debug. 7041 7042- bpo-39877: Deprecated :c:func:`PyEval_InitThreads` and 7043 :c:func:`PyEval_ThreadsInitialized`. Calling :c:func:`PyEval_InitThreads` 7044 now does nothing. 7045 7046- bpo-38249: :c:macro:`Py_UNREACHABLE` is now implemented with 7047 ``__builtin_unreachable()`` and analogs in release mode. 7048 7049- bpo-38643: :c:func:`PyNumber_ToBase` now raises a :exc:`SystemError` 7050 instead of crashing when called with invalid base. 7051 7052- bpo-39882: The :c:func:`Py_FatalError` function is replaced with a macro 7053 which logs automatically the name of the current function, unless the 7054 ``Py_LIMITED_API`` macro is defined. 7055 7056- bpo-39824: Extension modules: :c:member:`~PyModuleDef.m_traverse`, 7057 :c:member:`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` 7058 functions of :c:type:`PyModuleDef` are no longer called if the module 7059 state was requested but is not allocated yet. This is the case immediately 7060 after the module is created and before the module is executed 7061 (:c:data:`Py_mod_exec` function). More precisely, these functions are not 7062 called if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module 7063 state (as returned by :c:func:`PyModule_GetState`) is ``NULL``. 7064 7065 Extension modules without module state (``m_size <= 0``) are not affected. 7066 7067- bpo-38913: Fixed segfault in ``Py_BuildValue()`` called with a format 7068 containing "#" and undefined PY_SSIZE_T_CLEAN whwn an exception is set. 7069 7070- bpo-38500: Add a private API to get and set the frame evaluation function: 7071 add :c:func:`_PyInterpreterState_GetEvalFrameFunc` and 7072 :c:func:`_PyInterpreterState_SetEvalFrameFunc` C functions. The 7073 :c:type:`_PyFrameEvalFunction` function type now takes a *tstate* 7074 parameter. 7075 7076 7077What's New in Python 3.9.0 alpha 4? 7078=================================== 7079 7080*Release date: 2020-02-25* 7081 7082Security 7083-------- 7084 7085- bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, 7086 `resource`, `shutil`, `signal` and `syslog`. 7087 7088- bpo-39401: Avoid unsafe DLL load at startup on Windows 7 and earlier. 7089 7090- bpo-39184: Add audit events to command execution functions in os and pty 7091 modules. 7092 7093Core and Builtins 7094----------------- 7095 7096- bpo-39382: Fix a use-after-free in the single inheritance path of 7097 ``issubclass()``, when the ``__bases__`` of an object has a single 7098 reference, and so does its first item. Patch by Yonatan Goldschmidt. 7099 7100- bpo-39573: Update clinic tool to use :c:func:`Py_IS_TYPE`. Patch by 7101 Dong-hee Na. 7102 7103- bpo-39619: Enable use of :func:`os.chroot` on HP-UX systems. 7104 7105- bpo-39573: Add :c:func:`Py_IS_TYPE` static inline function to check 7106 whether the object *o* type is *type*. 7107 7108- bpo-39606: Fix regression caused by fix for bpo-39386, that prevented 7109 calling ``aclose`` on an async generator that had already been closed or 7110 exhausted. 7111 7112- bpo-39579: Change the ending column offset of `Attribute` nodes 7113 constructed in `ast_for_dotted_name` to point at the end of the current 7114 node and not at the end of the last `NAME` node. 7115 7116- bpo-1635741: Port _crypt extension module to multiphase initialization 7117 (:pep:`489`). 7118 7119- bpo-1635741: Port _contextvars extension module to multiphase 7120 initialization (:pep:`489`). 7121 7122- bpo-39510: Fix segfault in ``readinto()`` method on closed BufferedReader. 7123 7124- bpo-39502: Fix :func:`time.localtime` on 64-bit AIX to support years 7125 before 1902 and after 2038. Patch by M Felt. 7126 7127- bpo-39492: Fix a reference cycle in the C Pickler that was preventing the 7128 garbage collection of deleted, pickled objects. 7129 7130- bpo-39453: Fixed a possible crash in :meth:`list.__contains__` when a list 7131 is changed during comparing items. Patch by Dong-hee Na. 7132 7133- bpo-39434: :term:`floor division` of float operation now has a better 7134 performance. Also the message of :exc:`ZeroDivisionError` for this 7135 operation is updated. Patch by Dong-hee Na. 7136 7137- bpo-1635741: Port _codecs extension module to multiphase initialization 7138 (:pep:`489`). 7139 7140- bpo-1635741: Port _bz2 extension module to multiphase initialization 7141 (:pep:`489`). 7142 7143- bpo-1635741: Port _abc extension module to multiphase initialization 7144 (:pep:`489`). 7145 7146- bpo-39320: Replace two complex bytecodes for building dicts with two 7147 simpler ones. The new bytecodes ``DICT_MERGE`` and ``DICT_UPDATE`` have 7148 been added The old bytecodes ``BUILD_MAP_UNPACK`` and 7149 ``BUILD_MAP_UNPACK_WITH_CALL`` have been removed. 7150 7151- bpo-39219: Syntax errors raised in the tokenizer now always set correct 7152 "text" and "offset" attributes. 7153 7154- bpo-36051: Drop the GIL during large ``bytes.join`` operations. Patch by 7155 Bruce Merry. 7156 7157- bpo-38960: Fix DTrace build issues on FreeBSD. Patch by David Carlier. 7158 7159- bpo-37207: Speed up calls to ``range()`` by about 30%, by using the PEP 7160 590 ``vectorcall`` calling convention. Patch by Mark Shannon. 7161 7162- bpo-36144: :class:`dict` (and :class:`collections.UserDict`) objects now 7163 support PEP 584's merge (``|``) and update (``|=``) operators. Patch by 7164 Brandt Bucher. 7165 7166- bpo-32856: Optimized the idiom for assignment a temporary variable in 7167 comprehensions. Now ``for y in [expr]`` in comprehensions is as fast as a 7168 simple assignment ``y = expr``. 7169 7170Library 7171------- 7172 7173- bpo-30566: Fix :exc:`IndexError` when trying to decode an invalid string 7174 with punycode codec. 7175 7176- bpo-39649: Remove obsolete check for `__args__` in 7177 bdb.Bdb.format_stack_entry. 7178 7179- bpo-39648: Expanded :func:`math.gcd` and :func:`math.lcm` to handle 7180 multiple arguments. 7181 7182- bpo-39681: Fix a regression where the C pickle module wouldn't allow 7183 unpickling from a file-like object that doesn't expose a readinto() 7184 method. 7185 7186- bpo-35950: Raise :exc:`io.UnsupportedOperation` in 7187 :meth:`io.BufferedReader.truncate` when it is called on a read-only 7188 :class:`io.BufferedReader` instance. 7189 7190- bpo-39479: Add :func:`math.lcm` function: least common multiple. 7191 7192- bpo-39674: Revert "Do not expose abstract collection classes in the 7193 collections module" change (bpo-25988). Aliases to ABC like 7194 collections.Mapping are kept in Python 3.9 to ease transition from Python 7195 2.7, but will be removed in Python 3.10. 7196 7197- bpo-39104: Fix hanging ProcessPoolExcutor on ``shutdown(wait=False)`` when 7198 a task has failed pickling. 7199 7200- bpo-39627: Fixed TypedDict totality check for inherited keys. 7201 7202- bpo-39474: Fixed starting position of AST for expressions like ``(a)(b)``, 7203 ``(a)[b]`` and ``(a).b``. 7204 7205- bpo-21016: The :mod:`pydoc` and :mod:`trace` modules now use the 7206 :mod:`sysconfig` module to get the path to the Python standard library, to 7207 support uncommon installation path like ``/usr/lib64/python3.9/`` on 7208 Fedora. Patch by Jan Matějek. 7209 7210- bpo-39590: Collections.deque now holds strong references during 7211 deque.__contains__ and deque.count, fixing crashes. 7212 7213- bpo-39586: The distutils ``bdist_msi`` command is deprecated in Python 7214 3.9, use ``bdist_wheel`` (wheel packages) instead. 7215 7216- bpo-39595: Improved performance of zipfile.Path for files with a large 7217 number of entries. Also improved performance and fixed minor issue as 7218 published with `importlib_metadata 1.5 7219 <https://importlib-metadata.readthedocs.io/en/latest/changelog%20(links).html#v1-5-0>`_. 7220 7221- bpo-39350: Fix regression in :class:`fractions.Fraction` if the numerator 7222 and/or the denominator is an :class:`int` subclass. The :func:`math.gcd` 7223 function is now used to normalize the *numerator* and *denominator*. 7224 :func:`math.gcd` always return a :class:`int` type. Previously, the GCD 7225 type depended on *numerator* and *denominator*. 7226 7227- bpo-39567: Added audit for :func:`os.walk`, :func:`os.fwalk`, 7228 :meth:`pathlib.Path.glob` and :meth:`pathlib.Path.rglob`. 7229 7230- bpo-39559: Remove unused, undocumented argument ``getters`` from 7231 :func:`uuid.getnode` 7232 7233- bpo-38149: :func:`sys.audit` is now called only once per call of 7234 :func:`glob.glob` and :func:`glob.iglob`. 7235 7236- bpo-39546: Fix a regression in :class:`~argparse.ArgumentParser` where 7237 ``allow_abbrev=False`` was ignored for long options that used a prefix 7238 character other than "-". 7239 7240- bpo-39450: Striped whitespace from docstring before returning it from 7241 :func:`unittest.case.shortDescription`. 7242 7243- bpo-12915: A new function ``resolve_name`` has been added to the 7244 ``pkgutil`` module. This resolves a string of the form ``'a.b.c.d'`` or 7245 ``'a.b:c.d'`` to an object. In the example, ``a.b`` is a package/module 7246 and ``c.d`` is an object within that package/module reached via recursive 7247 attribute access. 7248 7249- bpo-39353: The :func:`binascii.crc_hqx` function is no longer deprecated. 7250 7251- bpo-39493: Mark ``typing.IO.closed`` as a property 7252 7253- bpo-39491: Add :data:`typing.Annotated` and ``include_extras`` parameter 7254 to :func:`typing.get_type_hints` as part of :pep:`593`. Patch by Till 7255 Varoquaux, documentation by Till Varoquaux and Konstantin Kashin. 7256 7257- bpo-39485: Fix a bug in :func:`unittest.mock.create_autospec` that would 7258 complain about the wrong number of arguments for custom descriptors 7259 defined in an extension module returning functions. 7260 7261- bpo-38932: Mock fully resets child objects on reset_mock(). Patch by 7262 Vegard Stikbakke 7263 7264- bpo-39082: Allow AsyncMock to correctly patch static/class methods 7265 7266- bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit\_..." symbol 7267 names in distutils to make it export the correct init symbol also on 7268 Windows. 7269 7270- bpo-18819: Omit ``devmajor`` and ``devminor`` fields for non-device files 7271 in :mod:`tarfile` archives, enabling bit-for-bit compatibility with GNU 7272 ``tar(1)``. 7273 7274- bpo-39349: Added a new *cancel_futures* parameter to 7275 :meth:`concurrent.futures.Executor.shutdown` that cancels all pending 7276 futures which have not started running, instead of waiting for them to 7277 complete before shutting down the executor. 7278 7279- bpo-39274: ``bool(fraction.Fraction)`` now returns a boolean even if 7280 (numerator != 0) does not return a boolean (ex: numpy number). 7281 7282- bpo-34793: Remove support for ``with (await asyncio.lock):`` and ``with 7283 (yield from asyncio.lock):``. The same is correct for 7284 ``asyncio.Condition`` and ``asyncio.Semaphore``. 7285 7286- bpo-25597: Ensure, if ``wraps`` is supplied to 7287 :class:`unittest.mock.MagicMock`, it is used to calculate return values 7288 for the magic methods instead of using the default return values. Patch by 7289 Karthikeyan Singaravelan. 7290 7291- bpo-36350: `inspect.Signature.parameters` and 7292 `inspect.BoundArguments.arguments` are now dicts instead of OrderedDicts. 7293 Patch contributed by Rémi Lapeyre. 7294 7295- bpo-35727: Fix sys.exit() and sys.exit(None) exit code propagation when 7296 used in multiprocessing.Process. 7297 7298- bpo-32173: * Add `lazycache` function to `__all__`. * Use `dict.clear` to 7299 clear the cache. * Refactoring `getline` function and `checkcache` 7300 function. 7301 7302Documentation 7303------------- 7304 7305- bpo-17422: The language reference now specifies restrictions on class 7306 namespaces. Adapted from a patch by Ethan Furman. 7307 7308- bpo-39572: Updated documentation of ``total`` flag of ``TypedDict``. 7309 7310- bpo-39654: In pyclbr doc, update 'class' to 'module' where appropriate and 7311 add readmodule comment. Patch by Hakan Çelik. 7312 7313- bpo-39153: Clarify refcounting semantics for the following functions: - 7314 PyObject_SetItem - PyMapping_SetItemString - PyDict_SetItem - 7315 PyDict_SetItemString 7316 7317- bpo-39392: Explain that when filling with turtle, overlap regions may be 7318 left unfilled. 7319 7320- bpo-39369: Update mmap readline method description. The fact that the 7321 readline method does update the file position should not be ignored since 7322 this might give the impression for the programmer that it doesn't update 7323 it. 7324 7325- bpo-9056: Include subsection in TOC for PDF version of docs. 7326 7327Tests 7328----- 7329 7330- bpo-38325: Skip tests on non-BMP characters of test_winconsoleio. 7331 7332- bpo-39502: Skip test_zipfile.test_add_file_after_2107() if 7333 :func:`time.localtime` fails with :exc:`OverflowError`. It is the case on 7334 AIX 6.1 for example. 7335 7336Build 7337----- 7338 7339- bpo-39489: Remove ``COUNT_ALLOCS`` special build. 7340 7341Windows 7342------- 7343 7344- bpo-39553: Delete unused code related to SxS manifests. 7345 7346- bpo-39439: Honor the Python path when a virtualenv is active on Windows. 7347 7348- bpo-39393: Improve the error message when attempting to load a DLL with 7349 unresolved dependencies. 7350 7351- bpo-38883: :meth:`~pathlib.Path.home()` and 7352 :meth:`~pathlib.Path.expanduser()` on Windows now prefer 7353 :envvar:`USERPROFILE` and no longer use :envvar:`HOME`, which is not 7354 normally set for regular user accounts. This makes them again behave like 7355 :func:`os.path.expanduser`, which was changed to ignore :envvar:`HOME` in 7356 3.8, see :issue:`36264`. 7357 7358- bpo-39185: The build.bat script has additional options for very-quiet 7359 output (-q) and very-verbose output (-vv) 7360 7361IDLE 7362---- 7363 7364- bpo-39663: Add tests for pyparse find_good_parse_start(). 7365 7366- bpo-39600: In the font configuration window, remove duplicated font names. 7367 7368- bpo-30780: Add remaining configdialog tests for buttons and highlights and 7369 keys tabs. 7370 7371- bpo-39388: IDLE Settings Cancel button now cancels pending changes 7372 7373- bpo-38792: Close an IDLE shell calltip if a :exc:`KeyboardInterrupt` or 7374 shell restart occurs. Patch by Zackery Spytz. 7375 7376C API 7377----- 7378 7379- bpo-35081: Move the ``bytes_methods.h`` header file to the internal C API 7380 as ``pycore_bytes_methods.h``: it only contains private symbols (prefixed 7381 by ``_Py``), except of the ``PyDoc_STRVAR_shared()`` macro. 7382 7383- bpo-35081: Move the ``dtoa.h`` header file to the internal C API as 7384 ``pycore_dtoa.h``: it only contains private functions (prefixed by 7385 ``_Py``). The :mod:`math` and :mod:`cmath` modules must now be compiled 7386 with the ``Py_BUILD_CORE`` macro defined. 7387 7388- bpo-39573: Add :c:func:`Py_SET_SIZE` function to set the size of an 7389 object. 7390 7391- bpo-39500: :c:func:`PyUnicode_IsIdentifier` does not call 7392 :c:func:`Py_FatalError` anymore if the string is not ready. 7393 7394- bpo-39573: Add :c:func:`Py_SET_TYPE` function to set the type of an 7395 object. 7396 7397- bpo-39573: Add a :c:func:`Py_SET_REFCNT` function to set the reference 7398 counter of an object. 7399 7400- bpo-39542: Convert :c:func:`PyType_HasFeature`, :c:func:`PyType_Check` and 7401 :c:func:`PyType_CheckExact` macros to static inline functions. 7402 7403- bpo-39542: In the limited C API, ``PyObject_INIT()`` and 7404 ``PyObject_INIT_VAR()`` are now defined as aliases to 7405 :c:func:`PyObject_Init` and :c:func:`PyObject_InitVar` to make their 7406 implementation opaque. It avoids to leak implementation details in the 7407 limited C API. Exclude the following functions from the limited C API: 7408 ``_Py_NewReference()``, ``_Py_ForgetReference()``, 7409 ``_PyTraceMalloc_NewReference()`` and ``_Py_GetRefTotal()``. 7410 7411- bpo-39542: Exclude trashcan mechanism from the limited C API: it requires 7412 access to PyTypeObject and PyThreadState structure fields, whereas these 7413 structures are opaque in the limited C API. 7414 7415- bpo-39511: The :c:func:`PyThreadState_Clear` function now calls the 7416 :c:member:`PyThreadState.on_delete` callback. Previously, that happened in 7417 :c:func:`PyThreadState_Delete`. 7418 7419- bpo-38076: Fix to clear the interpreter state only after clearing module 7420 globals to guarantee module state access from C Extensions during runtime 7421 destruction 7422 7423- bpo-39245: The Vectorcall API (PEP 590) was made public, adding the 7424 functions ``PyObject_Vectorcall``, ``PyObject_VectorcallMethod``, 7425 ``PyVectorcall_Function``, ``PyObject_CallOneArg``, 7426 ``PyObject_CallMethodNoArgs``, ``PyObject_CallMethodOneArg``, 7427 ``PyObject_FastCallDict``, and the flag ``Py_TPFLAGS_HAVE_VECTORCALL``. 7428 7429 7430What's New in Python 3.9.0 alpha 3? 7431=================================== 7432 7433*Release date: 2020-01-24* 7434 7435Core and Builtins 7436----------------- 7437 7438- bpo-39427: Document all possibilities for the ``-X`` options in the 7439 command line help section. Patch by Pablo Galindo. 7440 7441- bpo-39421: Fix possible crashes when operating with the functions in the 7442 :mod:`heapq` module and custom comparison operators. 7443 7444- bpo-39386: Prevent double awaiting of async iterator. 7445 7446- bpo-17005: Add :class:`functools.TopologicalSorter` to the 7447 :mod:`functools` module to offers functionality to perform topological 7448 sorting of graphs. Patch by Pablo Galindo, Tim Peters and Larry Hastings. 7449 7450- bpo-39320: Replace four complex bytecodes for building sequences with 7451 three simpler ones. 7452 7453 The following four bytecodes have been removed: 7454 7455 * BUILD_LIST_UNPACK 7456 * BUILD_TUPLE_UNPACK 7457 * BUILD_SET_UNPACK 7458 * BUILD_TUPLE_UNPACK_WITH_CALL 7459 7460 The following three bytecodes have been added: 7461 7462 * LIST_TO_TUPLE 7463 * LIST_EXTEND 7464 * SET_UPDATE 7465 7466- bpo-39336: Import loaders which publish immutable module objects can now 7467 publish immutable packages in addition to individual modules. 7468 7469- bpo-39322: Added a new function :func:`gc.is_finalized` to check if an 7470 object has been finalized by the garbage collector. Patch by Pablo 7471 Galindo. 7472 7473- bpo-39048: Improve the displayed error message when incorrect types are 7474 passed to ``async with`` statements by looking up the :meth:`__aenter__` 7475 special method before the :meth:`__aexit__` special method when entering 7476 an asynchronous context manager. Patch by Géry Ogam. 7477 7478- bpo-39235: Fix AST end location for lone generator expression in function 7479 call, e.g. f(i for i in a). 7480 7481- bpo-39209: Correctly handle multi-line tokens in interactive mode. Patch 7482 by Pablo Galindo. 7483 7484- bpo-1635741: Port _json extension module to multiphase initialization 7485 (:pep:`489`). 7486 7487- bpo-39216: Fix constant folding optimization for positional only arguments 7488 - by Anthony Sottile. 7489 7490- bpo-39215: Fix ``SystemError`` when nested function has annotation on 7491 positional-only argument - by Anthony Sottile. 7492 7493- bpo-39200: Correct the error message when calling the :func:`min` or 7494 :func:`max` with no arguments. Patch by Dong-hee Na. 7495 7496- bpo-39200: Correct the error message when trying to construct 7497 :class:`range` objects with no arguments. Patch by Pablo Galindo. 7498 7499- bpo-39166: Fix incorrect line execution reporting in trace functions when 7500 tracing the last iteration of asynchronous for loops. Patch by Pablo 7501 Galindo. 7502 7503- bpo-39114: Fix incorrect line execution reporting in trace functions when 7504 tracing exception handlers with name binding. Patch by Pablo Galindo. 7505 7506- bpo-39156: Split the COMPARE_OP bytecode instruction into four distinct 7507 instructions. 7508 7509 * COMPARE_OP for rich comparisons 7510 * IS_OP for 'is' and 'is not' tests 7511 * CONTAINS_OP for 'in' and 'is not' tests 7512 * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements. 7513 7514 This improves the clarity of the interpreter and should provide a modest 7515 speedup. 7516 7517- bpo-38588: Fix possible crashes in dict and list when calling 7518 :c:func:`PyObject_RichCompareBool`. 7519 7520- bpo-13601: By default, ``sys.stderr`` is line-buffered now, even if 7521 ``stderr`` is redirected to a file. You can still make ``sys.stderr`` 7522 unbuffered by passing the :option:`-u` command-line option or setting the 7523 :envvar:`PYTHONUNBUFFERED` environment variable. 7524 7525 (Contributed by Jendrik Seipp in bpo-13601.) 7526 7527- bpo-38610: Fix possible crashes in several list methods by holding strong 7528 references to list elements when calling 7529 :c:func:`PyObject_RichCompareBool`. 7530 7531- bpo-32021: Include brotli .br encoding in mimetypes encodings_map 7532 7533Library 7534------- 7535 7536- bpo-39430: Fixed race condition in lazy imports in :mod:`tarfile`. 7537 7538- bpo-39413: The :func:`os.unsetenv` function is now also available on 7539 Windows. 7540 7541- bpo-39390: Fixed a regression with the `ignore` callback of 7542 :func:`shutil.copytree`. The argument types are now str and List[str] 7543 again. 7544 7545- bpo-39395: The :func:`os.putenv` and :func:`os.unsetenv` functions are now 7546 always available. 7547 7548- bpo-39406: If ``setenv()`` C function is available, :func:`os.putenv` is 7549 now implemented with ``setenv()`` instead of ``putenv()``, so Python 7550 doesn't have to handle the environment variable memory. 7551 7552- bpo-39396: Fix ``math.nextafter(-0.0, +0.0)`` on AIX 7.1. 7553 7554- bpo-29435: Allow :func:`tarfile.is_tarfile` to be used with file and 7555 file-like objects, like :func:`zipfile.is_zipfile`. Patch by William 7556 Woodruff. 7557 7558- bpo-39377: Removed ``encoding`` option from :func:`json.loads`. It has 7559 been deprecated since Python 3.1. 7560 7561- bpo-39389: Write accurate compression level metadata in :mod:`gzip` 7562 archives, rather than always signaling maximum compression. 7563 7564- bpo-39366: The previously deprecated ``xpath()`` and ``xgtitle()`` methods 7565 of :class:`nntplib.NNTP` have been removed. 7566 7567- bpo-39357: Remove the *buffering* parameter of :class:`bz2.BZ2File`. Since 7568 Python 3.0, it was ignored and using it was emitting 7569 :exc:`DeprecationWarning`. Pass an open file object, to control how the 7570 file is opened. The *compresslevel* parameter becomes keyword-only. 7571 7572- bpo-39353: Deprecate binhex4 and hexbin4 standards. Deprecate the 7573 :mod:`binhex` module and the following :mod:`binascii` functions: 7574 :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`, 7575 :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`, 7576 :func:`~binascii.crc_hqx`. 7577 7578- bpo-39351: Remove ``base64.encodestring()`` and ``base64.decodestring()``, 7579 aliases deprecated since Python 3.1: use :func:`base64.encodebytes` and 7580 :func:`base64.decodebytes` instead. 7581 7582- bpo-39350: Remove ``fractions.gcd()`` function, deprecated since Python 7583 3.5 (:issue:`22486`): use :func:`math.gcd` instead. 7584 7585- bpo-39329: :class:`~smtplib.LMTP` constructor now has an optional 7586 *timeout* parameter. Patch by Dong-hee Na. 7587 7588- bpo-39313: Add a new ``exec_function`` option (*--exec-function* in the 7589 CLI) to ``RefactoringTool`` for making ``exec`` a function. Patch by 7590 Batuhan Taskaya. 7591 7592- bpo-39259: :class:`~ftplib.FTP_TLS` and :class:`~ftplib.FTP_TLS` now raise 7593 a :class:`ValueError` if the given timeout for their constructor is zero 7594 to prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 7595 7596- bpo-39259: :class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise 7597 a :class:`ValueError` if the given timeout for their constructor is zero 7598 to prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 7599 7600- bpo-39310: Add :func:`math.ulp`: return the value of the least significant 7601 bit of a float. 7602 7603- bpo-39297: Improved performance of importlib.metadata distribution 7604 discovery and resilients to inaccessible sys.path entries 7605 (importlib_metadata v1.4.0). 7606 7607- bpo-39259: :class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise 7608 a :class:`ValueError` if the given timeout for their constructor is zero 7609 to prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 7610 7611- bpo-38901: When you specify prompt='.' or equivalently python -m venv 7612 --prompt . ... the basename of the current directory is used to set the 7613 created venv's prompt when it's activated. 7614 7615- bpo-39288: Add :func:`math.nextafter`: return the next floating-point 7616 value after *x* towards *y*. 7617 7618- bpo-39259: :class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a 7619 :class:`ValueError` if the given timeout for their constructor is zero to 7620 prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 7621 7622- bpo-39242: Updated the Gmane domain from news.gmane.org to news.gmane.io 7623 which is used for examples of :class:`~nntplib.NNTP` news reader server 7624 and nntplib tests. 7625 7626- bpo-35292: Proxy the `SimpleHTTPRequestHandler.guess_type` to 7627 `mimetypes.guess_type` so the `mimetypes.init` is called lazily to avoid 7628 unnecessary costs when :mod:`http.server` module is imported. 7629 7630- bpo-39239: The :meth:`select.epoll.unregister` method no longer ignores 7631 the :data:`~errno.EBADF` error. 7632 7633- bpo-38907: In http.server script, restore binding to IPv4 on Windows. 7634 7635- bpo-39152: Fix ttk.Scale.configure([name]) to return configuration tuple 7636 for name or all options. Giovanni Lombardo contributed part of the patch. 7637 7638- bpo-39198: If an exception were to be thrown in `Logger.isEnabledFor` 7639 (say, by asyncio timeouts or stopit) , the `logging` global lock may not 7640 be released appropriately, resulting in deadlock. This change wraps that 7641 block of code with `try...finally` to ensure the lock is released. 7642 7643- bpo-39191: Perform a check for running loop before starting a new task in 7644 ``loop.run_until_complete()`` to fail fast; it prevents the side effect of 7645 new task spawning before exception raising. 7646 7647- bpo-38871: Correctly parenthesize filter-based statements that contain 7648 lambda expressions in mod:`lib2to3`. Patch by Dong-hee Na. 7649 7650- bpo-39142: A change was made to logging.config.dictConfig to avoid 7651 converting instances of named tuples to ConvertingTuple. It's assumed that 7652 named tuples are too specialised to be treated like ordinary tuples; if a 7653 user of named tuples requires ConvertingTuple functionality, they will 7654 have to implement that themselves in their named tuple class. 7655 7656- bpo-39158: ast.literal_eval() now supports empty sets. 7657 7658- bpo-39129: Fix import path for ``asyncio.TimeoutError`` 7659 7660- bpo-39057: :func:`urllib.request.proxy_bypass_environment` now ignores 7661 leading dots and no longer ignores a trailing newline. 7662 7663- bpo-39056: Fixed handling invalid warning category in the -W option. No 7664 longer import the re module if it is not needed. 7665 7666- bpo-39055: :func:`base64.b64decode` with ``validate=True`` raises now a 7667 binascii.Error if the input ends with a single ``\n``. 7668 7669- bpo-21600: Fix :func:`mock.patch.stopall` to stop active patches that were 7670 created with :func:`mock.patch.dict`. 7671 7672- bpo-39019: Implement dummy ``__class_getitem__`` for 7673 :class:`tempfile.SpooledTemporaryFile`. 7674 7675- bpo-39019: Implement dummy ``__class_getitem__`` for ``subprocess.Popen``, 7676 ``subprocess.CompletedProcess`` 7677 7678- bpo-38914: Adjusted the wording of the warning issued by distutils' 7679 ``check`` command when the ``author`` and ``maintainer`` fields are 7680 supplied but no corresponding e-mail field (``author_email`` or 7681 ``maintainer_email``) is found. The wording now reflects the fact that 7682 these fields are suggested, but not required. Patch by Juergen Gmach. 7683 7684- bpo-38878: Fixed __subclasshook__ of :class:`os.PathLike` to return a 7685 correct result upon inheritance. Patch by Bar Harel. 7686 7687- bpo-38615: :class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now 7688 have an optional *timeout* parameter for their constructors. Also, the 7689 :meth:`~imaplib.IMAP4.open` method now has an optional *timeout* parameter 7690 with this change. The overridden methods of :class:`~imaplib.IMAP4_SSL` 7691 and :class:`~imaplib.IMAP4_stream` were applied to this change. Patch by 7692 Dong-hee Na. 7693 7694- bpo-35182: Fixed :func:`Popen.communicate` subsequent call crash when the 7695 child process has already closed any piped standard stream, but still 7696 continues to be running. Patch by Andriy Maletsky. 7697 7698- bpo-38630: On Unix, :meth:`subprocess.Popen.send_signal` now polls the 7699 process status. Polling reduces the risk of sending a signal to the wrong 7700 process if the process completed, the :attr:`subprocess.Popen.returncode` 7701 attribute is still ``None``, and the pid has been reassigned (recycled) to 7702 a new different process. 7703 7704- bpo-38536: Removes trailing space in formatted currency with 7705 `international=True` and a locale with symbol following value. E.g. 7706 `locale.currency(12.34, international=True)` returned `'12,34 EUR '` 7707 instead of `'12,34 EUR'`. 7708 7709- bpo-38473: Use signature from inner mock for autospecced methods attached 7710 with :func:`unittest.mock.attach_mock`. Patch by Karthikeyan Singaravelan. 7711 7712- bpo-38361: Fixed an issue where ``ident`` could include a leading path 7713 separator when :func:`syslog.openlog` was called without arguments. 7714 7715- bpo-38293: Add :func:`copy.copy` and :func:`copy.deepcopy` support to 7716 :func:`property` objects. 7717 7718- bpo-37958: Added the pstats.Stats.get_profile_dict() method to return the 7719 profile data as a StatsProfile instance. 7720 7721- bpo-28367: Termios magic constants for the following baud rates: - 7722 B500000 - B576000 - B921600 - B1000000 - B1152000 - B1500000 - 7723 B2000000 - B2500000 - B3000000 - B3500000 - B4000000 Patch by 7724 Andrey Smirnov 7725 7726Documentation 7727------------- 7728 7729- bpo-39381: Mention in docs that :func:`asyncio.get_event_loop` implicitly 7730 creates new event loop only if called from the main thread. 7731 7732- bpo-38918: Add an entry for ``__module__`` in the "function" & "method" 7733 sections of the `inspect docs types and members table 7734 <https://docs.python.org/3/library/inspect.html#types-and-members>`_ 7735 7736- bpo-3530: In the :mod:`ast` module documentation, fix a misleading 7737 ``NodeTransformer`` example and add advice on when to use the 7738 ``fix_missing_locations`` function. 7739 7740Build 7741----- 7742 7743- bpo-39395: On non-Windows platforms, the :c:func:`setenv` and 7744 :c:func:`unsetenv` functions are now required to build Python. 7745 7746- bpo-39160: Updated the documentation in `./configure --help` to show 7747 default values, reference documentation where required and add additional 7748 explanation where needed. 7749 7750- bpo-39144: The ctags and etags build targets both include Modules/_ctypes 7751 and Python standard library source files. 7752 7753IDLE 7754---- 7755 7756- bpo-39050: Make IDLE Settings dialog Help button work again. 7757 7758- bpo-34118: Tag memoryview, range, and tuple as classes, the same as list, 7759 etcetera, in the library manual built-in functions list. 7760 7761- bpo-32989: Add tests for editor newline_and_indent_event method. Remove 7762 dead code from pyparse find_good_parse_start method. 7763 7764C API 7765----- 7766 7767- bpo-39372: Clean header files of interfaces defined but with no 7768 implementation. The public API symbols being removed are: 7769 ``_PyBytes_InsertThousandsGroupingLocale``, 7770 ``_PyBytes_InsertThousandsGrouping``, ``_Py_InitializeFromArgs``, 7771 ``_Py_InitializeFromWideArgs``, ``_PyFloat_Repr``, ``_PyFloat_Digits``, 7772 ``_PyFloat_DigitsInit``, ``PyFrame_ExtendStack``, 7773 ``_PyAIterWrapper_Type``, ``PyNullImporter_Type``, ``PyCmpWrapper_Type``, 7774 ``PySortWrapper_Type``, ``PyNoArgsFunction``. 7775 7776- bpo-39164: Add a private ``_PyErr_GetExcInfo()`` function to retrieve 7777 exception information of the specified Python thread state. 7778 7779 7780What's New in Python 3.9.0 alpha 2? 7781=================================== 7782 7783*Release date: 2019-12-18* 7784 7785Security 7786-------- 7787 7788- bpo-38945: Newline characters have been escaped when performing uu 7789 encoding to prevent them from overflowing into to content section of the 7790 encoded file. This prevents malicious or accidental modification of data 7791 during the decoding process. 7792 7793- bpo-37228: Due to significant security concerns, the *reuse_address* 7794 parameter of :meth:`asyncio.loop.create_datagram_endpoint` is no longer 7795 supported. This is because of the behavior of ``SO_REUSEADDR`` in UDP. For 7796 more details, see the documentation for 7797 ``loop.create_datagram_endpoint()``. (Contributed by Kyle Stanley, Antoine 7798 Pitrou, and Yury Selivanov in :issue:`37228`.) 7799 7800- bpo-38804: Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by 7801 Ben Caller. 7802 7803Core and Builtins 7804----------------- 7805 7806- bpo-39028: Slightly improve the speed of keyword argument parsing with 7807 many kwargs by strengthening the assumption that kwargs are interned 7808 strings. 7809 7810- bpo-39080: Fix the value of *end_col_offset* for Starred Expression AST 7811 nodes when they are among the elements in the *args* attribute of Call AST 7812 nodes. 7813 7814- bpo-39031: When parsing an "elif" node, lineno and col_offset of the node 7815 now point to the "elif" keyword and not to its condition, making it 7816 consistent with the "if" node. Patch by Lysandros Nikolaou. 7817 7818- bpo-20443: In Python 3.9.0a1, sys.argv[0] was made an absolute path if a 7819 filename was specified on the command line. Revert this change, since most 7820 users expect sys.argv to be unmodified. 7821 7822- bpo-39008: :c:func:`PySys_Audit` now requires ``Py_ssize_t`` to be used 7823 for size arguments in the format string, regardless of whether 7824 ``PY_SSIZE_T_CLEAN`` was defined at include time. 7825 7826- bpo-38673: In REPL mode, don't switch to PS2 if the line starts with 7827 comment or whitespace. Based on work by Batuhan Taşkaya. 7828 7829- bpo-38922: Calling ``replace`` on a code object now raises the 7830 ``code.__new__`` audit event. 7831 7832- bpo-38920: Add audit hooks for when :func:`sys.excepthook` and 7833 :func:`sys.unraisablehook` are invoked. 7834 7835- bpo-38892: Improve documentation for audit events table and functions. 7836 7837- bpo-38852: Set the thread stack size to 8 Mb for debug builds on android 7838 platforms. 7839 7840- bpo-38858: Each Python subinterpreter now has its own "small integer 7841 singletons": numbers in [-5; 257] range. It is no longer possible to 7842 change the number of small integers at build time by overriding 7843 ``NSMALLNEGINTS`` and ``NSMALLPOSINTS`` macros: macros should now be 7844 modified manually in ``pycore_pystate.h`` header file. 7845 7846- bpo-36854: The garbage collector state becomes per interpreter 7847 (``PyInterpreterState.gc``), rather than being global 7848 (``_PyRuntimeState.gc``). 7849 7850- bpo-38835: The ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` 7851 macros are empty: they have been doing nothing for the last year, so stop 7852 using them. 7853 7854- bpo-38328: Sped up the creation time of constant :class:`list` and 7855 :class:`set` displays. Patch by Brandt Bucher. 7856 7857- bpo-38707: ``MainThread.native_id`` is now correctly reset in child 7858 processes spawned using :class:`multiprocessing.Process`, instead of 7859 retaining the parent's value. 7860 7861- bpo-38629: Added ``__floor__`` and ``__ceil__`` methods to float object. 7862 Patch by Batuhan Taşkaya. 7863 7864- bpo-27145: int + int and int - int operators can now return small integer 7865 singletons. Patch by hongweipeng. 7866 7867- bpo-38021: Provide a platform tag for AIX that is sufficient for PEP425 7868 binary distribution identification. Patch by Michael Felt. 7869 7870- bpo-35409: Ignore GeneratorExit exceptions when throwing an exception into 7871 the aclose coroutine of an asynchronous generator. 7872 7873- bpo-33387: Removed WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, 7874 END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Replaced with RERAISE 7875 and WITH_EXCEPT_START bytecodes. The compiler now generates different code 7876 for exceptional and non-exceptional branches for 'with' and 'try-except' 7877 statements. For 'try-finally' statements the 'finally' block is replicated 7878 for each exit from the 'try' body. 7879 7880Library 7881------- 7882 7883- bpo-39033: Fix :exc:`NameError` in :mod:`zipimport`. Patch by Karthikeyan 7884 Singaravelan. 7885 7886- bpo-39022: Update importlib.metadata to include improvements from 7887 importlib_metadata 1.3 including better serialization of EntryPoints and 7888 improved documentation for custom finders. 7889 7890- bpo-39006: Fix asyncio when the ssl module is missing: only check for 7891 ssl.SSLSocket instance if the ssl module is available. 7892 7893- bpo-38708: Fix a potential IndexError in email parser when parsing an 7894 empty msg-id. 7895 7896- bpo-38698: Add a new ``InvalidMessageID`` token to email parser to 7897 represent invalid Message-ID headers. Also, add defects when there is 7898 remaining value after parsing the header. 7899 7900- bpo-38994: Implement ``__class_getitem__`` for ``os.PathLike``, 7901 ``pathlib.Path``. 7902 7903- bpo-38979: Return class from ``ContextVar.__class_getitem__`` to simplify 7904 subclassing. 7905 7906- bpo-38978: Implement ``__class_getitem__`` on asyncio objects (Future, 7907 Task, Queue). Patch by Batuhan Taskaya. 7908 7909- bpo-38916: :class:`array.array`: Remove ``tostring()`` and 7910 ``fromstring()`` methods. They were aliases to ``tobytes()`` and 7911 ``frombytes()``, deprecated since Python 3.2. 7912 7913- bpo-38986: Make repr of C accelerated TaskWakeupMethWrapper the same as of 7914 pure Python version. 7915 7916- bpo-38982: Fix asyncio ``PidfdChildWatcher``: handle ``waitpid()`` error. 7917 If ``waitpid()`` is called elsewhere, ``waitpid()`` call fails with 7918 :exc:`ChildProcessError`: use return code 255 in this case, and log a 7919 warning. It ensures that the pidfd file descriptor is closed if this error 7920 occurs. 7921 7922- bpo-38529: Drop too noisy asyncio warning about deletion of a stream 7923 without explicit ``.close()`` call. 7924 7925- bpo-27413: Added ability to pass through ``ensure_ascii`` options to 7926 json.dumps in the ``json.tool`` command-line interface. 7927 7928- bpo-38634: The :mod:`readline` module now detects if Python is linked to 7929 libedit at runtime on all platforms. Previously, the check was only done 7930 on macOS. 7931 7932- bpo-33684: Fix ``json.tool`` failed to read a JSON file with non-ASCII 7933 characters when locale encoding is not UTF-8. 7934 7935- bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id. 7936 7937 parse_message_id() was improperly using a token defined inside an 7938 exception handler, which was raising `UnboundLocalError` on parsing an 7939 invalid value. Patch by Claudiu Popa. 7940 7941- bpo-38927: Use ``python -m pip`` instead of ``pip`` to upgrade 7942 dependencies in venv. 7943 7944- bpo-26730: Fix ``SpooledTemporaryFile.rollover()`` might corrupt the file 7945 when it is in text mode. Patch by Serhiy Storchaka. 7946 7947- bpo-38881: random.choices() now raises a ValueError when all the weights 7948 are zero. 7949 7950- bpo-38876: Raise pickle.UnpicklingError when loading an item from memo for 7951 invalid input. 7952 7953 The previous code was raising a `KeyError` for both the Python and C 7954 implementation. This was caused by the specified index of an invalid input 7955 which did not exist in the memo structure, where the pickle stores what 7956 objects it has seen. The malformed input would have caused either a 7957 `BINGET` or `LONG_BINGET` load from the memo, leading to a `KeyError` as 7958 the determined index was bogus. Patch by Claudiu Popa 7959 7960- bpo-38688: Calling func:`shutil.copytree` to copy a directory tree from 7961 one directory to another subdirectory resulted in an endless loop and a 7962 RecursionError. A fix was added to consume an iterator and create the list 7963 of the entries to be copied, avoiding the recursion for newly created 7964 directories. Patch by Bruno P. Kinoshita. 7965 7966- bpo-38863: Improve :func:`is_cgi` function in :mod:`http.server`, which 7967 enables processing the case that cgi directory is a child of another 7968 directory other than root. 7969 7970- bpo-37838: :meth:`typing.get_type_hints` properly handles functions 7971 decorated with :meth:`functools.wraps`. 7972 7973- bpo-38870: Expose :func:`ast.unparse` as a function of the :mod:`ast` 7974 module that can be used to unparse an :class:`ast.AST` object and produce 7975 a string with code that would produce an equivalent :class:`ast.AST` 7976 object when parsed. Patch by Pablo Galindo and Batuhan Taskaya. 7977 7978- bpo-38859: AsyncMock now returns StopAsyncIteration on the exhaustion of a 7979 side_effects iterable. Since PEP-479 its Impossible to raise a 7980 StopIteration exception from a coroutine. 7981 7982- bpo-38857: AsyncMock fix for return values that are awaitable types. This 7983 also covers side_effect iterable values that happened to be awaitable, and 7984 wraps callables that return an awaitable type. Before these awaitables 7985 were being awaited instead of being returned as is. 7986 7987- bpo-38834: :class:`typing.TypedDict` subclasses now track which keys are 7988 optional using the ``__required_keys__`` and ``__optional_keys__`` 7989 attributes, to enable runtime validation by downstream projects. Patch by 7990 Zac Hatfield-Dodds. 7991 7992- bpo-38821: Fix unhandled exceptions in :mod:`argparse` when 7993 internationalizing error messages for arguments with ``nargs`` set to 7994 special (non-integer) values. Patch by Federico Bond. 7995 7996- bpo-38820: Make Python compatible with OpenSSL 3.0.0. 7997 :func:`ssl.SSLSocket.getpeercert` no longer returns IPv6 addresses with a 7998 trailing new line. 7999 8000- bpo-38811: Fix an unhandled exception in :mod:`pathlib` when 8001 :meth:`os.link` is missing. Patch by Toke Høiland-Jørgensen. 8002 8003- bpo-38686: Added support for multiple ``qop`` values in 8004 :class:`urllib.request.AbstractDigestAuthHandler`. 8005 8006- bpo-38712: Add the Linux-specific :func:`signal.pidfd_send_signal` 8007 function, which allows sending a signal to a process identified by a file 8008 descriptor rather than a pid. 8009 8010- bpo-38348: Add ``-i`` and ``--indent`` (indentation level), and 8011 ``--no-type-comments`` (type comments) command line options to ast parsing 8012 tool. 8013 8014- bpo-37523: Change :class:`zipfile.ZipExtFile` to raise ``ValueError`` when 8015 trying to access the underlying file object after it has been closed. This 8016 new behavior is consistent with how accessing closed files is handled in 8017 other parts of Python. 8018 8019- bpo-38045: Improve the performance of :func:`enum._decompose` in 8020 :mod:`enum`. Patch by hongweipeng. 8021 8022- bpo-36820: Break cycle generated when saving an exception in socket.py, 8023 codeop.py and dyld.py as they keep alive not only the exception but user 8024 objects through the ``__traceback__`` attribute. Patch by Mario Corchero. 8025 8026- bpo-36406: Handle namespace packages in :mod:`doctest`. Patch by 8027 Karthikeyan Singaravelan. 8028 8029- bpo-34776: Fix dataclasses to support forward references in type 8030 annotations 8031 8032- bpo-20928: ElementTree supports recursive XInclude processing. Patch by 8033 Stefan Behnel. 8034 8035- bpo-29636: Add whitespace options for formatting JSON with the 8036 ``json.tool`` CLI. The following mutually exclusive options are now 8037 supported: ``--indent`` for setting the indent level in spaces; ``--tab`` 8038 for indenting with tabs; ``--no-indent`` for suppressing newlines; and 8039 ``--compact`` for suppressing all whitespace. The default behavior remains 8040 the same as ``--indent=4``. 8041 8042Documentation 8043------------- 8044 8045- bpo-38928: Correct when venv's ``upgrade_dependencies()`` and 8046 ``--upgrade-deps`` are added. 8047 8048- bpo-38899: Update documentation to state that to activate virtual 8049 environments under fish one should use `source`, not `.` as documented at 8050 https://fishshell.com/docs/current/commands.html#source. 8051 8052- bpo-22377: Improves documentation of the values that 8053 :meth:`datetime.datetime.strptime` accepts for ``%Z``. Patch by Karl 8054 Dubost. 8055 8056Tests 8057----- 8058 8059- bpo-38546: Fix test_ressources_gced_in_workers() of 8060 test_concurrent_futures: explicitly stop the manager to prevent leaking a 8061 child process running in the background after the test completes. 8062 8063- bpo-38546: Multiprocessing and concurrent.futures tests now stop the 8064 resource tracker process when tests complete. 8065 8066- bpo-38614: Replace hardcoded timeout constants in tests with new 8067 :mod:`test.support` constants: :data:`~test.support.LOOPBACK_TIMEOUT`, 8068 :data:`~test.support.INTERNET_TIMEOUT`, 8069 :data:`~test.support.SHORT_TIMEOUT` and 8070 :data:`~test.support.LONG_TIMEOUT`. It becomes easier to adjust these four 8071 timeout constants for all tests at once, rather than having to adjust 8072 every single test file. 8073 8074- bpo-38547: Fix test_pty: if the process is the session leader, closing the 8075 master file descriptor raises a SIGHUP signal: simply ignore SIGHUP when 8076 running the tests. 8077 8078- bpo-38992: Fix a test for :func:`math.fsum` that was failing due to 8079 constant folding. 8080 8081- bpo-38991: :mod:`test.support`: 8082 :func:`~test.support.run_python_until_end`, 8083 :func:`~test.support.assert_python_ok` and 8084 :func:`~test.support.assert_python_failure` functions no longer strip 8085 whitespaces from stderr. Remove ``test.support.strip_python_stderr()`` 8086 function. 8087 8088- bpo-38965: Fix test_faulthandler on GCC 10. Use the "volatile" keyword in 8089 ``faulthandler._stack_overflow()`` to prevent tail call optimization on 8090 any compiler, rather than relying on compiler specific pragma. 8091 8092- bpo-38875: test_capi: trashcan tests now require the test "cpu" resource. 8093 8094- bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix 8095 on platforms lacking a functional bind() for named unix domain sockets. 8096 8097- bpo-38692: Skip the test_posix.test_pidfd_open() test if 8098 ``os.pidfd_open()`` fails with a :exc:`PermissionError`. This situation 8099 can happen in a Linux sandbox using a syscall whitelist which doesn't 8100 allow the ``pidfd_open()`` syscall yet. 8101 8102- bpo-38839: Fix some unused functions in tests. Patch by Adam Johnson. 8103 8104- bpo-38669: Raise :exc:`TypeError` when passing target as a string with 8105 :meth:`unittest.mock.patch.object`. 8106 8107- bpo-37957: test.regrtest now can receive a list of test patterns to ignore 8108 (using the -i/--ignore argument) or a file with a list of patterns to 8109 ignore (using the --ignore-file argument). Patch by Pablo Galindo. 8110 8111Build 8112----- 8113 8114- bpo-37404: :mod:`asyncio` now raises :exc:`TyperError` when calling 8115 incompatible methods with an :class:`ssl.SSLSocket` socket. Patch by Ido 8116 Michael. 8117 8118- bpo-36500: Added an optional "regen" project to the Visual Studio solution 8119 that will regenerate all grammar, tokens, and opcodes. 8120 8121Windows 8122------- 8123 8124- bpo-39007: Add auditing events to functions in :mod:`winreg`. 8125 8126- bpo-33125: Add support for building and releasing Windows ARM64 packages. 8127 8128macOS 8129----- 8130 8131- bpo-37931: Fixed a crash on OSX dynamic builds that occurred when 8132 re-initializing the posix module after a Py_Finalize if the environment 8133 had changed since the previous `import posix`. Patch by Benoît Hudson. 8134 8135IDLE 8136---- 8137 8138- bpo-38944: Escape key now closes IDLE completion windows. Patch by Johnny 8139 Najera. 8140 8141- bpo-38943: Fix IDLE autocomplete windows not always appearing on some 8142 systems. Patch by Johnny Najera. 8143 8144- bpo-38862: 'Strip Trailing Whitespace' on the Format menu removes extra 8145 newlines at the end of non-shell files. 8146 8147- bpo-38636: Fix IDLE Format menu tab toggle and file indent width. These 8148 functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in 8149 3.7.5 and 3.8.0. 8150 8151C API 8152----- 8153 8154- bpo-38896: Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free 8155 list has been removed in Python 3.3. 8156 8157- bpo-37340: Remove ``PyMethod_ClearFreeList()`` and 8158 ``PyCFunction_ClearFreeList()`` functions: the free lists of bound method 8159 objects have been removed. 8160 8161- bpo-38835: Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` 8162 macros of ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API). 8163 8164 8165What's New in Python 3.9.0 alpha 1? 8166=================================== 8167 8168*Release date: 2019-11-19* 8169 8170Security 8171-------- 8172 8173- bpo-38722: :mod:`runpy` now uses :meth:`io.open_code` to open code files. 8174 Patch by Jason Killen. 8175 8176- bpo-38622: Add additional audit events for the :mod:`ctypes` module. 8177 8178- bpo-38418: Fixes audit event for :func:`os.system` to be named 8179 ``os.system``. 8180 8181- bpo-38243: Escape the server title of 8182 :class:`xmlrpc.server.DocXMLRPCServer` when rendering the document page as 8183 HTML. (Contributed by Dong-hee Na in :issue:`38243`.) 8184 8185- bpo-38174: Update vendorized expat library version to 2.2.8, which 8186 resolves CVE-2019-15903. 8187 8188- bpo-37764: Fixes email._header_value_parser.get_unstructured going into an 8189 infinite loop for a specific case in which the email header does not have 8190 trailing whitespace, and the case in which it contains an invalid encoded 8191 word. Patch by Ashwin Ramaswami. 8192 8193- bpo-37461: Fix an infinite loop when parsing specially crafted email 8194 headers. Patch by Abhilash Raj. 8195 8196- bpo-37363: Adds audit events for the range of supported run commands (see 8197 :ref:`using-on-general`). 8198 8199- bpo-37463: ssl.match_hostname() no longer accepts IPv4 addresses with 8200 additional text after the address and only quad-dotted notation without 8201 trailing whitespaces. Some inet_aton() implementations ignore whitespace 8202 and all data after whitespace, e.g. '127.0.0.1 whatever'. 8203 8204- bpo-37363: Adds audit events for :mod:`ensurepip`, :mod:`ftplib`, 8205 :mod:`glob`, :mod:`imaplib`, :mod:`nntplib`, :mod:`pdb`, :mod:`poplib`, 8206 :mod:`shutil`, :mod:`smtplib`, :mod:`sqlite3`, :mod:`subprocess`, 8207 :mod:`telnetlib`, :mod:`tempfile` and :mod:`webbrowser`, as well as 8208 :func:`os.listdir`, :func:`os.scandir` and :func:`breakpoint`. 8209 8210- bpo-37364: :func:`io.open_code` is now used when reading :file:`.pth` 8211 files. 8212 8213- bpo-34631: Updated OpenSSL to 1.1.1c in Windows installer 8214 8215- bpo-34155: Fix parsing of invalid email addresses with more than one ``@`` 8216 (e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email 8217 address. Patch by maxking & jpic. 8218 8219Core and Builtins 8220----------------- 8221 8222- bpo-38631: Replace ``Py_FatalError()`` call with a regular 8223 :exc:`RuntimeError` exception in :meth:`float.__getformat__`. 8224 8225- bpo-38639: Optimized :func:`math.floor()`, :func:`math.ceil()` and 8226 :func:`math.trunc()` for floats. 8227 8228- bpo-38640: Fixed a bug in the compiler that was causing to raise in the 8229 presence of break statements and continue statements inside always false 8230 while loops. Patch by Pablo Galindo. 8231 8232- bpo-38613: Optimized some set operations (e.g. ``|``, ``^``, and ``-``) of 8233 ``dict_keys``. ``d.keys() | other`` was slower than ``set(d) | other`` but 8234 they are almost same performance for now. 8235 8236- bpo-28029: ``"".replace("", s, n)`` now returns ``s`` instead of an empty 8237 string for all non-zero ``n``. There are similar changes for 8238 :class:`bytes` and :class:`bytearray` objects. 8239 8240- bpo-38535: Fixed line numbers and column offsets for AST nodes for calls 8241 without arguments in decorators. 8242 8243- bpo-38525: Fix a segmentation fault when using reverse iterators of empty 8244 ``dict`` objects. Patch by Dong-hee Na and Inada Naoki. 8245 8246- bpo-38465: :class:`bytearray`, :class:`~array.array` and 8247 :class:`~mmap.mmap` objects allow now to export more than ``2**31`` 8248 buffers at a time. 8249 8250- bpo-38469: Fixed a bug where the scope of named expressions was not being 8251 resolved correctly in the presence of the *global* keyword. Patch by Pablo 8252 Galindo. 8253 8254- bpo-38437: Activate the ``GC_DEBUG`` macro for debug builds of the 8255 interpreter (when ``Py_DEBUG`` is set). Patch by Pablo Galindo. 8256 8257- bpo-38379: When the garbage collector makes a collection in which some 8258 objects resurrect (they are reachable from outside the isolated cycles 8259 after the finalizers have been executed), do not block the collection of 8260 all objects that are still unreachable. Patch by Pablo Galindo and Tim 8261 Peters. 8262 8263- bpo-38379: When cyclic garbage collection (gc) runs finalizers that 8264 resurrect unreachable objects, the current gc run ends, without collecting 8265 any cyclic trash. However, the statistics reported by ``collect()`` and 8266 ``get_stats()`` claimed that all cyclic trash found was collected, and 8267 that the resurrected objects were collected. Changed the stats to report 8268 that none were collected. 8269 8270- bpo-38392: In debug mode, :c:func:`PyObject_GC_Track` now calls 8271 ``tp_traverse()`` of the object type to ensure that the object is valid: 8272 test that objects visited by ``tp_traverse()`` are valid. 8273 8274- bpo-38210: Remove unnecessary intersection and update set operation in 8275 dictview with empty set. (Contributed by Dong-hee Na in :issue:`38210`.) 8276 8277- bpo-38402: Check the error from the system's underlying ``crypt`` or 8278 ``crypt_r``. 8279 8280- bpo-37474: On FreeBSD, Python no longer calls ``fedisableexcept()`` at 8281 startup to control the floating point control mode. The call became 8282 useless since FreeBSD 6: it became the default mode. 8283 8284- bpo-38006: Fix a bug due to the interaction of weakrefs and the cyclic 8285 garbage collector. We must clear any weakrefs in garbage in order to 8286 prevent their callbacks from executing and causing a crash. 8287 8288- bpo-38317: Fix warnings options priority: ``PyConfig.warnoptions`` has the 8289 highest priority, as stated in the :pep:`587`. 8290 8291- bpo-38310: Predict ``BUILD_MAP_UNPACK_WITH_CALL`` -> ``CALL_FUNCTION_EX`` 8292 opcode pairs in the main interpreter loop. Patch by Brandt Bucher. 8293 8294- bpo-36871: Improve error handling for the assert_has_calls and 8295 assert_has_awaits methods of mocks. Fixed a bug where any errors 8296 encountered while binding the expected calls to the mock's spec were 8297 silently swallowed, leading to misleading error output. 8298 8299- bpo-11410: Better control over symbol visibility is provided through use 8300 of the visibility attributes available in gcc >= 4.0, provided in a 8301 uniform way across POSIX and Windows. The POSIX build files have been 8302 updated to compile with -fvisibility=hidden, minimising exported symbols. 8303 8304- bpo-38219: Optimized the :class:`dict` constructor and the 8305 :meth:`~dict.update` method for the case when the argument is a dict. 8306 8307- bpo-38236: Python now dumps path configuration if it fails to import the 8308 Python codecs of the filesystem and stdio encodings. 8309 8310- bpo-38013: Allow to call ``async_generator_athrow().throw(...)`` even for 8311 non-started async generator helper. It fixes annoying warning at the end 8312 of :func:`asyncio.run` call. 8313 8314- bpo-38124: Fix an off-by-one error in PyState_AddModule that could cause 8315 out-of-bounds memory access. 8316 8317- bpo-38116: The select module is now PEP-384 compliant and no longer has 8318 static state 8319 8320- bpo-38113: ast module updated to PEP-384 and all statics removed 8321 8322- bpo-38076: The struct module is now PEP-384 compatible 8323 8324- bpo-38075: The random module is now PEP-384 compatible 8325 8326- bpo-38074: zlib module made PEP-384 compatible 8327 8328- bpo-38073: Make pwd extension module PEP-384 compatible 8329 8330- bpo-38072: grp module made PEP-384 compatible 8331 8332- bpo-38069: Make _posixsubprocess PEP-384 compatible 8333 8334- bpo-38071: Make termios extension module PEP-384 compatible 8335 8336- bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. 8337 8338- bpo-36946: Fix possible signed integer overflow when handling slices. 8339 Patch by hongweipeng. 8340 8341- bpo-37994: Fixed silencing arbitrary errors if an attribute lookup fails 8342 in several sites. Only AttributeError should be silenced. 8343 8344- bpo-8425: Optimize set difference_update for the case when the other set 8345 is much larger than the base set. (Suggested by Evgeny Kapun with code 8346 contributed by Michele Orrù). 8347 8348- bpo-37966: The implementation of :func:`~unicodedata.is_normalized` has 8349 been greatly sped up on strings that aren't normalized, by implementing 8350 the full normalization-quick-check algorithm from the Unicode standard. 8351 8352- bpo-37947: Adjust correctly the recursion level in the symtable generation 8353 for named expressions. Patch by Pablo Galindo. 8354 8355- bpo-37812: The ``CHECK_SMALL_INT`` macro used inside 8356 :file:`Object/longobject.c` has been replaced with an explicit ``return`` 8357 at each call site. 8358 8359- bpo-37751: Fix :func:`codecs.lookup` to normalize the encoding name the 8360 same way than :func:`encodings.normalize_encoding`, except that 8361 :func:`codecs.lookup` also converts the name to lower case. 8362 8363- bpo-37830: Fixed compilation of :keyword:`break` and :keyword:`continue` 8364 in the :keyword:`finally` block when the corresponding :keyword:`try` 8365 block contains :keyword:`return` with a non-constant value. 8366 8367- bpo-20490: Improve import error message for partially initialized module 8368 on circular ``from`` imports - by Anthony Sottile. 8369 8370- bpo-37840: Fix handling of negative indices in 8371 :c:member:`~PySequenceMethods.sq_item` of :class:`bytearray`. Patch by 8372 Sergey Fedoseev. 8373 8374- bpo-37802: Slightly improve performance of 8375 :c:func:`PyLong_FromUnsignedLong`, :c:func:`PyLong_FromUnsignedLongLong` 8376 and :c:func:`PyLong_FromSize_t`. Patch by Sergey Fedoseev. 8377 8378- bpo-37409: Ensure explicit relative imports from interactive sessions and 8379 scripts (having no parent package) always raise ImportError, rather than 8380 treating the current module as the package. Patch by Ben Lewis. 8381 8382- bpo-32912: Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead 8383 of :exc:`DeprecationWarning` for invalid escape sequences in string and 8384 bytes literals. 8385 8386- bpo-37757: :pep:`572`: As described in the PEP, assignment expressions now 8387 raise :exc:`SyntaxError` when their interaction with comprehension scoping 8388 results in an ambiguous target scope. 8389 8390 The ``TargetScopeError`` subclass originally proposed by the PEP has been 8391 removed in favour of just raising regular syntax errors for the disallowed 8392 cases. 8393 8394- bpo-36279: Fix potential use of uninitialized memory in :func:`os.wait3`. 8395 8396- bpo-36311: Decoding bytes objects larger than 2GiB is faster and no longer 8397 fails when a multibyte characters spans a chunk boundary. 8398 8399- bpo-34880: The :keyword:`assert` statement now works properly if the 8400 :exc:`AssertionError` exception is being shadowed. Patch by Zackery Spytz. 8401 8402- bpo-37340: Removed object cache (``free_list``) for bound method objects. 8403 Temporary bound method objects are less used than before thanks to the 8404 ``LOAD_METHOD`` opcode and the ``_PyObject_VectorcallMethod`` C API. 8405 8406- bpo-37648: Fixed minor inconsistency in :meth:`list.__contains__`, 8407 :meth:`tuple.__contains__` and a few other places. The collection's item 8408 is now always at the left and the needle is on the right of ``==``. 8409 8410- bpo-37444: Update differing exception between :meth:`builtins.__import__` 8411 and :meth:`importlib.__import__`. 8412 8413- bpo-37619: When adding a wrapper descriptor from one class to a different 8414 class (for example, setting ``__add__ = str.__add__`` on an ``int`` 8415 subclass), an exception is correctly raised when the operator is called. 8416 8417- bpo-37593: Swap the positions of the *posonlyargs* and *args* parameters 8418 in the constructor of :class:`ast.parameters` nodes. 8419 8420- bpo-37543: Optimized pymalloc for non PGO build. 8421 8422- bpo-37537: Compute allocated pymalloc blocks inside 8423 _Py_GetAllocatedBlocks(). This slows down _Py_GetAllocatedBlocks() but 8424 gives a small speedup to _PyObject_Malloc() and _PyObject_Free(). 8425 8426- bpo-37467: Fix :func:`sys.excepthook` and :c:func:`PyErr_Display` if a 8427 filename is a bytes string. For example, for a SyntaxError exception where 8428 the filename attribute is a bytes string. 8429 8430- bpo-37433: Fix ``SyntaxError`` indicator printing too many spaces for 8431 multi-line strings - by Anthony Sottile. 8432 8433- bpo-37417: :meth:`bytearray.extend` now correctly handles errors that 8434 arise during iteration. Patch by Brandt Bucher. 8435 8436- bpo-37414: The undocumented ``sys.callstats()`` function has been removed. 8437 Since Python 3.7, it was deprecated and always returned ``None``. It 8438 required a special build option ``CALL_PROFILE`` which was already removed 8439 in Python 3.7. 8440 8441- bpo-37392: Remove ``sys.getcheckinterval()`` and 8442 ``sys.setcheckinterval()`` functions. They were deprecated since Python 8443 3.2. Use :func:`sys.getswitchinterval` and :func:`sys.setswitchinterval` 8444 instead. Remove also ``check_interval`` field of the 8445 ``PyInterpreterState`` structure. 8446 8447- bpo-37388: In development mode and in debug build, *encoding* and *errors* 8448 arguments are now checked on string encoding and decoding operations. 8449 Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`. 8450 8451 By default, for best performances, the *errors* argument is only checked 8452 at the first encoding/decoding error, and the *encoding* argument is 8453 sometimes ignored for empty strings. 8454 8455- bpo-37348: Optimized decoding short ASCII string with UTF-8 and ascii 8456 codecs. ``b"foo".decode()`` is about 15% faster. Patch by Inada Naoki. 8457 8458- bpo-24214: Improved support of the surrogatepass error handler in the 8459 UTF-8 and UTF-16 incremental decoders. 8460 8461- bpo-37330: :func:`open`, :func:`io.open`, :func:`codecs.open` and 8462 :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal 8463 newline") in the file mode. This flag was deprecated since Python 3.3. 8464 8465- bpo-35224: Reverse evaluation order of key: value in dict comprehensions 8466 as proposed in PEP 572. I.e. in ``{k: v for ...}``, ``k`` will be 8467 evaluated before ``v``. 8468 8469- bpo-37316: Fix the :c:func:`PySys_Audit` call in :class:`mmap.mmap`. 8470 8471- bpo-37300: Remove an unnecessary Py_XINCREF in classobject.c. 8472 8473- bpo-37269: Fix a bug in the peephole optimizer that was not treating 8474 correctly constant conditions with binary operators. Patch by Pablo 8475 Galindo. 8476 8477- bpo-20443: Python now gets the absolute path of the script filename 8478 specified on the command line (ex: "python3 script.py"): the __file__ 8479 attribute of the __main__ module and sys.path[0] become an absolute path, 8480 rather than a relative path. 8481 8482- bpo-37257: Python's small object allocator (``obmalloc.c``) now allows (no 8483 more than) one empty arena to remain available for immediate reuse, 8484 without returning it to the OS. This prevents thrashing in simple loops 8485 where an arena could be created and destroyed anew on each iteration. 8486 8487- bpo-37231: The dispatching of type slots to special methods (for example 8488 calling ``__mul__`` when doing ``x * y``) has been made faster. 8489 8490- bpo-36974: Implemented separate vectorcall functions for every calling 8491 convention of builtin functions and methods. This improves performance for 8492 calls. 8493 8494- bpo-37213: Handle correctly negative line offsets in the peephole 8495 optimizer. Patch by Pablo Galindo. 8496 8497- bpo-37219: Remove erroneous optimization for empty set differences. 8498 8499- bpo-15913: Implement :c:func:`PyBuffer_SizeFromFormat()` function 8500 (previously documented but not implemented): call :func:`struct.calcsize`. 8501 Patch by Joannah Nanjekye. 8502 8503- bpo-36922: Slot functions optimize any callable with 8504 ``Py_TPFLAGS_METHOD_DESCRIPTOR`` instead of only instances of 8505 ``function``. 8506 8507- bpo-36974: The slot ``tp_vectorcall_offset`` is inherited unconditionally 8508 to support ``super().__call__()`` when the base class uses vectorcall. 8509 8510- bpo-37160: :func:`threading.get_native_id` now also supports NetBSD. 8511 8512- bpo-37077: Add :func:`threading.get_native_id` support for AIX. Patch by 8513 M. Felt 8514 8515- bpo-36781: :func:`sum` has been optimized for boolean values. 8516 8517- bpo-34556: Add ``--upgrade-deps`` to venv module. Patch by Cooper Ry Lees 8518 8519- bpo-20523: ``pdb.Pdb`` supports ~/.pdbrc in Windows 7. Patch by Tim Hopper 8520 and Dan Lidral-Porter. 8521 8522- bpo-35551: Updated encodings: - Removed the "tis260" encoding, which was 8523 an alias for the nonexistent "tactis" codec. - Added "mac_centeuro" as an 8524 alias for the mac_latin2 encoding. 8525 8526- bpo-19072: The :class:`classmethod` decorator can now wrap other 8527 descriptors such as property objects. Adapted from a patch written by 8528 Graham Dumpleton. 8529 8530- bpo-27575: Improve speed of dictview intersection by directly using set 8531 intersection logic. Patch by David Su. 8532 8533- bpo-30773: Prohibit parallel running of aclose() / asend() / athrow(). Fix 8534 ag_running to reflect the actual running status of the AG. 8535 8536Library 8537------- 8538 8539- bpo-36589: The :func:`curses.update_lines_cols` function now returns 8540 ``None`` instead of ``1`` on success. 8541 8542- bpo-38807: Update :exc:`TypeError` messages for :meth:`os.path.join` to 8543 include :class:`os.PathLike` objects as acceptable input types. 8544 8545- bpo-38724: Add a repr for ``subprocess.Popen`` objects. Patch by Andrey 8546 Doroschenko. 8547 8548- bpo-38786: pydoc now recognizes and parses HTTPS URLs. Patch by python273. 8549 8550- bpo-38785: Prevent asyncio from crashing if parent ``__init__`` is not 8551 called from a constructor of object derived from ``asyncio.Future``. 8552 8553- bpo-38723: :mod:`pdb` now uses :meth:`io.open_code` to trigger auditing 8554 events. 8555 8556- bpo-27805: Allow opening pipes and other non-seekable files in append mode 8557 with :func:`open`. 8558 8559- bpo-38438: Simplify the :mod:`argparse` usage message for ``nargs="*"``. 8560 8561- bpo-38761: WeakSet is now registered as a collections.abc.MutableSet. 8562 8563- bpo-38716: logging: change RotatingHandler namer and rotator to 8564 class-level attributes. This stops __init__ from setting them to None in 8565 the case where a subclass defines them with eponymous methods. 8566 8567- bpo-38713: Add :data:`os.P_PIDFD` constant, which may be passed to 8568 :func:`os.waitid` to wait on a Linux process file descriptor. 8569 8570- bpo-38692: Add :class:`asyncio.PidfdChildWatcher`, a Linux-specific child 8571 watcher implementation that polls process file descriptors. 8572 8573- bpo-38692: Expose the Linux ``pidfd_open`` syscall as 8574 :func:`os.pidfd_open`. 8575 8576- bpo-38602: Added constants :data:`~fcntl.F_OFD_GETLK`, 8577 :data:`~fcntl.F_OFD_SETLK` and :data:`~fcntl.F_OFD_SETLKW` to the 8578 :mod:`fcntl` module. Patch by Dong-hee Na. 8579 8580- bpo-38334: Fixed seeking backward on an encrypted 8581 :class:`zipfile.ZipExtFile`. 8582 8583- bpo-38312: Add :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, 8584 :func:`curses.get_tabsize`, and :func:`curses.set_tabsize` functions - by 8585 Anthony Sottile. 8586 8587- bpo-38586: Now :func:`~logging.config.fileConfig` correctly sets the .name 8588 of handlers loaded. 8589 8590- bpo-38565: Add new cache_parameters() method for functools.lru_cache() to 8591 better support pickling. 8592 8593- bpo-34679: asynci.ProactorEventLoop.close() now only calls 8594 signal.set_wakeup_fd() in the main thread. 8595 8596- bpo-31202: The case the result of :func:`pathlib.WindowsPath.glob` matches 8597 now the case of the pattern for literal parts. 8598 8599- bpo-36321: Remove misspelled attribute. The 3.8 changelog noted that this 8600 would be removed in 3.9. 8601 8602- bpo-38521: Fixed erroneous equality comparison in statistics.NormalDist(). 8603 8604- bpo-38493: Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for 8605 :attr:`si_code`. Patch by Dong-hee Na. 8606 8607- bpo-38478: Fixed a bug in :meth:`inspect.signature.bind` that was causing 8608 it to fail when handling a keyword argument with same name as 8609 positional-only parameter. Patch by Pablo Galindo. 8610 8611- bpo-33604: Fixed `hmac.new` and `hmac.HMAC` to raise TypeError instead of 8612 ValueError when the digestmod parameter, now required in 3.8, is omitted. 8613 Also clarified the hmac module documentation and docstrings. 8614 8615- bpo-38378: Parameters *out* and *in* of :func:`os.sendfile` was renamed to 8616 *out_fd* and *in_fd*. 8617 8618- bpo-38417: Added support for setting the umask in the child process to the 8619 subprocess module on POSIX systems. 8620 8621- bpo-38449: Revert GH-15522, which introduces a regression in 8622 :meth:`mimetypes.guess_type` due to improper handling of filenames as 8623 urls. 8624 8625- bpo-38431: Fix ``__repr__`` method for :class:`dataclasses.InitVar` to 8626 support typing objects, patch by Samuel Colvin. 8627 8628- bpo-38109: Add missing :data:`stat.S_IFDOOR`, :data:`stat.S_IFPORT`, 8629 :data:`stat.S_IFWHT`, :func:`stat.S_ISDOOR`, :func:`stat.S_ISPORT`, and 8630 :func:`stat.S_ISWHT` values to the Python implementation of :mod:`stat`. 8631 8632- bpo-38422: Clarify docstrings of pathlib suffix(es) 8633 8634- bpo-38405: Nested subclasses of :class:`typing.NamedTuple` are now 8635 pickleable. 8636 8637- bpo-38332: Prevent :exc:`KeyError` thrown by :func:`_encoded_words.decode` 8638 when given an encoded-word with invalid content-type encoding from 8639 propagating all the way to :func:`email.message.get`. 8640 8641- bpo-38371: Deprecated the ``split()`` method in 8642 :class:`_tkinter.TkappType` in favour of the ``splitlist()`` method which 8643 has more consistent and predicable behavior. 8644 8645- bpo-38341: Add :exc:`smtplib.SMTPNotSupportedError` to the :mod:`smtplib` 8646 exported names. 8647 8648- bpo-38319: sendfile() used in socket and shutil modules was raising 8649 OverflowError for files >= 2GiB on 32-bit architectures. (patch by 8650 Giampaolo Rodola) 8651 8652- bpo-38242: Revert the new asyncio Streams API 8653 8654- bpo-13153: OS native encoding is now used for converting between Python 8655 strings and Tcl objects. This allows to display, copy and paste to 8656 clipboard emoji and other non-BMP characters. Converting strings from Tcl 8657 to Python and back now never fails (except MemoryError). 8658 8659- bpo-38019: Correctly handle pause/resume reading of closed asyncio unix 8660 pipe. 8661 8662- bpo-38163: Child mocks will now detect their type as either synchronous or 8663 asynchronous, asynchronous child mocks will be AsyncMocks and synchronous 8664 child mocks will be either MagicMock or Mock (depending on their parent 8665 type). 8666 8667- bpo-38161: Removes _AwaitEvent from AsyncMock. 8668 8669- bpo-38216: Allow the rare code that wants to send invalid http requests 8670 from the `http.client` library a way to do so. The fixes for bpo-30458 8671 led to breakage for some projects that were relying on this ability to 8672 test their own behavior in the face of bad requests. 8673 8674- bpo-28286: Deprecate opening :class:`~gzip.GzipFile` for writing 8675 implicitly. Always specify the *mode* argument for writing. 8676 8677- bpo-38108: Any synchronous magic methods on an AsyncMock now return a 8678 MagicMock. Any asynchronous magic methods on a MagicMock now return an 8679 AsyncMock. 8680 8681- bpo-38265: Update the *length* parameter of :func:`os.pread` to accept 8682 :c:type:`Py_ssize_t` instead of :c:type:`int`. 8683 8684- bpo-38112: :mod:`compileall` has a higher default recursion limit and new 8685 command-line arguments for path manipulation, symlinks handling, and 8686 multiple optimization levels. 8687 8688- bpo-38248: asyncio: Fix inconsistent immediate Task cancellation 8689 8690- bpo-38237: The arguments for the builtin pow function are more 8691 descriptive. They can now also be passed in as keywords. 8692 8693- bpo-34002: Improve efficiency in parts of email package by changing 8694 while-pop to a for loop, using isdisjoint instead of set intersections. 8695 8696- bpo-38191: Constructors of :class:`~typing.NamedTuple` and 8697 :class:`~typing.TypedDict` types now accept arbitrary keyword argument 8698 names, including "cls", "self", "typename", "_typename", "fields" and 8699 "_fields". 8700 8701- bpo-38155: Add ``__all__`` to :mod:`datetime`. Patch by Tahia Khan. 8702 8703- bpo-38185: Fixed case-insensitive string comparison in 8704 :class:`sqlite3.Row` indexing. 8705 8706- bpo-38136: Changes AsyncMock call count and await count to be two 8707 different counters. Now await count only counts when a coroutine has been 8708 awaited, not when it has been called, and vice-versa. Update the 8709 documentation around this. 8710 8711- bpo-37828: Fix default mock name in 8712 :meth:`unittest.mock.Mock.assert_called` exceptions. Patch by Abraham 8713 Toriz Cruz. 8714 8715- bpo-38175: Fix a memory leak in comparison of :class:`sqlite3.Row` 8716 objects. 8717 8718- bpo-33936: _hashlib no longer calls obsolete OpenSSL initialization 8719 function with OpenSSL 1.1.0+. 8720 8721- bpo-34706: Preserve subclassing in inspect.Signature.from_callable. 8722 8723- bpo-38153: Names of hashing algorithms from OpenSSL are now normalized to 8724 follow Python's naming conventions. For example OpenSSL uses sha3-512 8725 instead of sha3_512 or blake2b512 instead of blake2b. 8726 8727- bpo-38115: Fix a bug in dis.findlinestarts() where it would return invalid 8728 bytecode offsets. Document that a code object's co_lnotab can contain 8729 invalid bytecode offsets. 8730 8731- bpo-38148: Add slots to :mod:`asyncio` transport classes, which can reduce 8732 memory usage. 8733 8734- bpo-38142: The _hashlib OpenSSL wrapper extension module is now PEP-384 8735 compliant. 8736 8737- bpo-9216: hashlib constructors now support usedforsecurity flag to signal 8738 that a hashing algorithm is not used in a security context. 8739 8740- bpo-36991: Fixes a potential incorrect AttributeError exception escaping 8741 ZipFile.extract() in some unsupported input error situations. 8742 8743- bpo-38134: Remove obsolete copy of PBKDF2_HMAC_fast. All supported OpenSSL 8744 versions contain a fast implementation. 8745 8746- bpo-38132: The OpenSSL hashlib wrapper uses a simpler implementation. 8747 Several Macros and pointless caches are gone. The hash name now comes from 8748 OpenSSL's EVP. The algorithm name stays the same, except it is now always 8749 lower case. 8750 8751- bpo-38008: Fix parent class check in protocols to correctly identify the 8752 module that provides a builtin protocol, instead of assuming they all come 8753 from the :mod:`collections.abc` module 8754 8755- bpo-34037: For :mod:`asyncio`, add a new coroutine 8756 :meth:`loop.shutdown_default_executor`. The new coroutine provides an API 8757 to schedule an executor shutdown that waits on the threadpool to finish 8758 closing. Also, :func:`asyncio.run` has been updated to utilize the new 8759 coroutine. Patch by Kyle Stanley. 8760 8761- bpo-37405: Fixed regression bug for socket.getsockname() for non-CAN_ISOTP 8762 AF_CAN address family sockets by returning a 1-tuple instead of string. 8763 8764- bpo-38121: Update parameter names on functions in importlib.metadata 8765 matching the changes in the 0.22 release of importlib_metadata. 8766 8767- bpo-38110: The os.closewalk() implementation now uses the libc fdwalk() 8768 API on platforms where it is available. 8769 8770- bpo-38093: Fixes AsyncMock so it doesn't crash when used with 8771 AsyncContextManagers or AsyncIterators. 8772 8773- bpo-37488: Add warning to :meth:`datetime.utctimetuple`, 8774 :meth:`datetime.utcnow` and :meth:`datetime.utcfromtimestamp` . 8775 8776- bpo-35640: Allow passing a :term:`path-like object` as ``directory`` 8777 argument to the :class:`http.server.SimpleHTTPRequestHandler` class. Patch 8778 by Géry Ogam. 8779 8780- bpo-38086: Update importlib.metadata with changes from `importlib_metadata 8781 0.21 8782 <https://gitlab.com/python-devs/importlib_metadata/blob/0.21/importlib_metadata/docs/changelog.rst>`_. 8783 8784- bpo-37251: Remove `__code__` check in AsyncMock that incorrectly evaluated 8785 function specs as async objects but failed to evaluate classes with 8786 `__await__` but no `__code__` attribute defined as async objects. 8787 8788- bpo-38037: Fix reference counters in the :mod:`signal` module. 8789 8790- bpo-38066: Hide internal asyncio.Stream methods: feed_eof(), feed_data(), 8791 set_exception() and set_transport(). 8792 8793- bpo-38059: inspect.py now uses sys.exit() instead of exit() 8794 8795- bpo-38049: Added command-line interface for the :mod:`ast` module. 8796 8797- bpo-37953: In :mod:`typing`, improved the ``__hash__`` and ``__eq__`` 8798 methods for :class:`ForwardReferences`. 8799 8800- bpo-38026: Fixed :func:`inspect.getattr_static` used ``isinstance`` while 8801 it should avoid dynamic lookup. 8802 8803- bpo-35923: Update :class:`importlib.machinery.BuiltinImporter` to use 8804 ``loader._ORIGIN`` instead of a hardcoded value. Patch by Dong-hee Na. 8805 8806- bpo-38010: In ``importlib.metadata`` sync with ``importlib_metadata`` 8807 0.20, clarifying behavior of ``files()`` and fixing issue where only one 8808 requirement was returned for ``requires()`` on ``dist-info`` packages. 8809 8810- bpo-38006: weakref.WeakValueDictionary defines a local remove() function 8811 used as callback for weak references. This function was created with a 8812 closure. Modify the implementation to avoid the closure. 8813 8814- bpo-37995: Added the *indent* option to :func:`ast.dump` which allows it 8815 to produce a multiline indented output. 8816 8817- bpo-34410: Fixed a crash in the :func:`tee` iterator when re-enter it. 8818 RuntimeError is now raised in this case. 8819 8820- bpo-37140: Fix a ctypes regression of Python 3.8. When a ctypes.Structure 8821 is passed by copy to a function, ctypes internals created a temporary 8822 object which had the side effect of calling the structure finalizer 8823 (__del__) twice. The Python semantics requires a finalizer to be called 8824 exactly once. Fix ctypes internals to no longer call the finalizer twice. 8825 8826- bpo-37587: ``_json.scanstring`` is now up to 3x faster when there are many 8827 backslash escaped characters in the JSON string. 8828 8829- bpo-37834: Prevent shutil.rmtree exception when built on non-Windows 8830 system without fd system call support, like older versions of macOS. 8831 8832- bpo-10978: Semaphores and BoundedSemaphores can now release more than one 8833 waiting thread at a time. 8834 8835- bpo-37972: Subscripts to the `unittest.mock.call` objects now receive the 8836 same chaining mechanism as any other custom attributes, so that the 8837 following usage no longer raises a `TypeError`: 8838 8839 call().foo().__getitem__('bar') 8840 8841 Patch by blhsing 8842 8843- bpo-37965: Fix C compiler warning caused by 8844 distutils.ccompiler.CCompiler.has_function. 8845 8846- bpo-37964: Add ``F_GETPATH`` command to :mod:`fcntl`. 8847 8848- bpo-37960: ``repr()`` of buffered and text streams now silences only 8849 expected exceptions when get the value of "name" and "mode" attributes. 8850 8851- bpo-37961: Add a ``total_nframe`` field to the traces collected by the 8852 tracemalloc module. This field indicates the original number of frames 8853 before it was truncated. 8854 8855- bpo-37951: Most features of the subprocess module now work again in 8856 subinterpreters. Only *preexec_fn* is restricted in subinterpreters. 8857 8858- bpo-36205: Fix the rusage implementation of time.process_time() to 8859 correctly report the sum of the system and user CPU time. 8860 8861- bpo-37950: Fix :func:`ast.dump` when call with incompletely initialized 8862 node. 8863 8864- bpo-34679: Restores instantiation of Windows IOCP event loops from the 8865 non-main thread. 8866 8867- bpo-36917: Add default implementation of the 8868 :meth:`ast.NodeVisitor.visit_Constant` method which emits a deprecation 8869 warning and calls corresponding methody ``visit_Num()``, ``visit_Str()``, 8870 etc. 8871 8872- bpo-37798: Update test_statistics.py to verify that the statistics module 8873 works well for both C and Python implementations. Patch by Dong-hee Na 8874 8875- bpo-26589: Added a new status code to the http module: 451 8876 UNAVAILABLE_FOR_LEGAL_REASONS 8877 8878- bpo-37915: Fix a segmentation fault that appeared when comparing instances 8879 of ``datetime.timezone`` and ``datetime.tzinfo`` objects. Patch by Pablo 8880 Galindo. 8881 8882- bpo-32554: Deprecate having random.seed() call hash on arbitrary types. 8883 8884- bpo-9938: Add optional keyword argument ``exit_on_error`` for 8885 :class:`ArgumentParser`. 8886 8887- bpo-37851: The :mod:`faulthandler` module no longer allocates its 8888 alternative stack at Python startup. Now the stack is only allocated at 8889 the first faulthandler usage. 8890 8891- bpo-32793: Fix a duplicated debug message when 8892 :meth:`smtplib.SMTP.connect` is called. 8893 8894- bpo-37885: venv: Don't generate unset variable warning on deactivate. 8895 8896- bpo-37868: Fix dataclasses.is_dataclass when given an instance that never 8897 raises AttributeError in __getattr__. That is, an object that returns 8898 something for __dataclass_fields__ even if it's not a dataclass. 8899 8900- bpo-37811: Fix ``socket`` module's ``socket.connect(address)`` function 8901 being unable to establish connection in case of interrupted system call. 8902 The problem was observed on all OSes which ``poll(2)`` system call can 8903 take only non-negative integers and -1 as a timeout value. 8904 8905- bpo-37863: Optimizations for Fraction.__hash__ suggested by Tim Peters. 8906 8907- bpo-21131: Fix ``faulthandler.register(chain=True)`` stack. faulthandler 8908 now allocates a dedicated stack of ``SIGSTKSZ*2`` bytes, instead of just 8909 ``SIGSTKSZ`` bytes. Calling the previous signal handler in faulthandler 8910 signal handler uses more than ``SIGSTKSZ`` bytes of stack memory on some 8911 platforms. 8912 8913- bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() Patch by 8914 Dong-hee Na 8915 8916- bpo-37804: Remove the deprecated method `threading.Thread.isAlive()`. 8917 Patch by Dong-hee Na. 8918 8919- bpo-37819: Add Fraction.as_integer_ratio() to match the corresponding 8920 methods in bool, int, float, and decimal. 8921 8922- bpo-14465: Add an xml.etree.ElementTree.indent() function for 8923 pretty-printing XML trees. Contributed by Stefan Behnel. 8924 8925- bpo-37810: Fix :mod:`difflib` ``?`` hint in diff output when dealing with 8926 tabs. Patch by Anthony Sottile. 8927 8928- bpo-37772: In ``zipfile.Path``, when adding implicit dirs, ensure that 8929 ancestral directories are added and that duplicates are excluded. 8930 8931- bpo-18578: Renamed and documented `test.bytecode_helper` as 8932 `test.support.bytecode_helper`. Patch by Joannah Nanjekye. 8933 8934- bpo-37785: Fix xgettext warnings in :mod:`argparse`. 8935 8936- bpo-34488: :meth:`writelines` method of :class:`io.BytesIO` is now 8937 slightly faster when many small lines are passed. Patch by Sergey 8938 Fedoseev. 8939 8940- bpo-37449: `ensurepip` now uses `importlib.resources.read_binary()` to 8941 read data instead of `pkgutil.get_data()`. Patch by Joannah Nanjekye. 8942 8943- bpo-28292: Mark calendar.py helper functions as being private. The 8944 follows PEP 8 guidance to maintain the style conventions in the module and 8945 it addresses a known case of user confusion. 8946 8947- bpo-18049: Add definition of THREAD_STACK_SIZE for AIX in 8948 Python/thread_pthread.h The default thread stacksize caused crashes with 8949 the default recursion limit Patch by M Felt 8950 8951- bpo-37742: The logging.getLogger() API now returns the root logger when 8952 passed the name 'root', whereas previously it returned a non-root logger 8953 named 'root'. This could affect cases where user code explicitly wants a 8954 non-root logger named 'root', or instantiates a logger using 8955 logging.getLogger(__name__) in some top-level module called 'root.py'. 8956 8957- bpo-37738: Fix the implementation of curses ``addch(str, color_pair)``: 8958 pass the color pair to ``setcchar()``, instead of always passing 0 as the 8959 color pair. 8960 8961- bpo-37723: Fix performance regression on regular expression parsing with 8962 huge character sets. Patch by Yann Vaginay. 8963 8964- bpo-35943: The function :c:func:`PyImport_GetModule` now ensures any 8965 module it returns is fully initialized. Patch by Joannah Nanjekye. 8966 8967- bpo-32178: Fix IndexError in :mod:`email` package when trying to parse 8968 invalid address fields starting with ``:``. 8969 8970- bpo-37268: The :mod:`parser` module is deprecated and will be removed in 8971 future versions of Python. 8972 8973- bpo-11953: Completing WSA* error codes in :mod:`socket`. 8974 8975- bpo-37685: Fixed comparisons of :class:`datetime.timedelta` and 8976 :class:`datetime.timezone`. 8977 8978- bpo-37697: Synchronize ``importlib.metadata`` with `importlib_metadata 8979 0.19 8980 <https://gitlab.com/python-devs/importlib_metadata/-/milestones/20>`_, 8981 improving handling of EGG-INFO files and fixing a crash when entry point 8982 names contained colons. 8983 8984- bpo-37695: Correct :func:`curses.unget_wch` error message. Patch by 8985 Anthony Sottile. 8986 8987- bpo-37689: Add :meth:`is_relative_to` in :class:`PurePath` to determine 8988 whether or not one path is relative to another. 8989 8990- bpo-29553: Fixed :meth:`argparse.ArgumentParser.format_usage` for mutually 8991 exclusive groups. Patch by Andrew Nester. 8992 8993- bpo-37691: Let math.dist() accept coordinates as sequences (or iterables) 8994 rather than just tuples. 8995 8996- bpo-37685: Fixed ``__eq__``, ``__lt__`` etc implementations in some 8997 classes. They now return :data:`NotImplemented` for unsupported type of 8998 the other operand. This allows the other operand to play role (for example 8999 the equality comparison with :data:`~unittest.mock.ANY` will return 9000 ``True``). 9001 9002- bpo-37354: Make Activate.ps1 Powershell script static to allow for signing 9003 it. 9004 9005- bpo-37664: Update wheels bundled with ensurepip (pip 19.2.3 and setuptools 9006 41.2.0) 9007 9008- bpo-37663: Bring consistency to venv shell activation scripts by always 9009 using __VENV_PROMPT__. 9010 9011- bpo-37642: Allowed the pure Python implementation of 9012 :class:`datetime.timezone` to represent sub-minute offsets close to 9013 minimum and maximum boundaries, specifically in the ranges (23:59, 24:00) 9014 and (-23:59, 24:00). Patch by Ngalim Siregar 9015 9016- bpo-36161: In :mod:`posix`, use ``ttyname_r`` instead of ``ttyname`` for 9017 thread safety. 9018 9019- bpo-36324: Make internal attributes for statistics.NormalDist() private. 9020 9021- bpo-37555: Fix `NonCallableMock._call_matcher` returning tuple instead of 9022 `_Call` object when `self._spec_signature` exists. Patch by Elizabeth 9023 Uselton 9024 9025- bpo-29446: Make `from tkinter import *` import only the expected objects. 9026 9027- bpo-16970: Adding a value error when an invalid value in passed to nargs 9028 Patch by Robert Leenders 9029 9030- bpo-34443: Exceptions from :mod:`enum` now use the ``__qualname`` of the 9031 enum class in the exception message instead of the ``__name__``. 9032 9033- bpo-37491: Fix ``IndexError`` when parsing email headers with unexpectedly 9034 ending bare-quoted string value. Patch by Abhilash Raj. 9035 9036- bpo-37587: Make json.loads faster for long strings. (Patch by Marco 9037 Paolini) 9038 9039- bpo-18378: Recognize "UTF-8" as a valid value for LC_CTYPE in 9040 locale._parse_localename. 9041 9042- bpo-37579: Return :exc:`NotImplemented` in Python implementation of 9043 ``__eq__`` for :class:`~datetime.timedelta` and :class:`~datetime.time` 9044 when the other object being compared is not of the same type to match C 9045 implementation. Patch by Karthikeyan Singaravelan. 9046 9047- bpo-21478: Record calls to parent when autospecced object is attached to a 9048 mock using :func:`unittest.mock.attach_mock`. Patch by Karthikeyan 9049 Singaravelan. 9050 9051- bpo-37531: "python3 -m test -jN --timeout=TIMEOUT" now kills a worker 9052 process if it runs longer than *TIMEOUT* seconds. 9053 9054- bpo-37482: Fix serialization of display name in originator or destination 9055 address fields with both encoded words and special chars. 9056 9057- bpo-36993: Improve error reporting for corrupt zip files with bad zip64 9058 extra data. Patch by Daniel Hillier. 9059 9060- bpo-37502: pickle.loads() no longer raises TypeError when the buffers 9061 argument is set to None 9062 9063- bpo-37520: Correct behavior for zipfile.Path.parent when the path object 9064 identifies a subdirectory. 9065 9066- bpo-18374: Fix the ``.col_offset`` attribute of nested :class:`ast.BinOp` 9067 instances which had a too large value in some situations. 9068 9069- bpo-37424: Fixes a possible hang when using a timeout on 9070 `subprocess.run()` while capturing output. If the child process spawned 9071 its own children or otherwise connected its stdout or stderr handles with 9072 another process, we could hang after the timeout was reached and our child 9073 was killed when attempting to read final output from the pipes. 9074 9075- bpo-37421: Fix :func:`multiprocessing.util.get_temp_dir` finalizer: clear 9076 also the 'tempdir' configuration of the current process, so next call to 9077 ``get_temp_dir()`` will create a new temporary directory, rather than 9078 reusing the removed temporary directory. 9079 9080- bpo-37481: The distutils ``bdist_wininst`` command is deprecated in Python 9081 3.8, use ``bdist_wheel`` (wheel packages) instead. 9082 9083- bpo-37479: When `Enum.__str__` is overridden in a derived class, the 9084 override will be used by `Enum.__format__` regardless of whether mixin 9085 classes are present. 9086 9087- bpo-37440: http.client now enables TLS 1.3 post-handshake authentication 9088 for default context or if a cert_file is passed to HTTPSConnection. 9089 9090- bpo-37437: Update vendorized expat version to 2.2.7. 9091 9092- bpo-37428: SSLContext.post_handshake_auth = True no longer sets 9093 SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the 9094 option is documented as ignored for clients, OpenSSL implicitly enables 9095 cert chain validation when the flag is set. 9096 9097- bpo-37420: :func:`os.sched_setaffinity` now correctly handles errors that 9098 arise during iteration over its ``mask`` argument. Patch by Brandt Bucher. 9099 9100- bpo-37412: The :func:`os.getcwdb` function now uses the UTF-8 encoding on 9101 Windows, rather than the ANSI code page: see :pep:`529` for the rationale. 9102 The function is no longer deprecated on Windows. 9103 9104- bpo-37406: The sqlite3 module now raises TypeError, rather than 9105 ValueError, if operation argument type is not str: execute(), 9106 executemany() and calling a connection. 9107 9108- bpo-29412: Fix IndexError in parsing a header value ending unexpectedly. 9109 Patch by Abhilash Raj. 9110 9111- bpo-36546: The *dist* argument for statistics.quantiles() is now 9112 positional only. The current name doesn't reflect that the argument can be 9113 either a dataset or a distribution. Marking the parameter as positional 9114 avoids confusion and makes it possible to change the name later. 9115 9116- bpo-37394: Fix a bug that was causing the :mod:`queue` module to fail if 9117 the accelerator module was not available. Patch by Pablo Galindo. 9118 9119- bpo-37376: :mod:`pprint` now has support for 9120 :class:`types.SimpleNamespace`. Patch by Carl Bordum Hansen. 9121 9122- bpo-26967: An :class:`~argparse.ArgumentParser` with 9123 ``allow_abbrev=False`` no longer disables grouping of short flags, such as 9124 ``-vv``, but only disables abbreviation of long flags as documented. Patch 9125 by Zac Hatfield-Dodds. 9126 9127- bpo-37212: :func:`unittest.mock.call` now preserves the order of keyword 9128 arguments in repr output. Patch by Karthikeyan Singaravelan. 9129 9130- bpo-37372: Fix error unpickling datetime.time objects from Python 2 with 9131 seconds>=24. Patch by Justin Blanchard. 9132 9133- bpo-37345: Add formal support for UDPLITE sockets. Support was present 9134 before, but it is now easier to detect support with ``hasattr(socket, 9135 'IPPROTO_UDPLITE')`` and there are constants defined for each of the 9136 values needed: :py:obj:`socket.IPPROTO_UDPLITE`, 9137 :py:obj:`UDPLITE_SEND_CSCOV`, and :py:obj:`UDPLITE_RECV_CSCOV`. Patch by 9138 Gabe Appleton. 9139 9140- bpo-37358: Optimized ``functools.partial`` by using vectorcall. 9141 9142- bpo-37347: :meth:`sqlite3.Connection.create_aggregate`, 9143 :meth:`sqlite3.Connection.create_function`, 9144 :meth:`sqlite3.Connection.set_authorizer`, 9145 :meth:`sqlite3.Connection.set_progress_handler` 9146 :meth:`sqlite3.Connection.set_trace_callback` methods lead to segfaults if 9147 some of these methods are called twice with an equal object but not the 9148 same. Now callbacks are stored more carefully. Patch by Aleksandr Balezin. 9149 9150- bpo-37163: The *obj* argument of :func:`dataclasses.replace` is 9151 positional-only now. 9152 9153- bpo-37085: Add the optional Linux SocketCAN Broadcast Manager constants, 9154 used as flags to configure the BCM behaviour, in the socket module. Patch 9155 by Karl Ding. 9156 9157- bpo-37328: ``HTMLParser.unescape`` is removed. It was undocumented and 9158 deprecated since Python 3.4. 9159 9160- bpo-37305: Add .webmanifest -> application/manifest+json to list of 9161 recognized file types and content type headers 9162 9163- bpo-37320: ``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` 9164 alias to ``sunau.open()``, and ``wave.openfp()`` alias to ``wave.open()`` 9165 have been removed. They were deprecated since Python 3.7. 9166 9167- bpo-37315: Deprecated accepting floats with integral value (like ``5.0``) 9168 in :func:`math.factorial`. 9169 9170- bpo-37312: ``_dummy_thread`` and ``dummy_threading`` modules have been 9171 removed. These modules were deprecated since Python 3.7 which requires 9172 threading support. 9173 9174- bpo-33972: Email with single part but content-type set to ``multipart/*`` 9175 doesn't raise AttributeError anymore. 9176 9177- bpo-37280: Use threadpool for reading from file for sendfile fallback 9178 mode. 9179 9180- bpo-37279: Fix asyncio sendfile support when sendfile sends extra data in 9181 fallback mode. 9182 9183- bpo-19865: :func:`ctypes.create_unicode_buffer()` now also supports 9184 non-BMP characters on platforms with 16-bit :c:type:`wchar_t` (for 9185 example, Windows and AIX). 9186 9187- bpo-37266: In a subinterpreter, spawning a daemon thread now raises an 9188 exception. Daemon threads were never supported in subinterpreters. 9189 Previously, the subinterpreter finalization crashed with a Python fatal 9190 error if a daemon thread was still running. 9191 9192- bpo-37210: Allow pure Python implementation of :mod:`pickle` to work even 9193 when the C :mod:`_pickle` module is unavailable. 9194 9195- bpo-21872: Fix :mod:`lzma`: module decompresses data incompletely. When 9196 decompressing a FORMAT_ALONE format file, and it doesn't have the end 9197 marker, sometimes the last one to dozens bytes can't be output. Patch by 9198 Ma Lin. 9199 9200- bpo-35922: Fix :meth:`RobotFileParser.crawl_delay` and 9201 :meth:`RobotFileParser.request_rate` to return ``None`` rather than raise 9202 :exc:`AttributeError` when no relevant rule is defined in the robots.txt 9203 file. Patch by Rémi Lapeyre. 9204 9205- bpo-35766: Change the format of feature_version to be a (major, minor) 9206 tuple. 9207 9208- bpo-36607: Eliminate :exc:`RuntimeError` raised by 9209 :func:`asyncio.all_tasks()` if internal tasks weak set is changed by 9210 another thread during iteration. 9211 9212- bpo-18748: :class:`_pyio.IOBase` destructor now does nothing if getting 9213 the ``closed`` attribute fails to better mimic :class:`_io.IOBase` 9214 finalizer. 9215 9216- bpo-36402: Fix a race condition at Python shutdown when waiting for 9217 threads. Wait until the Python thread state of all non-daemon threads get 9218 deleted (join all non-daemon threads), rather than just wait until 9219 non-daemon Python threads complete. 9220 9221- bpo-37206: Default values which cannot be represented as Python objects no 9222 longer improperly represented as ``None`` in function signatures. 9223 9224- bpo-37111: Added ``encoding`` and ``errors`` keyword parameters to 9225 ``logging.basicConfig``. 9226 9227- bpo-12144: Ensure cookies with ``expires`` attribute are handled in 9228 :meth:`CookieJar.make_cookies`. 9229 9230- bpo-34886: Fix an unintended ValueError from :func:`subprocess.run` when 9231 checking for conflicting `input` and `stdin` or `capture_output` and 9232 `stdout` or `stderr` args when they were explicitly provided but with 9233 `None` values within a passed in `**kwargs` dict rather than as passed 9234 directly by name. Patch contributed by Rémi Lapeyre. 9235 9236- bpo-37173: The exception message for ``inspect.getfile()`` now correctly 9237 reports the passed class rather than the builtins module. 9238 9239- bpo-37178: Give math.perm() a one argument form that means the same as 9240 math.factorial(). 9241 9242- bpo-37178: For math.perm(n, k), let k default to n, giving the same result 9243 as factorial. 9244 9245- bpo-37165: Converted _collections._count_elements to use the Argument 9246 Clinic. 9247 9248- bpo-34767: Do not always create a :class:`collections.deque` in 9249 :class:`asyncio.Lock`. 9250 9251- bpo-37158: Speed-up statistics.fmean() by switching from a function to a 9252 generator. 9253 9254- bpo-34282: Remove ``Enum._convert`` method, deprecated in 3.8. 9255 9256- bpo-37150: `argparse._ActionsContainer.add_argument` now throws error, if 9257 someone accidentally pass FileType class object instead of instance of 9258 FileType as `type` argument 9259 9260- bpo-28724: The socket module now has the :func:`socket.send_fds` and 9261 :func:`socket.recv.fds` methods. Contributed by Joannah Nanjekye, Shinya 9262 Okano and Victor Stinner. 9263 9264- bpo-35621: Support running asyncio subprocesses when execution event loop 9265 in a thread on UNIX. 9266 9267- bpo-36520: Lengthy email headers with UTF-8 characters are now properly 9268 encoded when they are folded. Patch by Jeffrey Kintscher. 9269 9270- bpo-30835: Fixed a bug in email parsing where a message with invalid bytes 9271 in content-transfer-encoding of a multipart message can cause an 9272 AttributeError. Patch by Andrew Donnellan. 9273 9274- bpo-31163: pathlib.Path instance's rename and replace methods now return 9275 the new Path instance. 9276 9277- bpo-25068: :class:`urllib.request.ProxyHandler` now lowercases the keys of 9278 the passed dictionary. 9279 9280- bpo-26185: Fix :func:`repr` on empty :class:`ZipInfo` object. Patch by 9281 Mickaël Schoentgen. 9282 9283- bpo-21315: Email headers containing RFC2047 encoded words are parsed 9284 despite the missing whitespace, and a defect registered. Also missing 9285 trailing whitespace after encoded words is now registered as a defect. 9286 9287- bpo-31904: Port test_datetime to VxWorks: skip zoneinfo tests on VxWorks 9288 9289- bpo-35805: Add parser for Message-ID header and add it to default 9290 HeaderRegistry. This should prevent folding of Message-ID using RFC 2048 9291 encoded words. 9292 9293- bpo-36871: Ensure method signature is used instead of constructor 9294 signature of a class while asserting mock object against method calls. 9295 Patch by Karthikeyan Singaravelan. 9296 9297- bpo-35070: posix.getgrouplist() now works correctly when the user belongs 9298 to NGROUPS_MAX supplemental groups. Patch by Jeffrey Kintscher. 9299 9300- bpo-31783: Fix race condition in ThreadPoolExecutor when worker threads 9301 are created during interpreter shutdown. 9302 9303- bpo-36582: Fix ``UserString.encode()`` to correctly return ``bytes`` 9304 rather than a ``UserString`` instance. 9305 9306- bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of 9307 copy.copy(). 9308 9309 Patch by Gordon P. Hemsley 9310 9311- bpo-36564: Fix infinite loop in email header folding logic that would be 9312 triggered when an email policy's max_line_length is not long enough to 9313 include the required markup and any values in the message. Patch by Paul 9314 Ganssle 9315 9316- bpo-36543: Removed methods Element.getchildren(), Element.getiterator() 9317 and ElementTree.getiterator() and the xml.etree.cElementTree module. 9318 9319- bpo-36409: Remove the old plistlib API deprecated in Python 3.4 9320 9321- bpo-36302: distutils sorts source file lists so that Extension .so files 9322 build more reproducibly by default 9323 9324- bpo-36250: Ignore ``ValueError`` from ``signal`` with ``interaction`` in 9325 non-main thread. 9326 9327- bpo-36046: Added ``user``, ``group`` and ``extra_groups`` parameters to 9328 the subprocess.Popen constructor. Patch by Patrick McLean. 9329 9330- bpo-32627: Fix compile error when ``_uuid`` headers conflicting included. 9331 9332- bpo-35800: Deprecate ``smtpd.MailmanProxy`` ready for future removal. 9333 9334- bpo-35168: :attr:`shlex.shlex.punctuation_chars` is now a read-only 9335 property. 9336 9337- bpo-8538: Add support for boolean actions like ``--foo`` and ``--no-foo`` 9338 to argparse. Patch contributed by Rémi Lapeyre. 9339 9340- bpo-20504: Fixes a bug in :mod:`cgi` module when a multipart/form-data 9341 request has no `Content-Length` header. 9342 9343- bpo-25988: The abstract base classes in :mod:`collections.abc` no longer 9344 are exposed in the regular :mod:`collections` module. 9345 9346- bpo-11122: Distutils won't check for rpmbuild in specified paths only. 9347 9348- bpo-34775: Division handling of PurePath now returns NotImplemented 9349 instead of raising a TypeError when passed something other than an 9350 instance of str or PurePath. Patch by Roger Aiudi. 9351 9352- bpo-34749: :func:`binascii.a2b_base64` is now up to 2 times faster. Patch 9353 by Sergey Fedoseev. 9354 9355- bpo-34519: Add additional aliases for HP Roman 8. Patch by Michael Osipov. 9356 9357- bpo-28009: Fix uuid.getnode() on platforms with '.' as MAC Addr delimiter 9358 as well fix for MAC Addr format that omits a leading 0 in MAC Addr values. 9359 Currently, AIX is the only know platform with these settings. Patch by 9360 Michael Felt. 9361 9362- bpo-30618: Add :meth:`~pathlib.Path.readlink`. Patch by Girts Folkmanis. 9363 9364- bpo-32498: Made :func:`urllib.parse.unquote()` accept bytes in addition to 9365 strings. Patch by Stein Karlsen. 9366 9367- bpo-33348: lib2to3 now recognizes expressions after ``*`` and `**` like in 9368 ``f(*[] or [])``. 9369 9370- bpo-32689: Update :func:`shutil.move` function to allow for Path objects 9371 to be used as source argument. Patch by Emily Morehouse and Maxwell 9372 "5.13b" McKinnon. 9373 9374- bpo-32820: Added __format__ to IPv4 and IPv6 classes. Always outputs a 9375 fully zero- padded string. Supports b/x/n modifiers (bin/hex/native 9376 format). Native format for IPv4 is bin, native format for IPv6 is hex. 9377 Also supports '#' and '_' modifiers. 9378 9379- bpo-27657: Fix urllib.parse.urlparse() with numeric paths. A string like 9380 "path:80" is no longer parsed as a path but as a scheme ("path") and a 9381 path ("80"). 9382 9383- bpo-4963: Fixed non-deterministic behavior related to mimetypes extension 9384 mapping and module reinitialization. 9385 9386Documentation 9387------------- 9388 9389- bpo-21767: Explicitly mention abc support in functools.singledispatch 9390 9391- bpo-38816: Provides more details about the interaction between 9392 :c:func:`fork` and CPython's runtime, focusing just on the C-API. This 9393 includes cautions about where :c:func:`fork` should and shouldn't be 9394 called. 9395 9396- bpo-38351: Modernize :mod:`email` examples from %-formatting to f-strings. 9397 9398- bpo-38778: Document the fact that :exc:`RuntimeError` is raised if 9399 :meth:`os.fork` is called in a subinterpreter. 9400 9401- bpo-38592: Add Brazilian Portuguese to the language switcher at Python 9402 Documentation website. 9403 9404- bpo-38294: Add list of no-longer-escaped chars to re.escape documentation 9405 9406- bpo-38053: Modernized the plistlib documentation 9407 9408- bpo-26868: Fix example usage of :c:func:`PyModule_AddObject` to properly 9409 handle errors. 9410 9411- bpo-36797: Fix a dead link in the distutils API Reference. 9412 9413- bpo-37977: Warn more strongly and clearly about pickle insecurity 9414 9415- bpo-37979: Added a link to dateutil.parser.isoparse in the 9416 datetime.fromisoformat documentation. Patch by Paul Ganssle 9417 9418- bpo-12707: Deprecate info(), geturl(), getcode() methods in favor of the 9419 headers, url, and status properties, respectively, for HTTPResponse and 9420 addinfourl. Also deprecate the code attribute of addinfourl in favor of 9421 the status attribute. Patch by Ashwin Ramaswami 9422 9423- bpo-37937: Mention ``frame.f_trace`` in :func:`sys.settrace` docs. 9424 9425- bpo-37878: Make :c:func:`PyThreadState_DeleteCurrent` Internal. 9426 9427- bpo-37759: Beginning edits to Whatsnew 3.8 9428 9429- bpo-37726: Stop recommending getopt in the tutorial for command line 9430 argument parsing and promote argparse. 9431 9432- bpo-32910: Remove implementation-specific behaviour of how venv's 9433 Deactivate works. 9434 9435- bpo-37256: Fix wording of arguments for :class:`Request` in 9436 :mod:`urllib.request` 9437 9438- bpo-37284: Add a brief note to indicate that any new 9439 ``sys.implementation`` required attributes must go through the PEP 9440 process. 9441 9442- bpo-30088: Documented that :class:`mailbox.Maildir` constructor doesn't 9443 attempt to verify the maildir folder layout correctness. Patch by 9444 Sviatoslav Sydorenko. 9445 9446- bpo-37521: Fix `importlib` examples to insert any newly created modules 9447 via importlib.util.module_from_spec() immediately into sys.modules instead 9448 of after calling loader.exec_module(). 9449 9450 Thanks to Benjamin Mintz for finding the bug. 9451 9452- bpo-37456: Slash ('/') is now part of syntax. 9453 9454- bpo-37487: Fix PyList_GetItem index description to include 0. 9455 9456- bpo-37149: Replace the dead link to the Tkinter 8.5 reference by John 9457 Shipman, New Mexico Tech, with a link to the archive.org copy. 9458 9459- bpo-37478: Added possible exceptions to the description of os.chdir(). 9460 9461- bpo-34903: Documented that in :meth:`datetime.datetime.strptime()`, the 9462 leading zero in some two-digit formats is optional. Patch by Mike Gleen. 9463 9464- bpo-36260: Add decompression pitfalls to zipfile module documentation. 9465 9466- bpo-37004: In the documentation for difflib, a note was added explicitly 9467 warning that the results of SequenceMatcher's ratio method may depend on 9468 the order of the input strings. 9469 9470- bpo-36960: Restructured the :mod:`datetime` docs in the interest of making 9471 them more user-friendly and improving readability. Patch by Brad Solomon. 9472 9473- bpo-36487: Make C-API docs clear about what the "main" interpreter is. 9474 9475- bpo-23460: The documentation for decimal string formatting using the `:g` 9476 specifier has been updated to reflect the correct exponential notation 9477 cutoff point. Original patch contributed by Tuomas Suutari. 9478 9479- bpo-35803: Document and test that ``tempfile`` functions may accept a 9480 :term:`path-like object` for the ``dir`` argument. Patch by Anthony 9481 Sottile. 9482 9483- bpo-33944: Added a note about the intended use of code in .pth files. 9484 9485- bpo-34293: Fix the Doc/Makefile regarding PAPER environment variable and 9486 PDF builds 9487 9488- bpo-25237: Add documentation for tkinter modules 9489 9490Tests 9491----- 9492 9493- bpo-38614: Fix test_communicate() of test_asyncio.test_subprocess: use 9494 ``support.LONG_TIMEOUT`` (5 minutes), instead of just 1 minute. 9495 9496- bpo-38614: Add timeout constants to :mod:`test.support`: 9497 :data:`~test.support.LOOPBACK_TIMEOUT`, 9498 :data:`~test.support.INTERNET_TIMEOUT`, 9499 :data:`~test.support.SHORT_TIMEOUT` and 9500 :data:`~test.support.LONG_TIMEOUT`. 9501 9502- bpo-38502: test.regrtest now uses process groups in the multiprocessing 9503 mode (-jN command line option) if process groups are available: if 9504 :func:`os.setsid` and :func:`os.killpg` functions are available. 9505 9506- bpo-35998: Fix a race condition in test_asyncio.test_start_tls_server_1(). 9507 Previously, there was a race condition between the test main() function 9508 which replaces the protocol and the test ServerProto protocol which sends 9509 ANSWER once it gets HELLO. Now, only the test main() function is 9510 responsible to send data, ServerProto no longer sends data. 9511 9512- bpo-38470: Fix ``test_compileall.test_compile_dir_maxlevels()`` on Windows 9513 without long path support: only create 3 subdirectories instead of between 9514 20 and 100 subdirectories. 9515 9516- bpo-37531: On timeout, regrtest no longer attempts to call 9517 ``popen.communicate()`` again: it can hang until all child processes using 9518 stdout and stderr pipes completes. Kill the worker process and ignores its 9519 output. Change also the faulthandler timeout of the main process from 1 9520 minute to 5 minutes, for Python slowest buildbots. 9521 9522- bpo-38239: Fix test_gdb for Link Time Optimization (LTO) builds. 9523 9524- bpo-38275: test_ssl now handles disabled TLS/SSL versions better. 9525 OpenSSL's crypto policy and run-time settings are recognized and tests for 9526 disabled versions are skipped. Tests also accept more TLS minimum_versions 9527 for platforms that override OpenSSL's default with strict settings. 9528 9529- bpo-38271: The private keys for test_ssl were encrypted with 3DES in 9530 traditional PKCS#5 format. 3DES and the digest algorithm of PKCS#5 are 9531 blocked by some strict crypto policies. Use PKCS#8 format with AES256 9532 encryption instead. 9533 9534- bpo-38270: test.support now has a helper function to check for 9535 availability of a hash digest function. Several tests are refactored avoid 9536 MD5 and use SHA256 instead. Other tests are marked to use MD5 and skipped 9537 when MD5 is disabled. 9538 9539- bpo-37123: Multiprocessing test test_mymanager() now also expects 9540 -SIGTERM, not only exitcode 0. BaseManager._finalize_manager() sends 9541 SIGTERM to the manager process if it takes longer than 1 second to stop, 9542 which happens on slow buildbots. 9543 9544- bpo-38212: Multiprocessing tests: increase 9545 test_queue_feeder_donot_stop_onexc() timeout from 1 to 60 seconds. 9546 9547- bpo-38117: Test with OpenSSL 1.1.1d 9548 9549- bpo-38018: Increase code coverage for multiprocessing.shared_memory. 9550 9551- bpo-37805: Add tests for json.dump(..., skipkeys=True). Patch by Dong-hee 9552 Na. 9553 9554- bpo-37531: Enhance regrtest multiprocess timeout: write a message when 9555 killing a worker process, catch popen.kill() and popen.wait() exceptions, 9556 put a timeout on the second call to popen.communicate(). 9557 9558- bpo-37876: Add tests for ROT-13 codec. 9559 9560- bpo-36833: Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of 9561 the :mod:`datetime` module. Patch by Joannah Nanjekye. 9562 9563- bpo-37558: Fix test_shared_memory_cleaned_after_process_termination name 9564 handling 9565 9566- bpo-37526: Add :func:`test.support.catch_threading_exception`: context 9567 manager catching :class:`threading.Thread` exception using 9568 :func:`threading.excepthook`. 9569 9570- bpo-37421: test_concurrent_futures now explicitly stops the ForkServer 9571 instance if it's running. 9572 9573- bpo-37421: multiprocessing tests now stop the ForkServer instance if it's 9574 running: close the "alive" file descriptor to ask the server to stop and 9575 then remove its UNIX address. 9576 9577- bpo-37421: test_distutils.test_build_ext() is now able to remove the 9578 temporary directory on Windows: don't import the newly built C extension 9579 ("xx") in the current process, but test it in a separated process. 9580 9581- bpo-37421: test_concurrent_futures now cleans up multiprocessing to remove 9582 immediately temporary directories created by 9583 multiprocessing.util.get_temp_dir(). 9584 9585- bpo-37421: test_winconsoleio doesn't leak a temporary file anymore: use 9586 tempfile.TemporaryFile() to remove it when the test completes. 9587 9588- bpo-37421: multiprocessing tests now explicitly call ``_run_finalizers()`` 9589 to immediately remove temporary directories created by tests. 9590 9591- bpo-37421: urllib.request tests now call 9592 :func:`~urllib.request.urlcleanup` to remove temporary files created by 9593 ``urlretrieve()`` tests and to clear the ``_opener`` global variable set 9594 by ``urlopen()`` and functions calling indirectly ``urlopen()``. 9595 9596- bpo-37472: Remove ``Lib/test/outstanding_bugs.py``. 9597 9598- bpo-37199: Fix test failures when IPv6 is unavailable or disabled. 9599 9600- bpo-19696: Replace deprecated method "random.choose" with "random.choice" 9601 in "test_pkg_import.py". 9602 9603- bpo-37335: Remove no longer necessary code from c locale coercion tests 9604 9605- bpo-37421: Fix test_shutil to no longer leak temporary files. 9606 9607- bpo-37411: Fix test_wsgiref.testEnviron() to no longer depend on the 9608 environment variables (don't fail if "X" variable is set). 9609 9610- bpo-37400: Fix test_os.test_chown(): use os.getgroups() rather than 9611 grp.getgrall() to get groups. Rename also the test to test_chown_gid(). 9612 9613- bpo-37359: Add --cleanup option to python3 -m test to remove 9614 ``test_python_*`` directories of previous failed jobs. Add "make 9615 cleantest" to run ``python3 -m test --cleanup``. 9616 9617- bpo-37362: test_gdb no longer fails if it gets an "unexpected" message on 9618 stderr: it now ignores stderr. The purpose of test_gdb is to test that 9619 python-gdb.py commands work as expected, not to test gdb. 9620 9621- bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() 9622 9623- bpo-37278: Fix test_asyncio ProactorLoopCtrlC: join the thread to prevent 9624 leaking a running thread and leaking a reference. 9625 9626- bpo-37261: Fix :func:`test.support.catch_unraisable_exception`: its 9627 __exit__() method now ignores unraisable exception raised when clearing 9628 its ``unraisable`` attribute. 9629 9630- bpo-37069: regrtest now uses :func:`sys.unraisablehook` to mark a test as 9631 "environment altered" (ENV_CHANGED) if it emits an "unraisable exception". 9632 Moreover, regrtest logs a warning in this case. 9633 9634 Use ``python3 -m test --fail-env-changed`` to catch unraisable exceptions 9635 in tests. 9636 9637- bpo-37252: Fix assertions in ``test_close`` and 9638 ``test_events_mask_overflow`` devpoll tests. 9639 9640- bpo-37169: Rewrite ``_PyObject_IsFreed()`` unit tests. 9641 9642- bpo-37153: ``test_venv.test_multiprocessing()`` now explicitly calls 9643 ``pool.terminate()`` to wait until the pool completes. 9644 9645- bpo-34001: Make test_ssl pass with LibreSSL. LibreSSL handles minimum and 9646 maximum TLS version differently than OpenSSL. 9647 9648- bpo-36919: Make ``test_source_encoding.test_issue2301`` implementation 9649 independent. The test will work now for both CPython and IronPython. 9650 9651- bpo-30202: Update ``test.test_importlib.test_abc`` to test 9652 ``find_spec()``. 9653 9654- bpo-28009: Modify the test_uuid logic to test when a program is available 9655 AND can be used to obtain a MACADDR as basis for an UUID. Patch by M. Felt 9656 9657- bpo-34596: Fallback to a default reason when :func:`unittest.skip` is 9658 uncalled. Patch by Naitree Zhu. 9659 9660Build 9661----- 9662 9663- bpo-38809: On Windows, build scripts will now recognize and use python.exe 9664 from an active virtual env. 9665 9666- bpo-38684: Fix _hashlib build when Blake2 is disabled, but OpenSSL 9667 supports it. 9668 9669- bpo-38468: Misc/python-config.in now uses `getvar()` for all still 9670 existing `sysconfig.get_config_var()` calls. Patch by Joannah Nanjekye. 9671 9672- bpo-37415: Fix stdatomic.h header check for ICC compiler: the ICC 9673 implementation lacks atomic_uintptr_t type which is needed by Python. 9674 9675- bpo-38301: In Solaris family, we must be sure to use ``-D_REENTRANT``. 9676 Patch by Jesús Cea Avión. 9677 9678- bpo-36002: Locate ``llvm-profdata`` and ``llvm-ar`` binaries using 9679 ``AC_PATH_TOOL`` rather than ``AC_PATH_TARGET_TOOL``. 9680 9681- bpo-37936: The :file:`.gitignore` file systematically keeps "rooted", with 9682 a non-trailing slash, all the rules that are meant to apply to files in a 9683 specific place in the repo. Previously, when the intended file to ignore 9684 happened to be at the root of the repo, we'd most often accidentally also 9685 ignore files and directories with the same name anywhere in the tree. 9686 9687- bpo-37760: The :file:`Tools/unicode/makeunicodedata.py` script, which is 9688 used for converting information from the Unicode Character Database into 9689 generated code and data used by the methods of :class:`str` and by the 9690 :mod:`unicodedata` module, now handles each character's data as a 9691 ``dataclass`` with named attributes, rather than a length-18 list of 9692 different fields. 9693 9694- bpo-37936: The :file:`.gitignore` file no longer applies to any files that 9695 are in fact tracked in the Git repository. Patch by Greg Price. 9696 9697- bpo-37725: Change "clean" makefile target to also clean the program guided 9698 optimization (PGO) data. Previously you would have to use "make clean" 9699 and "make profile-removal", or "make clobber". 9700 9701- bpo-37707: Mark some individual tests to skip when --pgo is used. The 9702 tests marked increase the PGO task time significantly and likely don't 9703 help improve optimization of the final executable. 9704 9705- bpo-36044: Reduce the number of unit tests run for the PGO generation 9706 task. This speeds up the task by a factor of about 15x. Running the full 9707 unit test suite is slow. This change may result in a slightly less 9708 optimized build since not as many code branches will be executed. If you 9709 are willing to wait for the much slower build, the old behavior can be 9710 restored using './configure [..] PROFILE_TASK="-m test --pgo-extended"'. 9711 We make no guarantees as to which PGO task set produces a faster build. 9712 Users who care should run their own relevant benchmarks as results can 9713 depend on the environment, workload, and compiler tool chain. 9714 9715- bpo-37468: ``make install`` no longer installs ``wininst-*.exe`` files 9716 used by distutils bdist_wininst: bdist_wininst only works on Windows. 9717 9718- bpo-37189: Many ``PyRun_XXX()`` functions like :c:func:`PyRun_String` were 9719 no longer exported in ``libpython38.dll`` by mistake. Export them again to 9720 fix the ABI compatibility. 9721 9722- bpo-25361: Enables use of SSE2 instructions in Windows 32-bit build. 9723 9724- bpo-36210: Update optional extension module detection for AIX. ossaudiodev 9725 and spwd are not applicable for AIX, and are no longer reported as 9726 missing. 3rd-party packaging of ncurses (with ASIS support) conflicts with 9727 officially supported AIX curses library, so configure AIX to use 9728 libcurses.a. However, skip trying to build _curses_panel. 9729 9730 patch by M Felt 9731 9732Windows 9733------- 9734 9735- bpo-38589: Fixes HTML Help shortcut when Windows is not installed to C 9736 drive 9737 9738- bpo-38453: Ensure ntpath.realpath() correctly resolves relative paths. 9739 9740- bpo-38519: Restores the internal C headers that were missing from the 9741 nuget.org and Microsoft Store packages. 9742 9743- bpo-38492: Remove ``pythonw.exe`` dependency on the Microsoft C++ runtime. 9744 9745- bpo-38344: Fix error message in activate.bat 9746 9747- bpo-38359: Ensures ``pyw.exe`` launcher reads correct registry key. 9748 9749- bpo-38355: Fixes ``ntpath.realpath`` failing on ``sys.executable``. 9750 9751- bpo-38117: Update bundled OpenSSL to 1.1.1d 9752 9753- bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual 9754 environment. 9755 9756- bpo-38133: Allow py.exe launcher to locate installations from the 9757 Microsoft Store and improve display of active virtual environments. 9758 9759- bpo-38114: The ``pip.ini`` is no longer included in the Nuget package. 9760 9761- bpo-32592: Set Windows 8 as the minimum required version for API support 9762 9763- bpo-36634: :func:`os.cpu_count` now returns active processors rather than 9764 maximum processors. 9765 9766- bpo-36634: venv activate.bat now works when the existing variables contain 9767 double quote characters. 9768 9769- bpo-38081: Prevent error calling :func:`os.path.realpath` on ``'NUL'``. 9770 9771- bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath. 9772 9773- bpo-38088: Fixes distutils not finding vcruntime140.dll with only the v142 9774 toolset installed. 9775 9776- bpo-37283: Ensure command-line and unattend.xml setting override 9777 previously detected states in Windows installer. 9778 9779- bpo-38030: Fixes :func:`os.stat` failing for block devices on Windows 9780 9781- bpo-38020: Fixes potential crash when calling :func:`os.readlink` (or 9782 indirectly through :func:`~os.path.realpath`) on a file that is not a 9783 supported link. 9784 9785- bpo-37705: Improve the implementation of ``winerror_to_errno()``. 9786 9787- bpo-37549: :func:`os.dup` no longer fails for standard streams on Windows 9788 7. 9789 9790- bpo-1311: The ``nul`` file on Windows now returns True from 9791 :func:`~os.path.exists` and a valid result from :func:`os.stat` with 9792 ``S_IFCHR`` set. 9793 9794- bpo-9949: Enable support for following symlinks in :func:`os.realpath`. 9795 9796- bpo-37834: Treat all name surrogate reparse points on Windows in 9797 :func:`os.lstat` and other reparse points as regular files in 9798 :func:`os.stat`. 9799 9800- bpo-36266: Add the module name in the formatted error message when DLL 9801 load fail happens during module import in 9802 ``_PyImport_FindSharedFuncptrWindows()``. Patch by Srinivas Nyayapati. 9803 9804- bpo-25172: Trying to import the :mod:`crypt` module on Windows will result 9805 in an :exc:`ImportError` with a message explaining that the module isn't 9806 supported on Windows. On other platforms, if the underlying ``_crypt`` 9807 module is not available, the ImportError will include a message explaining 9808 the problem. 9809 9810- bpo-37778: Fixes the icons used for file associations to the Microsoft 9811 Store package. 9812 9813- bpo-37734: Fix use of registry values to launch Python from Microsoft 9814 Store app. 9815 9816- bpo-37702: Fix memory leak on Windows in creating an SSLContext object or 9817 running urllib.request.urlopen('https://...'). 9818 9819- bpo-37672: Switch Windows Store package's pip to use bundled 9820 :file:`pip.ini` instead of :envvar:`PIP_USER` variable. 9821 9822- bpo-10945: Officially drop support for creating bdist_wininst installers 9823 on non-Windows systems. 9824 9825- bpo-37445: Include the ``FORMAT_MESSAGE_IGNORE_INSERTS`` flag in 9826 ``FormatMessageW()`` calls. 9827 9828- bpo-37369: Fixes path for :data:`sys.executable` when running from the 9829 Microsoft Store. 9830 9831- bpo-37380: Don't collect unfinished processes with ``subprocess._active`` 9832 on Windows to cleanup later. Patch by Ruslan Kuprieiev. 9833 9834- bpo-37351: Removes libpython38.a from standard Windows distribution. 9835 9836- bpo-35360: Update Windows builds to use SQLite 3.28.0. 9837 9838- bpo-37267: On Windows, :func:`os.dup` no longer creates an inheritable fd 9839 when handling a character file. 9840 9841- bpo-36779: Ensure ``time.tzname`` is correct on Windows when the active 9842 code page is set to CP_UTF7 or CP_UTF8. 9843 9844- bpo-32587: Make :data:`winreg.REG_MULTI_SZ` support zero-length strings. 9845 9846- bpo-28269: Replace use of :c:func:`strcasecmp` for the system function 9847 :c:func:`_stricmp`. Patch by Minmin Gong. 9848 9849- bpo-36590: Add native Bluetooth RFCOMM support to socket module. 9850 9851macOS 9852----- 9853 9854- bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. 9855 9856- bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests 9857 optional 9858 9859- bpo-18049: Increase the default stack size of threads from 5MB to 16MB on 9860 macOS, to match the stack size of the main thread. This avoids crashes on 9861 deep recursion in threads. 9862 9863- bpo-34602: Avoid test suite failures on macOS by no longer calling 9864 resource.setrlimit to increase the process stack size limit at runtime. 9865 The runtime change is no longer needed since the interpreter is being 9866 built with a larger default stack size. 9867 9868- bpo-35360: Update macOS installer to use SQLite 3.28.0. 9869 9870- bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer. 9871 9872IDLE 9873---- 9874 9875- bpo-26353: Stop adding newline when saving an IDLE shell window. 9876 9877- bpo-4630: Add an option to toggle IDLE's cursor blink for shell, editor, 9878 and output windows. See Settings, General, Window Preferences, Cursor 9879 Blink. Patch by Zackery Spytz. 9880 9881- bpo-38598: Do not try to compile IDLE shell or output windows 9882 9883- bpo-36698: IDLE no longer fails when write non-encodable characters to 9884 stderr. It now escapes them with a backslash, as the regular Python 9885 interpreter. Added the ``errors`` field to the standard streams. 9886 9887- bpo-35379: When exiting IDLE, catch any AttributeError. One happens when 9888 EditorWindow.close is called twice. Printing a traceback, when IDLE is 9889 run from a terminal, is useless and annoying. 9890 9891- bpo-38183: To avoid problems, test_idle ignores the user config directory. 9892 It no longer tries to create or access .idlerc or any files within. Users 9893 must run IDLE to discover problems with saving settings. 9894 9895- bpo-38077: IDLE no longer adds 'argv' to the user namespace when 9896 initializing it. This bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4. 9897 9898- bpo-38041: Shell restart lines now fill the window width, always start 9899 with '=', and avoid wrapping unnecessarily. The line will still wrap if 9900 the included file name is long relative to the width. 9901 9902- bpo-35771: To avoid occasional spurious test_idle failures on slower 9903 machines, increase the ``hover_delay`` in test_tooltip. 9904 9905- bpo-37824: Properly handle user input warnings in IDLE shell. Cease 9906 turning SyntaxWarnings into SyntaxErrors. 9907 9908- bpo-37929: IDLE Settings dialog now closes properly when there is no shell 9909 window. 9910 9911- bpo-37902: Add mousewheel scrolling for IDLE module, path, and stack 9912 browsers. Patch by George Zhang. 9913 9914- bpo-37849: Fixed completions list appearing too high or low when shown 9915 above the current line. 9916 9917- bpo-36419: Refactor IDLE autocomplete and improve testing. 9918 9919- bpo-37748: Reorder the Run menu. Put the most common choice, Run Module, 9920 at the top. 9921 9922- bpo-37692: Improve highlight config sample with example shell interaction 9923 and better labels for shell elements. 9924 9925- bpo-37628: Settings dialog no longer expands with font size. 9926 9927- bpo-37627: Initialize the Customize Run dialog with the command line 9928 arguments most recently entered before. The user can optionally edit 9929 before submitting them. 9930 9931- bpo-33610: Fix code context not showing the correct context when first 9932 toggled on. 9933 9934- bpo-37530: Optimize code context to reduce unneeded background activity. 9935 Font and highlight changes now occur along with text changes instead of 9936 after a random delay. 9937 9938- bpo-27452: Cleanup ``config.py`` by inlining ``RemoveFile`` and 9939 simplifying the handling of ``file`` in ``CreateConfigHandlers``. 9940 9941- bpo-37325: Fix tab focus traversal order for help source and custom run 9942 dialogs. 9943 9944- bpo-37321: Both subprocess connection error messages now refer to the 9945 'Startup failure' section of the IDLE doc. 9946 9947- bpo-17535: Add optional line numbers for IDLE editor windows. Windows 9948 open without line numbers unless set otherwise in the General tab of the 9949 configuration dialog. 9950 9951- bpo-26806: To compensate for stack frames added by IDLE and avoid possible 9952 problems with low recursion limits, add 30 to limits in the user code 9953 execution process. Subtract 30 when reporting recursion limits to make 9954 this addition mostly transparent. 9955 9956- bpo-37177: Properly 'attach' search dialogs to their main window so that 9957 they behave like other dialogs and do not get hidden behind their main 9958 window. 9959 9960- bpo-37039: Adjust "Zoom Height" to individual screens by momentarily 9961 maximizing the window on first use with a particular screen. Changing 9962 screen settings may invalidate the saved height. While a window is 9963 maximized, "Zoom Height" has no effect. 9964 9965- bpo-35763: Make calltip reminder about '/' meaning positional-only less 9966 obtrusive by only adding it when there is room on the first line. 9967 9968- bpo-5680: Add 'Run... Customized' to the Run menu to run a module with 9969 customized settings. Any 'command line arguments' entered are added to 9970 sys.argv. One can suppress the normal Shell main module restart. 9971 9972- bpo-36390: Gather Format menu functions into format.py. Combine 9973 paragraph.py, rstrip.py, and format methods from editor.py. 9974 9975Tools/Demos 9976----------- 9977 9978- bpo-38118: Update Valgrind suppression file to ignore a false alarm in 9979 :c:func:`PyUnicode_Decode` when using GCC builtin strcmp(). 9980 9981- bpo-38347: pathfix.py: Assume all files that end on '.py' are Python 9982 scripts when working recursively. 9983 9984- bpo-37803: pdb's ``--help`` and ``--version`` long options now work. 9985 9986- bpo-37942: Improve ArgumentClinic converter for floats. 9987 9988- bpo-37704: Remove ``Tools/scripts/h2py.py``: use cffi to access a C API in 9989 Python. 9990 9991- bpo-37675: 2to3 now works when run from a zipped standard library. 9992 9993- bpo-37034: Argument Clinic now uses the argument name on errors with 9994 keyword-only argument instead of their position. Patch contributed by Rémi 9995 Lapeyre. 9996 9997- bpo-37064: Add option -k to pathscript.py script: preserve shebang flags. 9998 Add option -a to pathscript.py script: add flags. 9999 10000C API 10001----- 10002 10003- bpo-37633: Re-export some function compatibility wrappers for macros in 10004 ``pythonrun.h``. 10005 10006- bpo-38644: Provide :c:func:`Py_EnterRecursiveCall` and 10007 :c:func:`Py_LeaveRecursiveCall` as regular functions for the limited API. 10008 Previously, there were defined as macros, but these macros didn't work 10009 with the limited API which cannot access ``PyThreadState.recursion_depth`` 10010 field. Remove ``_Py_CheckRecursionLimit`` from the stable ABI. 10011 10012- bpo-38650: The global variable :c:data:`PyStructSequence_UnnamedField` is 10013 now a constant and refers to a constant string. 10014 10015- bpo-38540: Fixed possible leak in :c:func:`PyArg_Parse` and similar 10016 functions for format units ``"es#"`` and ``"et#"`` when the macro 10017 :c:macro:`PY_SSIZE_T_CLEAN` is not defined. 10018 10019- bpo-38395: Fix a crash in :class:`weakref.proxy` objects due to incorrect 10020 lifetime management when calling some associated methods that may delete 10021 the last reference to object being referenced by the proxy. Patch by Pablo 10022 Galindo. 10023 10024- bpo-36389: The ``_PyObject_CheckConsistency()`` function is now also 10025 available in release mode. For example, it can be used to debug a crash in 10026 the ``visit_decref()`` function of the GC. 10027 10028- bpo-38266: Revert the removal of PyThreadState_DeleteCurrent() with 10029 documentation. 10030 10031- bpo-38303: Update audioop extension module to use the stable ABI 10032 (PEP-384). Patch by Tyler Kieft. 10033 10034- bpo-38234: :c:func:`Py_SetPath` now sets :data:`sys.executable` to the 10035 program full path (:c:func:`Py_GetProgramFullPath`) rather than to the 10036 program name (:c:func:`Py_GetProgramName`). 10037 10038- bpo-38234: Python ignored arguments passed to :c:func:`Py_SetPath`, 10039 :c:func:`Py_SetPythonHome` and :c:func:`Py_SetProgramName`: fix Python 10040 initialization to use specified arguments. 10041 10042- bpo-38205: The :c:func:`Py_UNREACHABLE` macro now calls 10043 :c:func:`Py_FatalError`. 10044 10045- bpo-38140: Make dict and weakref offsets opaque for C heap types by 10046 passing the offsets through PyMemberDef 10047 10048- bpo-15088: The C function ``PyGen_NeedsFinalizing`` has been removed. It 10049 was not documented, tested or used anywhere within CPython after the 10050 implementation of :pep:`442`. Patch by Joannah Nanjekye. (Patch by Joannah 10051 Nanjekye) 10052 10053- bpo-36763: Options added by ``PySys_AddXOption()`` are now handled the 10054 same way than ``PyConfig.xoptions`` and command line ``-X`` options. 10055 10056- bpo-37926: Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``. 10057 10058- bpo-37879: Fix subtype_dealloc to suppress the type decref when the base 10059 type is a C heap type 10060 10061- bpo-37645: Add :c:func:`_PyObject_FunctionStr` to get a user-friendly 10062 string representation of a function-like object. Patch by Jeroen Demeyer. 10063 10064- bpo-29548: The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, 10065 ``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are 10066 deprecated. Use :c:func:`PyObject_Call` and its variants instead. 10067 10068- bpo-37151: ``PyCFunction_Call`` is now a deprecated alias of 10069 :c:func:`PyObject_Call`. 10070 10071- bpo-37540: The vectorcall protocol now requires that the caller passes 10072 only strings as keyword names. 10073 10074- bpo-37207: The vectorcall protocol is now enabled for ``type`` objects: 10075 set ``tp_vectorcall`` to a vectorcall function to be used instead of 10076 ``tp_new`` and ``tp_init`` when calling the class itself. 10077 10078- bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API. 10079 10080- bpo-37483: Add new function ``_PyObject_CallOneArg`` for calling an object 10081 with one positional argument. 10082 10083- bpo-36763: Add :func:`PyConfig_SetWideStringList` function. 10084 10085- bpo-37337: Add fast functions for calling methods: 10086 :c:func:`_PyObject_VectorcallMethod`, :c:func:`_PyObject_CallMethodNoArgs` 10087 and :c:func:`_PyObject_CallMethodOneArg`. 10088 10089- bpo-28805: The :const:`METH_FASTCALL` calling convention has been 10090 documented. 10091 10092- bpo-37221: The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to 10093 create code objects like :c:func:`PyCode_New`, but with an extra 10094 *posonlyargcount* parameter for indicating the number of positonal-only 10095 arguments. 10096 10097- bpo-37215: Fix dtrace issue introduce by bpo-36842 10098 10099- bpo-37194: Add a new public :c:func:`PyObject_CallNoArgs` function to the 10100 C API: call a callable Python object without any arguments. It is the most 10101 efficient way to call a callback without any argument. On x86-64, for 10102 example, ``PyObject_CallFunctionObjArgs(func, NULL)`` allocates 960 bytes 10103 on the stack per call, whereas ``PyObject_CallNoArgs(func)`` only 10104 allocates 624 bytes per call. 10105 10106- bpo-37170: Fix the cast on error in 10107 :c:func:`PyLong_AsUnsignedLongLongMask()`. 10108 10109- bpo-35381: Convert posixmodule.c statically allocated types 10110 ``DirEntryType`` and ``ScandirIteratorType`` to heap-allocated types. 10111 10112- bpo-34331: Use singular/plural noun in error message when instantiating an 10113 abstract class with non-overriden abstract method(s). 10114 10115 10116What's New in Python 3.8.0 beta 1? 10117================================== 10118 10119*Release date: 2019-06-04* 10120 10121Security 10122-------- 10123 10124- bpo-35907: CVE-2019-9948: Avoid file reading by disallowing 10125 ``local-file://`` and ``local_file://`` URL schemes in 10126 ``URLopener().open()`` and ``URLopener().retrieve()`` of 10127 :mod:`urllib.request`. 10128 10129- bpo-33529: Prevent fold function used in email header encoding from 10130 entering infinite loop when there are too many non-ASCII characters in a 10131 header. 10132 10133- bpo-33164: Updated blake2 implementation which uses secure memset 10134 implementation provided by platform. 10135 10136Core and Builtins 10137----------------- 10138 10139- bpo-35814: Allow unpacking in the right hand side of annotated 10140 assignments. In particular, ``t: Tuple[int, ...] = x, y, *z`` is now 10141 allowed. 10142 10143- bpo-37126: All structseq objects are now tracked by the garbage collector. 10144 Patch by Pablo Galindo. 10145 10146- bpo-37122: Make the *co_argcount* attribute of code objects represent the 10147 total number of positional arguments (including positional-only 10148 arguments). The value of *co_posonlyargcount* can be used to distinguish 10149 which arguments are positional only, and the difference (*co_argcount* - 10150 *co_posonlyargcount*) is the number of positional-or-keyword arguments. 10151 Patch by Pablo Galindo. 10152 10153- bpo-20092: Constructors of :class:`int`, :class:`float` and 10154 :class:`complex` will now use the :meth:`~object.__index__` special 10155 method, if available and the corresponding method :meth:`~object.__int__`, 10156 :meth:`~object.__float__` or :meth:`~object.__complex__` is not available. 10157 10158- bpo-37087: Add native thread ID (TID) support to OpenBSD. 10159 10160- bpo-26219: Implemented per opcode cache mechanism and ``LOAD_GLOBAL`` 10161 instruction use it. ``LOAD_GLOBAL`` is now about 40% faster. Contributed 10162 by Yury Selivanov, and Inada Naoki. 10163 10164- bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL. 10165 10166- bpo-37029: Freeing a great many small objects could take time quadratic in 10167 the number of arenas, due to using linear search to keep ``obmalloc.c``'s 10168 list of usable arenas sorted by order of number of free memory pools. 10169 This is accomplished without search now, leaving the worst-case time 10170 linear in the number of arenas. For programs where this quite visibly 10171 matters (typically with more than 100 thousand small objects alive 10172 simultaneously), this can greatly reduce the time needed to release their 10173 memory. 10174 10175- bpo-26423: Fix possible overflow in ``wrap_lenfunc()`` when ``sizeof(long) 10176 < sizeof(Py_ssize_t)`` (e.g., 64-bit Windows). 10177 10178- bpo-37050: Improve the AST for "debug" f-strings, which use '=' to print 10179 out the source of the expression being evaluated. Delete expr_text from 10180 the FormattedValue node, and instead use a Constant string node (possibly 10181 merged with adjacent constant expressions inside the f-string). 10182 10183- bpo-22385: The `bytes.hex`, `bytearray.hex`, and `memoryview.hex` methods 10184 as well as the `binascii.hexlify` and `b2a_hex` functions now have the 10185 ability to include an optional separator between hex bytes. This 10186 functionality was inspired by MicroPython's hexlify implementation. 10187 10188- bpo-26836: Add :func:`os.memfd_create`. 10189 10190- bpo-37032: Added new ``replace()`` method to the code type 10191 (:class:`types.CodeType`). 10192 10193- bpo-37007: Implement :func:`socket.if_nameindex()`, 10194 :func:`socket.if_nametoindex()`, and :func:`socket.if_indextoname()` on 10195 Windows. 10196 10197- bpo-36829: :c:func:`PyErr_WriteUnraisable` now creates a traceback object 10198 if there is no current traceback. Moreover, call 10199 :c:func:`PyErr_NormalizeException` and :c:func:`PyException_SetTraceback` 10200 to normalize the exception value. Ignore any error. 10201 10202- bpo-36878: Only accept text after `# type: ignore` if the first character 10203 is ASCII. This is to disallow things like `# type: ignoreé`. 10204 10205- bpo-36878: Store text appearing after a `# type: ignore` comment in the 10206 AST. For example a type ignore like `# type: ignore[E1000]` will have the 10207 string `"[E1000]"` stored in its AST node. 10208 10209- bpo-2180: Treat line continuation at EOF as a ``SyntaxError`` by Anthony 10210 Sottile. 10211 10212- bpo-36907: Fix a crash when calling a C function with a keyword dict 10213 (``f(**kwargs)``) and changing the dict ``kwargs`` while that function is 10214 running. 10215 10216- bpo-36946: Fix possible signed integer overflow when handling slices. 10217 10218- bpo-36826: Add NamedExpression kind support to ast_unparse.c 10219 10220- bpo-1875: A :exc:`SyntaxError` is now raised if a code blocks that will be 10221 optimized away (e.g. if conditions that are always false) contains syntax 10222 errors. Patch by Pablo Galindo. 10223 10224- bpo-36027: Allow computation of modular inverses via three-argument 10225 ``pow``: the second argument is now permitted to be negative in the case 10226 where the first and third arguments are relatively prime. 10227 10228- bpo-36861: Update the Unicode database to version 12.1.0. 10229 10230- bpo-28866: Avoid caching attributes of classes which type defines mro() to 10231 avoid a hard cache invalidation problem. 10232 10233- bpo-36851: The ``FrameType`` stack is now correctly cleaned up if the 10234 execution ends with a return and the stack is not empty. 10235 10236- bpo-34616: The ``compile()`` builtin functions now support the 10237 ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag, which allow to compile sources 10238 that contains top-level ``await``, ``async with`` or ``async for``. This 10239 is useful to evaluate async-code from with an already async functions; for 10240 example in a custom REPL. 10241 10242- bpo-36842: Implement PEP 578, adding sys.audit, io.open_code and related 10243 APIs. 10244 10245- bpo-27639: Correct return type for UserList slicing operations. Patch by 10246 Michael Blahay, Erick Cervantes, and vaultah 10247 10248- bpo-36737: Move PyRuntimeState.warnings into per-interpreter state (via 10249 "module state"). 10250 10251- bpo-36793: Removed ``__str__`` implementations from builtin types 10252 :class:`bool`, :class:`int`, :class:`float`, :class:`complex` and few 10253 classes from the standard library. They now inherit ``__str__()`` from 10254 :class:`object`. 10255 10256- bpo-36817: Add a ``=`` feature f-strings for debugging. This can precede 10257 ``!s``, ``!r``, or ``!a``. It produces the text of the expression, 10258 followed by an equal sign, followed by the repr of the value of the 10259 expression. So ``f'{3*9+15=}'`` would be equal to the string 10260 ``'3*9+15=42'``. If ``=`` is specified, the default conversion is set to 10261 ``!r``, unless a format spec is given, in which case the formatting 10262 behavior is unchanged, and __format__ will be used. 10263 10264- bpo-24048: Save the live exception during import.c's ``remove_module()``. 10265 10266- bpo-27987: pymalloc returns memory blocks aligned by 16 bytes, instead of 10267 8 bytes, on 64-bit platforms to conform x86-64 ABI. Recent compilers 10268 assume this alignment more often. Patch by Inada Naoki. 10269 10270- bpo-36601: A long-since-meaningless check for ``getpid() == main_pid`` was 10271 removed from Python's internal C signal handler. 10272 10273- bpo-36594: Fix incorrect use of ``%p`` in format strings. Patch by Zackery 10274 Spytz. 10275 10276- bpo-36045: builtins.help() now prefixes `async` for async functions 10277 10278- bpo-36084: Add native thread ID (TID) to threading.Thread objects 10279 (supported platforms: Windows, FreeBSD, Linux, macOS) 10280 10281- bpo-36035: Added fix for broken symlinks in combination with pathlib 10282 10283- bpo-35983: Added new trashcan macros to deal with a double deallocation 10284 that could occur when the `tp_dealloc` of a subclass calls the 10285 `tp_dealloc` of a base class and that base class uses the trashcan 10286 mechanism. Patch by Jeroen Demeyer. 10287 10288- bpo-20602: Do not clear :data:`sys.flags` and :data:`sys.float_info` 10289 during shutdown. Patch by Zackery Spytz. 10290 10291- bpo-26826: Expose :func:`copy_file_range` as a low level API in the 10292 :mod:`os` module. 10293 10294- bpo-32388: Remove cross-version binary compatibility requirement in 10295 tp_flags. 10296 10297- bpo-31862: Port binascii to PEP 489 multiphase initialization. Patch by 10298 Marcel Plch. 10299 10300Library 10301------- 10302 10303- bpo-37128: Added :func:`math.perm`. 10304 10305- bpo-37120: Add SSLContext.num_tickets to control the number of TLSv1.3 10306 session tickets. 10307 10308- bpo-12202: Fix the error handling in 10309 :meth:`msilib.SummaryInformation.GetProperty`. Patch by Zackery Spytz. 10310 10311- bpo-26835: The fcntl module now contains file sealing constants for 10312 sealing of memfds. 10313 10314- bpo-29262: Add ``get_origin()`` and ``get_args()`` introspection helpers 10315 to ``typing`` module. 10316 10317- bpo-12639: :meth:`msilib.Directory.start_component()` no longer fails if 10318 *keyfile* is not ``None``. 10319 10320- bpo-36999: Add the ``asyncio.Task.get_coro()`` method to publicly expose 10321 the tasks's coroutine object. 10322 10323- bpo-35246: Make :func:`asyncio.create_subprocess_exec` accept path-like 10324 arguments. 10325 10326- bpo-35279: Change default *max_workers* of ``ThreadPoolExecutor`` from 10327 ``cpu_count() * 5`` to ``min(32, cpu_count() + 4)``. Previous value was 10328 unreasonably large on many cores machines. 10329 10330- bpo-37076: :func:`_thread.start_new_thread` now logs uncaught exception 10331 raised by the function using :func:`sys.unraisablehook`, rather than 10332 :func:`sys.excepthook`, so the hook gets access to the function which 10333 raised the exception. 10334 10335- bpo-33725: On macOS, the :mod:`multiprocessing` module now uses *spawn* 10336 start method by default. 10337 10338- bpo-37054: Fix destructor :class:`_pyio.BytesIO` and 10339 :class:`_pyio.TextIOWrapper`: initialize their ``_buffer`` attribute as 10340 soon as possible (in the class body), because it's used by ``__del__()`` 10341 which calls ``close()``. 10342 10343- bpo-37058: PEP 544: Add ``Protocol`` and ``@runtime_checkable`` to the 10344 ``typing`` module. 10345 10346- bpo-36933: The functions ``sys.set_coroutine_wrapper`` and 10347 ``sys.get_coroutine_wrapper`` that were deprecated and marked for removal 10348 in 3.8 have been removed. 10349 10350- bpo-37047: Handle late binding and attribute access in 10351 :class:`unittest.mock.AsyncMock` setup for autospeccing. Document newly 10352 implemented async methods in :class:`unittest.mock.MagicMock`. 10353 10354- bpo-37049: PEP 589: Add ``TypedDict`` to the ``typing`` module. 10355 10356- bpo-37046: PEP 586: Add ``Literal`` to the ``typing`` module. 10357 10358- bpo-37045: PEP 591: Add ``Final`` qualifier and ``@final`` decorator to 10359 the ``typing`` module. 10360 10361- bpo-37035: Don't log OSError based exceptions if a fatal error has 10362 occurred in asyncio transport. Peer can generate almost any OSError, user 10363 cannot avoid these exceptions by fixing own code. Errors are still 10364 propagated to user code, it's just logging them is pointless and pollute 10365 asyncio logs. 10366 10367- bpo-37001: :func:`symtable.symtable` now accepts the same input types for 10368 source code as the built-in :func:`compile` function. Patch by Dino 10369 Viehland. 10370 10371- bpo-37028: Implement asyncio REPL 10372 10373- bpo-37027: Return safe to use proxy socket object from 10374 transport.get_extra_info('socket') 10375 10376- bpo-32528: Make asyncio.CancelledError a BaseException. 10377 10378 This will address the common mistake many asyncio users make: an "except 10379 Exception" clause breaking Tasks cancellation. 10380 10381 In addition to this change, we stop inheriting asyncio.TimeoutError and 10382 asyncio.InvalidStateError from their concurrent.futures.* counterparts. 10383 There's no point for these exceptions to share the inheritance chain. 10384 10385- bpo-1230540: Add a new :func:`threading.excepthook` function which handles 10386 uncaught :meth:`threading.Thread.run` exception. It can be overridden to 10387 control how uncaught :meth:`threading.Thread.run` exceptions are handled. 10388 10389- bpo-36996: Handle :func:`unittest.mock.patch` used as a decorator on async 10390 functions. 10391 10392- bpo-37008: Add support for calling :func:`next` with the mock resulting 10393 from :func:`unittest.mock.mock_open` 10394 10395- bpo-27737: Allow whitespace only header encoding in ``email.header`` - by 10396 Batuhan Taskaya 10397 10398- bpo-36969: PDB command `args` now display positional only arguments. 10399 Patch contributed by Rémi Lapeyre. 10400 10401- bpo-36969: PDB command `args` now display keyword only arguments. Patch 10402 contributed by Rémi Lapeyre. 10403 10404- bpo-36983: Add missing names to ``typing.__all__``: ``ChainMap``, 10405 ``ForwardRef``, ``OrderedDict`` - by Anthony Sottile. 10406 10407- bpo-36972: Add SupportsIndex protocol to the typing module to allow type 10408 checking to detect classes that can be passed to `hex()`, `oct()` and 10409 `bin()`. 10410 10411- bpo-32972: Implement ``unittest.IsolatedAsyncioTestCase`` to help testing 10412 asyncio-based code. 10413 10414- bpo-36952: :func:`fileinput.input` and :class:`fileinput.FileInput` 10415 **bufsize** argument has been removed (was deprecated and ignored since 10416 Python 3.6), and as a result the **mode** and **openhook** arguments have 10417 been made keyword-only. 10418 10419- bpo-36952: Starting with Python 3.3, importing ABCs from 10420 :mod:`collections` is deprecated, and import should be done from 10421 :mod:`collections.abc`. Still being able to import from :mod:`collections` 10422 was marked for removal in 3.8, but has been delayed to 3.9; documentation 10423 and ``DeprecationWarning`` clarified. 10424 10425- bpo-36949: Implement __repr__ for WeakSet objects. 10426 10427- bpo-36948: Fix :exc:`NameError` in 10428 :meth:`urllib.request.URLopener.retrieve`. Patch by Karthikeyan 10429 Singaravelan. 10430 10431- bpo-33524: Fix the folding of email header when the max_line_length is 0 10432 or None and the header contains non-ascii characters. Contributed by 10433 Licht Takeuchi (@Licht-T). 10434 10435- bpo-24564: :func:`shutil.copystat` now ignores :const:`errno.EINVAL` on 10436 :func:`os.setxattr` which may occur when copying files on filesystems 10437 without extended attributes support. 10438 10439 Original patch by Giampaolo Rodola, updated by Ying Wang. 10440 10441- bpo-36888: Python child processes can now access the status of their 10442 parent process using multiprocessing.process.parent_process 10443 10444- bpo-36921: Deprecate ``@coroutine`` for sake of ``async def``. 10445 10446- bpo-25652: Fix bug in ``__rmod__`` of ``UserString`` - by Batuhan Taskaya. 10447 10448- bpo-36916: Remove a message about an unhandled exception in a task when 10449 writer.write() is used without await and writer.drain() fails with an 10450 exception. 10451 10452- bpo-36889: Introduce :class:`asyncio.Stream` class that merges 10453 :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter` 10454 functionality. :class:`asyncio.Stream` can work in readonly, writeonly and 10455 readwrite modes. Provide :func:`asyncio.connect`, 10456 :func:`asyncio.connect_unix`, :func:`asyncio.connect_read_pipe` and 10457 :func:`asyncio.connect_write_pipe` factories to open 10458 :class:`asyncio.Stream` connections. Provide :class:`asyncio.StreamServer` 10459 and :class:`UnixStreamServer` to serve servers with asyncio.Stream API. 10460 Modify :func:`asyncio.create_subprocess_shell` and 10461 :func:`asyncio.create_subprocess_exec` to use :class:`asyncio.Stream` 10462 instead of deprecated :class:`StreamReader` and :class:`StreamWriter`. 10463 Deprecate :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter`. 10464 Deprecate usage of private classes, e.g. 10465 :class:`asyncio.FlowControlMixing` and 10466 :class:`asyncio.StreamReaderProtocol` outside of asyncio package. 10467 10468- bpo-36845: Added validation of integer prefixes to the construction of IP 10469 networks and interfaces in the ipaddress module. 10470 10471- bpo-23378: Add an extend action to argparser. 10472 10473- bpo-36867: Fix a bug making a SharedMemoryManager instance and its parent 10474 process use two separate resource_tracker processes. 10475 10476- bpo-23896: Adds a grammar to lib2to3.pygram that contains exec as a 10477 function not as statement. 10478 10479- bpo-36895: The function ``time.clock()`` was deprecated in 3.3 in favor of 10480 ``time.perf_counter()`` and marked for removal in 3.8, it has removed. 10481 10482- bpo-35545: Fix asyncio discarding IPv6 scopes when ensuring hostname 10483 resolutions internally 10484 10485- bpo-36887: Add new function :func:`math.isqrt` to compute integer square 10486 roots. 10487 10488- bpo-34632: Introduce the ``importlib.metadata`` module with (provisional) 10489 support for reading metadata from third-party packages. 10490 10491- bpo-36878: When using `type_comments=True` in `ast.parse`, treat `# type: 10492 ignore` followed by a non-alphanumeric character and then arbitrary text 10493 as a type ignore, instead of requiring nothing but whitespace or another 10494 comment. This is to permit formations such as `# type: ignore[E1000]`. 10495 10496- bpo-36778: ``cp65001`` encoding (Windows code page 65001) becomes an alias 10497 to ``utf_8`` encoding. 10498 10499- bpo-36867: The multiprocessing.resource_tracker replaces the 10500 multiprocessing.semaphore_tracker module. Other than semaphores, 10501 resource_tracker also tracks shared_memory segments. 10502 10503- bpo-30262: The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3` 10504 module are not exposed to the user. Patch by Aviv Palivoda. 10505 10506- bpo-24538: In `shutil.copystat()`, first copy extended file attributes and 10507 then file permissions, since extended attributes can only be set on the 10508 destination while it is still writeable. 10509 10510- bpo-36829: Add new :func:`sys.unraisablehook` function which can be 10511 overridden to control how "unraisable exceptions" are handled. It is 10512 called when an exception has occurred but there is no way for Python to 10513 handle it. For example, when a destructor raises an exception or during 10514 garbage collection (:func:`gc.collect`). 10515 10516- bpo-36832: Introducing ``zipfile.Path``, a pathlib-compatible wrapper for 10517 traversing zip files. 10518 10519- bpo-36814: Fix an issue where os.posix_spawnp() would incorrectly raise a 10520 TypeError when file_actions is None. 10521 10522- bpo-33110: Handle exceptions raised by functions added by 10523 concurrent.futures add_done_callback correctly when the Future has already 10524 completed. 10525 10526- bpo-26903: Limit `max_workers` in `ProcessPoolExecutor` to 61 to work 10527 around a WaitForMultipleObjects limitation. 10528 10529- bpo-36813: Fix :class:`~logging.handlers.QueueListener` to call 10530 ``queue.task_done()`` upon stopping. Patch by Bar Harel. 10531 10532- bpo-36806: Forbid creation of asyncio stream objects like StreamReader, 10533 StreamWriter, Process, and their protocols outside of asyncio package. 10534 10535- bpo-36802: Provide both sync and async calls for StreamWriter.write() and 10536 StreamWriter.close() 10537 10538- bpo-36801: Properly handle SSL connection closing in asyncio 10539 StreamWriter.drain() call. 10540 10541- bpo-36785: Implement PEP 574 (pickle protocol 5 with out-of-band buffers). 10542 10543- bpo-36772: functools.lru_cache() can now be used as a straight decorator 10544 in addition to its existing usage as a function that returns a decorator. 10545 10546- bpo-6584: Add a :exc:`~gzip.BadGzipFile` exception to the :mod:`gzip` 10547 module. 10548 10549- bpo-36748: Optimized write buffering in C implementation of 10550 ``TextIOWrapper``. Writing ASCII string to ``TextIOWrapper`` with ascii, 10551 latin1, or utf-8 encoding is about 20% faster. Patch by Inada Naoki. 10552 10553- bpo-8138: Don't mark ``wsgiref.simple_server.SimpleServer`` as 10554 multi-threaded since ``wsgiref.simple_server.WSGIServer`` is 10555 single-threaded. 10556 10557- bpo-22640: :func:`py_compile.compile` now supports silent mode. Patch by 10558 Joannah Nanjekye 10559 10560- bpo-29183: Fix double exceptions in :class:`wsgiref.handlers.BaseHandler` 10561 by calling its :meth:`~wsgiref.handlers.BaseHandler.close` method only 10562 when no exception is raised. 10563 10564- bpo-36548: Improved the repr of regular expression flags. 10565 10566- bpo-36542: The signature of Python functions can now be overridden by 10567 specifying the ``__text_signature__`` attribute. 10568 10569- bpo-36533: Reinitialize logging.Handler locks in forked child processes 10570 instead of attempting to acquire them all in the parent before forking 10571 only to be released in the child process. The acquire/release pattern was 10572 leading to deadlocks in code that has implemented any form of chained 10573 logging handlers that depend upon one another as the lock acquisition 10574 order cannot be guaranteed. 10575 10576- bpo-35252: Throw a TypeError instead of an AssertionError when using an 10577 invalid type annotation with singledispatch. 10578 10579- bpo-35900: Allow reduction methods to return a 6-item tuple where the 6th 10580 item specifies a custom state-setting method that's called instead of the 10581 regular ``__setstate__`` method. 10582 10583- bpo-35900: enable custom reduction callback registration for functions and 10584 classes in _pickle.c, using the new Pickler's attribute 10585 ``reducer_override`` 10586 10587- bpo-36368: Fix a bug crashing SharedMemoryManager instances in interactive 10588 sessions after a ctrl-c (KeyboardInterrupt) was sent 10589 10590- bpo-31904: Fix mmap fail for VxWorks 10591 10592- bpo-27497: :meth:`csv.DictWriter.writeheader` now returns the return value 10593 of the underlying :meth:`csv.Writer.writerow` method. Patch contributed by 10594 Ashish Nitin Patil. 10595 10596- bpo-36239: Parsing .mo files now ignores comments starting and ending with 10597 #-#-#-#-#. 10598 10599- bpo-26707: Enable plistlib to read and write binary plist files that were 10600 created as a KeyedArchive file. Specifically, this allows the plistlib to 10601 process 0x80 tokens as UID objects. 10602 10603- bpo-31904: Add posix module support for VxWorks. 10604 10605- bpo-35125: Asyncio: Remove inner callback on outer cancellation in shield 10606 10607- bpo-35721: Fix :meth:`asyncio.SelectorEventLoop.subprocess_exec()` leaks 10608 file descriptors if ``Popen`` fails and called with 10609 ``stdin=subprocess.PIPE``. Patch by Niklas Fiekas. 10610 10611- bpo-31855: :func:`unittest.mock.mock_open` results now respects the 10612 argument of read([size]). Patch contributed by Rémi Lapeyre. 10613 10614- bpo-35431: Implement :func:`math.comb` that returns binomial coefficient, 10615 that computes the number of ways to choose k items from n items without 10616 repetition and without order. Patch by Yash Aggarwal and Keller Fuchs. 10617 10618- bpo-26660: Fixed permission errors in 10619 :class:`~tempfile.TemporaryDirectory` clean up. Previously 10620 ``TemporaryDirectory.cleanup()`` failed when non-writeable or 10621 non-searchable files or directories were created inside a temporary 10622 directory. 10623 10624- bpo-34271: Add debugging helpers to ssl module. It's now possible to dump 10625 key material and to trace TLS protocol. The default and stdlib contexts 10626 also support SSLKEYLOGFILE env var. 10627 10628- bpo-26467: Added AsyncMock to support using unittest to mock asyncio 10629 coroutines. Patch by Lisa Roach. 10630 10631- bpo-33569: dataclasses.InitVar: Exposes the type used to create the init 10632 var. 10633 10634- bpo-34424: Fix serialization of messages containing encoded strings when 10635 the policy.linesep is set to a multi-character string. Patch by Jens 10636 Troeger. 10637 10638- bpo-34303: Performance of :func:`functools.reduce` is slightly improved. 10639 Patch by Sergey Fedoseev. 10640 10641- bpo-33361: Fix a bug in :class:`codecs.StreamRecoder` where seeking might 10642 leave old data in a buffer and break subsequent read calls. Patch by Ammar 10643 Askar. 10644 10645- bpo-22454: The :mod:`shlex` module now exposes :func:`shlex.join`, the 10646 inverse of :func:`shlex.split`. Patch by Bo Bayles. 10647 10648- bpo-31922: :meth:`asyncio.AbstractEventLoop.create_datagram_endpoint`: Do 10649 not connect UDP socket when broadcast is allowed. This allows to receive 10650 replies after a UDP broadcast. 10651 10652- bpo-24882: Change ThreadPoolExecutor to use existing idle threads before 10653 spinning up new ones. 10654 10655- bpo-31961: Added support for bytes and path-like objects in 10656 :func:`subprocess.Popen` on Windows. The *args* parameter now accepts a 10657 :term:`path-like object` if *shell* is ``False`` and a sequence containing 10658 bytes and path-like objects. The *executable* parameter now accepts a 10659 bytes and :term:`path-like object`. The *cwd* parameter now accepts a 10660 bytes object. Based on patch by Anders Lorentsen. 10661 10662- bpo-33123: :class:`pathlib.Path.unlink` now accepts a *missing_ok* 10663 parameter to avoid a :exc:`FileNotFoundError` from being raised. Patch by 10664 Robert Buchholz. 10665 10666- bpo-32941: Allow :class:`mmap.mmap` objects to access the madvise() system 10667 call (through :meth:`mmap.mmap.madvise`). 10668 10669- bpo-22102: Added support for ZIP files with disks set to 0. Such files are 10670 commonly created by builtin tools on Windows when use ZIP64 extension. 10671 Patch by Francisco Facioni. 10672 10673- bpo-32515: trace.py can now run modules via python3 -m trace -t --module 10674 module_name 10675 10676- bpo-32299: Changed :func:`unittest.mock.patch.dict` to return the patched 10677 dictionary when used as context manager. Patch by Vadim Tsander. 10678 10679- bpo-27141: Added a ``__copy__()`` to ``collections.UserList`` and 10680 ``collections.UserDict`` in order to correctly implement shallow copying 10681 of the objects. Patch by Bar Harel. 10682 10683- bpo-31829: ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) are now 10684 escaped in protocol 0 pickles of Unicode strings. This allows to load them 10685 without loss from files open in text mode in Python 2. 10686 10687- bpo-23395: ``_thread.interrupt_main()`` now avoids setting the Python 10688 error status if the ``SIGINT`` signal is ignored or not handled by Python. 10689 10690Documentation 10691------------- 10692 10693- bpo-36896: Clarify that some types have unstable constructor signature 10694 between Python versions. 10695 10696- bpo-36686: Improve documentation of the stdin, stdout, and stderr 10697 arguments of the ``asyncio.subprocess_exec`` function to specify which 10698 values are supported. Also mention that decoding as text is not supported. 10699 10700 Add a few tests to verify that the various values passed to the std* 10701 arguments actually work. 10702 10703- bpo-36984: Improve version added references in ``typing`` module - by 10704 Anthony Sottile. 10705 10706- bpo-36868: What's new now mentions SSLContext.hostname_checks_common_name 10707 instead of SSLContext.host_flags. 10708 10709- bpo-35924: Add a note to the ``curses.addstr()`` documentation to warn 10710 that multiline strings can cause segfaults because of an ncurses bug. 10711 10712- bpo-36783: Added C API Documentation for Time_FromTimeAndFold and 10713 PyDateTime_FromDateAndTimeAndFold as per PEP 495. Patch by Edison 10714 Abahurire. 10715 10716- bpo-36797: More of the legacy distutils documentation has been either 10717 pruned, or else more clearly marked as being retained solely until the 10718 setuptools documentation covers it independently. 10719 10720- bpo-22865: Add detail to the documentation on the `pty.spawn` function. 10721 10722- bpo-35397: Remove deprecation and document urllib.parse.unwrap(). Patch 10723 contributed by Rémi Lapeyre. 10724 10725- bpo-32995: Added the context variable in glossary. 10726 10727- bpo-33519: Clarify that `copy()` is not part of the `MutableSequence` ABC. 10728 10729- bpo-33482: Make `codecs.StreamRecoder.writelines` take a list of bytes. 10730 10731- bpo-25735: Added documentation for func factorial to indicate that returns 10732 integer values 10733 10734- bpo-20285: Expand object.__doc__ (docstring) to make it clearer. Modify 10735 pydoc.py so that help(object) lists object methods (for other classes, 10736 help omits methods of the object base class.) 10737 10738Tests 10739----- 10740 10741- bpo-37069: Modify test_coroutines, test_cprofile, test_generators, 10742 test_raise, test_ssl and test_yield_from to use 10743 :func:`test.support.catch_unraisable_exception` rather than 10744 :func:`test.support.captured_stderr`. 10745 10746- bpo-37098: Fix test_memfd_create on older Linux Kernels. 10747 10748- bpo-37081: Test with OpenSSL 1.1.1c 10749 10750- bpo-36829: Add :func:`test.support.catch_unraisable_exception`: context 10751 manager catching unraisable exception using :func:`sys.unraisablehook`. 10752 10753- bpo-36915: The main regrtest process now always removes all temporary 10754 directories of worker processes even if they crash or if they are killed 10755 on KeyboardInterrupt (CTRL+c). 10756 10757- bpo-36719: "python3 -m test -jN ..." now continues the execution of next 10758 tests when a worker process crash (CHILD_ERROR state). Previously, the 10759 test suite stopped immediately. Use --failfast to stop at the first error. 10760 10761- bpo-36816: Update Lib/test/selfsigned_pythontestdotnet.pem to match 10762 self-signed.pythontest.net's new TLS certificate. 10763 10764- bpo-35925: Skip httplib and nntplib networking tests when they would 10765 otherwise fail due to a modern OS or distro with a default OpenSSL policy 10766 of rejecting connections to servers with weak certificates. 10767 10768- bpo-36782: Add tests for several C API functions in the :mod:`datetime` 10769 module. Patch by Edison Abahurire. 10770 10771- bpo-36342: Fix test_multiprocessing in test_venv if platform lacks 10772 functioning sem_open. 10773 10774Build 10775----- 10776 10777- bpo-36721: To embed Python into an application, a new ``--embed`` option 10778 must be passed to ``python3-config --libs --embed`` to get ``-lpython3.8`` 10779 (link the application to libpython). To support both 3.8 and older, try 10780 ``python3-config --libs --embed`` first and fallback to ``python3-config 10781 --libs`` (without ``--embed``) if the previous command fails. 10782 10783 Add a pkg-config ``python-3.8-embed`` module to embed Python into an 10784 application: ``pkg-config python-3.8-embed --libs`` includes 10785 ``-lpython3.8``. To support both 3.8 and older, try ``pkg-config 10786 python-X.Y-embed --libs`` first and fallback to ``pkg-config python-X.Y 10787 --libs`` (without ``--embed``) if the previous command fails (replace 10788 ``X.Y`` with the Python version). 10789 10790 On the other hand, ``pkg-config python3.8 --libs`` no longer contains 10791 ``-lpython3.8``. C extensions must not be linked to libpython (except on 10792 Android, case handled by the script); this change is backward incompatible 10793 on purpose. 10794 10795- bpo-36786: "make install" now runs compileall in parallel. 10796 10797Windows 10798------- 10799 10800- bpo-36965: include of STATUS_CONTROL_C_EXIT without depending on MSC 10801 compiler 10802 10803- bpo-35926: Update to OpenSSL 1.1.1b for Windows. 10804 10805- bpo-29883: Add Windows support for UDP transports for the Proactor Event 10806 Loop. Patch by Adam Meily. 10807 10808- bpo-33407: The :c:macro:`Py_DEPRECATED()` macro has been implemented for 10809 MSVC. 10810 10811macOS 10812----- 10813 10814- bpo-36231: Support building Python on macOS without /usr/include 10815 installed. As of macOS 10.14, system header files are only available 10816 within an SDK provided by either the Command Line Tools or the Xcode app. 10817 10818IDLE 10819---- 10820 10821- bpo-35610: Replace now redundant .context_use_ps1 with .prompt_last_line. 10822 This finishes change started in bpo-31858. 10823 10824- bpo-37038: Make idlelib.run runnable; add test clause. 10825 10826- bpo-36958: Print any argument other than None or int passed to SystemExit 10827 or sys.exit(). 10828 10829- bpo-36807: When saving a file, call os.fsync() so bits are flushed to e.g. 10830 USB drive. 10831 10832- bpo-32411: In browser.py, remove extraneous sorting by line number since 10833 dictionary was created in line number order. 10834 10835Tools/Demos 10836----------- 10837 10838- bpo-37053: Handle strings like u"bar" correctly in 10839 Tools/parser/unparse.py. Patch by Chih-Hsuan Yen. 10840 10841C API 10842----- 10843 10844- bpo-36763: Implement the :pep:`587` "Python Initialization Configuration". 10845 10846- bpo-36379: Fix crashes when attempting to use the *modulo* parameter when 10847 ``__ipow__`` is implemented in C. 10848 10849- bpo-37107: Update :c:func:`PyObject_CallMethodObjArgs` and 10850 ``_PyObject_CallMethodIdObjArgs`` to use ``_PyObject_GetMethod`` to avoid 10851 creating a bound method object in many cases. Patch by Michael J. 10852 Sullivan. 10853 10854- bpo-36974: Implement :pep:`590`: Vectorcall: a fast calling protocol for 10855 CPython. This is a new protocol to optimize calls of custom callable 10856 objects. 10857 10858- bpo-36763: ``Py_Main()`` now returns the exitcode rather than calling 10859 ``Py_Exit(exitcode)`` when calling ``PyErr_Print()`` if the current 10860 exception type is ``SystemExit``. 10861 10862- bpo-36922: Add new type flag ``Py_TPFLAGS_METHOD_DESCRIPTOR`` for objects 10863 behaving like unbound methods. These are objects supporting the 10864 optimization given by the ``LOAD_METHOD``/``CALL_METHOD`` opcodes. See PEP 10865 590. 10866 10867- bpo-36728: The :c:func:`PyEval_ReInitThreads` function has been removed 10868 from the C API. It should not be called explicitly: use 10869 :c:func:`PyOS_AfterFork_Child` instead. 10870 10871 10872What's New in Python 3.8.0 alpha 4? 10873=================================== 10874 10875*Release date: 2019-05-06* 10876 10877Security 10878-------- 10879 10880- bpo-36742: Fixes mishandling of pre-normalization characters in 10881 urlsplit(). 10882 10883- bpo-30458: Address CVE-2019-9740 by disallowing URL paths with embedded 10884 whitespace or control characters through into the underlying http client 10885 request. Such potentially malicious header injection URLs now cause an 10886 http.client.InvalidURL exception to be raised. 10887 10888- bpo-35755: :func:`shutil.which` now uses ``os.confstr("CS_PATH")`` if 10889 available and if the :envvar:`PATH` environment variable is not set. 10890 Remove also the current directory from :data:`posixpath.defpath`. On Unix, 10891 :func:`shutil.which` and the :mod:`subprocess` module no longer search the 10892 executable in the current directory if the :envvar:`PATH` environment 10893 variable is not set. 10894 10895Core and Builtins 10896----------------- 10897 10898- bpo-36722: In debug build, import now also looks for C extensions compiled 10899 in release mode and for C extensions compiled in the stable ABI. 10900 10901- bpo-32849: Fix Python Initialization code on FreeBSD to detect properly 10902 when stdin file descriptor (fd 0) is invalid. 10903 10904- bpo-36623: Remove parser headers and related function declarations that 10905 lack implementations after the removal of pgen. 10906 10907- bpo-20180: ``dict.pop()`` is now up to 33% faster thanks to Argument 10908 Clinic. Patch by Inada Naoki. 10909 10910- bpo-36611: Debug memory allocators: disable serialno field by default from 10911 debug hooks on Python memory allocators to reduce the memory footprint by 10912 5%. Enable :mod:`tracemalloc` to get the traceback where a memory block 10913 has been allocated when a fatal memory error is logged to decide where to 10914 put a breakpoint. Compile Python with ``PYMEM_DEBUG_SERIALNO`` defined to 10915 get back the field. 10916 10917- bpo-36588: On AIX, :attr:`sys.platform` doesn't contain the major version 10918 anymore. Always return ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. 10919 Since older Python versions include the version number, it is recommended 10920 to always use ``sys.platform.startswith('aix')``. Contributed by M. Felt. 10921 10922- bpo-36549: Change str.capitalize to use titlecase for the first character 10923 instead of uppercase. 10924 10925- bpo-36540: Implement :pep:`570` (Python positional-only parameters). Patch 10926 by Pablo Galindo. 10927 10928- bpo-36475: :c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` 10929 now terminate the current thread if called while the interpreter is 10930 finalizing, making them consistent with :c:func:`PyEval_RestoreThread`, 10931 :c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`. 10932 10933- bpo-36504: Fix signed integer overflow in _ctypes.c's 10934 ``PyCArrayType_new()``. 10935 10936- bpo-20844: Fix running script with encoding cookie and LF line ending may 10937 fail on Windows. 10938 10939- bpo-24214: Fixed support of the surrogatepass error handler in the UTF-8 10940 incremental decoder. 10941 10942- bpo-36452: Changing ``dict`` keys during iteration of the dict itself, 10943 ``keys()``, ``values()``, or ``items()`` will now be detected in certain 10944 corner cases where keys are deleted/added so that the number of keys isn't 10945 changed. A `RuntimeError` will be raised after ``len(dict)`` iterations. 10946 Contributed by Thomas Perl. 10947 10948- bpo-36459: Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's 10949 ``tok_nextc()``. 10950 10951- bpo-36433: Fixed TypeError message in classmethoddescr_call. 10952 10953- bpo-36430: Fix a possible reference leak in :func:`itertools.count`. 10954 10955- bpo-36440: Include node names in ``ParserError`` messages, instead of 10956 numeric IDs. Patch by A. Skrobov. 10957 10958- bpo-36143: Regenerate :mod:`keyword` from the Grammar and Tokens file 10959 using pgen. Patch by Pablo Galindo. 10960 10961- bpo-18372: Add missing :c:func:`PyObject_GC_Track` calls in the 10962 :mod:`pickle` module. Patch by Zackery Spytz. 10963 10964Library 10965------- 10966 10967- bpo-35952: Fix pythoninfo when the compiler is missing. 10968 10969- bpo-28238: The ``.find*()`` methods of xml.etree.ElementTree can now 10970 search for wildcards like ``{*}tag`` and ``{ns}*`` that match a tag in any 10971 namespace or all tags in a namespace. Patch by Stefan Behnel. 10972 10973- bpo-26978: `pathlib.path.link_to()` is now implemented. It creates a hard 10974 link pointing to a path. 10975 10976- bpo-1613500: :class:`fileinput.FileInput` now uses the input file mode to 10977 correctly set the output file mode (previously it was hardcoded to 10978 ``'w'``) when ``inplace=True`` is passed to its constructor. 10979 10980- bpo-36734: Fix compilation of ``faulthandler.c`` on HP-UX. Initialize 10981 ``stack_t current_stack`` to zero using ``memset()``. 10982 10983- bpo-13611: The xml.etree.ElementTree packages gained support for C14N 2.0 10984 serialisation. Patch by Stefan Behnel. 10985 10986- bpo-36669: Add missing matrix multiplication operator support to 10987 weakref.proxy. 10988 10989- bpo-36676: The XMLParser() in xml.etree.ElementTree provides namespace 10990 prefix context to the parser target if it defines the callback methods 10991 "start_ns()" and/or "end_ns()". Patch by Stefan Behnel. 10992 10993- bpo-36673: The TreeBuilder and XMLPullParser in xml.etree.ElementTree 10994 gained support for parsing comments and processing instructions. Patch by 10995 Stefan Behnel. 10996 10997- bpo-36650: The C version of functools.lru_cache() was treating calls with 10998 an empty ``**kwargs`` dictionary as being distinct from calls with no 10999 keywords at all. This did not result in an incorrect answer, but it did 11000 trigger an unexpected cache miss. 11001 11002- bpo-28552: Fix :mod:`distutils.sysconfig` if :data:`sys.executable` is 11003 ``None`` or an empty string: use :func:`os.getcwd` to initialize 11004 ``project_base``. Fix also the distutils build command: don't use 11005 :data:`sys.executable` if it is ``None`` or an empty string. 11006 11007- bpo-35755: :func:`shutil.which` and 11008 :func:`distutils.spawn.find_executable` now use ``os.confstr("CS_PATH")`` 11009 if available instead of :data:`os.defpath`, if the ``PATH`` environment 11010 variable is not set. Moreover, don't use ``os.confstr("CS_PATH")`` nor 11011 :data:`os.defpath` if the ``PATH`` environment variable is set to an empty 11012 string. 11013 11014- bpo-25430: improve performance of ``IPNetwork.__contains__()`` 11015 11016- bpo-30485: Path expressions in xml.etree.ElementTree can now avoid 11017 explicit namespace prefixes for tags (or the "{namespace}tag" notation) by 11018 passing a default namespace with an empty string prefix. 11019 11020- bpo-36613: Fix :mod:`asyncio` wait() not removing callback if exception 11021 11022- bpo-36598: Fix ``isinstance`` check for Mock objects with spec when the 11023 code is executed under tracing. Patch by Karthikeyan Singaravelan. 11024 11025- bpo-18748: In development mode (:option:`-X` ``dev``) and in debug build, 11026 the :class:`io.IOBase` destructor now logs ``close()`` exceptions. These 11027 exceptions are silent by default in release mode. 11028 11029- bpo-36575: The ``_lsprof`` module now uses internal timer same to 11030 ``time.perf_counter()`` by default. ``gettimeofday(2)`` was used on Unix. 11031 New timer has better resolution on most Unix platforms and timings are no 11032 longer impacted by system clock updates since ``perf_counter()`` is 11033 monotonic. Patch by Inada Naoki. 11034 11035- bpo-33461: ``json.loads`` now emits ``DeprecationWarning`` when 11036 ``encoding`` option is specified. Patch by Matthias Bussonnier. 11037 11038- bpo-36559: The random module now prefers the lean internal _sha512 module 11039 over hashlib for seed(version=2) to optimize import time. 11040 11041- bpo-17561: Set backlog=None as the default for socket.create_server. 11042 11043- bpo-34373: Fix :func:`time.mktime` error handling on AIX for year before 11044 1970. 11045 11046- bpo-36232: Improve error message when trying to open existing DBM database 11047 that actually doesn't exist. Patch by Marco Rougeth. 11048 11049- bpo-36546: Add statistics.quantiles() 11050 11051- bpo-36050: Optimized ``http.client.HTTPResponse.read()`` for large 11052 response. Patch by Inada Naoki. 11053 11054- bpo-36522: If *debuglevel* is set to >0 in :mod:`http.client`, print all 11055 values for headers with multiple values for the same header name. Patch by 11056 Matt Houglum. 11057 11058- bpo-36492: Deprecated passing required arguments like *func* as keyword 11059 arguments in functions which should accept arbitrary keyword arguments and 11060 pass them to other function. Arbitrary keyword arguments (even with names 11061 "self" and "func") can now be passed to these functions if the required 11062 arguments are passed as positional arguments. 11063 11064- bpo-27181: Add statistics.geometric_mean(). 11065 11066- bpo-30427: ``os.path.normcase()`` relies on ``os.fspath()`` to check the 11067 type of its argument. Redundant checks have been removed from its 11068 ``posixpath.normcase()`` and ``ntpath.normcase()`` implementations. Patch 11069 by Wolfgang Maier. 11070 11071- bpo-36385: Stop rejecting IPv4 octets for being ambiguously octal. Leading 11072 zeros are ignored, and no longer are assumed to specify octal octets. 11073 Octets are always decimal numbers. Octets must still be no more than three 11074 digits, including leading zeroes. 11075 11076- bpo-36434: Errors during writing to a ZIP file no longer prevent to 11077 properly close it. 11078 11079- bpo-36407: Fixed wrong indentation writing for CDATA section in 11080 xml.dom.minidom. Patch by Vladimir Surjaninov. 11081 11082- bpo-36326: inspect.getdoc() can now find docstrings for member objects 11083 when __slots__ is a dictionary. 11084 11085- bpo-36366: Calling ``stop()`` on an unstarted or stopped 11086 :func:`unittest.mock.patch` object will now return `None` instead of 11087 raising :exc:`RuntimeError`, making the method idempotent. Patch by 11088 Karthikeyan Singaravelan. 11089 11090- bpo-36348: The :meth:`imap.IMAP4.logout` method no longer ignores silently 11091 arbitrary exceptions. 11092 11093- bpo-31904: Add time module support and fix test_time faiures for VxWorks. 11094 11095- bpo-36227: Added support for keyword arguments `default_namespace` and 11096 `xml_declaration` in functions ElementTree.tostring() and 11097 ElementTree.tostringlist(). 11098 11099- bpo-36004: Added new alternate constructors 11100 :meth:`datetime.date.fromisocalendar` and 11101 :meth:`datetime.datetime.fromisocalendar`, which construct date objects 11102 from ISO year, week number and weekday; these are the inverse of each 11103 class's ``isocalendar`` method. Patch by Paul Ganssle. 11104 11105- bpo-35936: :mod:`modulefinder` no longer depends on the deprecated 11106 :mod:`imp` module, and the initializer for 11107 :class:`modulefinder.ModuleFinder` now has immutable default arguments. 11108 Patch by Brandt Bucher. 11109 11110- bpo-35376: :mod:`modulefinder` correctly handles modules that have the 11111 same name as a bad package. Patch by Brandt Bucher. 11112 11113- bpo-17396: :mod:`modulefinder` no longer crashes when encountering syntax 11114 errors in followed imports. Patch by Brandt Bucher. 11115 11116- bpo-35934: Added :meth:`~socket.create_server()` and 11117 :meth:`~socket.has_dualstack_ipv6()` convenience functions to automate the 11118 necessary tasks usually involved when creating a server socket, including 11119 accepting both IPv4 and IPv6 connections on the same socket. (Contributed 11120 by Giampaolo Rodola in :issue:`17561`.) 11121 11122- bpo-23078: Add support for :func:`classmethod` and :func:`staticmethod` to 11123 :func:`unittest.mock.create_autospec`. Initial patch by Felipe Ochoa. 11124 11125- bpo-35416: Fix potential resource warnings in distutils. Patch by Mickaël 11126 Schoentgen. 11127 11128- bpo-25451: Add transparency methods to :class:`tkinter.PhotoImage`. Patch 11129 by Zackery Spytz. 11130 11131- bpo-35082: Don't return deleted attributes when calling dir on a 11132 :class:`unittest.mock.Mock`. 11133 11134- bpo-34547: :class:`wsgiref.handlers.BaseHandler` now handles abrupt client 11135 connection terminations gracefully. Patch by Petter Strandmark. 11136 11137- bpo-31658: :func:`xml.sax.parse` now supports :term:`path-like <path-like 11138 object>`. Patch by Mickaël Schoentgen. 11139 11140- bpo-34139: Remove stale unix datagram socket before binding 11141 11142- bpo-33530: Implemented Happy Eyeballs in `asyncio.create_connection()`. 11143 Added two new arguments, *happy_eyeballs_delay* and *interleave*, to 11144 specify Happy Eyeballs behavior. 11145 11146- bpo-33291: Do not raise AttributeError when calling the inspect functions 11147 isgeneratorfunction, iscoroutinefunction, isasyncgenfunction on a method 11148 created from an arbitrary callable. Instead, return False. 11149 11150- bpo-31310: Fix the multiprocessing.semaphore_tracker so it is reused by 11151 child processes 11152 11153- bpo-31292: Fix ``setup.py check --restructuredtext`` for files containing 11154 ``include`` directives. 11155 11156Documentation 11157------------- 11158 11159- bpo-36625: Remove obsolete comments from docstrings in fractions.Fraction 11160 11161- bpo-30840: Document relative imports 11162 11163- bpo-36523: Add docstring for io.IOBase.writelines(). 11164 11165- bpo-36425: New documentation translation: `Simplified Chinese 11166 <https://docs.python.org/zh-cn/>`_. 11167 11168- bpo-36345: Avoid the duplication of code from ``Tools/scripts/serve.py`` 11169 in using the :rst:dir:`literalinclude` directive for the basic 11170 wsgiref-based web server in the documentation of :mod:`wsgiref`. 11171 Contributed by Stéphane Wirtel. 11172 11173- bpo-36345: Using the code of the ``Tools/scripts/serve.py`` script as an 11174 example in the :mod:`wsgiref` documentation. Contributed by Stéphane 11175 Wirtel. 11176 11177- bpo-36157: Added Documention for PyInterpreterState_Main(). 11178 11179- bpo-33043: Updates the docs.python.org page with the addition of a 11180 'Contributing to Docs' link at the end of the page (between 'Reporting 11181 Bugs' and 'About Documentation'). Updates the 'Found a Bug' page with 11182 additional links and information in the Documentation Bugs section. 11183 11184- bpo-35581: @typing.type_check_only now allows type stubs to mark functions 11185 and classes not available during runtime. 11186 11187- bpo-33832: Add glossary entry for 'magic method'. 11188 11189- bpo-32913: Added re.Match.groupdict example to regex HOWTO. 11190 11191Tests 11192----- 11193 11194- bpo-36719: regrtest now always detects uncollectable objects. Previously, 11195 the check was only enabled by ``--findleaks``. The check now also works 11196 with ``-jN/--multiprocess N``. ``--findleaks`` becomes a deprecated alias 11197 to ``--fail-env-changed``. 11198 11199- bpo-36725: When using multiprocessing mode (-jN), regrtest now better 11200 reports errors if a worker process fails, and it exits immediately on a 11201 worker thread failure or when interrupted. 11202 11203- bpo-36454: Change test_time.test_monotonic() to test only the lower bound 11204 of elapsed time after a sleep command rather than the upper bound. This 11205 prevents unnecessary test failures on slow buildbots. Patch by Victor 11206 Stinner. 11207 11208- bpo-32424: Improve test coverage for xml.etree.ElementTree. Patch by 11209 Gordon P. Hemsley. 11210 11211- bpo-32424: Fix typo in test_cyclic_gc() test for xml.etree.ElementTree. 11212 Patch by Gordon P. Hemsley. 11213 11214- bpo-36635: Add a new :mod:`_testinternalcapi` module to test the internal 11215 C API. 11216 11217- bpo-36629: Fix ``test_imap4_host_default_value()`` of ``test_imaplib``: 11218 catch also :data:`errno.ENETUNREACH` error. 11219 11220- bpo-36611: Fix ``test_sys.test_getallocatedblocks()`` when 11221 :mod:`tracemalloc` is enabled. 11222 11223- bpo-36560: Fix reference leak hunting in regrtest: compute also deltas (of 11224 reference count, allocated memory blocks, file descriptor count) during 11225 warmup, to ensure that everything is initialized before starting to hunt 11226 reference leaks. 11227 11228- bpo-36565: Fix reference hunting (``python3 -m test -R 3:3``) when Python 11229 has no built-in abc module. 11230 11231- bpo-31904: Port test_resource to VxWorks: skip tests cases setting 11232 RLIMIT_FSIZE and RLIMIT_CPU. 11233 11234- bpo-31904: Fix test_tabnanny on VxWorks: adjust ENOENT error message. 11235 11236- bpo-36436: Fix ``_testcapi.pymem_buffer_overflow()``: handle memory 11237 allocation failure. 11238 11239- bpo-31904: Fix test_utf8_mode on VxWorks: Python always use UTF-8 on 11240 VxWorks. 11241 11242- bpo-36341: Fix tests that may fail with PermissionError upon calling 11243 bind() on AF_UNIX sockets. 11244 11245Build 11246----- 11247 11248- bpo-36747: Remove the stale scriptsinstall Makefile target. 11249 11250- bpo-21536: On Unix, C extensions are no longer linked to libpython except 11251 on Android and Cygwin. 11252 11253 It is now possible for a statically linked Python to load a C extension 11254 built using a shared library Python. 11255 11256 When Python is embedded, ``libpython`` must not be loaded with 11257 ``RTLD_LOCAL``, but ``RTLD_GLOBAL`` instead. Previously, using 11258 ``RTLD_LOCAL``, it was already not possible to load C extensions which 11259 were not linked to ``libpython``, such as C extensions of the standard 11260 library built by the ``*shared*`` section of ``Modules/Setup``. 11261 11262 distutils, python-config and python-config.py have been modified. 11263 11264- bpo-36707: ``./configure --with-pymalloc`` no longer adds the ``m`` flag 11265 to SOABI (sys.implementation.cache_tag). Enabling or disabling pymalloc 11266 has no impact on the ABI. 11267 11268- bpo-36635: Change ``PyAPI_FUNC(type)``, ``PyAPI_DATA(type)`` and 11269 ``PyMODINIT_FUNC`` macros of ``pyport.h`` when ``Py_BUILD_CORE_MODULE`` is 11270 defined. The ``Py_BUILD_CORE_MODULE`` define must be now be used to build 11271 a C extension as a dynamic library accessing Python internals: export the 11272 PyInit_xxx() function in DLL exports on Windows. 11273 11274- bpo-31904: Don't build the ``_crypt`` extension on VxWorks. 11275 11276- bpo-36618: Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is 11277 detected. The pymalloc memory allocator aligns memory on 8 bytes. On 11278 x86-64, clang expects alignment on 16 bytes by default and so uses MOVAPS 11279 instruction which can lead to segmentation fault. Instruct clang that 11280 Python is limited to alignment on 8 bytes to use MOVUPS instruction 11281 instead: slower but don't trigger a SIGSEGV if the memory is not aligned 11282 on 16 bytes. Sadly, the flag must be added to ``CFLAGS`` and not just 11283 ``CFLAGS_NODIST``, since third party C extensions can have the same issue. 11284 11285- bpo-36605: ``make tags`` and ``make TAGS`` now also parse 11286 ``Modules/_io/*.c`` and ``Modules/_io/*.h``. 11287 11288- bpo-36465: Release builds and debug builds are now ABI compatible: 11289 defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` 11290 macro, which introduces the only ABI incompatibility. The 11291 ``Py_TRACE_REFS`` macro, which adds the :func:`sys.getobjects` function 11292 and the :envvar:`PYTHONDUMPREFS` environment variable, can be set using 11293 the new ``./configure --with-trace-refs`` build option. 11294 11295- bpo-36577: setup.py now correctly reports missing OpenSSL headers and 11296 libraries again. 11297 11298- bpo-36544: Fix regression introduced in bpo-36146 refactoring setup.py 11299 11300- bpo-36508: ``python-config --ldflags`` no longer includes flags of the 11301 ``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be 11302 used to build executables. 11303 11304- bpo-36503: Remove references to "aix3" and "aix4". Patch by M. Felt. 11305 11306Windows 11307------- 11308 11309- bpo-35920: Added platform.win32_edition() and platform.win32_is_iot(). 11310 Added support for cross-compiling packages for Windows ARM32. Skip tests 11311 that are not expected to work on Windows IoT Core ARM32. 11312 11313- bpo-36649: Remove trailing spaces for registry keys when installed via the 11314 Store. 11315 11316- bpo-34144: Fixed activate.bat to correctly update codepage when chcp.com 11317 returns dots in output. Patch by Lorenz Mende. 11318 11319- bpo-36509: Added preset-iot layout for Windows IoT ARM containers. This 11320 layout doesn't contain UI components like tkinter or IDLE. It also doesn't 11321 contain files to support on-target builds since Windows ARM32 builds must 11322 be cross-compiled when using MSVC. 11323 11324- bpo-35941: enum_certificates function of the ssl module now returns 11325 certificates from all available certificate stores inside windows in a 11326 query instead of returning only certificates from the system wide 11327 certificate store. This includes certificates from these certificate 11328 stores: local machine, local machine enterprise, local machine group 11329 policy, current user, current user group policy, services, users. 11330 ssl.enum_crls() function is changed in the same way to return all 11331 certificate revocation lists inside the windows certificate revocation 11332 list stores. 11333 11334- bpo-36441: Fixes creating a venv when debug binaries are installed. 11335 11336- bpo-36085: Enable better DLL resolution on Windows by using safe DLL 11337 search paths and adding :func:`os.add_dll_directory`. 11338 11339- bpo-36010: Add the venv standard library module to the nuget distribution 11340 for Windows. 11341 11342- bpo-29515: Add the following socket module constants on Windows: 11343 IPPROTO_AH IPPROTO_CBT IPPROTO_DSTOPTS IPPROTO_EGP IPPROTO_ESP 11344 IPPROTO_FRAGMENT IPPROTO_GGP IPPROTO_HOPOPTS IPPROTO_ICLFXBM 11345 IPPROTO_ICMPV6 IPPROTO_IDP IPPROTO_IGMP IPPROTO_IGP IPPROTO_IPV4 11346 IPPROTO_IPV6 IPPROTO_L2TP IPPROTO_MAX IPPROTO_ND IPPROTO_NONE IPPROTO_PGM 11347 IPPROTO_PIM IPPROTO_PUP IPPROTO_RDP IPPROTO_ROUTING IPPROTO_SCTP 11348 IPPROTO_ST 11349 11350- bpo-35947: Added current version of libffi to cpython-source-deps. Change 11351 _ctypes to use current version of libffi on Windows. 11352 11353- bpo-34060: Report system load when running test suite on Windows. Patch by 11354 Ammar Askar. Based on prior work by Jeremy Kloth. 11355 11356- bpo-31512: With the Windows 10 Creators Update, non-elevated users can now 11357 create symlinks as long as the computer has Developer Mode enabled. 11358 11359macOS 11360----- 11361 11362- bpo-34602: Avoid failures setting macOS stack resource limit with 11363 resource.setrlimit. This reverts an earlier fix for bpo-18075 which forced 11364 a non-default stack size when building the interpreter executable on 11365 macOS. 11366 11367IDLE 11368---- 11369 11370- bpo-36429: Fix starting IDLE with pyshell. Add idlelib.pyshell alias at 11371 top; remove pyshell alias at bottom. Remove obsolete __name__=='__main__' 11372 command. 11373 11374Tools/Demos 11375----------- 11376 11377- bpo-14546: Fix the argument handling in Tools/scripts/lll.py. 11378 11379C API 11380----- 11381 11382- bpo-36763: Fix memory leak in :c:func:`Py_SetStandardStreamEncoding`: 11383 release memory if the function is called twice. 11384 11385- bpo-36641: :c:macro:`PyDoc_VAR(name)` and 11386 :c:macro:`PyDoc_STRVAR(name,str)` now create ``static const char name[]`` 11387 instead of ``static char name[]``. Patch by Inada Naoki. 11388 11389- bpo-36389: Change the value of ``CLEANBYTE``, ``DEADDYTE`` and 11390 ``FORBIDDENBYTE`` internal constants used by debug hooks on Python memory 11391 allocators (:c:func:`PyMem_SetupDebugHooks` function). Byte patterns 11392 ``0xCB``, ``0xDB`` and ``0xFB`` have been replaced with ``0xCD``, ``0xDD`` 11393 and ``0xFD`` to use the same values than Windows CRT debug ``malloc()`` 11394 and ``free()``. 11395 11396- bpo-36443: Since Python 3.7.0, calling :c:func:`Py_DecodeLocale` before 11397 :c:func:`Py_Initialize` produces mojibake if the ``LC_CTYPE`` locale is 11398 coerced and/or if the UTF-8 Mode is enabled by the user configuration. The 11399 LC_CTYPE coercion and UTF-8 Mode are now disabled by default to fix the 11400 mojibake issue. They must now be enabled explicitly (opt-in) using the new 11401 :c:func:`_Py_PreInitialize` API with ``_PyPreConfig``. 11402 11403- bpo-36025: Fixed an accidental change to the datetime C API where the 11404 arguments to the :c:func:`PyDate_FromTimestamp` function were incorrectly 11405 interpreted as a single timestamp rather than an arguments tuple, which 11406 causes existing code to start raising :exc:`TypeError`. The 11407 backwards-incompatible change was only present in alpha releases of Python 11408 3.8. Patch by Paul Ganssle. 11409 11410- bpo-35810: Modify ``PyObject_Init`` to correctly increase the refcount of 11411 heap- allocated Type objects. Also fix the refcounts of the heap-allocated 11412 types that were either doing this manually or not decreasing the type's 11413 refcount in tp_dealloc 11414 11415 11416What's New in Python 3.8.0 alpha 3? 11417=================================== 11418 11419*Release date: 2019-03-25* 11420 11421Security 11422-------- 11423 11424- bpo-36216: Changes urlsplit() to raise ValueError when the URL contains 11425 characters that decompose under IDNA encoding (NFKC-normalization) into 11426 characters that affect how the URL is parsed. 11427 11428- bpo-35121: Don't send cookies of domain A without Domain attribute to 11429 domain B when domain A is a suffix match of domain B while using a 11430 cookiejar with :class:`http.cookiejar.DefaultCookiePolicy` policy. Patch 11431 by Karthikeyan Singaravelan. 11432 11433Core and Builtins 11434----------------- 11435 11436- bpo-36421: Fix a possible double decref in _ctypes.c's 11437 ``PyCArrayType_new()``. 11438 11439- bpo-36412: Fix a possible crash when creating a new dictionary. 11440 11441- bpo-36398: Fix a possible crash in ``structseq_repr()``. 11442 11443- bpo-36256: Fix bug in parsermodule when parsing a state in a DFA that has 11444 two or more arcs with labels of the same type. Patch by Pablo Galindo. 11445 11446- bpo-36365: repr(structseq) is no longer limited to 512 bytes. 11447 11448- bpo-36374: Fix a possible null pointer dereference in 11449 ``merge_consts_recursive()``. Patch by Zackery Spytz. 11450 11451- bpo-36236: At Python initialization, the current directory is no longer 11452 prepended to :data:`sys.path` if it has been removed. 11453 11454- bpo-36352: Python initialization now fails with an error, rather than 11455 silently truncating paths, if a path is too long. 11456 11457- bpo-36301: Python initialization now fails if decoding ``pybuilddir.txt`` 11458 configuration file fails at startup. 11459 11460- bpo-36333: Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane 11461 Wirtel. 11462 11463- bpo-36332: The builtin :func:`compile` can now handle AST objects that 11464 contain assignment expressions. Patch by Pablo Galindo. 11465 11466- bpo-36282: Improved error message for too much positional arguments in 11467 some builtin functions. 11468 11469- bpo-30040: New empty dict uses fewer memory for now. It used more memory 11470 than empty dict created by ``dict.clear()``. And empty dict creation and 11471 deletion is about 2x faster. Patch by Inada Naoki. 11472 11473- bpo-36262: Fix an unlikely memory leak on conversion from string to float 11474 in the function ``_Py_dg_strtod()`` used by ``float(str)``, 11475 ``complex(str)``, :func:`pickle.load`, :func:`marshal.load`, etc. 11476 11477- bpo-36252: Update Unicode databases to version 12.0.0. 11478 11479- bpo-36218: Fix a segfault occurring when sorting a list of heterogeneous 11480 values. Patch contributed by Rémi Lapeyre and Elliot Gorokhovsky. 11481 11482- bpo-36188: Cleaned up left-over vestiges of Python 2 unbound method 11483 handling in method objects and documentation. Patch by Martijn Pieters 11484 11485- bpo-36124: Add a new interpreter-specific dict and expose it in the C-API 11486 via PyInterpreterState_GetDict(). This parallels PyThreadState_GetDict(). 11487 However, extension modules should continue using PyModule_GetState() for 11488 their own internal per-interpreter state. 11489 11490- bpo-35975: Add a ``feature_version`` flag to ``ast.parse()`` (documented) 11491 and ``compile()`` (hidden) that allows tweaking the parser to support 11492 older versions of the grammar. In particular, if ``feature_version`` is 5 11493 or 6, the hacks for the ``async`` and ``await`` keyword from PEP 492 are 11494 reinstated. (For 7 or higher, these are unconditionally treated as 11495 keywords, but they are still special tokens rather than ``NAME`` tokens 11496 that the parser driver recognizes.) 11497 11498- bpo-31904: Use UTF-8 as the system encoding on VxWorks. 11499 11500- bpo-36048: The :meth:`~object.__index__` special method will be used 11501 instead of :meth:`~object.__int__` for implicit conversion of Python 11502 numbers to C integers. Using the ``__int__()`` method in implicit 11503 conversions has been deprecated. 11504 11505- bpo-35808: Retire pgen and use a modified version of pgen2 to generate the 11506 parser. Patch by Pablo Galindo. 11507 11508Library 11509------- 11510 11511- bpo-36401: The class documentation created by pydoc now has a separate 11512 section for readonly properties. 11513 11514- bpo-36320: The typing.NamedTuple() class has deprecated the _field_types 11515 attribute in favor of the __annotations__ attribute which carried the same 11516 information. Also, both attributes were converted from OrderedDict to a 11517 regular dict. 11518 11519- bpo-34745: Fix :mod:`asyncio` ssl memory issues caused by circular 11520 references 11521 11522- bpo-36324: Add method to statistics.NormalDist for computing the inverse 11523 cumulative normal distribution. 11524 11525- bpo-36321: collections.namedtuple() misspelled the name of an attribute. 11526 To be consistent with typing.NamedTuple, the attribute name should have 11527 been "_field_defaults" instead of "_fields_defaults". For backwards 11528 compatibility, both spellings are now created. The misspelled version may 11529 be removed in the future. 11530 11531- bpo-36297: "unicode_internal" codec is removed. It was deprecated since 11532 Python 3.3. Patch by Inada Naoki. 11533 11534- bpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be 11535 found. Thanks to 'mental' for the bug report. 11536 11537- bpo-36268: Switch the default format used for writing tars with 11538 mod:`tarfile` to the modern POSIX.1-2001 pax standard, from the 11539 vendor-specific GNU. Contributed by C.A.M. Gerlach. 11540 11541- bpo-36285: Fix integer overflows in the array module. Patch by Stephan 11542 Hohe. 11543 11544- bpo-31904: Add _signal module support for VxWorks. 11545 11546- bpo-36272: :mod:`logging` does not silently ignore RecursionError anymore. 11547 Patch contributed by Rémi Lapeyre. 11548 11549- bpo-36280: Add a kind field to ast.Constant. It is 'u' if the literal has 11550 a 'u' prefix (i.e. a Python 2 style unicode literal), else None. 11551 11552- bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles all 11553 exceptions. 11554 11555- bpo-36251: Fix format strings used for stderrprinter and re.Match reprs. 11556 Patch by Stephan Hohe. 11557 11558- bpo-36235: Fix ``CFLAGS`` in ``customize_compiler()`` of 11559 ``distutils.sysconfig``: when the ``CFLAGS`` environment variable is 11560 defined, don't override ``CFLAGS`` variable with the ``OPT`` variable 11561 anymore. Initial patch written by David Malcolm. 11562 11563- bpo-35807: Update ensurepip to install pip 19.0.3 and setuptools 40.8.0. 11564 11565- bpo-36139: Release GIL when closing :class:`~mmap.mmap` objects. 11566 11567- bpo-36179: Fix two unlikely reference leaks in _hashopenssl. The leaks 11568 only occur in out-of-memory cases. 11569 11570- bpo-36169: Add overlap() method to statistics.NormalDist. Computes the 11571 overlapping coefficient for two normal distributions. 11572 11573- bpo-36103: Default buffer size used by ``shutil.copyfileobj()`` is changed 11574 from 16 KiB to 64 KiB on non-Windows platform to reduce system call 11575 overhead. Contributed by Inada Naoki. 11576 11577- bpo-36130: Fix ``pdb`` with ``skip=...`` when stepping into a frame 11578 without a ``__name__`` global. Patch by Anthony Sottile. 11579 11580- bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry 11581 instead of a path string. 11582 11583- bpo-35178: Ensure custom :func:`warnings.formatwarning` function can 11584 receive `line` as positional argument. Based on patch by Tashrif Billah. 11585 11586- bpo-36106: Resolve potential name clash with libm's sinpi(). Patch by 11587 Dmitrii Pasechnik. 11588 11589- bpo-36091: Clean up reference to async generator in Lib/types. Patch by 11590 Henry Chen. 11591 11592- bpo-36043: :class:`FileCookieJar` supports :term:`path-like object`. 11593 Contributed by Stéphane Wirtel 11594 11595- bpo-35899: Enum has been fixed to correctly handle empty strings and 11596 strings with non-Latin characters (ie. 'α', 'א') without crashing. 11597 Original patch contributed by Maxwell. Assisted by Stéphane Wirtel. 11598 11599- bpo-21269: Add ``args`` and ``kwargs`` properties to mock call objects. 11600 Contributed by Kumar Akshay. 11601 11602- bpo-30670: `pprint.pp` has been added to pretty-print objects with 11603 dictionary keys being sorted with their insertion order by default. 11604 Parameter *sort_dicts* has been added to `pprint.pprint`, `pprint.pformat` 11605 and `pprint.PrettyPrinter`. Contributed by Rémi Lapeyre. 11606 11607- bpo-35843: Implement ``__getitem__`` for ``_NamespacePath``. Patch by 11608 Anthony Sottile. 11609 11610- bpo-35802: Clean up code which checked presence of ``os.stat`` / 11611 ``os.lstat`` / ``os.chmod`` which are always present. Patch by Anthony 11612 Sottile. 11613 11614- bpo-35715: Librates the return value of a ProcessPoolExecutor 11615 _process_worker after it's no longer needed to free memory 11616 11617- bpo-35493: Use :func:`multiprocessing.connection.wait` instead of polling 11618 each 0.2 seconds for worker updates in :class:`multiprocessing.Pool`. 11619 Patch by Pablo Galindo. 11620 11621- bpo-35661: Store the venv prompt in pyvenv.cfg. 11622 11623- bpo-35121: Don't set cookie for a request when the request path is a 11624 prefix match of the cookie's path attribute but doesn't end with "/". 11625 Patch by Karthikeyan Singaravelan. 11626 11627- bpo-21478: Calls to a child function created with 11628 :func:`unittest.mock.create_autospec` should propagate to the parent. 11629 Patch by Karthikeyan Singaravelan. 11630 11631- bpo-35198: Fix C++ extension compilation on AIX 11632 11633Documentation 11634------------- 11635 11636- bpo-36329: Declare the path of the Python binary for the usage of 11637 ``Tools/scripts/serve.py`` when executing ``make -C Doc/ serve``. 11638 Contributed by Stéphane Wirtel 11639 11640- bpo-36138: Improve documentation about converting datetime.timedelta to 11641 scalars. 11642 11643- bpo-21314: A new entry was added to the Core Language Section of the 11644 Programming FAQ, which explaines the usage of slash(/) in the signature of 11645 a function. Patch by Lysandros Nikolaou 11646 11647Tests 11648----- 11649 11650- bpo-36234: test_posix.PosixUidGidTests: add tests for invalid uid/gid type 11651 (str). Initial patch written by David Malcolm. 11652 11653- bpo-29571: Fix ``test_re.test_locale_flag()``: use 11654 ``locale.getpreferredencoding()`` rather than ``locale.getlocale()`` to 11655 get the locale encoding. With some locales, ``locale.getlocale()`` returns 11656 the wrong encoding. 11657 11658- bpo-36123: Fix race condition in test_socket. 11659 11660Build 11661----- 11662 11663- bpo-36356: Fix leaks that led to build failure when configured with 11664 address sanitizer. 11665 11666- bpo-36146: Add ``TEST_EXTENSIONS`` constant to ``setup.py`` to allow to 11667 not build test extensions like ``_testcapi``. 11668 11669- bpo-36146: Fix setup.py on macOS: only add ``/usr/include/ffi`` to include 11670 directories of _ctypes, not for all extensions. 11671 11672- bpo-31904: Enable build system to cross-build for VxWorks RTOS. 11673 11674Windows 11675------- 11676 11677- bpo-36312: Fixed decoders for the following code pages: 50220, 50221, 11678 50222, 50225, 50227, 50229, 57002 through 57011, 65000 and 42. 11679 11680- bpo-36264: Don't honor POSIX ``HOME`` in ``os.path.expanduser`` on 11681 windows. Patch by Anthony Sottile. 11682 11683- bpo-24643: Fix name collisions due to ``#define timezone _timezone`` in 11684 PC/pyconfig.h. 11685 11686IDLE 11687---- 11688 11689- bpo-36405: Use dict unpacking in idlelib. 11690 11691- bpo-36396: Remove fgBg param of idlelib.config.GetHighlight(). This param 11692 was only used twice and changed the return type. 11693 11694- bpo-36176: Fix IDLE autocomplete & calltip popup colors. Prevent conflicts 11695 with Linux dark themes (and slightly darken calltip background). 11696 11697- bpo-23205: For the grep module, add tests for findfiles, refactor 11698 findfiles to be a module-level function, and refactor findfiles to use 11699 os.walk. 11700 11701- bpo-23216: Add docstrings to IDLE search modules. 11702 11703- bpo-36152: Remove colorizer.ColorDelegator.close_when_done and the 11704 corresponding argument of .close(). In IDLE, both have always been None 11705 or False since 2007. 11706 11707- bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Patch 11708 by Kevin Walzer. 11709 11710- bpo-36096: Refactor class variables to instance variables in colorizer. 11711 11712- bpo-30348: Increase test coverage of idlelib.autocomplete by 30%. Patch by 11713 Louie Lu 11714 11715Tools/Demos 11716----------- 11717 11718- bpo-35132: Fix py-list and py-bt commands of python-gdb.py on gdb7. 11719 11720- bpo-32217: Fix freeze script on Windows. 11721 11722C API 11723----- 11724 11725- bpo-36381: Raise ``DeprecationWarning`` when '#' formats are used for 11726 building or parsing values without ``PY_SSIZE_T_CLEAN``. 11727 11728- bpo-36142: The whole coreconfig.h header is now excluded from 11729 Py_LIMITED_API. Move functions definitions into a new internal 11730 pycore_coreconfig.h header. 11731 11732 11733What's New in Python 3.8.0 alpha 2? 11734=================================== 11735 11736*Release date: 2019-02-25* 11737 11738Core and Builtins 11739----------------- 11740 11741- bpo-36052: Raise a :exc:`SyntaxError` when assigning a value to 11742 `__debug__` with the Assignment Operator. Contributed by Stéphane Wirtel 11743 and Pablo Galindo. 11744 11745- bpo-36012: Doubled the speed of class variable writes. When a non-dunder 11746 attribute was updated, there was an unnecessary call to update slots. 11747 11748- bpo-35942: The error message emitted when returning invalid types from 11749 ``__fspath__`` in interfaces that allow passing :class:`~os.PathLike` 11750 objects has been improved and now it does explain the origin of the error. 11751 11752- bpo-36016: ``gc.get_objects`` can now receive an optional parameter 11753 indicating a generation to get objects from. Patch by Pablo Galindo. 11754 11755- bpo-1054041: When the main interpreter exits due to an uncaught 11756 KeyboardInterrupt, the process now exits in the appropriate manner for its 11757 parent process to detect that a SIGINT or ^C terminated the process. This 11758 allows shells and batch scripts to understand that the user has asked them 11759 to stop. 11760 11761- bpo-35992: Fix ``__class_getitem__()`` not being called on a class with a 11762 custom non-subscriptable metaclass. 11763 11764- bpo-35993: Fix a crash on fork when using subinterpreters. Contributed by 11765 Stéphane Wirtel 11766 11767- bpo-35991: Fix a potential double free in Modules/_randommodule.c. 11768 11769- bpo-35961: Fix a crash in slice_richcompare(): use strong references 11770 rather than stolen references for the two temporary internal tuples. 11771 11772- bpo-35911: Enable the creation of cell objects by adding a 11773 ``cell.__new__`` method, and expose the type ``cell`` in ``Lib/types.py`` 11774 under the name CellType. Patch by Pierre Glaser. 11775 11776- bpo-12822: Use monotonic clock for ``pthread_cond_timedwait`` when 11777 ``pthread_condattr_setclock`` and ``CLOCK_MONOTONIC`` are available. 11778 11779- bpo-15248: The compiler emits now syntax warnings in the case when a comma 11780 is likely missed before tuple or list. 11781 11782- bpo-35886: The implementation of PyInterpreterState has been moved into 11783 the internal header files (guarded by Py_BUILD_CORE). 11784 11785- bpo-31506: Clarify the errors reported when ``object.__new__`` and 11786 ``object.__init__`` receive more than one argument. Contributed by Sanyam 11787 Khurana. 11788 11789- bpo-35724: Signal-handling is now guaranteed to happen relative to the 11790 main interpreter. 11791 11792- bpo-33608: We added a new internal _Py_AddPendingCall() that operates 11793 relative to the provided interpreter. This allows us to use the existing 11794 implementation to ask another interpreter to do work that cannot be done 11795 in the current interpreter, like decref an object the other interpreter 11796 owns. The existing Py_AddPendingCall() only operates relative to the main 11797 interpreter. 11798 11799- bpo-33989: Fix a possible crash in :meth:`list.sort` when sorting objects 11800 with ``ob_type->tp_richcompare == NULL``. Patch by Zackery Spytz. 11801 11802Library 11803------- 11804 11805- bpo-35512: :func:`unittest.mock.patch.dict` used as a decorator with 11806 string target resolves the target during function call instead of during 11807 decorator construction. Patch by Karthikeyan Singaravelan. 11808 11809- bpo-36018: Add statistics.NormalDist, a tool for creating and manipulating 11810 normal distributions of random variable. Features a composite class that 11811 treats the mean and standard deviation of measurement data as single 11812 entity. 11813 11814- bpo-35904: Added statistics.fmean() as a faster, floating point variant of 11815 the existing mean() function. 11816 11817- bpo-35918: Removed broken ``has_key`` method from 11818 multiprocessing.managers.SyncManager.dict. Contributed by Rémi Lapeyre. 11819 11820- bpo-18283: Add support for bytes to :func:`shutil.which`. 11821 11822- bpo-35960: Fix :func:`dataclasses.field` throwing away empty mapping 11823 objects passed as metadata. 11824 11825- bpo-35500: Write expected and actual call parameters on separate lines in 11826 :meth:`unittest.mock.Mock.assert_called_with` assertion errors. 11827 Contributed by Susan Su. 11828 11829- bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles syntax 11830 errors. 11831 11832- bpo-24209: In http.server script, rely on getaddrinfo to bind to preferred 11833 address based on the bind parameter. Now default bind or binding to a name 11834 may bind to IPv6 or dual-stack, depending on the environment. 11835 11836- bpo-35321: Set ``__spec__.origin`` of ``_frozen_importlib`` to frozen so 11837 that it matches the behavior of ``_frozen_importlib_external``. Patch by 11838 Nina Zakharenko. 11839 11840- bpo-35378: Fix a reference issue inside :class:`multiprocessing.Pool` that 11841 caused the pool to remain alive if it was deleted without being closed or 11842 terminated explicitly. A new strong reference is added to the pool 11843 iterators to link the lifetime of the pool to the lifetime of its 11844 iterators so the pool does not get destroyed if a pool iterator is still 11845 alive. 11846 11847- bpo-34294: re module, fix wrong capturing groups in rare cases. 11848 :func:`re.search`, :func:`re.findall`, :func:`re.sub` and other functions 11849 that scan through string looking for a match, should reset capturing 11850 groups between two match attempts. Patch by Ma Lin. 11851 11852- bpo-35615: :mod:`weakref`: Fix a RuntimeError when copying a 11853 WeakKeyDictionary or a WeakValueDictionary, due to some keys or values 11854 disappearing while iterating. 11855 11856- bpo-35606: Implement :func:`math.prod` as analogous function to 11857 :func:`sum` that returns the product of a 'start' value (default: 1) times 11858 an iterable of numbers. Patch by Pablo Galindo. 11859 11860- bpo-32417: Performing arithmetic between :class:`datetime.datetime` 11861 subclasses and :class:`datetime.timedelta` now returns an object of the 11862 same type as the :class:`datetime.datetime` subclass. As a result, 11863 :meth:`datetime.datetime.astimezone` and alternate constructors like 11864 :meth:`datetime.datetime.now` and :meth:`datetime.fromtimestamp` called 11865 with a ``tz`` argument now *also* retain their subclass. 11866 11867- bpo-35153: Add *headers* optional keyword-only parameter to 11868 :class:`xmlrpc.client.ServerProxy`, :class:`xmlrpc.client.Transport` and 11869 :class:`xmlrpc.client.SafeTransport`. Patch by Cédric Krier. 11870 11871- bpo-34572: Fix C implementation of pickle.loads to use importlib's locking 11872 mechanisms, and thereby avoid using partially-loaded modules. Patch by Tim 11873 Burgess. 11874 11875Documentation 11876------------- 11877 11878- bpo-36083: Fix formatting of --check-hash-based-pycs options in the 11879 manpage Synopsis. 11880 11881- bpo-36007: Bump minimum sphinx version to 1.8. Patch by Anthony Sottile. 11882 11883- bpo-22062: Update documentation and docstrings for pathlib. Original patch 11884 by Mike Short. 11885 11886Tests 11887----- 11888 11889- bpo-27313: Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa 11890 Tk. 11891 11892- bpo-36019: Add test.support.TEST_HTTP_URL and replace references of 11893 http://www.example.com by this new constant. Contributed by Stéphane 11894 Wirtel. 11895 11896- bpo-36037: Fix test_ssl for strict OpenSSL configuration like RHEL8 strict 11897 crypto policy. Use older TLS version for minimum TLS version of the server 11898 SSL context if needed, to test TLS version older than default minimum TLS 11899 version. 11900 11901- bpo-35798: Added :func:`test.support.check_syntax_warning`. 11902 11903- bpo-35505: Make test_imap4_host_default_value independent on whether the 11904 local IMAP server is running. 11905 11906- bpo-35917: multiprocessing: provide unit tests for SyncManager and 11907 SharedMemoryManager classes + all the shareable types which are supposed 11908 to be supported by them. (patch by Giampaolo Rodola) 11909 11910- bpo-35704: Skip ``test_shutil.test_unpack_archive_xztar`` to prevent a 11911 MemoryError on 32-bit AIX when MAXDATA setting is less than 0x20000000. 11912 11913 Patch by Michael Felt (aixtools) 11914 11915- bpo-34720: Assert m_state != NULL to mimic GC traversal functions that do 11916 not correctly handle module creation when the module state has not been 11917 created. 11918 11919Windows 11920------- 11921 11922- bpo-35976: Added ARM build support to Windows build files in PCBuild. 11923 11924- bpo-35692: ``pathlib`` no longer raises when checking file and directory 11925 existence on drives that are not ready 11926 11927- bpo-35872: Uses the base Python executable when invoking venv in a virtual 11928 environment 11929 11930- bpo-35873: Prevents venv paths being inherited by child processes 11931 11932- bpo-35299: Fix sysconfig detection of the source directory and distutils 11933 handling of pyconfig.h during PGO profiling 11934 11935IDLE 11936---- 11937 11938- bpo-24310: IDLE -- Document settings dialog font tab sample. 11939 11940- bpo-35833: Revise IDLE doc for control codes sent to Shell. Add a code 11941 example block. 11942 11943- bpo-35689: Add docstrings and unittests for colorizer.py. 11944 11945 11946What's New in Python 3.8.0 alpha 1? 11947=================================== 11948 11949*Release date: 2019-02-03* 11950 11951Security 11952-------- 11953 11954- bpo-35746: [CVE-2019-5010] Fix a NULL pointer deref in ssl module. The 11955 cert parser did not handle CRL distribution points with empty DP or URI 11956 correctly. A malicious or buggy certificate can result into segfault. 11957 Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas Edet of 11958 Cisco. 11959 11960- bpo-34812: The :option:`-I` command line option (run Python in isolated 11961 mode) is now also copied by the :mod:`multiprocessing` and 11962 :mod:`distutils` modules when spawning child processes. Previously, only 11963 :option:`-E` and :option:`-s` options (enabled by :option:`-I`) were 11964 copied. 11965 11966- bpo-34791: The xml.sax and xml.dom.domreg no longer use environment 11967 variables to override parser implementations when 11968 sys.flags.ignore_environment is set by -E or -I arguments. 11969 11970- bpo-17239: The xml.sax and xml.dom.minidom parsers no longer processes 11971 external entities by default. External DTD and ENTITY declarations no 11972 longer load files or create network connections. 11973 11974- bpo-34623: CVE-2018-14647: The C accelerated _elementtree module now 11975 initializes hash randomization salt from _Py_HashSecret instead of 11976 libexpat's default CSPRNG. 11977 11978- bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. 11979 11980- bpo-33871: Fixed sending the part of the file in :func:`os.sendfile` on 11981 macOS. Using the *trailers* argument could cause sending more bytes from 11982 the input file than was specified. 11983 11984- bpo-32533: Fixed thread-safety of error handling in _ssl. 11985 11986- bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970. 11987 X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new 11988 test ensures that NULL bytes are not allowed. 11989 11990- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows 11991 11992- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic 11993 backtracking. These regexes formed potential DOS vectors (REDOS). They 11994 have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch 11995 by Jamie Davis. 11996 11997- bpo-28414: The ssl module now allows users to perform their own IDN 11998 en/decoding when using SNI. 11999 12000Core and Builtins 12001----------------- 12002 12003- bpo-35877: Make parenthesis optional for named expressions in while 12004 statement. Patch by Karthikeyan Singaravelan. 12005 12006- bpo-35814: Allow same right hand side expressions in annotated assignments 12007 as in normal ones. In particular, ``x: Tuple[int, int] = 1, 2`` (without 12008 parentheses on the right) is now allowed. 12009 12010- bpo-35766: Add the option to parse PEP 484 type comments in the ast 12011 module. (Off by default.) This is merging the key functionality of the 12012 third party fork thereof, 12013 [typed_ast](https://github.com/python/typed_ast). 12014 12015- bpo-35713: Reorganize Python initialization to get working exceptions and 12016 sys.stderr earlier. 12017 12018- bpo-33416: Add end line and end column position information to the Python 12019 AST nodes. This is a C-level backwards incompatible change. 12020 12021- bpo-35720: Fixed a minor memory leak in pymain_parse_cmdline_impl function 12022 in Modules/main.c 12023 12024- bpo-35634: ``func(**kwargs)`` will now raise an error when ``kwargs`` is a 12025 mapping containing multiple entries with the same key. An error was 12026 already raised when other keyword arguments are passed before ``**kwargs`` 12027 since Python 3.6. 12028 12029- bpo-35623: Fix a crash when sorting very long lists. Patch by Stephan 12030 Hohe. 12031 12032- bpo-35214: clang Memory Sanitizer build instrumentation was added to work 12033 around false positives from posix, socket, time, test_io, and 12034 test_faulthandler. 12035 12036- bpo-35560: Fix an assertion error in :func:`format` in debug build for 12037 floating point formatting with "n" format, zero padding and small width. 12038 Release build is not impacted. Patch by Karthikeyan Singaravelan. 12039 12040- bpo-35552: Format characters ``%s`` and ``%V`` in 12041 :c:func:`PyUnicode_FromFormat` and ``%s`` in :c:func:`PyBytes_FromFormat` 12042 no longer read memory past the limit if *precision* is specified. 12043 12044- bpo-35504: Fix segfaults and :exc:`SystemError`\ s when deleting certain 12045 attributes. Patch by Zackery Spytz. 12046 12047- bpo-35504: Fixed a SystemError when delete the characters_written 12048 attribute of an OSError. 12049 12050- bpo-35494: Improved syntax error messages for unbalanced parentheses in 12051 f-string. 12052 12053- bpo-35444: Fixed error handling in pickling methods when fail to look up 12054 builtin "getattr". Sped up pickling iterators. 12055 12056- bpo-35436: Fix various issues with memory allocation error handling. 12057 Patch by Zackery Spytz. 12058 12059- bpo-35423: Separate the signal handling trigger in the eval loop from the 12060 "pending calls" machinery. There is no semantic change and the difference 12061 in performance is insignificant. 12062 12063- bpo-35357: Internal attributes' names of unittest.mock._Call and 12064 unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with 12065 _mock_ in order to prevent clashes with widely used object attributes. 12066 Fixed minor typo in test function name. 12067 12068- bpo-35372: Fixed the code page decoder for input longer than 2 GiB 12069 containing undecodable bytes. 12070 12071- bpo-35336: Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the 12072 C locale if the LC_CTYPE locale is "C". 12073 12074- bpo-31241: The *lineno* and *col_offset* attributes of AST nodes for list 12075 comprehensions, generator expressions and tuples are now point to the 12076 opening parenthesis or square brace. For tuples without parenthesis they 12077 point to the position of the first item. 12078 12079- bpo-33954: For :meth:`str.format`, :meth:`float.__format__` and 12080 :meth:`complex.__format__` methods for non-ASCII decimal point when using 12081 the "n" formatter. 12082 12083- bpo-35269: Fix a possible segfault involving a newly-created coroutine. 12084 Patch by Zackery Spytz. 12085 12086- bpo-35224: Implement :pep:`572` (assignment expressions). Patch by Emily 12087 Morehouse. 12088 12089- bpo-32492: Speed up :class:`namedtuple` attribute access by 1.6x using a C 12090 fast-path for the name descriptors. Patch by Pablo Galindo. 12091 12092- bpo-35214: Fixed an out of bounds memory access when parsing a truncated 12093 unicode escape sequence at the end of a string such as ``'\N'``. It would 12094 read one byte beyond the end of the memory allocation. 12095 12096- bpo-35214: The interpreter and extension modules have had annotations 12097 added so that they work properly under clang's Memory Sanitizer. A new 12098 configure flag --with-memory-sanitizer has been added to make test builds 12099 of this nature easier to perform. 12100 12101- bpo-35193: Fix an off by one error in the bytecode peephole optimizer 12102 where it could read bytes beyond the end of bounds of an array when 12103 removing unreachable code. This bug was present in every release of Python 12104 3.6 and 3.7 until now. 12105 12106- bpo-35169: Improved error messages for forbidden assignments. 12107 12108- bpo-34022: Fix handling of hash-based bytecode files in :mod:`zipimport`. 12109 Patch by Elvis Pranskevichus. 12110 12111- bpo-28401: Debug builds will no longer to attempt to import extension 12112 modules built for the ABI as they were never compatible to begin with. 12113 Patch by Stefano Rivera. 12114 12115- bpo-29341: Clarify in the docstrings of :mod:`os` methods that path-like 12116 objects are also accepted as input parameters. 12117 12118- bpo-35050: :mod:`socket`: Fix off-by-one bug in length check for 12119 ``AF_ALG`` name and type. 12120 12121- bpo-29743: Raise :exc:`ValueError` instead of :exc:`OverflowError` in case 12122 of a negative ``_length_`` in a :class:`ctypes.Array` subclass. Also 12123 raise :exc:`TypeError` instead of :exc:`AttributeError` for non-integer 12124 ``_length_``. Original patch by Oren Milman. 12125 12126- bpo-16806: Fix ``lineno`` and ``col_offset`` for multi-line string tokens. 12127 12128- bpo-35029: :exc:`SyntaxWarning` raised as an exception at code generation 12129 time will be now replaced with a :exc:`SyntaxError` for better error 12130 reporting. 12131 12132- bpo-34983: Expose :meth:`symtable.Symbol.is_nonlocal` in the symtable 12133 module. Patch by Pablo Galindo. 12134 12135- bpo-34974: :class:`bytes` and :class:`bytearray` constructors no longer 12136 convert unexpected exceptions (e.g. :exc:`MemoryError` and 12137 :exc:`KeyboardInterrupt`) to :exc:`TypeError`. 12138 12139- bpo-34939: Allow annotated names in module namespace that are declared 12140 global before the annotation happens. Patch by Pablo Galindo. 12141 12142- bpo-34973: Fixed crash in :func:`bytes` when the :class:`list` argument is 12143 mutated while it is iterated. 12144 12145- bpo-34876: The *lineno* and *col_offset* attributes of the AST for 12146 decorated function and class refer now to the position of the 12147 corresponding ``def``, ``async def`` and ``class`` instead of the position 12148 of the first decorator. This leads to more correct line reporting in 12149 tracing. This is the only case when the position of child AST nodes can 12150 precede the position of the parent AST node. 12151 12152- bpo-34879: Fix a possible null pointer dereference in bytesobject.c. 12153 Patch by Zackery Spytz. 12154 12155- bpo-34784: Fix the implementation of PyStructSequence_NewType in order to 12156 create heap allocated StructSequences. 12157 12158- bpo-32912: A :exc:`SyntaxWarning` is now emitted instead of a 12159 :exc:`DeprecationWarning` for invalid escape sequences in string and bytes 12160 literals. 12161 12162- bpo-34854: Fixed a crash in compiling string annotations containing a 12163 lambda with a keyword-only argument that doesn't have a default value. 12164 12165- bpo-34850: The compiler now produces a :exc:`SyntaxWarning` when identity 12166 checks (``is`` and ``is not``) are used with certain types of literals 12167 (e.g. strings, ints). These can often work by accident in CPython, but 12168 are not guaranteed by the language spec. The warning advises users to use 12169 equality tests (``==`` and ``!=``) instead. 12170 12171- bpo-34824: Fix a possible null pointer dereference in Modules/_ssl.c. 12172 Patch by Zackery Spytz. 12173 12174- bpo-30156: The C function ``property_descr_get()`` uses a "cached" tuple 12175 to optimize function calls. But this tuple can be discovered in debug mode 12176 with :func:`sys.getobjects()`. Remove the optimization, it's not really 12177 worth it and it causes 3 different crashes last years. 12178 12179- bpo-34762: Fix contextvars C API to use PyObject* pointer types. 12180 12181- bpo-34751: The hash function for tuples is now based on xxHash which gives 12182 better collision results on (formerly) pathological cases. Additionally, 12183 on 64-bit systems it improves tuple hashes in general. Patch by Jeroen 12184 Demeyer with substantial contributions by Tim Peters. 12185 12186- bpo-34735: Fix a memory leak in Modules/timemodule.c. Patch by Zackery 12187 Spytz. 12188 12189- bpo-34683: Fixed a bug where some SyntaxError error pointed to locations 12190 that were off-by-one. 12191 12192- bpo-34651: Only allow the main interpreter to fork. The avoids the 12193 possibility of affecting the main interpreter, which is critical to 12194 operation of the runtime. 12195 12196- bpo-34653: Remove unused function PyParser_SimpleParseStringFilename. 12197 12198- bpo-32236: Warn that line buffering is not supported if :func:`open` is 12199 called with binary mode and ``buffering=1``. 12200 12201- bpo-34641: Further restrict the syntax of the left-hand side of keyword 12202 arguments in function calls. In particular, ``f((keyword)=arg)`` is now 12203 disallowed. 12204 12205- bpo-34637: Make the *start* argument to *sum()* visible as a keyword 12206 argument. 12207 12208- bpo-1621: Do not assume signed integer overflow behavior (C undefined 12209 behavior) when performing set hash table resizing. 12210 12211- bpo-34588: Fix an off-by-one in the recursive call pruning feature of 12212 traceback formatting. 12213 12214- bpo-34485: On Windows, the LC_CTYPE is now set to the user preferred 12215 locale at startup. Previously, the LC_CTYPE locale was "C" at startup, but 12216 changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, ""). 12217 12218- bpo-34485: Standard streams like sys.stdout now use the "surrogateescape" 12219 error handler, instead of "strict", on the POSIX locale (when the C locale 12220 is not coerced and the UTF-8 Mode is disabled). 12221 12222- bpo-34485: Fix the error handler of standard streams like sys.stdout: 12223 PYTHONIOENCODING=":" is now ignored instead of setting the error handler 12224 to "strict". 12225 12226- bpo-34485: Python now gets the locale encoding with C code to initialize 12227 the encoding of standard streams like sys.stdout. Moreover, the encoding 12228 is now initialized to the Python codec name to get a normalized encoding 12229 name and to ensure that the codec is loaded. The change avoids importing 12230 _bootlocale and _locale modules at startup by default. 12231 12232- bpo-34527: On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also 12233 forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if 12234 the LC_CTYPE locale is "C". 12235 12236- bpo-34527: The UTF-8 Mode is now also enabled by the "POSIX" locale, not 12237 only by the "C" locale. 12238 12239- bpo-34403: On HP-UX with C or POSIX locale, sys.getfilesystemencoding() 12240 now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled 12241 and the C locale is not coerced). 12242 12243- bpo-34523: The Python filesystem encoding is now read earlier during the 12244 Python initialization. 12245 12246- bpo-12458: Tracebacks show now correct line number for subexpressions in 12247 multiline expressions. Tracebacks show now the line number of the first 12248 line for multiline expressions instead of the line number of the last 12249 subexpression. 12250 12251- bpo-34408: Prevent a null pointer dereference and resource leakage in 12252 ``PyInterpreterState_New()``. 12253 12254- bpo-34400: Fix undefined behavior in parsetok.c. Patch by Zackery Spytz. 12255 12256- bpo-33073: Added as_integer_ratio to ints to make them more interoperable 12257 with floats. 12258 12259- bpo-34377: Update valgrind suppression list to use 12260 ``_PyObject_Free``/``_PyObject_Realloc`` instead of 12261 ``PyObject_Free``/``PyObject_Realloc``. 12262 12263- bpo-34353: Added the "socket" option in the `stat.filemode()` Python 12264 implementation to match the C implementation. 12265 12266- bpo-34320: Fix ``dict(od)`` didn't copy iteration order of OrderedDict. 12267 12268- bpo-34113: Fixed crash on debug builds when opcode stack was adjusted with 12269 negative numbers. Patch by Constantin Petrisor. 12270 12271- bpo-34100: Compiler now merges constants in tuples and frozensets 12272 recursively. Code attributes like ``co_names`` are merged too. 12273 12274- bpo-34151: Performance of list concatenation, repetition and slicing 12275 operations is slightly improved. Patch by Sergey Fedoseev. 12276 12277- bpo-34170: -X dev: it is now possible to override the memory allocator 12278 using PYTHONMALLOC even if the developer mode is enabled. 12279 12280- bpo-33237: Improved :exc:`AttributeError` message for partially 12281 initialized module. 12282 12283- bpo-34149: Fix min and max functions to get default behavior when key is 12284 None. 12285 12286- bpo-34125: Profiling of unbound built-in methods now works when 12287 ``**kwargs`` is given. 12288 12289- bpo-34141: Optimized pickling atomic types (None, bool, int, float, bytes, 12290 str). 12291 12292- bpo-34126: Fix crashes when profiling certain invalid calls of unbound 12293 methods. Patch by Jeroen Demeyer. 12294 12295- bpo-24618: Fixed reading invalid memory when create the code object with 12296 too small varnames tuple or too large argument counts. 12297 12298- bpo-34068: In :meth:`io.IOBase.close`, ensure that the 12299 :attr:`~io.IOBase.closed` attribute is not set with a live exception. 12300 Patch by Zackery Spytz and Serhiy Storchaka. 12301 12302- bpo-34087: Fix buffer overflow while converting unicode to numeric values. 12303 12304- bpo-34080: Fixed a memory leak in the compiler when it raised some 12305 uncommon errors during tokenizing. 12306 12307- bpo-34066: Disabled interruption by Ctrl-C between calling ``open()`` and 12308 entering a **with** block in ``with open()``. 12309 12310- bpo-34042: Fix dict.copy() to maintain correct total refcount (as reported 12311 by sys.gettotalrefcount()). 12312 12313- bpo-33418: Fix potential memory leak in function object when it creates 12314 reference cycle. 12315 12316- bpo-33985: Implement contextvars.ContextVar.name attribute. 12317 12318- bpo-33956: Update vendored Expat library copy to version 2.2.5. 12319 12320- bpo-24596: Decref the module object in :c:func:`PyRun_SimpleFileExFlags` 12321 before calling :c:func:`PyErr_Print()`. Patch by Zackery Spytz. 12322 12323- bpo-33451: Close directly executed pyc files before calling 12324 ``PyEval_EvalCode()``. 12325 12326- bpo-1617161: The hash of :class:`BuiltinMethodType` instances (methods of 12327 built-in classes) now depends on the hash of the identity of *__self__* 12328 instead of its value. The hash and equality of :class:`ModuleType` and 12329 :class:`MethodWrapperType` instances (methods of user-defined classes and 12330 some methods of built-in classes like ``str.__add__``) now depend on the 12331 hash and equality of the identity of *__self__* instead of its value. 12332 :class:`MethodWrapperType` instances no longer support ordering. 12333 12334- bpo-33824: Fix "LC_ALL=C python3.7 -V": reset properly the command line 12335 parser when the encoding changes after reading the Python configuration. 12336 12337- bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an 12338 object that hadn't all of its fields set to NULL. 12339 12340- bpo-33738: Seven macro incompatibilities with the Limited API were fixed, 12341 and the macros :c:func:`PyIter_Check`, :c:func:`PyIndex_Check` and 12342 :c:func:`PyExceptionClass_Name` were added as functions. A script for 12343 automatic macro checks was added. 12344 12345- bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 12346 correctly 12347 12348- bpo-30167: ``PyRun_SimpleFileExFlags`` removes ``__cached__`` from module 12349 in addition to ``__file__``. 12350 12351- bpo-33706: Fix a crash in Python initialization when parsing the command 12352 line options. Thanks Christoph Gohlke for the bug report and the fix! 12353 12354- bpo-33597: Reduce ``PyGC_Head`` size from 3 words to 2 words. 12355 12356- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter 12357 shutdown even when there was a custom handler set previously. Patch by 12358 Philipp Kerling. 12359 12360- bpo-33622: Fixed a leak when the garbage collector fails to add an object 12361 with the ``__del__`` method or referenced by it into the 12362 :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an 12363 exception is set and preserves it. 12364 12365- bpo-33462: Make dict and dict views reversible. Patch by Rémi Lapeyre. 12366 12367- bpo-23722: A :exc:`RuntimeError` is now raised when the custom metaclass 12368 doesn't provide the ``__classcell__`` entry in the namespace passed to 12369 ``type.__new__``. A :exc:`DeprecationWarning` was emitted in Python 12370 3.6--3.7. 12371 12372- bpo-33499: Add :envvar:`PYTHONPYCACHEPREFIX` environment variable and 12373 :option:`-X` ``pycache_prefix`` command-line option to set an alternate 12374 root directory for writing module bytecode cache files. 12375 12376- bpo-25711: The :mod:`zipimport` module has been rewritten in pure Python. 12377 12378- bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't 12379 crash if module_globals is not a dict. 12380 12381- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c. 12382 12383- bpo-33475: Fixed miscellaneous bugs in converting annotations to strings 12384 and optimized parentheses in the string representation. 12385 12386- bpo-20104: Added support for the `setpgroup`, `resetids`, `setsigmask`, 12387 `setsigdef` and `scheduler` parameters of `posix_spawn`. Patch by Pablo 12388 Galindo. 12389 12390- bpo-33391: Fix a leak in set_symmetric_difference(). 12391 12392- bpo-33363: Raise a SyntaxError for ``async with`` and ``async for`` 12393 statements outside of async functions. 12394 12395- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer. 12396 12397- bpo-33128: Fix a bug that causes PathFinder to appear twice on 12398 sys.meta_path. Patch by Pablo Galindo Salgado. 12399 12400- bpo-33331: Modules imported last are now cleared first at interpreter 12401 shutdown. 12402 12403- bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in 12404 dictobject.c by adjusting how the internal struct _dictkeysobject shared 12405 keys structure is declared. 12406 12407- bpo-33305: Improved syntax error messages for invalid numerical literals. 12408 12409- bpo-33306: Improved syntax error messages for unbalanced parentheses. 12410 12411- bpo-33234: The list constructor will pre-size and not over-allocate when 12412 the input length is known. 12413 12414- bpo-33270: Intern the names for all anonymous code objects. Patch by 12415 Zackery Spytz. 12416 12417- bpo-30455: The C and Python code and the documentation related to tokens 12418 are now generated from a single source file :file:`Grammar/Tokens`. 12419 12420- bpo-33176: Add a ``toreadonly()`` method to memoryviews. 12421 12422- bpo-33231: Fix potential memory leak in ``normalizestring()``. 12423 12424- bpo-33205: Change dict growth function from 12425 ``round_up_to_power_2(used*2+hashtable_size/2)`` to 12426 ``round_up_to_power_2(used*3)``. Previously, dict is shrinked only when 12427 ``used == 0``. Now dict has more chance to be shrinked. 12428 12429- bpo-29922: Improved error messages in 'async with' when ``__aenter__()`` 12430 or ``__aexit__()`` return non-awaitable object. 12431 12432- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized 12433 when copying from key-sharing dict. 12434 12435- bpo-33053: When using the -m switch, sys.path[0] is now explicitly 12436 expanded as the *starting* working directory, rather than being left as 12437 the empty path (which allows imports from the current working directory at 12438 the time of the import) 12439 12440- bpo-33138: Changed standard error message for non-pickleable and 12441 non-copyable types. It now says "cannot pickle" instead of "can't pickle" 12442 or "cannot serialize". 12443 12444- bpo-33018: Improve consistency of errors raised by ``issubclass()`` when 12445 called with a non-class and an abstract base class as the first and second 12446 arguments, respectively. Patch by Josh Bronson. 12447 12448- bpo-33083: ``math.factorial`` no longer accepts arguments that are not 12449 int-like. Patch by Pablo Galindo. 12450 12451- bpo-33041: Added new opcode :opcode:`END_ASYNC_FOR` and fixes the 12452 following issues: 12453 12454 * Setting global :exc:`StopAsyncIteration` no longer breaks ``async for`` 12455 loops. 12456 * Jumping into an ``async for`` loop is now disabled. 12457 * Jumping out of an ``async for`` loop no longer corrupts the stack. 12458 12459- bpo-25750: Fix rare Python crash due to bad refcounting in 12460 ``type_getattro()`` if a descriptor deletes itself from the class. Patch 12461 by Jeroen Demeyer. 12462 12463- bpo-33041: Fixed bytecode generation for "async for" with a complex 12464 target. A StopAsyncIteration raised on assigning or unpacking will be now 12465 propagated instead of stopping the iteration. 12466 12467- bpo-33026: Fixed jumping out of "with" block by setting f_lineno. 12468 12469- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex: 12470 using PYTHONMALLOC env var). _PyGILState_Reinit() and 12471 _PyInterpreterState_Enable() now use the default RAW memory allocator to 12472 allocate a new interpreters mutex on fork. 12473 12474- bpo-32911: Due to unexpected compatibility issues discovered during 12475 downstream beta testing, reverted :issue:`29463`. ``docstring`` field is 12476 removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes 12477 which was added in 3.7a1. Docstring expression is restored as a first 12478 statement in their body. Based on patch by Inada Naoki. 12479 12480- bpo-17288: Prevent jumps from 'return' and 'exception' trace events. 12481 12482- bpo-32946: Importing names from already imported module with "from ... 12483 import ..." is now 30% faster if the module is not a package. 12484 12485- bpo-32932: Make error message more revealing when there are non-str 12486 objects in ``__all__``. 12487 12488- bpo-32925: Optimized iterating and containing test for literal lists 12489 consisting of non-constants: ``x in [a, b]`` and ``for x in [a, b]``. The 12490 case of all constant elements already was optimized. 12491 12492- bpo-32889: Update Valgrind suppression list to account for the rename of 12493 ``Py_ADDRESS_IN_RANG`` to ``address_in_range``. 12494 12495- bpo-32836: Don't use temporary variables in cases of list/dict/set 12496 comprehensions 12497 12498- bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled() 12499 context manager). 12500 12501- bpo-32305: For namespace packages, ensure that both ``__file__`` and 12502 ``__spec__.origin`` are set to None. 12503 12504- bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for 12505 namespace packages. 12506 12507- bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by 12508 Stéphane Wirtel 12509 12510- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by 12511 write out-of-bound errors when using customized decode error handlers. 12512 12513- bpo-32489: A :keyword:`continue` statement is now allowed in the 12514 :keyword:`finally` clause. 12515 12516- bpo-17611: Simplified the interpreter loop by moving the logic of 12517 unrolling the stack of blocks into the compiler. The compiler emits now 12518 explicit instructions for adjusting the stack of values and calling the 12519 cleaning up code for :keyword:`break`, :keyword:`continue` and 12520 :keyword:`return`. 12521 12522 Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, 12523 :opcode:`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes 12524 :opcode:`ROT_FOUR`, :opcode:`BEGIN_FINALLY` and :opcode:`CALL_FINALLY` and 12525 :opcode:`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY` and 12526 :opcode:`WITH_CLEANUP_START`. 12527 12528- bpo-32285: New function unicodedata.is_normalized, which can check whether 12529 a string is in a specific normal form. 12530 12531- bpo-10544: Yield expressions are now disallowed in comprehensions and 12532 generator expressions except the expression for the outermost iterable. 12533 12534- bpo-32117: Iterable unpacking is now allowed without parentheses in yield 12535 and return statements, e.g. ``yield 1, 2, 3, *rest``. Thanks to David 12536 Cuthbert for the change and Jordan Chapman for added tests. 12537 12538- bpo-31902: Fix the ``col_offset`` attribute for ast nodes 12539 ``ast.AsyncFor``, ``ast.AsyncFunctionDef``, and ``ast.AsyncWith``. 12540 Previously, ``col_offset`` pointed to the keyword after ``async``. 12541 12542- bpo-25862: Fix assertion failures in the ``tell()`` method of 12543 ``io.TextIOWrapper``. Patch by Zackery Spytz. 12544 12545- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a 12546 ctypes structured data type. Patch by Eryk Sun and Oren Milman. 12547 12548- bpo-31577: Fix a crash in `os.utime()` in case of a bad ns argument. Patch 12549 by Oren Milman. 12550 12551- bpo-29832: Remove references to 'getsockaddrarg' from various socket error 12552 messages. Patch by Oren Milman. 12553 12554Library 12555------- 12556 12557- bpo-35845: Add 'order' parameter to memoryview.tobytes(). 12558 12559- bpo-35864: The _asdict() method for collections.namedtuple now returns a 12560 regular dict instead of an OrderedDict. 12561 12562- bpo-35537: An ExitStack is now used internally within subprocess.Popen to 12563 clean up pipe file handles. No behavior change in normal operation. But if 12564 closing one handle were ever to cause an exception, the others will now be 12565 closed instead of leaked. (patch by Giampaolo Rodola) 12566 12567- bpo-35847: RISC-V needed the CTYPES_PASS_BY_REF_HACK. Fixes ctypes 12568 Structure test_pass_by_value. 12569 12570- bpo-35813: Shared memory submodule added to multiprocessing to avoid need 12571 for serialization between processes 12572 12573- bpo-35780: Fix lru_cache() errors arising in recursive, reentrant, or 12574 multi-threaded code. These errors could result in orphan links and in the 12575 cache being trapped in a state with fewer than the specified maximum 12576 number of links. Fix handling of negative maxsize which should have been 12577 treated as zero. Fix errors in toggling the "full" status flag. Fix 12578 misordering of links when errors are encountered. Sync-up the C code and 12579 pure Python code for the space saving path in functions with a single 12580 positional argument. In this common case, the space overhead of an lru 12581 cache entry is reduced by almost half. Fix counting of cache misses. In 12582 error cases, the miss count was out of sync with the actual number of 12583 times the underlying user function was called. 12584 12585- bpo-35537: :func:`os.posix_spawn` and :func:`os.posix_spawnp` now have a 12586 *setsid* parameter. 12587 12588- bpo-23846: :class:`asyncio.ProactorEventLoop` now catches and logs send 12589 errors when the self-pipe is full. 12590 12591- bpo-34323: :mod:`asyncio`: Enhance ``IocpProactor.close()`` log: wait 1 12592 second before the first log, then log every second. Log also the number of 12593 seconds since ``close()`` was called. 12594 12595- bpo-35674: Add a new :func:`os.posix_spawnp` function. Patch by Joannah 12596 Nanjekye. 12597 12598- bpo-35733: ``ast.Constant(boolean)`` no longer an instance of 12599 :class:`ast.Num`. Patch by Anthony Sottile. 12600 12601- bpo-35726: QueueHandler.prepare() now makes a copy of the record before 12602 modifying and enqueueing it, to avoid affecting other handlers in the 12603 chain. 12604 12605- bpo-35719: Sped up multi-argument :mod:`math` functions atan2(), 12606 copysign(), remainder() and hypot() by 1.3--2.5 times. 12607 12608- bpo-35717: Fix KeyError exception raised when using enums and compile. 12609 Patch contributed by Rémi Lapeyre. 12610 12611- bpo-35699: Fixed detection of Visual Studio Build Tools 2017 in distutils 12612 12613- bpo-32710: Fix memory leaks in asyncio ProactorEventLoop on overlapped 12614 operation failure. 12615 12616- bpo-35702: The :data:`time.CLOCK_UPTIME_RAW` constant is now available for 12617 macOS 10.12. 12618 12619- bpo-32710: Fix a memory leak in asyncio in the ProactorEventLoop when 12620 ``ReadFile()`` or ``WSASend()`` overlapped operation fail immediately: 12621 release the internal buffer. 12622 12623- bpo-35682: Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to 12624 set the result of an internal future if it's already done. 12625 12626- bpo-35283: Add a deprecated warning for the 12627 :meth:`threading.Thread.isAlive` method. Patch by Dong-hee Na. 12628 12629- bpo-35664: Improve operator.itemgetter() performance by 33% with optimized 12630 argument handling and with adding a fast path for the common case of a 12631 single non-negative integer index into a tuple (which is the typical use 12632 case in the standard library). 12633 12634- bpo-35643: Fixed a SyntaxWarning: invalid escape sequence in 12635 Modules/_sha3/cleanup.py. Patch by Mickaël Schoentgen. 12636 12637- bpo-35619: Improved support of custom data descriptors in :func:`help` and 12638 :mod:`pydoc`. 12639 12640- bpo-28503: The `crypt` module now internally uses the `crypt_r()` library 12641 function instead of `crypt()` when available. 12642 12643- bpo-35614: Fixed help() on metaclasses. Patch by Sanyam Khurana. 12644 12645- bpo-35568: Expose ``raise(signum)`` as `raise_signal` 12646 12647- bpo-35588: The floor division and modulo operations and the :func:`divmod` 12648 function on :class:`fractions.Fraction` types are 2--4x faster. Patch by 12649 Stefan Behnel. 12650 12651- bpo-35585: Speed-up building enums by value, e.g. http.HTTPStatus(200). 12652 12653- bpo-30561: random.gammavariate(1.0, beta) now computes the same result as 12654 random.expovariate(1.0 / beta). This synchronizes the two algorithms and 12655 eliminates some idiosyncrasies in the old implementation. It does however 12656 produce a difference stream of random variables than it used to. 12657 12658- bpo-35537: The :mod:`subprocess` module can now use the 12659 :func:`os.posix_spawn` function in some cases for better performance. 12660 12661- bpo-35526: Delaying the 'joke' of barry_as_FLUFL.mandatory to Python 12662 version 4.0 12663 12664- bpo-35523: Remove :mod:`ctypes` callback workaround: no longer create a 12665 callback at startup. Avoid SELinux alert on ``import ctypes`` and ``import 12666 uuid``. 12667 12668- bpo-31784: :func:`uuid.uuid1` now calls :func:`time.time_ns` rather than 12669 ``int(time.time() * 1e9)``. 12670 12671- bpo-35513: :class:`~unittest.runner.TextTestRunner` of 12672 :mod:`unittest.runner` now uses :func:`time.perf_counter` rather than 12673 :func:`time.time` to measure the execution time of a test: 12674 :func:`time.time` can go backwards, whereas :func:`time.perf_counter` is 12675 monotonic. 12676 12677- bpo-35502: Fixed reference leaks in 12678 :class:`xml.etree.ElementTree.TreeBuilder` in case of unfinished building 12679 of the tree (in particular when an error was raised during parsing XML). 12680 12681- bpo-35348: Make :func:`platform.architecture` parsing of ``file`` command 12682 output more reliable: add the ``-b`` option to the ``file`` command to 12683 omit the filename, force the usage of the C locale, and search also the 12684 "shared object" pattern. 12685 12686- bpo-35491: :mod:`multiprocessing`: Add ``Pool.__repr__()`` and enhance 12687 ``BaseProcess.__repr__()`` (add pid and parent pid) to ease debugging. 12688 Pool state constant values are now strings instead of integers, for 12689 example ``RUN`` value becomes ``'RUN'`` instead of ``0``. 12690 12691- bpo-35477: :meth:`multiprocessing.Pool.__enter__` now fails if the pool is 12692 not running: ``with pool:`` fails if used more than once. 12693 12694- bpo-31446: Copy command line that was passed to CreateProcessW since this 12695 function can change the content of the input buffer. 12696 12697- bpo-35471: Python 2.4 dropped MacOS 9 support. The macpath module was 12698 deprecated in Python 3.7. The module is now removed. 12699 12700- bpo-23057: Unblock Proactor event loop when keyboard interrupt is received 12701 on Windows 12702 12703- bpo-35052: Fix xml.dom.minidom cloneNode() on a document with an entity: 12704 pass the correct arguments to the user data handler of an entity. 12705 12706- bpo-20239: Allow repeated assignment deletion of 12707 :class:`unittest.mock.Mock` attributes. Patch by Pablo Galindo. 12708 12709- bpo-17185: Set ``__signature__`` on mock for :mod:`inspect` to get 12710 signature. Patch by Karthikeyan Singaravelan. 12711 12712- bpo-35445: Memory errors during creating posix.environ no longer ignored. 12713 12714- bpo-35415: Validate fileno= argument to socket.socket(). 12715 12716- bpo-35424: :class:`multiprocessing.Pool` destructor now emits 12717 :exc:`ResourceWarning` if the pool is still running. 12718 12719- bpo-35330: When a :class:`Mock` instance was used to wrap an object, if 12720 `side_effect` is used in one of the mocks of it methods, don't call the 12721 original implementation and return the result of using the side effect the 12722 same way that it is done with return_value. 12723 12724- bpo-35346: Drop Mac OS 9 and Rhapsody support from the :mod:`platform` 12725 module. Rhapsody last release was in 2000. Mac OS 9 last release was in 12726 2001. 12727 12728- bpo-10496: :func:`~distutils.utils.check_environ` of 12729 :mod:`distutils.utils` now catches :exc:`KeyError` on calling 12730 :func:`pwd.getpwuid`: don't create the ``HOME`` environment variable in 12731 this case. 12732 12733- bpo-10496: :func:`posixpath.expanduser` now returns the input *path* 12734 unchanged if the ``HOME`` environment variable is not set and the current 12735 user has no home directory (if the current user identifier doesn't exist 12736 in the password database). This change fix the :mod:`site` module if the 12737 current user doesn't exist in the password database (if the user has no 12738 home directory). 12739 12740- bpo-35389: :func:`platform.libc_ver` now uses 12741 ``os.confstr('CS_GNU_LIBC_VERSION')`` if available and the *executable* 12742 parameter is not set. 12743 12744- bpo-35394: Add empty slots to asyncio abstract protocols. 12745 12746- bpo-35310: Fix a bug in :func:`select.select` where, in some cases, the 12747 file descriptor sequences were returned unmodified after a signal 12748 interruption, even though the file descriptors might not be ready yet. 12749 :func:`select.select` will now always return empty lists if a timeout has 12750 occurred. Patch by Oran Avraham. 12751 12752- bpo-35380: Enable TCP_NODELAY on Windows for proactor asyncio event loop. 12753 12754- bpo-35341: Add generic version of ``collections.OrderedDict`` to the 12755 ``typing`` module. Patch by Ismo Toijala. 12756 12757- bpo-35371: Fixed possible crash in ``os.utime()`` on Windows when pass 12758 incorrect arguments. 12759 12760- bpo-35346: :func:`platform.uname` now redirects ``stderr`` to 12761 :data:`os.devnull` when running external programs like ``cmd /c ver``. 12762 12763- bpo-35066: Previously, calling the strftime() method on a datetime object 12764 with a trailing '%' in the format string would result in an exception. 12765 However, this only occurred when the datetime C module was being used; the 12766 python implementation did not match this behavior. Datetime is now PEP-399 12767 compliant, and will not throw an exception on a trailing '%'. 12768 12769- bpo-35345: The function `platform.popen` has been removed, it was 12770 deprecated since Python 3.3: use :func:`os.popen` instead. 12771 12772- bpo-35344: On macOS, :func:`platform.platform` now uses 12773 :func:`platform.mac_ver`, if it returns a non-empty release string, to get 12774 the macOS version rather than the darwin version. 12775 12776- bpo-35312: Make ``lib2to3.pgen2.parse.ParseError`` round-trip pickle-able. 12777 Patch by Anthony Sottile. 12778 12779- bpo-35308: Fix regression in ``webbrowser`` where default browsers may be 12780 preferred over browsers in the ``BROWSER`` environment variable. 12781 12782- bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff. 12783 Original patch by R. David Murray & Jairo Trad. Enhanced by Sanyam 12784 Khurana. 12785 12786- bpo-28604: :func:`locale.localeconv` now sets temporarily the ``LC_CTYPE`` 12787 locale to the ``LC_MONETARY`` locale if the two locales are different and 12788 monetary strings are non-ASCII. This temporary change affects other 12789 threads. 12790 12791- bpo-35277: Update ensurepip to install pip 18.1 and setuptools 40.6.2. 12792 12793- bpo-24209: Adds IPv6 support when invoking http.server directly. 12794 12795- bpo-35226: Recursively check arguments when testing for equality of 12796 :class:`unittest.mock.call` objects and add note that tracking of 12797 parameters used to create ancestors of mocks in ``mock_calls`` is not 12798 possible. 12799 12800- bpo-29564: The warnings module now suggests to enable tracemalloc if the 12801 source is specified, the tracemalloc module is available, but tracemalloc 12802 is not tracing memory allocations. 12803 12804- bpo-35189: Modify the following fnctl function to retry if interrupted by 12805 a signal (EINTR): flock, lockf, fnctl 12806 12807- bpo-30064: Use add_done_callback() in sock_* asyncio API to unsubscribe 12808 reader/writer early on calcellation. 12809 12810- bpo-35186: Removed the "built with" comment added when ``setup.py upload`` 12811 is used with either ``bdist_rpm`` or ``bdist_dumb``. 12812 12813- bpo-35152: Allow sending more than 2 GB at once on a multiprocessing 12814 connection on non-Windows systems. 12815 12816- bpo-35062: Fix incorrect parsing of 12817 :class:`_io.IncrementalNewlineDecoder`'s *translate* argument. 12818 12819- bpo-35065: Remove `StreamReaderProtocol._untrack_reader`. The call to 12820 `_untrack_reader` is currently performed too soon, causing the protocol to 12821 forget about the reader before `connection_lost` can run and feed the EOF 12822 to the reader. 12823 12824- bpo-34160: ElementTree and minidom now preserve the attribute order 12825 specified by the user. 12826 12827- bpo-35079: Improve difflib.SequenceManager.get_matching_blocks doc by 12828 adding 'non-overlapping' and changing '!=' to '<'. 12829 12830- bpo-33710: Deprecated ``l*gettext()`` functions and methods in the 12831 :mod:`gettext` module. They return encoded bytes instead of Unicode 12832 strings and are artifacts from Python 2 times. Also deprecated functions 12833 and methods related to setting the charset for ``l*gettext()`` functions 12834 and methods. 12835 12836- bpo-35017: :meth:`socketserver.BaseServer.serve_forever` now exits 12837 immediately if it's :meth:`~socketserver.BaseServer.shutdown` method is 12838 called while it is polling for new events. 12839 12840- bpo-35024: `importlib` no longer logs `wrote <bytecode path>` redundantly 12841 after `(created|could not create) <bytecode path>` is already logged. 12842 Patch by Quentin Agren. 12843 12844- bpo-35047: ``unittest.mock`` now includes mock calls in exception messages 12845 if ``assert_not_called``, ``assert_called_once``, or 12846 ``assert_called_once_with`` fails. Patch by Petter Strandmark. 12847 12848- bpo-31047: Fix ``ntpath.abspath`` regression where it didn't remove a 12849 trailing separator on Windows. Patch by Tim Graham. 12850 12851- bpo-35053: tracemalloc now tries to update the traceback when an object is 12852 reused from a "free list" (optimization for faster object creation, used 12853 by the builtin list type for example). 12854 12855- bpo-31553: Add the --json-lines option to json.tool. Patch by hongweipeng. 12856 12857- bpo-34794: Fixed a leak in Tkinter when pass the Python wrapper around 12858 Tcl_Obj back to Tcl/Tk. 12859 12860- bpo-34909: Enum: fix grandchildren subclassing when parent mixed with 12861 concrete data types. 12862 12863- bpo-35022: :class:`unittest.mock.MagicMock` now supports the 12864 ``__fspath__`` method (from :class:`os.PathLike`). 12865 12866- bpo-35008: Fixed references leaks when call the ``__setstate__()`` method 12867 of :class:`xml.etree.ElementTree.Element` in the C implementation for 12868 already initialized element. 12869 12870- bpo-23420: Verify the value for the parameter '-s' of the cProfile CLI. 12871 Patch by Robert Kuska 12872 12873- bpo-33947: dataclasses now handle recursive reprs without raising 12874 RecursionError. 12875 12876- bpo-34890: Make :func:`inspect.iscoroutinefunction`, 12877 :func:`inspect.isgeneratorfunction` and :func:`inspect.isasyncgenfunction` 12878 work with :func:`functools.partial`. Patch by Pablo Galindo. 12879 12880- bpo-34521: Use :func:`socket.CMSG_SPACE` to calculate ancillary data size 12881 instead of :func:`socket.CMSG_LEN` in 12882 :func:`multiprocessing.reduction.recvfds` as :rfc:`3542` requires the use 12883 of the former for portable applications. 12884 12885- bpo-31522: The `mailbox.mbox.get_string` function *from_* parameter can 12886 now successfully be set to a non-default value. 12887 12888- bpo-34970: Protect tasks weak set manipulation in ``asyncio.all_tasks()`` 12889 12890- bpo-34969: gzip: Add --fast, --best on the gzip CLI, these parameters will 12891 be used for the fast compression method (quick) or the best method 12892 compress (slower, but smaller file). Also, change the default compression 12893 level to 6 (tradeoff). 12894 12895- bpo-16965: The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file 12896 with mode ``'rb'``. Patch by Zackery Spytz. 12897 12898- bpo-34966: :mod:`pydoc` now supports aliases not only to methods defined 12899 in the end class, but also to inherited methods. The docstring is not 12900 duplicated for aliases. 12901 12902- bpo-34926: :meth:`mimetypes.MimeTypes.guess_type` now accepts 12903 :term:`path-like object` in addition to url strings. Patch by Mayank 12904 Asthana. 12905 12906- bpo-23831: Add ``moveto()`` method to the ``tkinter.Canvas`` widget. Patch 12907 by Juliette Monsel. 12908 12909- bpo-34941: Methods ``find()``, ``findtext()`` and ``findall()`` of the 12910 ``Element`` class in the :mod:`xml.etree.ElementTree` module are now able 12911 to find children which are instances of ``Element`` subclasses. 12912 12913- bpo-32680: :class:`smtplib.SMTP` objects now always have a `sock` 12914 attribute present 12915 12916- bpo-34769: Fix for async generators not finalizing when event loop is in 12917 debug mode and garbage collector runs in another thread. 12918 12919- bpo-34936: Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. 12920 Patch by Juliette Monsel. 12921 12922- bpo-34829: Add methods ``selection_from``, ``selection_range``, 12923 ``selection_present`` and ``selection_to`` to the ``tkinter.Spinbox`` for 12924 consistency with the ``tkinter.Entry`` widget. Patch by Juliette Monsel. 12925 12926- bpo-34911: Added *secure_protocols* argument to 12927 *http.cookiejar.DefaultCookiePolicy* to allow for tweaking of protocols 12928 and also to add support by default for *wss*, the secure websocket 12929 protocol. 12930 12931- bpo-34922: Fixed integer overflow in the :meth:`~hashlib.shake.digest()` 12932 and :meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm in 12933 the :mod:`hashlib` module. 12934 12935- bpo-34925: 25% speedup in argument parsing for the functions in the bisect 12936 module. 12937 12938- bpo-34900: Fixed :meth:`unittest.TestCase.debug` when used to call test 12939 methods with subtests. Patch by Bruno Oliveira. 12940 12941- bpo-34844: logging.Formatter enhancement - Ensure styles and fmt matches 12942 in logging.Formatter - Added validate method in each format style class: 12943 StrFormatStyle, PercentStyle, StringTemplateStyle. - This method is called 12944 in the constructor of logging.Formatter class - Also re-raise the KeyError 12945 in the format method of each style class, so it would a bit clear that 12946 it's an error with the invalid format fields. 12947 12948- bpo-34897: Adjust test.support.missing_compiler_executable check so that a 12949 nominal command name of "" is ignored. Patch by Michael Felt. 12950 12951- bpo-34871: Fix inspect module polluted ``sys.modules`` when parsing 12952 ``__text_signature__`` of callable. 12953 12954- bpo-34898: Add `mtime` argument to `gzip.compress` for reproducible 12955 output. Patch by Guo Ci Teo. 12956 12957- bpo-28441: On Cygwin and MinGW, ensure that ``sys.executable`` always 12958 includes the full filename in the path, including the ``.exe`` suffix 12959 (unless it is a symbolic link). 12960 12961- bpo-34866: Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS 12962 attacks harder by limiting the number of ``MiniFieldStorage`` objects 12963 created by ``FieldStorage``. 12964 12965- bpo-34711: http.server ensures it reports HTTPStatus.NOT_FOUND when the 12966 local path ends with "/" and is not a directory, even if the underlying OS 12967 (e.g. AIX) accepts such paths as a valid file reference. Patch by Michael 12968 Felt. 12969 12970- bpo-34872: Fix self-cancellation in C implementation of asyncio.Task 12971 12972- bpo-34849: Don't log waiting for ``selector.select`` in asyncio loop 12973 iteration. The waiting is pretty normal for any asyncio program, logging 12974 its time just adds a noise to logs without any useful information 12975 provided. 12976 12977- bpo-34022: The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer 12978 overrides the value of the *invalidation_mode* argument to 12979 :func:`py_compile.compile`, and determines its default value instead. 12980 12981- bpo-34819: Use a monotonic clock to compute timeouts in 12982 :meth:`Executor.map` and :func:`as_completed`, in order to prevent 12983 timeouts from deviating when the system clock is adjusted. 12984 12985- bpo-34758: Add .wasm -> application/wasm to list of recognized file types 12986 and content type headers 12987 12988- bpo-34789: :func:`xml.sax.make_parser` now accepts any iterable as its 12989 *parser_list* argument. Patch by Andrés Delfino. 12990 12991- bpo-34334: In :class:`QueueHandler`, clear `exc_text` from 12992 :class:`LogRecord` to prevent traceback from being written twice. 12993 12994- bpo-34687: On Windows, asyncio now uses ProactorEventLoop, instead of 12995 SelectorEventLoop, by default. 12996 12997- bpo-5950: Support reading zip files with archive comments in 12998 :mod:`zipimport`. 12999 13000- bpo-32892: The parser now represents all constants as 13001 :class:`ast.Constant` instead of using specific constant AST types 13002 (``Num``, ``Str``, ``Bytes``, ``NameConstant`` and ``Ellipsis``). These 13003 classes are considered deprecated and will be removed in future Python 13004 versions. 13005 13006- bpo-34728: Add deprecation warning when `loop` is used in methods: 13007 `asyncio.sleep`, `asyncio.wait` and `asyncio.wait_for`. 13008 13009- bpo-34738: ZIP files created by :mod:`distutils` will now include entries 13010 for directories. 13011 13012- bpo-34659: Add an optional *initial* argument to itertools.accumulate(). 13013 13014- bpo-29577: Support multiple mixin classes when creating Enums. 13015 13016- bpo-34670: Add SSLContext.post_handshake_auth and 13017 SSLSocket.verify_client_post_handshake for TLS 1.3's post handshake 13018 authentication feature. 13019 13020- bpo-32718: The Activate.ps1 script from venv works with PowerShell Core 13021 6.1 and is now available under all operating systems. 13022 13023- bpo-31177: Fix bug that prevented using :meth:`reset_mock 13024 <unittest.mock.Mock.reset_mock>` on mock instances with deleted attributes 13025 13026- bpo-34672: Add a workaround, so the ``'Z'`` :func:`time.strftime` 13027 specifier on the musl C library can work in some cases. 13028 13029- bpo-34666: Implement ``asyncio.StreamWriter.awrite`` and 13030 ``asyncio.StreamWriter.aclose()`` coroutines. Methods are needed for 13031 providing a consistent stream API with control flow switched on by 13032 default. 13033 13034- bpo-6721: Acquire the logging module's commonly used internal locks while 13035 fork()ing to avoid deadlocks in the child process. 13036 13037- bpo-34658: Fix a rare interpreter unhandled exception state SystemError 13038 only seen when using subprocess with a preexec_fn while an after_parent 13039 handler has been registered with os.register_at_fork and the fork system 13040 call fails. 13041 13042- bpo-34652: Ensure :func:`os.lchmod` is never defined on Linux. 13043 13044- bpo-34638: Store a weak reference to stream reader to break strong 13045 references loop between reader and protocol. It allows to detect and 13046 close the socket if the stream is deleted (garbage collected) without 13047 ``close()`` call. 13048 13049- bpo-34536: `Enum._missing_`: raise `ValueError` if None returned and 13050 `TypeError` if non-member is returned. 13051 13052- bpo-34636: Speed up re scanning of many non-matching characters for \s \w 13053 and \d within bytes objects. (microoptimization) 13054 13055- bpo-24412: Add :func:`~unittest.addModuleCleanup()` and 13056 :meth:`~unittest.TestCase.addClassCleanup()` to unittest to support 13057 cleanups for :func:`~unittest.setUpModule()` and 13058 :meth:`~unittest.TestCase.setUpClass()`. Patch by Lisa Roach. 13059 13060- bpo-34630: Don't log SSL certificate errors in asyncio code (connection 13061 error logging is skipped already). 13062 13063- bpo-32490: Prevent filename duplication in :mod:`subprocess` exception 13064 messages. Patch by Zackery Spytz. 13065 13066- bpo-34363: dataclasses.asdict() and .astuple() now handle namedtuples 13067 correctly. 13068 13069- bpo-34625: Update vendorized expat library version to 2.2.6. 13070 13071- bpo-32270: The subprocess module no longer mistakenly closes redirected 13072 fds even when they were in pass_fds when outside of the default {0, 1, 2} 13073 set. 13074 13075- bpo-34622: Create a dedicated ``asyncio.CancelledError``, 13076 ``asyncio.InvalidStateError`` and ``asyncio.TimeoutError`` exception 13077 classes. Inherit them from corresponding exceptions from 13078 ``concurrent.futures`` package. Extract ``asyncio`` exceptions into a 13079 separate file. 13080 13081- bpo-34610: Fixed iterator of :class:`multiprocessing.managers.DictProxy`. 13082 13083- bpo-34421: Fix distutils logging for non-ASCII strings. This caused 13084 installation issues on Windows. 13085 13086- bpo-34604: Fix possible mojibake in the error message of `pwd.getpwnam` 13087 and `grp.getgrnam` using string representation because of invisible 13088 characters or trailing whitespaces. Patch by William Grzybowski. 13089 13090- bpo-30977: Make uuid.UUID use ``__slots__`` to reduce its memory 13091 footprint. Based on original patch by Wouter Bolsterlee. 13092 13093- bpo-34574: OrderedDict iterators are not exhausted during pickling 13094 anymore. Patch by Sergey Fedoseev. 13095 13096- bpo-8110: Refactored :mod:`subprocess` to check for Windows-specific 13097 modules rather than ``sys.platform == 'win32'``. 13098 13099- bpo-34530: ``distutils.spawn.find_executable()`` now falls back on 13100 :data:`os.defpath` if the ``PATH`` environment variable is not set. 13101 13102- bpo-34563: On Windows, fix multiprocessing.Connection for very large read: 13103 fix _winapi.PeekNamedPipe() and _winapi.ReadFile() for read larger than 13104 INT_MAX (usually ``2**31-1``). 13105 13106- bpo-34558: Correct typo in Lib/ctypes/_aix.py 13107 13108- bpo-34282: Move ``Enum._convert`` to ``EnumMeta._convert_`` and fix enum 13109 members getting shadowed by parent attributes. 13110 13111- bpo-22872: When the queue is closed, :exc:`ValueError` is now raised by 13112 :meth:`multiprocessing.Queue.put` and :meth:`multiprocessing.Queue.get` 13113 instead of :exc:`AssertionError` and :exc:`OSError`, respectively. Patch 13114 by Zackery Spytz. 13115 13116- bpo-34515: Fix parsing non-ASCII identifiers in 13117 :mod:`lib2to3.pgen2.tokenize` (PEP 3131). 13118 13119- bpo-13312: Avoids a possible integer underflow (undefined behavior) in the 13120 time module's year handling code when passed a very low negative year 13121 value. 13122 13123- bpo-34472: Improved compatibility for streamed files in :mod:`zipfile`. 13124 Previously an optional signature was not being written and certain ZIP 13125 applications were not supported. Patch by Silas Sewell. 13126 13127- bpo-34454: Fix the .fromisoformat() methods of datetime types crashing 13128 when given unicode with non-UTF-8-encodable code points. Specifically, 13129 datetime.fromisoformat() now accepts surrogate unicode code points used as 13130 the separator. Report and tests by Alexey Izbyshev, patch by Paul Ganssle. 13131 13132- bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks. 13133 Patch by Vladimir Matveev. 13134 13135- bpo-34171: Running the :mod:`trace` module no longer creates the 13136 ``trace.cover`` file. 13137 13138- bpo-34441: Fix crash when an ``ABC``-derived class with invalid 13139 ``__subclasses__`` is passed as the second argument to 13140 :func:`issubclass()`. Patch by Alexey Izbyshev. 13141 13142- bpo-34427: Fix infinite loop in ``a.extend(a)`` for ``MutableSequence`` 13143 subclasses. 13144 13145- bpo-34412: Make :func:`signal.strsignal` work on HP-UX. Patch by Michael 13146 Osipov. 13147 13148- bpo-20849: shutil.copytree now accepts a new ``dirs_exist_ok`` keyword 13149 argument. Patch by Josh Bronson. 13150 13151- bpo-31715: Associate ``.mjs`` file extension with 13152 ``application/javascript`` MIME Type. 13153 13154- bpo-34384: :func:`os.readlink` now accepts :term:`path-like <path-like 13155 object>` and :class:`bytes` objects on Windows. 13156 13157- bpo-22602: The UTF-7 decoder now raises :exc:`UnicodeDecodeError` for 13158 ill-formed sequences starting with "+" (as specified in RFC 2152). Patch 13159 by Zackery Spytz. 13160 13161- bpo-2122: The :meth:`mmap.flush() <mmap.mmap.flush>` method now returns 13162 ``None`` on success, raises an exception on error under all platforms. 13163 13164- bpo-34341: Appending to the ZIP archive with the ZIP64 extension no longer 13165 grows the size of extra fields of existing entries. 13166 13167- bpo-34333: Fix %-formatting in :meth:`pathlib.PurePath.with_suffix` when 13168 formatting an error message. 13169 13170- bpo-18540: The :class:`imaplib.IMAP4` and :class:`imaplib.IMAP4_SSL` 13171 classes now resolve to the local host IP correctly when the default value 13172 of *host* parameter (``''``) is used. 13173 13174- bpo-26502: Implement ``traceback.FrameSummary.__len__()`` method to 13175 preserve compatibility with the old tuple API. 13176 13177- bpo-34318: :func:`~unittest.TestCase.assertRaises`, 13178 :func:`~unittest.TestCase.assertRaisesRegex`, 13179 :func:`~unittest.TestCase.assertWarns` and 13180 :func:`~unittest.TestCase.assertWarnsRegex` no longer success if the 13181 passed callable is None. They no longer ignore unknown keyword arguments 13182 in the context manager mode. A DeprecationWarning was raised in these 13183 cases since Python 3.5. 13184 13185- bpo-9372: Deprecate :meth:`__getitem__` methods of 13186 :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper` 13187 and :class:`fileinput.FileInput`. 13188 13189- bpo-33613: Fix a race condition in ``multiprocessing.semaphore_tracker`` 13190 when the tracker receives SIGINT before it can register signal handlers 13191 for ignoring it. 13192 13193- bpo-34248: Report filename in the exception raised when the database file 13194 cannot be opened by :func:`dbm.gnu.open` and :func:`dbm.ndbm.open` due to 13195 OS-related error. Patch by Zsolt Cserna. 13196 13197- bpo-33089: Add math.dist() to compute the Euclidean distance between two 13198 points. 13199 13200- bpo-34246: :meth:`smtplib.SMTP.send_message` no longer modifies the 13201 content of the *mail_options* argument. Patch by Pablo S. Blum de Aguiar. 13202 13203- bpo-31047: Fix ``ntpath.abspath`` for invalid paths on windows. Patch by 13204 Franz Woellert. 13205 13206- bpo-32321: Add pure Python fallback for functools.reduce. Patch by Robert 13207 Wright. 13208 13209- bpo-34270: The default asyncio task class now always has a name which can 13210 be get or set using two new methods (:meth:`~asyncio.Task.get_name()` and 13211 :meth:`~asyncio.Task.set_name`) and is visible in the :func:`repr` output. 13212 An initial name can also be set using the new ``name`` keyword argument to 13213 :func:`asyncio.create_task` or the 13214 :meth:`~asyncio.AbstractEventLoop.create_task` method of the event loop. 13215 If no initial name is set, the default Task implementation generates a 13216 name like ``Task-1`` using a monotonic counter. 13217 13218- bpo-34263: asyncio's event loop will not pass timeouts longer than one day 13219 to epoll/select etc. 13220 13221- bpo-34035: Fix several AttributeError in zipfile seek() methods. Patch by 13222 Mickaël Schoentgen. 13223 13224- bpo-32215: Fix performance regression in :mod:`sqlite3` when a DML 13225 statement appeared in a different line than the rest of the SQL query. 13226 13227- bpo-34075: Deprecate passing non-ThreadPoolExecutor instances to 13228 :meth:`AbstractEventLoop.set_default_executor`. 13229 13230- bpo-34251: Restore ``msilib.Win64`` to preserve backwards compatibility 13231 since it's already used by :mod:`distutils`' ``bdist_msi`` command. 13232 13233- bpo-19891: Ignore errors caused by missing / non-writable homedir while 13234 writing history during exit of an interactive session. Patch by Anthony 13235 Sottile. 13236 13237- bpo-33089: Enhanced math.hypot() to support more than two dimensions. 13238 13239- bpo-34228: tracemalloc: PYTHONTRACEMALLOC=0 environment variable and -X 13240 tracemalloc=0 command line option are now allowed to disable explicitly 13241 tracemalloc at startup. 13242 13243- bpo-13041: Use :func:`shutil.get_terminal_size` to calculate the terminal 13244 width correctly in the ``argparse.HelpFormatter`` class. Initial patch by 13245 Zbyszek Jędrzejewski-Szmek. 13246 13247- bpo-34213: Allow frozen dataclasses to have a field named "object". 13248 Previously this conflicted with an internal use of "object". 13249 13250- bpo-34052: :meth:`sqlite3.Connection.create_aggregate`, 13251 :meth:`sqlite3.Connection.create_function`, 13252 :meth:`sqlite3.Connection.set_authorizer`, 13253 :meth:`sqlite3.Connection.set_progress_handler` methods raises TypeError 13254 when unhashable objects are passed as callable. These methods now don't 13255 pass such objects to SQLite API. Previous behavior could lead to 13256 segfaults. Patch by Sergey Fedoseev. 13257 13258- bpo-34197: Attributes *skipinitialspace*, *doublequote* and *strict* of 13259 the *dialect* attribute of the :mod:`csv` reader are now :class:`bool` 13260 instances instead of integers 0 or 1. 13261 13262- bpo-32788: Errors other than :exc:`TypeError` raised in methods 13263 ``__adapt__()`` and ``__conform__()`` in the :mod:`sqlite3` module are now 13264 propagated to the user. 13265 13266- bpo-21446: The :2to3fixer:`reload` fixer now uses :func:`importlib.reload` 13267 instead of deprecated :func:`imp.reload`. 13268 13269- bpo-940286: pydoc's ``Helper.showtopic()`` method now prints the cross 13270 references of a topic correctly. 13271 13272- bpo-34164: :func:`base64.b32decode` could raise UnboundLocalError or 13273 OverflowError for incorrect padding. Now it always raises 13274 :exc:`base64.Error` in these cases. 13275 13276- bpo-33729: Fixed issues with arguments parsing in :mod:`hashlib`. 13277 13278- bpo-34097: ZipFile can zip files older than 1980-01-01 and newer than 13279 2107-12-31 using a new ``strict_timestamps`` parameter at the cost of 13280 setting the timestamp to the limit. 13281 13282- bpo-34108: Remove extraneous CR in 2to3 refactor. 13283 13284- bpo-34070: Make sure to only check if the handle is a tty, when opening a 13285 file with ``buffering=-1``. 13286 13287- bpo-27494: Reverted :issue:`27494`. 2to3 rejects now a trailing comma in 13288 generator expressions. 13289 13290- bpo-33967: functools.singledispatch now raises TypeError instead of 13291 IndexError when no positional arguments are passed. 13292 13293- bpo-34041: Add the parameter *deterministic* to the 13294 :meth:`sqlite3.Connection.create_function` method. Patch by Sergey 13295 Fedoseev. 13296 13297- bpo-34056: Ensure the loader shim created by ``imp.load_module`` always 13298 returns bytes from its ``get_data()`` function. This fixes using 13299 ``imp.load_module`` with :pep:`552` hash-based pycs. 13300 13301- bpo-34054: The multiprocessing module now uses the monotonic clock 13302 :func:`time.monotonic` instead of the system clock :func:`time.time` to 13303 implement timeout. 13304 13305- bpo-34043: Optimize tarfile uncompress performance about 15% when gzip is 13306 used. 13307 13308- bpo-34044: ``subprocess.Popen`` now copies the *startupinfo* argument to 13309 leave it unchanged: it will modify the copy, so that the same 13310 ``STARTUPINFO`` object can be used multiple times. 13311 13312- bpo-34010: Fixed a performance regression for reading streams with 13313 tarfile. The buffered read should use a list, instead of appending to a 13314 bytes object. 13315 13316- bpo-34019: webbrowser: Correct the arguments passed to Opera Browser when 13317 opening a new URL using the ``webbrowser`` module. Patch by Bumsik Kim. 13318 13319- bpo-34003: csv.DictReader now creates dicts instead of OrderedDicts. Patch 13320 by Michael Selik. 13321 13322- bpo-33978: Closed existing logging handlers before reconfiguration via 13323 fileConfig and dictConfig. Patch by Karthikeyan Singaravelan. 13324 13325- bpo-14117: Make minor tweaks to turtledemo. The 'wikipedia' example is now 13326 'rosette', describing what it draws. The 'penrose' print output is 13327 reduced. The'1024' output of 'tree' is eliminated. 13328 13329- bpo-33974: Fixed passing lists and tuples of strings containing special 13330 characters ``"``, ``\``, ``{``, ``}`` and ``\n`` as options to 13331 :mod:`~tkinter.ttk` widgets. 13332 13333- bpo-27500: Fix getaddrinfo to resolve IPv6 addresses correctly. 13334 13335- bpo-24567: Improve random.choices() to handle subnormal input weights that 13336 could occasionally trigger an IndexError. 13337 13338- bpo-33871: Fixed integer overflow in :func:`os.readv`, :func:`os.writev`, 13339 :func:`os.preadv` and :func:`os.pwritev` and in :func:`os.sendfile` with 13340 *headers* or *trailers* arguments (on BSD-based OSes and macOS). 13341 13342- bpo-25007: Add :func:`copy.copy` and :func:`copy.deepcopy` support to zlib 13343 compressors and decompressors. Patch by Zackery Spytz. 13344 13345- bpo-33929: multiprocessing: Fix a race condition in Popen of 13346 multiprocessing.popen_spawn_win32. The child process now duplicates the 13347 read end of pipe instead of "stealing" it. Previously, the read end of 13348 pipe was "stolen" by the child process, but it leaked a handle if the 13349 child process had been terminated before it could steal the handle from 13350 the parent process. 13351 13352- bpo-33899: Tokenize module now implicitly emits a NEWLINE when provided 13353 with input that does not have a trailing new line. This behavior now 13354 matches what the C tokenizer does internally. Contributed by Ammar Askar. 13355 13356- bpo-33897: Added a 'force' keyword argument to logging.basicConfig(). 13357 13358- bpo-33695: :func:`shutil.copytree` uses :func:`os.scandir` function and 13359 all copy functions depending from it use cached :func:`os.stat` values. 13360 The speedup for copying a directory with 8000 files is around +9% on 13361 Linux, +20% on Windows and + 30% on a Windows SMB share. Also the number 13362 of :func:`os.stat` syscalls is reduced by 38% making 13363 :func:`shutil.copytree` especially faster on network filesystems. 13364 (Contributed by Giampaolo Rodola' in :issue:`33695`.) 13365 13366- bpo-33916: bz2 and lzma: When Decompressor.__init__() is called twice, 13367 free the old lock to not leak memory. 13368 13369- bpo-32568: Make select.epoll() and its documentation consistent regarding 13370 *sizehint* and *flags*. 13371 13372- bpo-33833: Fixed bug in asyncio where ProactorSocketTransport logs 13373 AssertionError if force closed during write. 13374 13375- bpo-33663: Convert content length to string before putting to header. 13376 13377- bpo-33721: :mod:`os.path` functions that return a boolean result like 13378 :func:`~os.path.exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`, 13379 :func:`~os.path.isfile`, :func:`~os.path.islink`, and 13380 :func:`~os.path.ismount`, and :mod:`pathlib.Path` methods that return a 13381 boolean result like :meth:`~pathlib.Path.exists()`, 13382 :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib.Path.is_file()`, 13383 :meth:`~pathlib.Path.is_mount()`, :meth:`~pathlib.Path.is_symlink()`, 13384 :meth:`~pathlib.Path.is_block_device()`, 13385 :meth:`~pathlib.Path.is_char_device()`, :meth:`~pathlib.Path.is_fifo()`, 13386 :meth:`~pathlib.Path.is_socket()` now return ``False`` instead of raising 13387 :exc:`ValueError` or its subclasses :exc:`UnicodeEncodeError` and 13388 :exc:`UnicodeDecodeError` for paths that contain characters or bytes 13389 unrepresentable at the OS level. 13390 13391- bpo-26544: Fixed implementation of :func:`platform.libc_ver`. It almost 13392 always returned version '2.9' for glibc. 13393 13394- bpo-33843: Remove deprecated ``cgi.escape``, ``cgi.parse_qs`` and 13395 ``cgi.parse_qsl``. 13396 13397- bpo-33842: Remove ``tarfile.filemode`` which is deprecated since Python 13398 3.3. 13399 13400- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by 13401 Steve Weber. 13402 13403- bpo-33805: Improve error message of dataclasses.replace() when an InitVar 13404 is not specified 13405 13406- bpo-33687: Fix the call to ``os.chmod()`` for ``uu.decode()`` if a mode is 13407 given or decoded. Patch by Timo Furrer. 13408 13409- bpo-33812: Datetime instance d with non-None tzinfo, but with 13410 d.tzinfo.utcoffset(d) returning None is now treated as naive by the 13411 astimezone() method. 13412 13413- bpo-32108: In configparser, don't clear section when it is assigned to 13414 itself. 13415 13416- bpo-27397: Make email module properly handle invalid-length base64 13417 strings. 13418 13419- bpo-33578: Implement multibyte encoder/decoder state methods 13420 13421- bpo-30805: Avoid race condition with debug logging 13422 13423- bpo-33476: Fix _header_value_parser.py when address group is missing final 13424 ';'. Contributed by Enrique Perez-Terron 13425 13426- bpo-33694: asyncio: Fix a race condition causing data loss on 13427 pause_reading()/resume_reading() when using the ProactorEventLoop. 13428 13429- bpo-32493: Correct test for ``uuid_enc_be`` availability in 13430 ``configure.ac``. Patch by Michael Felt. 13431 13432- bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and 13433 asyncio.WindowsProactorEventLoopPolicy. 13434 13435- bpo-33274: W3C DOM Level 1 specifies return value of 13436 Element.removeAttributeNode() as "The Attr node that was removed." 13437 xml.dom.minidom now complies with this requirement. 13438 13439- bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0. 13440 13441- bpo-33165: Added a stacklevel parameter to logging calls to allow use of 13442 wrapper/helper functions for logging APIs. 13443 13444- bpo-33770: improve base64 exception message for encoded inputs of invalid 13445 length 13446 13447- bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case 13448 of an unhandled error; mark SSLTransport as closed if it is aborted. 13449 13450- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence 13451 operations now raise :exc:`TypeError` instead of :exc:`SystemError` when 13452 performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz. 13453 13454- bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake 13455 timeout 13456 13457- bpo-31014: Fixed creating a controller for :mod:`webbrowser` when a user 13458 specifies a path to an entry in the BROWSER environment variable. Based 13459 on patch by John Still. 13460 13461- bpo-2504: Add gettext.pgettext() and variants. 13462 13463- bpo-33197: Add description property for _ParameterKind 13464 13465- bpo-32751: When cancelling the task due to a timeout, 13466 :meth:`asyncio.wait_for` will now wait until the cancellation is complete. 13467 13468- bpo-32684: Fix gather to propagate cancellation of itself even with 13469 return_exceptions. 13470 13471- bpo-33654: Support protocol type switching in SSLTransport.set_protocol(). 13472 13473- bpo-33674: Pause the transport as early as possible to further reduce the 13474 risk of data_received() being called before connection_made(). 13475 13476- bpo-33671: :func:`shutil.copyfile`, :func:`shutil.copy`, 13477 :func:`shutil.copy2`, :func:`shutil.copytree` and :func:`shutil.move` use 13478 platform-specific fast-copy syscalls on Linux and macOS in order to copy 13479 the file more efficiently. On Windows :func:`shutil.copyfile` uses a 13480 bigger default buffer size (1 MiB instead of 16 KiB) and a 13481 :func:`memoryview`-based variant of :func:`shutil.copyfileobj` is used. 13482 The speedup for copying a 512MiB file is about +26% on Linux, +50% on 13483 macOS and +40% on Windows. Also, much less CPU cycles are consumed. 13484 (Contributed by Giampaolo Rodola' in :issue:`25427`.) 13485 13486- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of 13487 asyncio.sslproto: start immediately the handshake instead of using 13488 call_soon(). Previously, data_received() could be called before the 13489 handshake started, causing the handshake to hang or fail. 13490 13491- bpo-31647: Fixed bug where calling write_eof() on a 13492 _SelectorSocketTransport after it's already closed raises AttributeError. 13493 13494- bpo-32610: Make asyncio.all_tasks() return only pending tasks. 13495 13496- bpo-32410: Avoid blocking on file IO in sendfile fallback code 13497 13498- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor 13499 13500- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines 13501 13502- bpo-33654: Fix transport.set_protocol() to support switching between 13503 asyncio.Protocol and asyncio.BufferedProtocol. Fix loop.start_tls() to 13504 work with asyncio.BufferedProtocols. 13505 13506- bpo-33652: Pickles of type variables and subscripted generics are now 13507 future-proof and compatible with older Python versions. 13508 13509- bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD. 13510 13511- bpo-33238: Add ``InvalidStateError`` to :mod:`concurrent.futures`. 13512 ``Future.set_result`` and ``Future.set_exception`` now raise 13513 ``InvalidStateError`` if the futures are not pending or running. Patch by 13514 Jason Haydaman. 13515 13516- bpo-33618: Finalize and document preliminary and experimental TLS 1.3 13517 support with OpenSSL 1.1.1 13518 13519- bpo-33625: Release GIL on `grp.getgrnam`, `grp.getgrgid`, `pwd.getpwnam` 13520 and `pwd.getpwuid` if reentrant variants of these functions are available. 13521 Patch by William Grzybowski. 13522 13523- bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ 13524 13525- bpo-11874: Use a better regex when breaking usage into wrappable parts. 13526 Avoids bogus assertion errors from custom metavar strings. 13527 13528- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder 13529 that prevented the cache of parsed strings from clearing after finishing 13530 the decoding. Based on patch by c-fos. 13531 13532- bpo-33604: Remove HMAC default to md5 marked for removal in 3.8 (removal 13533 originally planned in 3.6, bump to 3.8 in gh-7062). 13534 13535- bpo-33582: Emit a deprecation warning for inspect.formatargspec 13536 13537- bpo-21145: Add ``functools.cached_property`` decorator, for computed 13538 properties cached for the life of the instance. 13539 13540- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with 13541 OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers 13542 enabled by default. 13543 13544- bpo-28556: Do not simplify arguments to `typing.Union`. Now 13545 `Union[Manager, Employee]` is not simplified to `Employee` at runtime. 13546 Such simplification previously caused several bugs and limited 13547 possibilities for introspection. 13548 13549- bpo-12486: :func:`tokenize.generate_tokens` is now documented as a public 13550 API to tokenize unicode strings. It was previously present but 13551 undocumented. 13552 13553- bpo-33540: Add a new ``block_on_close`` class attribute to 13554 ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`. 13555 13556- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP 13557 locations 13558 13559- bpo-33109: argparse subparsers are once again not required by default, 13560 reverting the change in behavior introduced by bpo-26510 in 3.7.0a2. 13561 13562- bpo-33541: Remove unused private method ``_strptime.LocaleTime.__pad`` 13563 (a.k.a. ``_LocaleTime__pad``). 13564 13565- bpo-33536: dataclasses.make_dataclass now checks for invalid field names 13566 and duplicate fields. Also, added a check for invalid field 13567 specifications. 13568 13569- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on 13570 Windows. Patch by Zvi Effron 13571 13572- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in 13573 Windows proactor event loop. 13574 13575- Fix failure in `typing.get_type_hints()` when ClassVar was provided as a 13576 string forward reference. 13577 13578- bpo-33516: :class:`unittest.mock.MagicMock` now supports the ``__round__`` 13579 magic method. 13580 13581- bpo-28612: Added support for Site Maps to urllib's ``RobotFileParser`` as 13582 :meth:`RobotFileParser.site_maps() 13583 <urllib.robotparser.RobotFileParser.site_maps>`. Patch by Lady Red, based 13584 on patch by Peter Wirtz. 13585 13586- bpo-28167: Remove platform.linux_distribution, which was deprecated since 13587 3.5. 13588 13589- bpo-33504: Switch the default dictionary implementation for 13590 :mod:`configparser` from :class:`collections.OrderedDict` to the standard 13591 :class:`dict` type. 13592 13593- bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x 13594 faster. 13595 13596- bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in 13597 FieldStorage use the given errors (needed for Twisted). Patch by Amber 13598 Brown. 13599 13600- bpo-29235: The :class:`cProfile.Profile` class can now be used as a 13601 context manager. Patch by Scott Sanderson. 13602 13603- bpo-33495: Change dataclasses.Fields repr to use the repr of each of its 13604 members, instead of str. This makes it more clear what each field 13605 actually represents. This is especially true for the 'type' member. 13606 13607- bpo-26103: Correct ``inspect.isdatadescriptor`` to look for ``__set__`` or 13608 ``__delete__``. Patch by Aaron Hall. 13609 13610- bpo-29209: Removed the ``doctype()`` method and the *html* parameter of 13611 the constructor of :class:`~xml.etree.ElementTree.XMLParser`. The 13612 ``doctype()`` method defined in a subclass will no longer be called. 13613 Deprecated methods ``getchildren()`` and ``getiterator()`` in the 13614 :mod:`~xml.etree.ElementTree` module emit now a :exc:`DeprecationWarning` 13615 instead of :exc:`PendingDeprecationWarning`. 13616 13617- bpo-33453: Fix dataclasses to work if using literal string type 13618 annotations or if using PEP 563 "Postponed Evaluation of Annotations". 13619 Only specific string prefixes are detected for both ClassVar ("ClassVar" 13620 and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar"). 13621 13622- bpo-28556: Minor fixes in typing module: add annotations to 13623 ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in 13624 ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova. 13625 13626- bpo-33365: Print the header values besides the header keys instead just 13627 the header keys if *debuglevel* is set to >0 in :mod:`http.client`. Patch 13628 by Marco Strigl. 13629 13630- bpo-20087: Updated alias mapping with glibc 2.27 supported locales. 13631 13632- bpo-33422: Fix trailing quotation marks getting deleted when looking up 13633 byte/string literals on pydoc. Patch by Andrés Delfino. 13634 13635- bpo-28167: The function ``platform.linux_distribution`` and 13636 ``platform.dist`` now trigger a ``DeprecationWarning`` and have been 13637 marked for removal in Python 3.8 13638 13639- bpo-33281: Fix ctypes.util.find_library regression on macOS. 13640 13641- bpo-33311: Text and html output generated by cgitb does not display 13642 parentheses if the current call is done directly in the module. Patch by 13643 Stéphane Blondon. 13644 13645- bpo-27300: The file classes in *tempfile* now accept an *errors* parameter 13646 that complements the already existing *encoding*. Patch by Stephan Hohe. 13647 13648- bpo-32933: :func:`unittest.mock.mock_open` now supports iteration over the 13649 file contents. Patch by Tony Flury. 13650 13651- bpo-33217: Raise :exc:`TypeError` when looking up non-Enum objects in Enum 13652 classes and Enum members. 13653 13654- bpo-33197: Update error message when constructing invalid 13655 inspect.Parameters Patch by Dong-hee Na. 13656 13657- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database 13658 object when it is called with a single argument. 13659 13660- bpo-33375: The warnings module now finds the Python file associated with a 13661 warning from the code object, rather than the frame's global namespace. 13662 This is consistent with how tracebacks and pdb find filenames, and should 13663 work better for dynamically executed code. 13664 13665- bpo-33336: ``imaplib`` now allows ``MOVE`` command in ``IMAP4.uid()`` (RFC 13666 6851: IMAP MOVE Extension) and potentially as a name of supported method 13667 of ``IMAP4`` object. 13668 13669- bpo-32455: Added *jump* parameter to :func:`dis.stack_effect`. 13670 13671- bpo-27485: Rename and deprecate undocumented functions in 13672 :func:`urllib.parse`. 13673 13674- bpo-33332: Add ``signal.valid_signals()`` to expose the POSIX sigfillset() 13675 functionality. 13676 13677- bpo-33251: `ConfigParser.items()` was fixed so that key-value pairs passed 13678 in via `vars` are not included in the resulting output. 13679 13680- bpo-33329: Fix multiprocessing regression on newer glibcs 13681 13682- bpo-33334: :func:`dis.stack_effect` now supports all defined opcodes 13683 including NOP and EXTENDED_ARG. 13684 13685- bpo-991266: Fix quoting of the ``Comment`` attribute of 13686 :class:`http.cookies.SimpleCookie`. 13687 13688- bpo-33131: Upgrade bundled version of pip to 10.0.1. 13689 13690- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST 13691 object to a tree of tuples or lists with ``line_info=False`` and 13692 ``col_info=True``. 13693 13694- bpo-23403: lib2to3 now uses pickle protocol 4 for pre-computed grammars. 13695 13696- bpo-33266: lib2to3 now recognizes ``rf'...'`` strings. 13697 13698- bpo-11594: Ensure line-endings are respected when using lib2to3. 13699 13700- bpo-33254: Have :func:`importlib.resources.contents` and 13701 :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable` 13702 instead of an :term:`iterator`. 13703 13704- bpo-33265: ``contextlib.ExitStack`` and ``contextlib.AsyncExitStack`` now 13705 use a method instead of a wrapper function for exit callbacks. 13706 13707- bpo-33263: Fix FD leak in `_SelectorSocketTransport` Patch by Vlad 13708 Starostin. 13709 13710- bpo-33256: Fix display of ``<module>`` call in the html produced by 13711 ``cgitb.html()``. Patch by Stéphane Blondon. 13712 13713- bpo-33144: ``random.Random()`` and its subclassing mechanism got optimized 13714 to check only once at class/subclass instantiation time whether its 13715 ``getrandbits()`` method can be relied on by other methods, including 13716 ``randrange()``, for the generation of arbitrarily large random integers. 13717 Patch by Wolfgang Maier. 13718 13719- bpo-33185: Fixed regression when running pydoc with the :option:`-m` 13720 switch. (The regression was introduced in 3.7.0b3 by the resolution of 13721 :issue:`33053`) 13722 13723 This fix also changed pydoc to add ``os.getcwd()`` to :data:`sys.path` 13724 when necessary, rather than adding ``"."``. 13725 13726- bpo-29613: Added support for the ``SameSite`` cookie flag to the 13727 ``http.cookies`` module. 13728 13729- bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache` 13730 when :meth:`importlib.machinery.invalidate_caches` is called. 13731 13732- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty 13733 sequences consistently even when called from subclasses without a 13734 ``getrandbits()`` implementation. 13735 13736- bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught 13737 StopIteration in a generator into a return-statement. 13738 13739- bpo-33209: End framing at the end of C implementation of 13740 :func:`pickle.Pickler.dump`. 13741 13742- bpo-32861: The urllib.robotparser's ``__str__`` representation now 13743 includes wildcard entries and the "Crawl-delay" and "Request-rate" fields. 13744 Also removes extra newlines that were being appended to the end of the 13745 string. Patch by Michael Lazar. 13746 13747- bpo-23403: ``DEFAULT_PROTOCOL`` in :mod:`pickle` was bumped to 4. Protocol 13748 4 is described in :pep:`3154` and available since Python 3.4. It offers 13749 better performance and smaller size compared to protocol 3 introduced in 13750 Python 3.0. 13751 13752- bpo-20104: Improved error handling and fixed a reference leak in 13753 :func:`os.posix_spawn()`. 13754 13755- bpo-33106: Deleting a key from a read-only dbm database raises module 13756 specific error instead of KeyError. 13757 13758- bpo-33175: In dataclasses, Field.__set_name__ now looks up the 13759 __set_name__ special method on the class, not the instance, of the default 13760 value. 13761 13762- bpo-32380: Create functools.singledispatchmethod to support generic single 13763 dispatch on descriptors and methods. 13764 13765- bpo-33141: Have Field objects pass through __set_name__ to their default 13766 values, if they have their own __set_name__. 13767 13768- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false 13769 boolean value. Note iid=0 and iid=False would be same. Patch by Garvit 13770 Khatri. 13771 13772- bpo-32873: Treat type variables and special typing forms as immutable by 13773 copy and pickle. This fixes several minor issues and inconsistencies, and 13774 improves backwards compatibility with Python 3.6. 13775 13776- bpo-33134: When computing dataclass's __hash__, use the lookup table to 13777 contain the function which returns the __hash__ value. This is an 13778 improvement over looking up a string, and then testing that string to see 13779 what to do. 13780 13781- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1. 13782 13783- bpo-32505: Raise TypeError if a member variable of a dataclass is of type 13784 Field, but doesn't have a type annotation. 13785 13786- bpo-33078: Fix the failure on OSX caused by the tests relying on 13787 sem_getvalue 13788 13789- bpo-33116: Add 'Field' to dataclasses.__all__. 13790 13791- bpo-32896: Fix an error where subclassing a dataclass with a field that 13792 uses a default_factory would generate an incorrect class. 13793 13794- bpo-33100: Dataclasses: If a field has a default value that's a 13795 MemberDescriptorType, then it's from that field being in __slots__, not an 13796 actual default value. 13797 13798- bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow 13799 attributes to be added to the derived class. Only attributes from the 13800 frozen dataclass cannot be assigned to. Require all dataclasses in a 13801 hierarchy to be either all frozen or all non-frozen. 13802 13803- bpo-33097: Raise RuntimeError when ``executor.submit`` is called during 13804 interpreter shutdown. 13805 13806- bpo-32968: Modulo and floor division involving Fraction and float should 13807 return float. 13808 13809- bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py 13810 13811- bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling 13812 error occurs. 13813 13814- bpo-33064: lib2to3 now properly supports trailing commas after ``*args`` 13815 and ``**kwargs`` in function signatures. 13816 13817- bpo-33056: FIX properly close leaking fds in 13818 concurrent.futures.ProcessPoolExecutor. 13819 13820- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all 13821 threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch 13822 by Nir Soffer. 13823 13824- bpo-31804: Avoid failing in multiprocessing.Process if the standard 13825 streams are closed or None at exit. 13826 13827- bpo-33034: Providing an explicit error message when casting the port 13828 property to anything that is not an integer value using ``urlparse()`` and 13829 ``urlsplit()``. Patch by Matt Eaton. 13830 13831- bpo-30249: Improve struct.unpack_from() exception messages for problems 13832 with the buffer size and offset. 13833 13834- bpo-33037: Skip sending/receiving data after SSL transport closing. 13835 13836- bpo-27683: Fix a regression in :mod:`ipaddress` that result of 13837 :meth:`hosts` is empty when the network is constructed by a tuple 13838 containing an integer mask and only 1 bit left for addresses. 13839 13840- bpo-22674: Add the strsignal() function in the signal module that returns 13841 the system description of the given signal, as returned by strsignal(3). 13842 13843- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls, 13844 subclass)`` crashed when ``subclass`` is not a type object. 13845 13846- bpo-33009: Fix inspect.signature() for single-parameter partialmethods. 13847 13848- bpo-32969: Expose several missing constants in zlib and fix corresponding 13849 documentation. 13850 13851- bpo-32056: Improved exceptions raised for invalid number of channels and 13852 sample width when read an audio file in modules :mod:`aifc`, :mod:`wave` 13853 and :mod:`sunau`. 13854 13855- bpo-32970: Improved disassembly of the MAKE_FUNCTION instruction. 13856 13857- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in 13858 subprocess if another low descriptor is closed. 13859 13860- bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen 13861 classes, and also disallow inheriting non-frozen from frozen classes. This 13862 restriction will be relaxed at a future date. 13863 13864- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch 13865 by Joffrey Fuhrer. 13866 13867- bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant, 13868 available with OpenSSL 1.1.0h or 1.1.1. 13869 13870- bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now 13871 prohibited. The constructors were never documented, tested, or designed as 13872 public constructors. Users were suppose to use ssl.wrap_socket() or 13873 SSLContext. 13874 13875- bpo-32929: Remove the tri-state parameter "hash", and add the boolean 13876 "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a 13877 __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__ 13878 based on the values of eq= and frozen=. The unsafe_hash=False behavior is 13879 the same as the old hash=None behavior. unsafe_hash=False is the default, 13880 just as hash=None used to be. 13881 13882- bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 13883 for future compatibility with OpenSSL 1.1.1. 13884 13885- bpo-32146: Document the interaction between frozen executables and the 13886 spawn and forkserver start methods in multiprocessing. 13887 13888- bpo-30622: The ssl module now detects missing NPN support in LibreSSL. 13889 13890- bpo-32922: dbm.open() now encodes filename with the filesystem encoding 13891 rather than default encoding. 13892 13893- bpo-32759: Free unused arenas in multiprocessing.heap. 13894 13895- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3`` 13896 syscall exists or not. 13897 13898- bpo-32556: nt._getfinalpathname, nt._getvolumepathname and 13899 nt._getdiskusage now correctly convert from bytes. 13900 13901- bpo-21060: Rewrite confusing message from setup.py upload from "No dist 13902 file created in earlier command" to the more helpful "Must create and 13903 upload files in one command". 13904 13905- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a 13906 :exc:`ValueError` instead of canceling the first scheduled function. 13907 Patch by Cheryl Sabella. 13908 13909- bpo-32852: Make sure sys.argv remains as a list when running trace. 13910 13911- bpo-31333: ``_abc`` module is added. It is a speedup module with C 13912 implementations for various functions and methods in ``abc``. Creating an 13913 ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC 13914 subclass are up to 1.5x faster. In addition, this makes Python start-up up 13915 to 10% faster. 13916 13917 Note that the new implementation hides internal registry and caches, 13918 previously accessible via private attributes ``_abc_registry``, 13919 ``_abc_cache``, and ``_abc_negative_cache``. There are three debugging 13920 helper methods that can be used instead ``_dump_registry``, 13921 ``_abc_registry_clear``, and ``_abc_caches_clear``. 13922 13923- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored 13924 cancellation after notifying and cancelling a conditional lock. Patch by 13925 Bar Harel. 13926 13927- bpo-32819: ssl.match_hostname() has been simplified and no longer depends 13928 on re and ipaddress module for wildcard and IP addresses. Error reporting 13929 for invalid wildcards has been improved. 13930 13931- bpo-19675: ``multiprocessing.Pool`` no longer leaks processes if its 13932 initialization fails. 13933 13934- bpo-32394: socket: Remove 13935 TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version 13936 Windows during run-time. 13937 13938- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules. 13939 (Contributed by Oren Milman) 13940 13941- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when 13942 only the last field is quoted. Patch by Jake Davis. 13943 13944- bpo-30688: Added support of ``\N{name}`` escapes in regular expressions. 13945 Based on patch by Jonathan Eunice. 13946 13947- bpo-32792: collections.ChainMap() preserves the order of the underlying 13948 mappings. 13949 13950- bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which 13951 contain set operations. Sets starting with '[' or containing '--', '&&', 13952 '~~' or '||' will be interpreted differently in regular expressions in 13953 future versions. Currently they emit warnings. fnmatch.translate() now 13954 avoids producing patterns containing such sets by accident. 13955 13956- bpo-32622: Implement native fast sendfile for Windows proactor event loop. 13957 13958- bpo-32777: Fix a rare but potential pre-exec child process deadlock in 13959 subprocess on POSIX systems when marking file descriptors inheritable on 13960 exec in the child process. This bug appears to have been introduced in 13961 3.4. 13962 13963- bpo-32647: The ctypes module used to depend on indirect linking for 13964 dlopen. The shared extension is now explicitly linked against libdl on 13965 platforms with dl. 13966 13967- bpo-32749: A :mod:`dbm.dumb` database opened with flags 'r' is now 13968 read-only. :func:`dbm.dumb.open` with flags 'r' and 'w' no longer creates 13969 a database if it does not exist. 13970 13971- bpo-32741: Implement ``asyncio.TimerHandle.when()`` method. 13972 13973- bpo-32691: Use mod_spec.parent when running modules with pdb 13974 13975- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring 13976 and locking the same lock multiple times, without it being free. Patch by 13977 Bar Harel. 13978 13979- bpo-32727: Do not include name field in SMTP envelope from address. Patch 13980 by Stéphane Wirtel 13981 13982- bpo-31453: Add TLSVersion constants and SSLContext.maximum_version / 13983 minimum_version attributes. The new API wraps OpenSSL 1.1 13984 https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html 13985 feature. 13986 13987- bpo-24334: Internal implementation details of ssl module were cleaned up. 13988 The SSLSocket has one less layer of indirection. Owner and session 13989 information are now handled by the SSLSocket and SSLObject constructor. 13990 Channel binding implementation has been simplified. 13991 13992- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND 13993 chunk is not found. Patch by Zackery Spytz. 13994 13995- bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D 13996 Moore. 13997 13998- bpo-32512: :mod:`profile` CLI accepts `-m module_name` as an alternative 13999 to script path. 14000 14001- bpo-8525: help() on a type now displays builtin subclasses. This is 14002 intended primarily to help with notification of more specific exception 14003 subclasses. 14004 14005 Patch by Sanyam Khurana. 14006 14007- bpo-31639: http.server now exposes a ThreadingHTTPServer class and uses it 14008 when the module is run with ``-m`` to cope with web browsers pre-opening 14009 sockets. 14010 14011- bpo-29877: compileall: import ProcessPoolExecutor only when needed, 14012 preventing hangs on low resource platforms 14013 14014- bpo-32221: Various functions returning tuple containing IPv6 addresses now 14015 omit ``%scope`` part since the same information is already encoded in 14016 *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` 14017 when it receives multicast packet since useless resolving of network 14018 interface name is omitted. 14019 14020- bpo-32147: :func:`binascii.unhexlify` is now up to 2 times faster. Patch 14021 by Sergey Fedoseev. 14022 14023- bpo-30693: The TarFile class now recurses directories in a reproducible 14024 way. 14025 14026- bpo-30693: The ZipFile class now recurses directories in a reproducible 14027 way. 14028 14029- bpo-31680: Added :data:`curses.ncurses_version`. 14030 14031- bpo-31908: Fix output of cover files for ``trace`` module command-line 14032 tool. Previously emitted cover files only when ``--missing`` option was 14033 used. Patch by Michael Selik. 14034 14035- bpo-31608: Raise a ``TypeError`` instead of crashing if a 14036 ``collections.deque`` subclass returns a non-deque from ``__new__``. Patch 14037 by Oren Milman. 14038 14039- bpo-31425: Add support for sockets of the AF_QIPCRTR address family, 14040 supported by the Linux kernel. This is used to communicate with services, 14041 such as GPS or radio, running on Qualcomm devices. Patch by Bjorn 14042 Andersson. 14043 14044- bpo-22005: Implemented unpickling instances of 14045 :class:`~datetime.datetime`, :class:`~datetime.date` and 14046 :class:`~datetime.time` pickled by Python 2. ``encoding='latin1'`` should 14047 be used for successful decoding. 14048 14049- bpo-27645: :class:`sqlite3.Connection` now exposes a 14050 :class:`~sqlite3.Connection.backup` method, if the underlying SQLite 14051 library is at version 3.6.11 or higher. Patch by Lele Gaifax. 14052 14053- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer. 14054 14055- bpo-31508: Removed support of arguments in 14056 `tkinter.ttk.Treeview.selection`. It was deprecated in 3.6. Use 14057 specialized methods like `selection_set` for changing the selection. 14058 14059- bpo-29456: Fix bugs in hangul normalization: u1176, u11a7 and u11c3 14060 14061Documentation 14062------------- 14063 14064- bpo-21257: Document :func:`http.client.parse_headers`. 14065 14066- bpo-34764: Improve example of iter() with 2nd sentinel argument. 14067 14068- bpo-35564: Explicitly set master_doc variable in conf.py for compliance 14069 with Sphinx 2.0 14070 14071- bpo-35511: Specified that profile.Profile class doesn't not support enable 14072 or disable methods. Also, elaborated that Profile object as a context 14073 manager is only supported in cProfile module. 14074 14075- bpo-10536: Enhance the gettext docs. Patch by Éric Araujo 14076 14077- bpo-35089: Remove mention of ``typing.io`` and ``typing.re``. Their types 14078 should be imported from ``typing`` directly. 14079 14080- bpo-35038: Fix the documentation about an unexisting `f_restricted` 14081 attribute in the frame object. Patch by Stéphane Wirtel 14082 14083- bpo-35042: Replace PEP XYZ by the pep role and allow to use the direct 14084 links to the PEPs. 14085 14086- bpo-35044: Fix the documentation with the role ``exc`` for the 14087 appropriated exception. Patch by Stéphane Wirtel 14088 14089- bpo-35035: Rename documentation for :mod:`email.utils` to 14090 ``email.utils.rst``. 14091 14092- bpo-34967: Use app.add_object_type() instead of the deprecated Sphinx 14093 function app.description_unit() 14094 14095- bpo-34913: Add documentation about the new command line interface of the 14096 gzip module. 14097 14098- bpo-32174: chm document displays non-ASCII charaters properly on some MBCS 14099 Windows systems. 14100 14101- bpo-11233: Create availability directive for documentation. Original 14102 patch by Georg Brandl. 14103 14104- bpo-34790: Document how passing coroutines to asyncio.wait() can be 14105 confusing. 14106 14107- bpo-34552: Make clear that ``==`` operator sometimes is equivalent to 14108 `is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where 14109 they make sense. 14110 14111- bpo-28617: Fixed info in the stdtypes docs concerning the types that 14112 support membership tests. 14113 14114- bpo-20177: Migrate datetime.date.fromtimestamp to Argument Clinic. Patch 14115 by Tim Hoffmann. 14116 14117- bpo-34065: Fix wrongly written basicConfig documentation markup syntax 14118 14119- bpo-33460: replaced ellipsis with correct error codes in tutorial chapter 14120 3. 14121 14122- bpo-33847: Add '@' operator entry to index. 14123 14124- bpo-33409: Clarified the relationship between :pep:`538`'s 14125 PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode. 14126 14127- bpo-33197: Add versionadded tag to the documentation of 14128 ParameterKind.description 14129 14130- bpo-17045: Improve the C-API doc for PyTypeObject. This includes adding 14131 several quick-reference tables and a lot of missing slot/typedef entries. 14132 The existing entries were also cleaned up with a slightly more consistent 14133 format. 14134 14135- bpo-33736: Improve the documentation of :func:`asyncio.open_connection`, 14136 :func:`asyncio.start_server` and their UNIX socket counterparts. 14137 14138- bpo-23859: Document that `asyncio.wait()` does not cancel its futures on 14139 timeout. 14140 14141- bpo-32436: Document :pep:`567` changes to asyncio. 14142 14143- bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal 14144 to 3.8. 14145 14146- bpo-33594: Document ``getargspec``, ``from_function`` and ``from_builtin`` 14147 as deprecated in their respective docstring, and include version since 14148 deprecation in DeprecationWarning message. 14149 14150- bpo-33503: Fix broken pypi link 14151 14152- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``. 14153 14154- bpo-33487: BZ2file now emit a DeprecationWarning when buffering=None is 14155 passed, the deprecation message and documentation also now explicitly 14156 state it is deprecated since 3.0. 14157 14158- bpo-33378: Add Korean language switcher for https://docs.python.org/3/ 14159 14160- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be 14161 just any value. 14162 14163- bpo-33201: Modernize documentation for writing C extension types. 14164 14165- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document. 14166 ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is 14167 missed in the document. 14168 14169- bpo-33126: Document PyBuffer_ToContiguous(). 14170 14171- bpo-27212: Modify documentation for the :func:`islice` recipe to consume 14172 initial values up to the start index. 14173 14174- bpo-28247: Update :mod:`zipapp` documentation to describe how to make 14175 standalone applications. 14176 14177- bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and 14178 Berker Peksag. 14179 14180- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder`` 14181 implements ``MetaPathFinder``. (Patch by Himanshu Lakhara) 14182 14183- bpo-28124: The ssl module function ssl.wrap_socket() has been 14184 de-emphasized and deprecated in favor of the more secure and efficient 14185 SSLContext.wrap_socket() method. 14186 14187- bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy. 14188 14189- bpo-32436: Add documentation for the contextvars module (PEP 567). 14190 14191- bpo-32800: Update link to w3c doc for xml default namespaces. 14192 14193- bpo-11015: Update :mod:`test.support` documentation. 14194 14195- bpo-32613: Update the faq/windows.html to use the py command from PEP 397 14196 instead of python. 14197 14198- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get` 14199 method raises :exc:`AttributeError`. 14200 14201- bpo-32614: Modify RE examples in documentation to use raw strings to 14202 prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight 14203 the deprecation. 14204 14205- bpo-20709: Remove the paragraph where we explain that os.utime() does not 14206 support a directory as path under Windows. Patch by Jan-Philip Gehrcke 14207 14208- bpo-32722: Remove the bad example in the tutorial of the Generator 14209 Expression. Patch by Stéphane Wirtel 14210 14211- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses. 14212 14213- bpo-30607: Use the externalized ``python-docs-theme`` package when 14214 building the documentation. 14215 14216- bpo-8243: Add a note about curses.addch and curses.addstr exception 14217 behavior when writing outside a window, or pad. 14218 14219- bpo-32337: Update documentation related with ``dict`` order. 14220 14221- bpo-25041: Document ``AF_PACKET`` in the :mod:`socket` module. 14222 14223- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED 14224 flags for ssl.SSLContext.verify_mode. 14225 14226Tests 14227----- 14228 14229- bpo-35772: Fix sparse file tests of test_tarfile on ppc64 with the tmpfs 14230 filesystem. Fix the function testing if the filesystem supports sparse 14231 files: create a file which contains data and "holes", instead of creating 14232 a file which contains no data. tmpfs effective block size is a page size 14233 (tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64, 14234 ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch 14235 holes of 4 KiB. 14236 14237- bpo-35045: Make ssl tests less strict and also accept TLSv1 as system 14238 default. The changes unbreaks test_min_max_version on Fedora 29. 14239 14240- bpo-32710: ``test_asyncio/test_sendfile.py`` now resets the event loop 14241 policy using :func:`tearDownModule` as done in other tests, to prevent a 14242 warning when running tests on Windows. 14243 14244- bpo-33717: test.pythoninfo now logs information of all clocks, not only 14245 time.time() and time.perf_counter(). 14246 14247- bpo-35488: Add a test to pathlib's Path.match() to verify it does not 14248 support glob-style ** recursive pattern matching. 14249 14250- bpo-31731: Fix a race condition in ``check_interrupted_write()`` of 14251 test_io: create directly the thread with SIGALRM signal blocked, rather 14252 than blocking the signal later from the thread. Previously, it was 14253 possible that the thread gets the signal before the signal is blocked. 14254 14255- bpo-35424: Fix test_multiprocessing_main_handling: use 14256 :class:`multiprocessing.Pool` with a context manager and then explicitly 14257 join the pool. 14258 14259- bpo-35519: Rename :mod:`test.bisect` module to :mod:`test.bisect_cmd` to 14260 avoid conflict with :mod:`bisect` module when running directly a test like 14261 ``./python Lib/test/test_xmlrpc.py``. 14262 14263- bpo-35513: Replace :func:`time.time` with :func:`time.monotonic` in tests 14264 to measure time delta. 14265 14266- bpo-34279: :func:`test.support.run_unittest` no longer raise 14267 :exc:`TestDidNotRun` if the test result contains skipped tests. The 14268 exception is now only raised if no test have been run and no test have 14269 been skipped. 14270 14271- bpo-35412: Add testcase to ``test_future4``: check unicode literal. 14272 14273- bpo-26704: Added test demonstrating double-patching of an instance method. 14274 Patch by Anthony Sottile. 14275 14276- bpo-33725: test_multiprocessing_fork may crash on recent versions of 14277 macOS. Until the issue is resolved, skip the test on macOS. 14278 14279- bpo-35352: Modify test_asyncio to use the certificate set from the test 14280 directory. 14281 14282- bpo-35317: Fix ``mktime()`` overflow error in ``test_email``: run 14283 ``test_localtime_daylight_true_dst_true()`` and 14284 ``test_localtime_daylight_false_dst_true()`` with a specific timezone. 14285 14286- bpo-21263: After several reports that test_gdb does not work properly on 14287 macOS and since gdb is not shipped by default anymore, test_gdb is now 14288 skipped on macOS when LLVM Clang has been used to compile Python. Patch by 14289 Lysandros Nikolaou 14290 14291- bpo-34279: regrtest issue a warning when no tests have been executed in a 14292 particular test file. Also, a new final result state is issued if no test 14293 have been executed across all test files. Patch by Pablo Galindo. 14294 14295- bpo-34962: make docstest in Doc now passes., and is enforced in CI 14296 14297- bpo-23596: Use argparse for the command line of the gzip module. Patch by 14298 Antony Lee 14299 14300- bpo-34537: Fix ``test_gdb.test_strings()`` when ``LC_ALL=C`` and GDB was 14301 compiled with Python 3.6 or earlier. 14302 14303- bpo-34587: test_socket: Remove RDSTest.testCongestion(). The test tries to 14304 fill the receiver's socket buffer and expects an error. But the RDS 14305 protocol doesn't require that. Moreover, the Linux implementation of RDS 14306 expects that the producer of the messages reduces its rate, it's not the 14307 role of the receiver to trigger an error. The test fails on Fedora 28 by 14308 design, so just remove it. 14309 14310- bpo-34661: Fix test_shutil if unzip doesn't support -t. 14311 14312- bpo-34200: Fixed non-deterministic flakiness of test_pkg by not using the 14313 scary test.support.module_cleanup() logic to save and restore sys.modules 14314 contents between test cases. 14315 14316- bpo-34569: The experimental PEP 554 data channels now correctly pass 14317 negative PyLong objects between subinterpreters on 32-bit systems. Patch 14318 by Michael Felt. 14319 14320- bpo-34594: Fix usage of hardcoded ``errno`` values in the tests. 14321 14322- bpo-34579: Fix test_embed for AIX Patch by Michael Felt 14323 14324- bpo-34542: Use 3072 RSA keys and SHA-256 signature for test certs and 14325 keys. 14326 14327- bpo-11193: Remove special condition for AIX in 14328 `test_subprocess.test_undecodable_env` 14329 14330- bpo-34347: Fix `test_utf8_mode.test_cmd_line` for AIX 14331 14332- bpo-34490: On AIX with AF_UNIX family sockets getsockname() does not 14333 provide 'sockname', so skip calls to transport.get_extra_info('sockname') 14334 14335- bpo-34391: Fix ftplib test for TLS 1.3 by reading from data socket. 14336 14337- bpo-11192: Fix `test_socket` on AIX 6.1 and later IPv6 zone id supports 14338 only supported by inet_pton6_zone() Switch to runtime-based 14339 platform.system() to establish current platform rather than build-time 14340 based sys.platform() 14341 14342- bpo-34399: Update all RSA keys and DH params to use at least 2048 bits. 14343 14344- bpo-34373: Fix ``test_mktime`` and ``test_pthread_getcpuclickid`` tests 14345 for AIX Add range checking for ``_PyTime_localtime`` for AIX Patch by 14346 Michael Felt 14347 14348- bpo-11191: Skip the distutils test 'test_search_cpp' when using XLC as 14349 compiler patch by aixtools (Michael Felt) 14350 14351- Improved an error message when mock assert_has_calls fails. 14352 14353- bpo-33746: Fix test_unittest when run in verbose mode. 14354 14355- bpo-33901: Fix test_dbm_gnu on macOS with gdbm 1.15: add a larger value to 14356 make sure that the file size changes. 14357 14358- bpo-33873: Fix a bug in ``regrtest`` that caused an extra test to run if 14359 --huntrleaks/-R was used. Exit with error in case that invalid parameters 14360 are specified to --huntrleaks/-R (at least one warmup run and one 14361 repetition must be used). 14362 14363- bpo-33562: Check that a global asyncio event loop policy is not left 14364 behind by any tests. 14365 14366- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that 14367 might be due to running on ZFS. 14368 14369- bpo-32962: Fixed test_gdb when Python is compiled with flags -mcet 14370 -fcf-protection -O0. 14371 14372- bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when 14373 the interpreter is built with ``--enable-shared``. 14374 14375- bpo-32872: Avoid regrtest compatibility issue with namespace packages. 14376 14377- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport 14378 of ``KqueueSelector`` loop was not being closed. 14379 14380- bpo-32663: Making sure the `SMTPUTF8SimTests` class of tests gets run in 14381 test_smtplib.py. 14382 14383- bpo-27643: Test_C test case needs "signed short" bitfields, but the IBM 14384 XLC compiler (on AIX) does not support this Skip the code and test when 14385 AIX and XLC are used 14386 14387 Applicable to Python2-2.7 and later 14388 14389- bpo-19417: Add test_bdb.py. 14390 14391- bpo-31809: Add tests to verify connection with secp ECDH curves. 14392 14393Build 14394----- 14395 14396- bpo-34691: The _contextvars module is now built into the core Python 14397 library on Windows. 14398 14399- bpo-35683: Improved Azure Pipelines build steps and now verifying layouts 14400 correctly 14401 14402- bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj 14403 14404- bpo-35550: Fix incorrect Solaris #ifdef checks to look for __sun && __SVR4 14405 instead of sun when compiling. 14406 14407- bpo-35499: ``make profile-opt`` no longer replaces ``CFLAGS_NODIST`` with 14408 ``CFLAGS``. It now adds profile-guided optimization (PGO) flags to 14409 ``CFLAGS_NODIST``: existing ``CFLAGS_NODIST`` flags are kept. 14410 14411- bpo-35257: Avoid leaking the linker flags from Link Time Optimizations 14412 (LTO) into distutils when compiling C extensions. 14413 14414- bpo-35351: When building Python with clang and LTO, LTO flags are no 14415 longer passed into CFLAGS to build third-party C extensions through 14416 distutils. 14417 14418- bpo-35139: Fix a compiler error when statically linking `pyexpat` in 14419 `Modules/Setup`. 14420 14421- bpo-35059: PCbuild: Set InlineFunctionExpansion to OnlyExplicitInline 14422 ("/Ob1" option) in pyproject.props in Debug mode to expand functions 14423 marked as inline. This change should make Python compiled in Debug mode a 14424 little bit faster on Windows. 14425 14426- bpo-35011: Restores the use of pyexpatns.h to isolate our embedded copy of 14427 the expat C library so that its symbols do not conflict at link or dynamic 14428 loading time with an embedding application or other extension modules with 14429 their own version of libexpat. 14430 14431- bpo-28015: Have --with-lto works correctly with clang. 14432 14433- bpo-34765: Update the outdated install-sh file to the latest revision from 14434 automake v1.16.1 14435 14436- bpo-34585: Check for floating-point byte order in configure.ac using 14437 compilation tests instead of executing code, so that these checks work in 14438 cross-compiled builds. 14439 14440- bpo-34710: Fixed SSL module build with OpenSSL & pedantic CFLAGS. 14441 14442- bpo-34582: Add JUnit XML output for regression tests and update Azure 14443 DevOps builds. 14444 14445- bpo-34081: Make Sphinx warnings as errors in the Docs Makefile. 14446 14447- bpo-34555: Fix for case where it was not possible to have both 14448 ``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined. 14449 14450- bpo-33015: Fix an undefined behaviour in the pthread implementation of 14451 :c:func:`PyThread_start_new_thread`: add a function wrapper to always 14452 return ``NULL``. 14453 14454- bpo-34245: The Python shared library is now installed with write 14455 permission (mode 0755), which is the standard way of installing such 14456 libraries. 14457 14458- bpo-34121: Fix detection of C11 atomic support on clang. 14459 14460- bpo-32430: Rename Modules/Setup.dist to Modules/Setup, and remove the 14461 necessity to copy the former manually to the latter when updating the 14462 local source tree. 14463 14464- bpo-30345: Add -g to LDFLAGS when compiling with LTO to get debug symbols. 14465 14466- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from 14467 ``OPT``. This option emitted annoying warnings when building extension 14468 modules written in C++. 14469 14470- bpo-33614: Ensures module definition files for the stable ABI on Windows 14471 are correctly regenerated. 14472 14473- bpo-33648: The --with-c-locale-warning configuration flag has been 14474 removed. It has had no effect for about a year. 14475 14476- bpo-33522: Enable CI builds on Visual Studio Team Services at 14477 https://python.visualstudio.com/cpython 14478 14479- bpo-33512: configure's check for "long double" has been simplified 14480 14481- bpo-33483: C compiler is now correctly detected from the standard 14482 environment variables. --without-gcc and --with-icc options have been 14483 removed. 14484 14485- bpo-33394: Enable the verbose build for extension modules, when GNU make 14486 is passed macros on the command line. 14487 14488- bpo-33393: Update config.guess and config.sub files. 14489 14490- bpo-33377: Add new triplets for mips r6 and riscv variants (used in 14491 extension suffixes). 14492 14493- bpo-32232: By default, modules configured in `Modules/Setup` are no longer 14494 built with `-DPy_BUILD_CORE`. Instead, modules that specifically need that 14495 preprocessor definition include it in their individual entries. 14496 14497- bpo-33182: The embedding tests can once again be built with clang 6.0 14498 14499- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. 14500 14501- bpo-33012: gcc 8 has added a new warning heuristic to detect invalid 14502 function casts and a stock python build seems to hit that warning quite 14503 often. The most common is the cast of a METH_NOARGS function (that uses 14504 just one argument) to a PyCFunction. Fix this by adding a dummy argument 14505 to all functions that implement METH_NOARGS. 14506 14507- bpo-32898: Fix the python debug build when using COUNT_ALLOCS. 14508 14509- bpo-29442: Replace optparse with argparse in setup.py 14510 14511Windows 14512------- 14513 14514- bpo-35890: Fix API calling consistency of GetVersionEx and wcstok. 14515 14516- bpo-32560: The ``py`` launcher now forwards its ``STARTUPINFO`` structure 14517 to child processes. 14518 14519- bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows 14520 14521- bpo-35811: Avoid propagating venv settings when launching via py.exe 14522 14523- bpo-35797: Fix default executable used by the multiprocessing module 14524 14525- bpo-35758: Allow building on ARM with MSVC. 14526 14527- bpo-29734: Fix handle leaks in os.stat on Windows. 14528 14529- bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport 14530 restrictions. 14531 14532- bpo-35596: Fix vcruntime140.dll being added to embeddable distro multiple 14533 times. 14534 14535- bpo-35402: Update Windows build to use Tcl and Tk 8.6.9 14536 14537- bpo-35401: Updates Windows build to OpenSSL 1.1.0j 14538 14539- bpo-34977: venv on Windows will now use a python.exe redirector rather 14540 than copying the actual binaries from the base environment. 14541 14542- bpo-34977: Adds support for building a Windows App Store package 14543 14544- bpo-35067: Remove _distutils_findvs module and use vswhere.exe instead. 14545 14546- bpo-32557: Allow shutil.disk_usage to take a file path on Windows 14547 14548- bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp. 14549 14550- bpo-34603: Fix returning structs from functions produced by MSVC 14551 14552- bpo-34581: Guard MSVC-specific code in socketmodule.c with ``#ifdef 14553 _MSC_VER``. 14554 14555- bpo-34532: Fixes exit code of list version arguments for py.exe. 14556 14557- bpo-34062: Fixed the '--list' and '--list-paths' arguments for the py.exe 14558 launcher 14559 14560- bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. 14561 14562- bpo-34011: A suite of code has been changed which copied across DLLs and 14563 init.tcl from the running Python location into a venv being created. These 14564 copies are needed only when running from a Python source build, and the 14565 copying code is now only run when that is the case, rather than whenever a 14566 venv is created. 14567 14568- bpo-34006: Revert line length limit for Windows help docs. The line-length 14569 limit is not needed because the pages appear in a separate app rather than 14570 on a browser tab. It can also interact badly with the DPI setting. 14571 14572- bpo-31546: Restore running PyOS_InputHook while waiting for user input at 14573 the prompt. The restores integration of interactive GUI windows (such as 14574 Matplotlib figures) with the prompt on Windows. 14575 14576- bpo-30237: Output error when ReadConsole is canceled by 14577 CancelSynchronousIo instead of crashing. 14578 14579- bpo-33895: GIL is released while calling functions that acquire Windows 14580 loader lock. 14581 14582- bpo-33720: Reduces maximum marshal recursion depth on release builds. 14583 14584- bpo-29097: Fix bug where :meth:`datetime.fromtimestamp` erroneously throws 14585 an :exc:`OSError` on Windows for values between 0 and 86400. Patch by 14586 Ammar Askar. 14587 14588- bpo-33316: PyThread_release_lock always fails 14589 14590- bpo-33184: Update Windows installer to use OpenSSL 1.1.0h. 14591 14592- bpo-32890: Fix usage of GetLastError() instead of errno in os.execve() and 14593 os.truncate(). 14594 14595- bpo-33016: Fix potential use of uninitialized memory in 14596 nt._getfinalpathname 14597 14598- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current 14599 directory is set to a UNC path. 14600 14601- bpo-32901: Update Tcl and Tk versions to 8.6.8 14602 14603- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. 14604 14605- bpo-32409: Ensures activate.bat can handle Unicode contents. 14606 14607- bpo-32457: Improves handling of denormalized executable path when 14608 launching Python. 14609 14610- bpo-32370: Use the correct encoding for ipconfig output in the uuid 14611 module. Patch by Segev Finer. 14612 14613- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly 14614 treating the ``PrintNameOffset`` field of the reparse data buffer as a 14615 number of characters instead of bytes. Patch by Craig Holmquist and SSE4. 14616 14617- bpo-1104: Correctly handle string length in 14618 ``msilib.SummaryInfo.GetProperty()`` to prevent it from truncating the 14619 last character. 14620 14621macOS 14622----- 14623 14624- bpo-35401: Update macOS installer to use OpenSSL 1.1.0j. 14625 14626- bpo-35025: Properly guard the use of the ``CLOCK_GETTIME`` et al. macros 14627 in ``timemodule`` on macOS. 14628 14629- bpo-24658: On macOS, fix reading from and writing into a file with a size 14630 larger than 2 GiB. 14631 14632- bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds. 14633 14634- bpo-33635: In macOS stat on some file descriptors (/dev/fd/3 f.e) will 14635 result in bad file descriptor OSError. Guard against this exception was 14636 added in is_dir, is_file and similar methods. DirEntry.is_dir can also 14637 throw this exception so _RecursiveWildcardSelector._iterate_directories 14638 was also extended with the same error ignoring pattern. 14639 14640- bpo-13631: The .editrc file in user's home directory is now processed 14641 correctly during the readline initialization through editline emulation on 14642 macOS. 14643 14644- bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. 14645 14646- bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS 14647 10.6+ installer. The 10.9+ installer variant already does this. This 14648 means that the Python 3.7 provided by the python.org macOS installers no 14649 longer need or use any external versions of Tcl/Tk, either system-provided 14650 or user-installed, such as ActiveTcl. 14651 14652- bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8. 14653 14654- bpo-31903: In :mod:`_scproxy`, drop the GIL when calling into 14655 ``SystemConfiguration`` to avoid deadlocks. 14656 14657IDLE 14658---- 14659 14660- bpo-35770: IDLE macosx deletes Options => Configure IDLE. It previously 14661 deleted Window => Zoom Height by mistake. (Zoom Height is now on the 14662 Options menu). On Mac, the settings dialog is accessed via Preferences on 14663 the IDLE menu. 14664 14665- bpo-35769: Change IDLE's new file name from 'Untitled' to 'untitled' 14666 14667- bpo-35660: Fix imports in idlelib.window. 14668 14669- bpo-35641: Proper format `calltip` when the function has no docstring. 14670 14671- bpo-33987: Use ttk Frame for ttk widgets. 14672 14673- bpo-34055: Fix erroneous 'smart' indents and newlines in IDLE Shell. 14674 14675- bpo-35591: Find Selection now works when selection not found. 14676 14677- bpo-35196: Speed up squeezer line counting. 14678 14679- bpo-35598: Update config_key: use PEP 8 names and ttk widgets, make some 14680 objects global, and add tests. 14681 14682- bpo-28097: Add Previous/Next History entries to Shell menu. 14683 14684- bpo-35208: Squeezer now properly counts wrapped lines before newlines. 14685 14686- bpo-35555: Gray out Code Context menu entry when it's not applicable. 14687 14688- bpo-35521: Document the IDLE editor code context feature. Add some 14689 internal references within the IDLE doc. 14690 14691- bpo-22703: The Code Context menu label now toggles between Show/Hide Code 14692 Context. The Zoom Height menu now toggles between Zoom/Restore Height. 14693 Zoom Height has moved from the Window menu to the Options menu. 14694 14695- bpo-35213: Where appropriate, use 'macOS' in idlelib. 14696 14697- bpo-34864: On macOS, warn if the system preference "Prefer tabs when 14698 opening documents" is set to "Always". 14699 14700- bpo-34864: Document two IDLE on MacOS issues. The System Preferences Dock 14701 "prefer tabs always" setting disables some IDLE features. Menus are a bit 14702 different than as described for Windows and Linux. 14703 14704- bpo-35202: Remove unused imports from lib/idlelib 14705 14706- bpo-33000: Document that IDLE's shell has no line limit. A program that 14707 runs indefinitely can overfill memory. 14708 14709- bpo-23220: Explain how IDLE's Shell displays output. 14710 14711- bpo-35099: Improve the doc about IDLE running user code. The section is 14712 renamed from "IDLE -- console differences" is renamed "Running user code". 14713 It mostly covers the implications of using custom sys.stdxxx objects. 14714 14715- bpo-35097: Add IDLE doc subsection explaining editor windows. Topics 14716 include opening, title and status bar, .py* extension, and running. 14717 14718- bpo-35093: Document the IDLE document viewer in the IDLE doc. Add a 14719 paragraph in "Help and preferences", "Help sources" subsection. 14720 14721- bpo-35088: Update idlelib.help.copy_string docstring. We now use git and 14722 backporting instead of hg and forward merging. 14723 14724- bpo-35087: Update idlelib help files for the current doc build. The main 14725 change is the elimination of chapter-section numbers. 14726 14727- bpo-34548: Use configured color theme for read-only text views. 14728 14729- bpo-1529353: Enable "squeezing" of long outputs in the shell, to avoid 14730 performance degradation and to clean up the history without losing it. 14731 Squeezed outputs may be copied, viewed in a separate window, and 14732 "unsqueezed". 14733 14734- bpo-34047: Fixed mousewheel scrolling direction on macOS. 14735 14736- bpo-34275: Make IDLE calltips always visible on Mac. Some MacOS-tk 14737 combinations need .update_idletasks(). Patch by Kevin Walzer. 14738 14739- bpo-34120: Fix unresponsiveness after closing certain windows and dialogs. 14740 14741- bpo-33975: Avoid small type when running htests. Since part of the purpose 14742 of human-viewed tests is to determine that widgets look right, it is 14743 important that they look the same for testing as when running IDLE. 14744 14745- bpo-33905: Add test for idlelib.stackview.StackBrowser. 14746 14747- bpo-33924: Change mainmenu.menudefs key 'windows' to 'window'. Every other 14748 menudef key is lowercase version of main menu entry. 14749 14750- bpo-33906: Rename idlelib.windows as window Match Window on the main menu 14751 and remove last plural module name. 14752 14753- bpo-33917: Fix and document idlelib/idle_test/template.py. The revised 14754 file compiles, runs, and tests OK. idle_test/README.txt explains how to 14755 use it to create new IDLE test files. 14756 14757- bpo-33904: IDLE: In rstrip, rename class RstripExtension as Rstrip 14758 14759- bpo-33907: For consistency and clarity, rename an IDLE module and classes. 14760 Module calltips and its class CallTips are now calltip and Calltip. In 14761 module calltip_w, class CallTip is now CalltipWindow. 14762 14763- bpo-33856: Add "help" in the welcome message of IDLE 14764 14765- bpo-33839: IDLE: refactor ToolTip and CallTip and add documentation and 14766 tests 14767 14768- bpo-33855: Minimally test all IDLE modules. Add missing files, import 14769 module, instantiate classes, and check coverage. Check existing files. 14770 14771- bpo-33656: On Windows, add API call saying that tk scales for DPI. On 14772 Windows 8.1+ or 10, with DPI compatibility properties of the Python binary 14773 unchanged, and a monitor resolution greater than 96 DPI, this should make 14774 text and lines sharper. It should otherwise have no effect. 14775 14776- bpo-33768: Clicking on a context line moves that line to the top of the 14777 editor window. 14778 14779- bpo-33763: IDLE: Use read-only text widget for code context instead of 14780 label widget. 14781 14782- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel 14783 and scrollbar slider moved text by a fixed number of pixels, resulting in 14784 partial lines at the top of the editor box. The change also applies to 14785 the shell and grep output windows, but not to read-only text views. 14786 14787- bpo-33679: Enable theme-specific color configuration for Code Context. Use 14788 the Highlights tab to see the setting for built-in themes or add settings 14789 to custom themes. 14790 14791- bpo-33642: Display up to maxlines non-blank lines for Code Context. If 14792 there is no current context, show a single blank line. 14793 14794- bpo-33628: IDLE: Cleanup codecontext.py and its test. 14795 14796- bpo-33564: IDLE's code context now recognizes async as a block opener. 14797 14798- bpo-21474: Update word/identifier definition from ascii to unicode. In 14799 text and entry boxes, this affects selection by double-click, movement 14800 left/right by control-left/right, and deletion left/right by 14801 control-BACKSPACE/DEL. 14802 14803- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string 14804 prefix cannot be paired with either 'r' or 'f'. Consistently color as much 14805 of the prefix, starting at the right, as is valid. Revise and extend 14806 colorizer test. 14807 14808- bpo-32984: Set ``__file__`` while running a startup file. Like Python, 14809 IDLE optionally runs one startup file in the Shell window before 14810 presenting the first interactive input prompt. For IDLE, ``-s`` runs a 14811 file named in environmental variable :envvar:`IDLESTARTUP` or 14812 :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets 14813 ``__file__`` to the startup file name before running the file and unsets 14814 it before the first prompt. IDLE now does the same when run normally, 14815 without the ``-n`` option. 14816 14817- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse. 14818 14819- bpo-32916: Change ``str`` to ``code`` in pyparse. 14820 14821- bpo-32905: Remove unused code in pyparse module. 14822 14823- bpo-32874: Add tests for pyparse. 14824 14825- bpo-32837: Using the system and place-dependent default encoding for 14826 open() is a bad idea for IDLE's system and location-independent files. 14827 14828- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI 14829 test test_file_buttons() only looks at initial ascii-only lines, but 14830 failed on systems where open() defaults to 'ascii' because readline() 14831 internally reads and decodes far enough ahead to encounter a non-ascii 14832 character in CREDITS.txt. 14833 14834- bpo-32831: Add docstrings and tests for codecontext. 14835 14836- bpo-32765: Update configdialog General tab docstring to add new widgets to 14837 the widget list. 14838 14839Tools/Demos 14840----------- 14841 14842- bpo-35884: Add a benchmark script for timing various ways to access 14843 variables: ``Tools/scripts/var_access_benchmark.py``. 14844 14845- bpo-34989: python-gdb.py now handles errors on computing the line number 14846 of a Python frame. 14847 14848- bpo-20260: Argument Clinic now has non-bitwise unsigned int converters. 14849 14850- bpo-32962: python-gdb now catches ``UnicodeDecodeError`` exceptions when 14851 calling ``string()``. 14852 14853- bpo-32962: python-gdb now catches ValueError on read_var(): when Python 14854 has no debug symbols for example. 14855 14856- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as 14857 docstrings and translatable strings, and rejects bytes literals and 14858 f-string expressions. 14859 14860- bpo-31920: Fixed handling directories as arguments in the ``pygettext`` 14861 script. Based on patch by Oleg Krasnikov. 14862 14863- bpo-29673: Fix pystackv and pystack gdbinit macros. 14864 14865- bpo-25427: Remove the pyvenv script in favor of ``python3 -m venv`` in 14866 order to lower confusion as to what Python interpreter a virtual 14867 environment will be created for. 14868 14869- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable 14870 automatic backup creation (files with ``~`` suffix). 14871 14872- bpo-32222: Fix pygettext not extracting docstrings for functions with type 14873 annotated arguments. Patch by Toby Harradine. 14874 14875- bpo-31583: Fix 2to3 for using with --add-suffix option but without 14876 --output-dir option for relative path to files in current directory. 14877 14878C API 14879----- 14880 14881- bpo-35713: The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` 14882 functions have been removed. They did nothing since Python 2.7.4 and 14883 Python 3.2.0, were excluded from the limited API (stable ABI), and were 14884 not documented. 14885 14886- bpo-33817: Fixed :c:func:`_PyBytes_Resize` for empty bytes objects. 14887 14888- bpo-35322: Fix memory leak in :c:func:`PyUnicode_EncodeLocale` and 14889 :c:func:`PyUnicode_EncodeFSDefault` on error handling. 14890 14891- bpo-35059: The following C macros have been converted to static inline 14892 functions: :c:func:`Py_INCREF`, :c:func:`Py_DECREF`, :c:func:`Py_XINCREF`, 14893 :c:func:`Py_XDECREF`, :c:func:`PyObject_INIT`, 14894 :c:func:`PyObject_INIT_VAR`. 14895 14896- bpo-35296: ``make install`` now also installs the internal API: 14897 ``Include/internal/*.h`` header files. 14898 14899- bpo-35081: Internal APIs surrounded by ``#ifdef Py_BUILD_CORE`` have been 14900 moved from ``Include/*.h`` headers to new header files 14901 ``Include/internal/pycore_*.h``. 14902 14903- bpo-35259: Conditionally declare :c:func:`Py_FinalizeEx()` (new in 3.6) 14904 based on Py_LIMITED_API. Patch by Arthur Neufeld. 14905 14906- bpo-35081: The :c:func:`_PyObject_GC_TRACK` and 14907 :c:func:`_PyObject_GC_UNTRACK` macros have been removed from the public C 14908 API. 14909 14910- bpo-35134: Creation of a new ``Include/cpython/`` subdirectory. 14911 14912- bpo-34725: Adds _Py_SetProgramFullPath so embedders may override 14913 sys.executable 14914 14915- bpo-34910: Ensure that :c:func:`PyObject_Print` always returns ``-1`` on 14916 error. Patch by Zackery Spytz. 14917 14918- bpo-34523: Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 14919 encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero. 14920 14921- bpo-34193: Fix pluralization in TypeError messages in getargs.c and 14922 typeobject.c: '1 argument' instead of '1 arguments' and '1 element' 14923 instead of '1 elements'. 14924 14925- bpo-34127: Return grammatically correct error message based on argument 14926 count. Patch by Karthikeyan Singaravelan. 14927 14928- bpo-23927: Fixed :exc:`SystemError` in 14929 :c:func:`PyArg_ParseTupleAndKeywords` when the ``w*`` format unit is used 14930 for optional parameter. 14931 14932- bpo-32455: Added :c:func:`PyCompile_OpcodeStackEffectWithJump`. 14933 14934- bpo-34008: Py_Main() can again be called after Py_Initialize(), as in 14935 Python 3.6. 14936 14937- bpo-32500: Fixed error messages for :c:func:`PySequence_Size`, 14938 :c:func:`PySequence_GetItem`, :c:func:`PySequence_SetItem` and 14939 :c:func:`PySequence_DelItem` called with a mapping and 14940 :c:func:`PyMapping_Size` called with a sequence. 14941 14942- bpo-33818: :c:func:`PyExceptionClass_Name` will now return ``const char 14943 *`` instead of ``char *``. 14944 14945- bpo-33042: Embedding applications may once again call 14946 PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to 14947 calling Py_Initialize. 14948 14949- bpo-32374: Document that m_traverse for multi-phase initialized modules 14950 can be called with m_state=NULL, and add a sanity check 14951 14952- bpo-30863: :c:func:`PyUnicode_AsWideChar` and 14953 :c:func:`PyUnicode_AsWideCharString` no longer cache the ``wchar_t*`` 14954 representation of string objects. 14955 14956 14957What's New in Python 3.7.0 final? 14958================================= 14959 14960*Release date: 2018-06-27* 14961 14962Library 14963------- 14964 14965- bpo-33851: Fix :func:`ast.get_docstring` for a node that lacks a 14966 docstring. 14967 14968C API 14969----- 14970 14971- bpo-33932: Calling Py_Initialize() twice does nothing, instead of failing 14972 with a fatal error: restore the Python 3.6 behaviour. 14973 14974 14975What's New in Python 3.7.0 release candidate 1? 14976=============================================== 14977 14978*Release date: 2018-06-12* 14979 14980Core and Builtins 14981----------------- 14982 14983- bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an 14984 object that hadn't all of its fields set to NULL. 14985 14986- bpo-33706: Fix a crash in Python initialization when parsing the command 14987 line options. Thanks Christoph Gohlke for the bug report and the fix! 14988 14989- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter 14990 shutdown even when there was a custom handler set previously. Patch by 14991 Philipp Kerling. 14992 14993- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c. 14994 14995Library 14996------- 14997 14998- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by 14999 Steve Weber. 15000 15001- bpo-33812: Datetime instance d with non-None tzinfo, but with 15002 d.tzinfo.utcoffset(d) returning None is now treated as naive by the 15003 astimezone() method. 15004 15005- bpo-30805: Avoid race condition with debug logging 15006 15007- bpo-33694: asyncio: Fix a race condition causing data loss on 15008 pause_reading()/resume_reading() when using the ProactorEventLoop. 15009 15010- bpo-32493: Correct test for ``uuid_enc_be`` availability in 15011 ``configure.ac``. Patch by Michael Felt. 15012 15013- bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and 15014 asyncio.WindowsProactorEventLoopPolicy. 15015 15016- bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0. 15017 15018- bpo-33770: improve base64 exception message for encoded inputs of invalid 15019 length 15020 15021- bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case 15022 of an unhandled error; mark SSLTransport as closed if it is aborted. 15023 15024- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence 15025 operations now raise :exc:`TypeError` instead of :exc:`SystemError` when 15026 performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz. 15027 15028- bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake 15029 timeout 15030 15031- bpo-11874: Use a better regex when breaking usage into wrappable parts. 15032 Avoids bogus assertion errors from custom metavar strings. 15033 15034- bpo-33582: Emit a deprecation warning for inspect.formatargspec 15035 15036Documentation 15037------------- 15038 15039- bpo-33409: Clarified the relationship between :pep:`538`'s 15040 PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode. 15041 15042- bpo-33736: Improve the documentation of :func:`asyncio.open_connection`, 15043 :func:`asyncio.start_server` and their UNIX socket counterparts. 15044 15045- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED 15046 flags for ssl.SSLContext.verify_mode. 15047 15048Build 15049----- 15050 15051- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from 15052 ``OPT``. This option emitted annoying warnings when building extension 15053 modules written in C++. 15054 15055Windows 15056------- 15057 15058- bpo-33720: Reduces maximum marshal recursion depth on release builds. 15059 15060IDLE 15061---- 15062 15063- bpo-33656: On Windows, add API call saying that tk scales for DPI. On 15064 Windows 8.1+ or 10, with DPI compatibility properties of the Python binary 15065 unchanged, and a monitor resolution greater than 96 DPI, this should make 15066 text and lines sharper. It should otherwise have no effect. 15067 15068- bpo-33768: Clicking on a context line moves that line to the top of the 15069 editor window. 15070 15071- bpo-33763: IDLE: Use read-only text widget for code context instead of 15072 label widget. 15073 15074- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel 15075 and scrollbar slider moved text by a fixed number of pixels, resulting in 15076 partial lines at the top of the editor box. The change also applies to 15077 the shell and grep output windows, but not to read-only text views. 15078 15079- bpo-33679: Enable theme-specific color configuration for Code Context. Use 15080 the Highlights tab to see the setting for built-in themes or add settings 15081 to custom themes. 15082 15083- bpo-33642: Display up to maxlines non-blank lines for Code Context. If 15084 there is no current context, show a single blank line. 15085 15086 15087What's New in Python 3.7.0 beta 5? 15088================================== 15089 15090*Release date: 2018-05-30* 15091 15092Core and Builtins 15093----------------- 15094 15095- bpo-33622: Fixed a leak when the garbage collector fails to add an object 15096 with the ``__del__`` method or referenced by it into the 15097 :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an 15098 exception is set and preserves it. 15099 15100- bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't 15101 crash if module_globals is not a dict. 15102 15103- bpo-20104: The new `os.posix_spawn` added in 3.7.0b1 was removed as we are 15104 still working on what the API should look like. Expect this in 3.8 15105 instead. 15106 15107- bpo-33475: Fixed miscellaneous bugs in converting annotations to strings 15108 and optimized parentheses in the string representation. 15109 15110- bpo-33391: Fix a leak in set_symmetric_difference(). 15111 15112- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer. 15113 15114- bpo-32911: Due to unexpected compatibility issues discovered during 15115 downstream beta testing, reverted :issue:`29463`. ``docstring`` field is 15116 removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes 15117 which was added in 3.7a1. Docstring expression is restored as a first 15118 statement in their body. Based on patch by Inada Naoki. 15119 15120- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a 15121 ctypes structured data type. Patch by Eryk Sun and Oren Milman. 15122 15123Library 15124------- 15125 15126- bpo-32751: When cancelling the task due to a timeout, 15127 :meth:`asyncio.wait_for` will now wait until the cancellation is complete. 15128 15129- bpo-32684: Fix gather to propagate cancellation of itself even with 15130 return_exceptions. 15131 15132- bpo-33654: Support protocol type switching in SSLTransport.set_protocol(). 15133 15134- bpo-33674: Pause the transport as early as possible to further reduce the 15135 risk of data_received() being called before connection_made(). 15136 15137- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of 15138 asyncio.sslproto: start immediately the handshake instead of using 15139 call_soon(). Previously, data_received() could be called before the 15140 handshake started, causing the handshake to hang or fail. 15141 15142- bpo-31647: Fixed bug where calling write_eof() on a 15143 _SelectorSocketTransport after it's already closed raises AttributeError. 15144 15145- bpo-32610: Make asyncio.all_tasks() return only pending tasks. 15146 15147- bpo-32410: Avoid blocking on file IO in sendfile fallback code 15148 15149- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor 15150 15151- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines 15152 15153- bpo-33654: Fix transport.set_protocol() to support switching between 15154 asyncio.Protocol and asyncio.BufferedProtocol. Fix loop.start_tls() to 15155 work with asyncio.BufferedProtocols. 15156 15157- bpo-33652: Pickles of type variables and subscripted generics are now 15158 future-proof and compatible with older Python versions. 15159 15160- bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD. 15161 15162- bpo-33618: Finalize and document preliminary and experimental TLS 1.3 15163 support with OpenSSL 1.1.1 15164 15165- bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ 15166 15167- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder 15168 that prevented the cache of parsed strings from clearing after finishing 15169 the decoding. Based on patch by c-fos. 15170 15171- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with 15172 OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers 15173 enabled by default. 15174 15175- bpo-28556: Do not simplify arguments to `typing.Union`. Now 15176 `Union[Manager, Employee]` is not simplified to `Employee` at runtime. 15177 Such simplification previously caused several bugs and limited 15178 possibilities for introspection. 15179 15180- bpo-33540: Add a new ``block_on_close`` class attribute to 15181 ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`. 15182 15183- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP 15184 locations 15185 15186- bpo-33109: argparse subparsers are once again not required by default, 15187 reverting the change in behavior introduced by bpo-26510 in 3.7.0a2. 15188 15189- bpo-33536: dataclasses.make_dataclass now checks for invalid field names 15190 and duplicate fields. Also, added a check for invalid field 15191 specifications. 15192 15193- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on 15194 Windows. Patch by Zvi Effron 15195 15196- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in 15197 Windows proactor event loop. 15198 15199- Fix failure in `typing.get_type_hints()` when ClassVar was provided as a 15200 string forward reference. 15201 15202- bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x 15203 faster. 15204 15205- bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in 15206 FieldStorage use the given errors (needed for Twisted). Patch by Amber 15207 Brown. 15208 15209- bpo-33495: Change dataclasses.Fields repr to use the repr of each of its 15210 members, instead of str. This makes it more clear what each field 15211 actually represents. This is especially true for the 'type' member. 15212 15213- bpo-33453: Fix dataclasses to work if using literal string type 15214 annotations or if using PEP 563 "Postponed Evaluation of Annotations". 15215 Only specific string prefixes are detected for both ClassVar ("ClassVar" 15216 and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar"). 15217 15218- bpo-28556: Minor fixes in typing module: add annotations to 15219 ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in 15220 ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova. 15221 15222- bpo-20087: Updated alias mapping with glibc 2.27 supported locales. 15223 15224- bpo-33422: Fix trailing quotation marks getting deleted when looking up 15225 byte/string literals on pydoc. Patch by Andrés Delfino. 15226 15227- bpo-28167: The function ``platform.linux_distribution`` and 15228 ``platform.dist`` now trigger a ``DeprecationWarning`` and have been 15229 marked for removal in Python 3.8 15230 15231- bpo-33197: Update error message when constructing invalid 15232 inspect.Parameters Patch by Dong-hee Na. 15233 15234- bpo-33263: Fix FD leak in `_SelectorSocketTransport` Patch by Vlad 15235 Starostin. 15236 15237- bpo-32861: The urllib.robotparser's ``__str__`` representation now 15238 includes wildcard entries and the "Crawl-delay" and "Request-rate" fields. 15239 Patch by Michael Lazar. 15240 15241- bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant, 15242 available with OpenSSL 1.1.0h or 1.1.1. 15243 15244- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer. 15245 15246Documentation 15247------------- 15248 15249- bpo-23859: Document that `asyncio.wait()` does not cancel its futures on 15250 timeout. 15251 15252- bpo-32436: Document :pep:`567` changes to asyncio. 15253 15254- bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal 15255 to 3.8. 15256 15257- bpo-33503: Fix broken pypi link 15258 15259- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``. 15260 15261Tests 15262----- 15263 15264- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that 15265 might be due to running on ZFS. 15266 15267- bpo-32604: Remove the _xxsubinterpreters module (meant for testing) and 15268 associated helpers. This module was originally added recently in 3.7b1. 15269 15270Build 15271----- 15272 15273- bpo-33614: Ensures module definition files for the stable ABI on Windows 15274 are correctly regenerated. 15275 15276- bpo-33522: Enable CI builds on Visual Studio Team Services at 15277 https://python.visualstudio.com/cpython 15278 15279- bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing 15280 warnings about function casts like casting to PyCFunction in method 15281 definition lists. 15282 15283macOS 15284----- 15285 15286- bpo-13631: The .editrc file in user's home directory is now processed 15287 correctly during the readline initialization through editline emulation on 15288 macOS. 15289 15290IDLE 15291---- 15292 15293- bpo-33628: IDLE: Cleanup codecontext.py and its test. 15294 15295- bpo-33564: IDLE's code context now recognizes async as a block opener. 15296 15297- bpo-32831: Add docstrings and tests for codecontext. 15298 15299 15300What's New in Python 3.7.0 beta 4? 15301================================== 15302 15303*Release date: 2018-05-02* 15304 15305Core and Builtins 15306----------------- 15307 15308- bpo-33363: Raise a SyntaxError for ``async with`` and ``async for`` 15309 statements outside of async functions. 15310 15311- bpo-33128: Fix a bug that causes PathFinder to appear twice on 15312 sys.meta_path. Patch by Pablo Galindo Salgado. 15313 15314- bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in 15315 dictobject.c by adjusting how the internal struct _dictkeysobject shared 15316 keys structure is declared. 15317 15318- bpo-33231: Fix potential memory leak in ``normalizestring()``. 15319 15320- bpo-33205: Change dict growth function from 15321 ``round_up_to_power_2(used*2+hashtable_size/2)`` to 15322 ``round_up_to_power_2(used*3)``. Previously, dict is shrinked only when 15323 ``used == 0``. Now dict has more chance to be shrinked. 15324 15325- bpo-29922: Improved error messages in 'async with' when ``__aenter__()`` 15326 or ``__aexit__()`` return non-awaitable object. 15327 15328- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized 15329 when copying from key-sharing dict. 15330 15331Library 15332------- 15333 15334- bpo-33281: Fix ctypes.util.find_library regression on macOS. 15335 15336- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database 15337 object when it is called with a single argument. 15338 15339- bpo-33329: Fix multiprocessing regression on newer glibcs 15340 15341- bpo-991266: Fix quoting of the ``Comment`` attribute of 15342 :class:`http.cookies.SimpleCookie`. 15343 15344- bpo-33131: Upgrade bundled version of pip to 10.0.1. 15345 15346- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST 15347 object to a tree of tuples or lists with ``line_info=False`` and 15348 ``col_info=True``. 15349 15350- bpo-33266: lib2to3 now recognizes ``rf'...'`` strings. 15351 15352- bpo-11594: Ensure line-endings are respected when using lib2to3. 15353 15354- bpo-33254: Have :func:`importlib.resources.contents` and 15355 :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable` 15356 instead of an :term:`iterator`. 15357 15358- bpo-33256: Fix display of ``<module>`` call in the html produced by 15359 ``cgitb.html()``. Patch by Stéphane Blondon. 15360 15361- bpo-33185: Fixed regression when running pydoc with the :option:`-m` 15362 switch. (The regression was introduced in 3.7.0b3 by the resolution of 15363 :issue:`33053`) This fix also changed pydoc to add ``os.getcwd()`` to 15364 :data:`sys.path` when necessary, rather than adding ``"."``. 15365 15366- bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache` 15367 when :meth:`importlib.machinery.invalidate_caches` is called. 15368 15369- bpo-33217: Deprecate looking up non-Enum objects in Enum classes and Enum 15370 members (will raise :exc:`TypeError` in 3.8+). 15371 15372- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty 15373 sequences consistently even when called from subclasses without a 15374 ``getrandbits()`` implementation. 15375 15376- bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught 15377 StopIteration in a generator into a return-statement. 15378 15379- bpo-33209: End framing at the end of C implementation of 15380 :func:`pickle.Pickler.dump`. 15381 15382- bpo-20104: Improved error handling and fixed a reference leak in 15383 :func:`os.posix_spawn()`. 15384 15385- bpo-33175: In dataclasses, Field.__set_name__ now looks up the 15386 __set_name__ special method on the class, not the instance, of the default 15387 value. 15388 15389- bpo-33097: Raise RuntimeError when ``executor.submit`` is called during 15390 interpreter shutdown. 15391 15392- bpo-31908: Fix output of cover files for ``trace`` module command-line 15393 tool. Previously emitted cover files only when ``--missing`` option was 15394 used. Patch by Michael Selik. 15395 15396Documentation 15397------------- 15398 15399- bpo-33378: Add Korean language switcher for https://docs.python.org/3/ 15400 15401- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be 15402 just any value. 15403 15404- bpo-33201: Modernize documentation for writing C extension types. 15405 15406- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document. 15407 ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is 15408 missed in the document. 15409 15410- bpo-8243: Add a note about curses.addch and curses.addstr exception 15411 behavior when writing outside a window, or pad. 15412 15413- bpo-32337: Update documentation related with ``dict`` order. 15414 15415Tests 15416----- 15417 15418- bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when 15419 the interpreter is built with ``--enable-shared``. 15420 15421Build 15422----- 15423 15424- bpo-33394: Enable the verbose build for extension modules, when GNU make 15425 is passed macros on the command line. 15426 15427- bpo-33393: Update config.guess and config.sub files. 15428 15429- bpo-33377: Add new triplets for mips r6 and riscv variants (used in 15430 extension suffixes). 15431 15432- bpo-32232: By default, modules configured in `Modules/Setup` are no longer 15433 built with `-DPy_BUILD_CORE`. Instead, modules that specifically need that 15434 preprocessor definition include it in their individual entries. 15435 15436- bpo-33182: The embedding tests can once again be built with clang 6.0 15437 15438Windows 15439------- 15440 15441- bpo-33184: Update Windows installer to use OpenSSL 1.1.0h. 15442 15443macOS 15444----- 15445 15446- bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. 15447 15448IDLE 15449---- 15450 15451- bpo-21474: Update word/identifier definition from ascii to unicode. In 15452 text and entry boxes, this affects selection by double-click, movement 15453 left/right by control-left/right, and deletion left/right by 15454 control-BACKSPACE/DEL. 15455 15456- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string 15457 prefix cannot be paired with either 'r' or 'f'. Consistently color as much 15458 of the prefix, starting at the right, as is valid. Revise and extend 15459 colorizer test. 15460 15461Tools/Demos 15462----------- 15463 15464- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as 15465 docstrings and translatable strings, and rejects bytes literals and 15466 f-string expressions. 15467 15468- bpo-31920: Fixed handling directories as arguments in the ``pygettext`` 15469 script. Based on patch by Oleg Krasnikov. 15470 15471- bpo-29673: Fix pystackv and pystack gdbinit macros. 15472 15473- bpo-31583: Fix 2to3 for using with --add-suffix option but without 15474 --output-dir option for relative path to files in current directory. 15475 15476 15477What's New in Python 3.7.0 beta 3? 15478================================== 15479 15480*Release date: 2018-03-29* 15481 15482Security 15483-------- 15484 15485- bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970. 15486 X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new 15487 test ensures that NULL bytes are not allowed. 15488 15489- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows 15490 15491- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic 15492 backtracking. These regexes formed potential DOS vectors (REDOS). They 15493 have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch 15494 by Jamie Davis. 15495 15496Core and Builtins 15497----------------- 15498 15499- bpo-33053: When using the -m switch, sys.path[0] is now explicitly 15500 expanded as the *starting* working directory, rather than being left as 15501 the empty path (which allows imports from the current working directory at 15502 the time of the import) 15503 15504- bpo-33018: Improve consistency of errors raised by ``issubclass()`` when 15505 called with a non-class and an abstract base class as the first and second 15506 arguments, respectively. Patch by Josh Bronson. 15507 15508- bpo-33041: Fixed jumping when the function contains an ``async for`` loop. 15509 15510- bpo-33026: Fixed jumping out of "with" block by setting f_lineno. 15511 15512- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex: 15513 using PYTHONMALLOC env var). _PyGILState_Reinit() and 15514 _PyInterpreterState_Enable() now use the default RAW memory allocator to 15515 allocate a new interpreters mutex on fork. 15516 15517- bpo-17288: Prevent jumps from 'return' and 'exception' trace events. 15518 15519- bpo-32836: Don't use temporary variables in cases of list/dict/set 15520 comprehensions 15521 15522Library 15523------- 15524 15525- bpo-33141: Have Field objects pass through __set_name__ to their default 15526 values, if they have their own __set_name__. 15527 15528- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false 15529 boolean value. Note iid=0 and iid=False would be same. Patch by Garvit 15530 Khatri. 15531 15532- bpo-32873: Treat type variables and special typing forms as immutable by 15533 copy and pickle. This fixes several minor issues and inconsistencies, and 15534 improves backwards compatibility with Python 3.6. 15535 15536- bpo-33134: When computing dataclass's __hash__, use the lookup table to 15537 contain the function which returns the __hash__ value. This is an 15538 improvement over looking up a string, and then testing that string to see 15539 what to do. 15540 15541- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1. 15542 15543- bpo-32505: Raise TypeError if a member variable of a dataclass is of type 15544 Field, but doesn't have a type annotation. 15545 15546- bpo-33078: Fix the failure on OSX caused by the tests relying on 15547 sem_getvalue 15548 15549- bpo-33116: Add 'Field' to dataclasses.__all__. 15550 15551- bpo-32896: Fix an error where subclassing a dataclass with a field that 15552 uses a default_factory would generate an incorrect class. 15553 15554- bpo-33100: Dataclasses: If a field has a default value that's a 15555 MemberDescriptorType, then it's from that field being in __slots__, not an 15556 actual default value. 15557 15558- bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow 15559 attributes to be added to the derived class. Only attributes from the 15560 frozen dataclass cannot be assigned to. Require all dataclasses in a 15561 hierarchy to be either all frozen or all non-frozen. 15562 15563- bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py 15564 15565- bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling 15566 error occurs. 15567 15568- bpo-33064: lib2to3 now properly supports trailing commas after ``*args`` 15569 and ``**kwargs`` in function signatures. 15570 15571- bpo-33056: FIX properly close leaking fds in 15572 concurrent.futures.ProcessPoolExecutor. 15573 15574- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all 15575 threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch 15576 by Nir Soffer. 15577 15578- bpo-31804: Avoid failing in multiprocessing.Process if the standard 15579 streams are closed or None at exit. 15580 15581- bpo-33037: Skip sending/receiving data after SSL transport closing. 15582 15583- bpo-27683: Fix a regression in :mod:`ipaddress` that result of 15584 :meth:`hosts` is empty when the network is constructed by a tuple 15585 containing an integer mask and only 1 bit left for addresses. 15586 15587- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls, 15588 subclass)`` crashed when ``subclass`` is not a type object. 15589 15590- bpo-33009: Fix inspect.signature() for single-parameter partialmethods. 15591 15592- bpo-32969: Expose several missing constants in zlib and fix corresponding 15593 documentation. 15594 15595- bpo-32056: Improved exceptions raised for invalid number of channels and 15596 sample width when read an audio file in modules :mod:`aifc`, :mod:`wave` 15597 and :mod:`sunau`. 15598 15599- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in 15600 subprocess if another low descriptor is closed. 15601 15602- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a 15603 :exc:`ValueError` instead of canceling the first scheduled function. 15604 Patch by Cheryl Sabella. 15605 15606- bpo-31639: http.server now exposes a ThreadedHTTPServer class and uses it 15607 when the module is run with ``-m`` to cope with web browsers pre-opening 15608 sockets. 15609 15610- bpo-27645: :class:`sqlite3.Connection` now exposes a 15611 :class:`~sqlite3.Connection.backup` method, if the underlying SQLite 15612 library is at version 3.6.11 or higher. Patch by Lele Gaifax. 15613 15614Documentation 15615------------- 15616 15617- bpo-33126: Document PyBuffer_ToContiguous(). 15618 15619- bpo-27212: Modify documentation for the :func:`islice` recipe to consume 15620 initial values up to the start index. 15621 15622- bpo-28247: Update :mod:`zipapp` documentation to describe how to make 15623 standalone applications. 15624 15625- bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and 15626 Berker Peksag. 15627 15628- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder`` 15629 implements ``MetaPathFinder``. (Patch by Himanshu Lakhara) 15630 15631Tests 15632----- 15633 15634- bpo-32872: Avoid regrtest compatibility issue with namespace packages. 15635 15636- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport 15637 of ``KqueueSelector`` loop was not being closed. 15638 15639- bpo-19417: Add test_bdb.py. 15640 15641Build 15642----- 15643 15644- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. 15645 15646Windows 15647------- 15648 15649- bpo-33016: Fix potential use of uninitialized memory in 15650 nt._getfinalpathname 15651 15652- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current 15653 directory is set to a UNC path. 15654 15655macOS 15656----- 15657 15658- bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS 15659 10.6+ installer. The 10.9+ installer variant already does this. This 15660 means that the Python 3.7 provided by the python.org macOS installers no 15661 longer need or use any external versions of Tcl/Tk, either system-provided 15662 or user-installed, such as ActiveTcl. 15663 15664IDLE 15665---- 15666 15667- bpo-32984: Set ``__file__`` while running a startup file. Like Python, 15668 IDLE optionally runs one startup file in the Shell window before 15669 presenting the first interactive input prompt. For IDLE, ``-s`` runs a 15670 file named in environmental variable :envvar:`IDLESTARTUP` or 15671 :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets 15672 ``__file__`` to the startup file name before running the file and unsets 15673 it before the first prompt. IDLE now does the same when run normally, 15674 without the ``-n`` option. 15675 15676- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse. 15677 15678Tools/Demos 15679----------- 15680 15681- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable 15682 automatic backup creation (files with ``~`` suffix). 15683 15684C API 15685----- 15686 15687- bpo-33042: Embedding applications may once again call 15688 PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to 15689 calling Py_Initialize. 15690 15691- bpo-32374: Document that m_traverse for multi-phase initialized modules 15692 can be called with m_state=NULL, and add a sanity check 15693 15694 15695What's New in Python 3.7.0 beta 2? 15696================================== 15697 15698*Release date: 2018-02-27* 15699 15700Security 15701-------- 15702 15703- bpo-28414: The ssl module now allows users to perform their own IDN 15704 en/decoding when using SNI. 15705 15706Core and Builtins 15707----------------- 15708 15709- bpo-32889: Update Valgrind suppression list to account for the rename of 15710 ``Py_ADDRESS_IN_RANG`` to ``address_in_range``. 15711 15712- bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled() 15713 context manager). 15714 15715- bpo-32305: For namespace packages, ensure that both ``__file__`` and 15716 ``__spec__.origin`` are set to None. 15717 15718- bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for 15719 namespace packages. 15720 15721- bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by 15722 Stéphane Wirtel 15723 15724- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by 15725 write out-of-bound errors when using customized decode error handlers. 15726 15727Library 15728------- 15729 15730- bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen 15731 classes, and also disallow inheriting non-frozen from frozen classes. This 15732 restriction will be relaxed at a future date. 15733 15734- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch 15735 by Joffrey Fuhrer. 15736 15737- bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now 15738 prohibited. The constructors were never documented, tested, or designed as 15739 public constructors. Users were suppose to use ssl.wrap_socket() or 15740 SSLContext. 15741 15742- bpo-32929: Remove the tri-state parameter "hash", and add the boolean 15743 "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a 15744 __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__ 15745 based on the values of eq= and frozen=. The unsafe_hash=False behavior is 15746 the same as the old hash=None behavior. unsafe_hash=False is the default, 15747 just as hash=None used to be. 15748 15749- bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 15750 for future compatibility with OpenSSL 1.1.1. 15751 15752- bpo-30622: The ssl module now detects missing NPN support in LibreSSL. 15753 15754- bpo-32922: dbm.open() now encodes filename with the filesystem encoding 15755 rather than default encoding. 15756 15757- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3`` 15758 syscall exists or not. 15759 15760- bpo-32556: nt._getfinalpathname, nt._getvolumepathname and 15761 nt._getdiskusage now correctly convert from bytes. 15762 15763- bpo-25988: Emit a :exc:`DeprecationWarning` when using or importing an ABC 15764 directly from :mod:`collections` rather than from :mod:`collections.abc`. 15765 15766- bpo-21060: Rewrite confusing message from setup.py upload from "No dist 15767 file created in earlier command" to the more helpful "Must create and 15768 upload files in one command". 15769 15770- bpo-32852: Make sure sys.argv remains as a list when running trace. 15771 15772- bpo-31333: ``_abc`` module is added. It is a speedup module with C 15773 implementations for various functions and methods in ``abc``. Creating an 15774 ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC 15775 subclass are up to 1.5x faster. In addition, this makes Python start-up up 15776 to 10% faster. Note that the new implementation hides internal registry 15777 and caches, previously accessible via private attributes 15778 ``_abc_registry``, ``_abc_cache``, and ``_abc_negative_cache``. There are 15779 three debugging helper methods that can be used instead 15780 ``_dump_registry``, ``_abc_registry_clear``, and ``_abc_caches_clear``. 15781 15782- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored 15783 cancellation after notifying and cancelling a conditional lock. Patch by 15784 Bar Harel. 15785 15786- bpo-32819: ssl.match_hostname() has been simplified and no longer depends 15787 on re and ipaddress module for wildcard and IP addresses. Error reporting 15788 for invalid wildcards has been improved. 15789 15790- bpo-32394: socket: Remove 15791 TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version 15792 Windows during run-time. 15793 15794- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules. 15795 (Contributed by Oren Milman) 15796 15797- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when 15798 only the last field is quoted. Patch by Jake Davis. 15799 15800- bpo-32792: collections.ChainMap() preserves the order of the underlying 15801 mappings. 15802 15803- bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which 15804 contain set operations. Sets starting with '[' or containing '--', '&&', 15805 '~~' or '||' will be interpreted differently in regular expressions in 15806 future versions. Currently they emit warnings. fnmatch.translate() now 15807 avoids producing patterns containing such sets by accident. 15808 15809- bpo-32622: Implement native fast sendfile for Windows proactor event loop. 15810 15811- bpo-32777: Fix a rare but potential pre-exec child process deadlock in 15812 subprocess on POSIX systems when marking file descriptors inheritable on 15813 exec in the child process. This bug appears to have been introduced in 15814 3.4. 15815 15816- bpo-32647: The ctypes module used to depend on indirect linking for 15817 dlopen. The shared extension is now explicitly linked against libdl on 15818 platforms with dl. 15819 15820- bpo-32741: Implement ``asyncio.TimerHandle.when()`` method. 15821 15822- bpo-32691: Use mod_spec.parent when running modules with pdb 15823 15824- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring 15825 and locking the same lock multiple times, without it being free. Patch by 15826 Bar Harel. 15827 15828- bpo-32727: Do not include name field in SMTP envelope from address. Patch 15829 by Stéphane Wirtel 15830 15831- bpo-31453: Add TLSVersion constants and SSLContext.maximum_version / 15832 minimum_version attributes. The new API wraps OpenSSL 1.1 15833 https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html 15834 feature. 15835 15836- bpo-24334: Internal implementation details of ssl module were cleaned up. 15837 The SSLSocket has one less layer of indirection. Owner and session 15838 information are now handled by the SSLSocket and SSLObject constructor. 15839 Channel binding implementation has been simplified. 15840 15841- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND 15842 chunk is not found. Patch by Zackery Spytz. 15843 15844- bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D 15845 Moore. 15846 15847- bpo-32221: Various functions returning tuple containing IPv6 addresses now 15848 omit ``%scope`` part since the same information is already encoded in 15849 *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` 15850 when it receives multicast packet since useless resolving of network 15851 interface name is omitted. 15852 15853- bpo-30693: The TarFile class now recurses directories in a reproducible 15854 way. 15855 15856- bpo-30693: The ZipFile class now recurses directories in a reproducible 15857 way. 15858 15859Documentation 15860------------- 15861 15862- bpo-28124: The ssl module function ssl.wrap_socket() has been 15863 de-emphasized and deprecated in favor of the more secure and efficient 15864 SSLContext.wrap_socket() method. 15865 15866- bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy. 15867 15868- bpo-32436: Add documentation for the contextvars module (PEP 567). 15869 15870- bpo-32800: Update link to w3c doc for xml default namespaces. 15871 15872- bpo-11015: Update :mod:`test.support` documentation. 15873 15874- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get` 15875 method raises :exc:`AttributeError`. 15876 15877- bpo-32614: Modify RE examples in documentation to use raw strings to 15878 prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight 15879 the deprecation. 15880 15881- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses. 15882 15883Tests 15884----- 15885 15886- bpo-31809: Add tests to verify connection with secp ECDH curves. 15887 15888Build 15889----- 15890 15891- bpo-32898: Fix the python debug build when using COUNT_ALLOCS. 15892 15893Windows 15894------- 15895 15896- bpo-32901: Update Tcl and Tk versions to 8.6.8 15897 15898- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. 15899 15900- bpo-32409: Ensures activate.bat can handle Unicode contents. 15901 15902- bpo-32457: Improves handling of denormalized executable path when 15903 launching Python. 15904 15905- bpo-32370: Use the correct encoding for ipconfig output in the uuid 15906 module. Patch by Segev Finer. 15907 15908- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly 15909 treating the ``PrintNameOffset`` field of the reparse data buffer as a 15910 number of characters instead of bytes. Patch by Craig Holmquist and SSE4. 15911 15912macOS 15913----- 15914 15915- bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8. 15916 15917IDLE 15918---- 15919 15920- bpo-32916: Change ``str`` to ``code`` in pyparse. 15921 15922- bpo-32905: Remove unused code in pyparse module. 15923 15924- bpo-32874: Add tests for pyparse. 15925 15926- bpo-32837: Using the system and place-dependent default encoding for 15927 open() is a bad idea for IDLE's system and location-independent files. 15928 15929- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI 15930 test test_file_buttons() only looks at initial ascii-only lines, but 15931 failed on systems where open() defaults to 'ascii' because readline() 15932 internally reads and decodes far enough ahead to encounter a non-ascii 15933 character in CREDITS.txt. 15934 15935- bpo-32765: Update configdialog General tab docstring to add new widgets to 15936 the widget list. 15937 15938Tools/Demos 15939----------- 15940 15941- bpo-32222: Fix pygettext not extracting docstrings for functions with type 15942 annotated arguments. Patch by Toby Harradine. 15943 15944 15945What's New in Python 3.7.0 beta 1? 15946================================== 15947 15948*Release date: 2018-01-30* 15949 15950Core and Builtins 15951----------------- 15952 15953- bpo-32703: Fix coroutine's ResourceWarning when there's an active error 15954 set when it's being finalized. 15955 15956- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step 15957 over (next command) native coroutines. Patch by Pablo Galindo. 15958 15959- bpo-28685: Optimize list.sort() and sorted() by using type specialized 15960 comparisons when possible. 15961 15962- bpo-32685: Improve suggestion when the Python 2 form of print statement is 15963 either present on the same line as the header of a compound statement or 15964 else terminated by a semi-colon instead of a newline. Patch by Nitish 15965 Chandra. 15966 15967- bpo-32697: Python now explicitly preserves the definition order of 15968 keyword-only parameters. It's always preserved their order, but this 15969 behavior was never guaranteed before; this behavior is now guaranteed and 15970 tested. 15971 15972- bpo-32690: The locals() dictionary now displays in the lexical order that 15973 variables were defined. Previously, the order was reversed. 15974 15975- bpo-32677: Add ``.isascii()`` method to ``str``, ``bytes`` and 15976 ``bytearray``. It can be used to test that string contains only ASCII 15977 characters. 15978 15979- bpo-32670: Enforce :pep:`479` for all code. This means that manually 15980 raising a StopIteration exception from a generator is prohibited for all 15981 code, regardless of whether 'from __future__ import generator_stop' was 15982 used or not. 15983 15984- bpo-32591: Added built-in support for tracking the origin of coroutine 15985 objects; see sys.set_coroutine_origin_tracking_depth and 15986 CoroutineType.cr_origin. This replaces the asyncio debug mode's use of 15987 coroutine wrapping for native coroutine objects. 15988 15989- bpo-31368: Expose preadv and pwritev system calls in the os module. Patch 15990 by Pablo Galindo 15991 15992- bpo-32544: ``hasattr(obj, name)`` and ``getattr(obj, name, default)`` are 15993 about 4 times faster than before when ``name`` is not found and ``obj`` 15994 doesn't override ``__getattr__`` or ``__getattribute__``. 15995 15996- bpo-26163: Improved frozenset() hash to create more distinct hash values 15997 when faced with datasets containing many similar values. 15998 15999- bpo-32550: Remove the STORE_ANNOTATION bytecode. 16000 16001- bpo-20104: Expose posix_spawn as a low level API in the os module. 16002 (removed before 3.7.0rc1) 16003 16004- bpo-24340: Fixed estimation of the code stack size. 16005 16006- bpo-32436: Implement :pep:`567` Context Variables. 16007 16008- bpo-18533: ``repr()`` on a dict containing its own ``values()`` or 16009 ``items()`` no longer raises ``RecursionError``; OrderedDict similarly. 16010 Instead, use ``...``, as for other recursive structures. Patch by Ben 16011 North. 16012 16013- bpo-20891: Py_Initialize() now creates the GIL. The GIL is no longer 16014 created "on demand" to fix a race condition when PyGILState_Ensure() is 16015 called in a non-Python thread. 16016 16017- bpo-32028: Leading whitespace is now correctly ignored when generating 16018 suggestions for converting Py2 print statements to Py3 builtin print 16019 function calls. Patch by Sanyam Khurana. 16020 16021- bpo-31179: Make dict.copy() up to 5.5 times faster. 16022 16023- bpo-31113: Get rid of recursion in the compiler for normal control flow. 16024 16025Library 16026------- 16027 16028- bpo-25988: Deprecate exposing the contents of collections.abc in the 16029 regular collections module. 16030 16031- bpo-31429: The default cipher suite selection of the ssl module now uses a 16032 blacklist approach rather than a hard-coded whitelist. Python no longer 16033 re-enables ciphers that have been blocked by OpenSSL security update. 16034 Default cipher suite selection can be configured on compile time. 16035 16036- bpo-30306: contextlib.contextmanager now releases the arguments passed to 16037 the underlying generator as soon as the context manager is entered. 16038 Previously it would keep them alive for as long as the context manager was 16039 alive, even when not being used as a function decorator. Patch by Martin 16040 Teichmann. 16041 16042- bpo-21417: Added support for setting the compression level for 16043 zipfile.ZipFile. 16044 16045- bpo-32251: Implement asyncio.BufferedProtocol (provisional API). 16046 16047- bpo-32513: In dataclasses, allow easier overriding of dunder methods 16048 without specifying decorator parameters. 16049 16050- bpo-32660: :mod:`termios` makes available ``FIONREAD``, ``FIONCLEX``, 16051 ``FIOCLEX``, ``FIOASYNC`` and ``FIONBIO`` also under Solaris/derivatives. 16052 16053- bpo-27931: Fix email address header parsing error when the username is an 16054 empty quoted string. Patch by Xiang Zhang. 16055 16056- bpo-32659: Under Solaris and derivatives, :class:`os.stat_result` provides 16057 a st_fstype attribute. 16058 16059- bpo-32662: Implement Server.start_serving(), Server.serve_forever(), and 16060 Server.is_serving() methods. Add 'start_serving' keyword parameter to 16061 loop.create_server() and loop.create_unix_server(). 16062 16063- bpo-32391: Implement :meth:`asyncio.StreamWriter.wait_closed` and 16064 :meth:`asyncio.StreamWriter.is_closing` methods 16065 16066- bpo-32643: Make Task._step, Task._wakeup and Future._schedule_callbacks 16067 methods private. 16068 16069- bpo-32630: Refactor decimal module to use contextvars to store decimal 16070 context. 16071 16072- bpo-32622: Add :meth:`asyncio.AbstractEventLoop.sendfile` method. 16073 16074- bpo-32304: distutils' upload command no longer corrupts tar files ending 16075 with a CR byte, and no longer tries to convert CR to CRLF in any of the 16076 upload text fields. 16077 16078- bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware 16079 address is encountered. 16080 16081- bpo-32596: ``concurrent.futures`` imports ``ThreadPoolExecutor`` and 16082 ``ProcessPoolExecutor`` lazily (using :pep:`562`). It makes ``import 16083 asyncio`` about 15% faster because asyncio uses only 16084 ``ThreadPoolExecutor`` by default. 16085 16086- bpo-31801: Add ``_ignore_`` to ``Enum`` so temporary variables can be used 16087 during class construction without being turned into members. 16088 16089- bpo-32576: Use queue.SimpleQueue() in places where it can be invoked from 16090 a weakref callback. 16091 16092- bpo-32574: Fix memory leak in asyncio.Queue, when the queue has limited 16093 size and it is full, the cancelation of queue.put() can cause a memory 16094 leak. Patch by: José Melero. 16095 16096- bpo-32521: The nis module is now compatible with new libnsl and headers 16097 location. 16098 16099- bpo-32467: collections.abc.ValuesView now inherits from 16100 collections.abc.Collection. 16101 16102- bpo-32473: Improve ABCMeta._dump_registry() output readability 16103 16104- bpo-32102: New argument ``capture_output`` for subprocess.run 16105 16106- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and 16107 library in nis module. 16108 16109- bpo-32493: UUID module fixes build for FreeBSD/OpenBSD 16110 16111- bpo-32503: Pickling with protocol 4 no longer creates too small frames. 16112 16113- bpo-29237: Create enum for pstats sorting options 16114 16115- bpo-32454: Add close(fd) function to the socket module. 16116 16117- bpo-25942: The subprocess module is now more graceful when handling a 16118 Ctrl-C KeyboardInterrupt during subprocess.call, subprocess.run, or a 16119 Popen context manager. It now waits a short amount of time for the child 16120 (presumed to have also gotten the SIGINT) to exit, before continuing the 16121 KeyboardInterrupt exception handling. This still includes a SIGKILL in 16122 the call() and run() APIs, but at least the child had a chance first. 16123 16124- bpo-32433: The hmac module now has hmac.digest(), which provides an 16125 optimized HMAC digest. 16126 16127- bpo-28134: Sockets now auto-detect family, type and protocol from file 16128 descriptor by default. 16129 16130- bpo-32404: Fix bug where :meth:`datetime.datetime.fromtimestamp` did not 16131 call __new__ in :class:`datetime.datetime` subclasses. 16132 16133- bpo-32403: Improved speed of :class:`datetime.date` and 16134 :class:`datetime.datetime` alternate constructors. 16135 16136- bpo-32228: Ensure that ``truncate()`` preserves the file position (as 16137 reported by ``tell()``) after writes longer than the buffer size. 16138 16139- bpo-32410: Implement ``loop.sock_sendfile`` for asyncio event loop. 16140 16141- bpo-22908: Added seek and tell to the ZipExtFile class. This only works if 16142 the file object used to open the zipfile is seekable. 16143 16144- bpo-32373: Add socket.getblocking() method. 16145 16146- bpo-32248: Add :mod:`importlib.resources` and 16147 :class:`importlib.abc.ResourceReader` as the unified API for reading 16148 resources contained within packages. Loaders wishing to support resource 16149 reading must implement the :meth:`get_resource_reader()` method. 16150 File-based and zipimport-based loaders both implement these APIs. 16151 :class:`importlib.abc.ResourceLoader` is deprecated in favor of these new 16152 APIs. 16153 16154- bpo-32320: collections.namedtuple() now supports default values. 16155 16156- bpo-29302: Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya 16157 Kulakov. 16158 16159- bpo-31961: *Removed in Python 3.7.0b2.* The *args* argument of 16160 subprocess.Popen can now be a :term:`path-like object`. If *args* is given 16161 as a sequence, it's first element can now be a :term:`path-like object` as 16162 well. 16163 16164- bpo-31900: The :func:`locale.localeconv` function now sets temporarily the 16165 ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode 16166 ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII 16167 or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the 16168 ``LC_CTYPE`` locale. This temporary change affects other threads. Same 16169 change for the :meth:`str.format` method when formatting a number 16170 (:class:`int`, :class:`float`, :class:`float` and subclasses) with the 16171 ``n`` type (ex: ``'{:n}'.format(1234)``). 16172 16173- bpo-31853: Use super().method instead of socket.method in SSLSocket. They 16174 were there most likely for legacy reasons. 16175 16176- bpo-31399: The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() 16177 and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. 16178 Subject common name fallback can be disabled with 16179 SSLContext.hostname_checks_common_name. 16180 16181- bpo-14976: Add a queue.SimpleQueue class, an unbounded FIFO queue with a 16182 reentrant C implementation of put(). 16183 16184Documentation 16185------------- 16186 16187- bpo-32724: Add references to some commands in the documentation of Pdb. 16188 Patch by Stéphane Wirtel 16189 16190- bpo-32649: Complete the C API documentation, profiling and tracing part 16191 with the newly added per-opcode events. 16192 16193- bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and 16194 their C-API counterparts regarding which type of events are received in 16195 each function. Patch by Pablo Galindo Salgado. 16196 16197Tests 16198----- 16199 16200- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built. 16201 16202- bpo-28414: Add test cases for IDNA 2003 and 2008 host names. IDNA 2003 16203 internationalized host names are working since bpo-31399 has landed. IDNA 16204 2008 are still broken. 16205 16206- bpo-32604: Add a new "_xxsubinterpreters" extension module that exposes 16207 the existing subinterpreter C-API and a new cross-interpreter data sharing 16208 mechanism. The module is primarily intended for more thorough testing of 16209 the existing subinterpreter support. Note that the _xxsubinterpreters 16210 module has been removed in 3.7.0rc1. 16211 16212- bpo-32602: Add test certs and test for ECDSA cert and EC/RSA dual mode. 16213 16214- bpo-32549: On Travis CI, Python now Compiles and uses a local copy of 16215 OpenSSL 1.1.0g for testing. 16216 16217Build 16218----- 16219 16220- bpo-32635: Fix segfault of the crypt module when libxcrypt is provided 16221 instead of libcrypt at the system. 16222 16223- bpo-32598: Use autoconf to detect OpenSSL libs, headers and supported 16224 features. The ax_check_openssl M4 macro uses pkg-config to locate OpenSSL 16225 and falls back to manual search. 16226 16227- bpo-32593: Drop support of FreeBSD 9 and older. 16228 16229- bpo-29708: If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, 16230 :mod:`py_compile` will always create hash-based ``.pyc`` files. 16231 16232Windows 16233------- 16234 16235- bpo-32588: Create standalone _distutils_findvs module and add missing 16236 _queue module to installer. 16237 16238- bpo-29911: Ensure separate Modify and Uninstall buttons are displayed. 16239 16240- bpo-32507: Use app-local UCRT install rather than the proper update for 16241 old versions of Windows. 16242 16243macOS 16244----- 16245 16246- bpo-32726: Provide an additional, more modern macOS installer variant that 16247 supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied 16248 third-party libraries to OpenSSL 1.1.0g and to SQLite 3.22.0. The 10.9+ 16249 installer now links with and supplies its own copy of Tcl/Tk 8.6. 16250 16251- bpo-28440: No longer add /Library/Python/3.x/site-packages to sys.path for 16252 macOS framework builds to avoid future conflicts. 16253 16254C API 16255----- 16256 16257- bpo-32681: Fix uninitialized variable 'res' in the C implementation of 16258 os.dup2. Patch by Stéphane Wirtel 16259 16260- bpo-10381: Add C API access to the ``datetime.timezone`` constructor and 16261 ``datetime.timzone.UTC`` singleton. 16262 16263 16264What's New in Python 3.7.0 alpha 4? 16265=================================== 16266 16267*Release date: 2018-01-08* 16268 16269Core and Builtins 16270----------------- 16271 16272- bpo-31975: The default warning filter list now starts with a 16273 "default::DeprecationWarning:__main__" entry, so deprecation warnings are 16274 once again shown by default in single-file scripts and at the interactive 16275 prompt. 16276 16277- bpo-32226: ``__class_getitem__`` is now an automatic class method. 16278 16279- bpo-32399: Add AIX uuid library support for RFC4122 using uuid_create() in 16280 libc.a 16281 16282- bpo-32390: Fix the compilation failure on AIX after the f_fsid field has 16283 been added to the object returned by os.statvfs() (issue #32143). Original 16284 patch by Michael Felt. 16285 16286- bpo-32379: Make MRO computation faster when a class inherits from a single 16287 base. 16288 16289- bpo-32259: The error message of a TypeError raised when unpack 16290 non-iterable is now more specific. 16291 16292- bpo-27169: The ``__debug__`` constant is now optimized out at compile 16293 time. This fixes also bpo-22091. 16294 16295- bpo-32329: The :option:`-R` option now turns on hash randomization when 16296 the :envvar:`PYTHONHASHSEED` environment variable is set to ``0``. 16297 Previously, the option was ignored. Moreover, 16298 ``sys.flags.hash_randomization`` is now properly set to 0 when hash 16299 randomization is turned off by ``PYTHONHASHSEED=0``. 16300 16301- bpo-30416: The optimizer is now protected from spending much time doing 16302 complex calculations and consuming much memory for creating large 16303 constants in constant folding. Increased limits for constants that can be 16304 produced in constant folding. 16305 16306- bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in 16307 socketmodule on Windows. 16308 16309- bpo-30579: Implement TracebackType.__new__ to allow Python-level creation 16310 of traceback objects, and make TracebackType.tb_next mutable. 16311 16312- bpo-32260: Don't byte swap the input keys to the SipHash algorithm on 16313 big-endian platforms. This should ensure siphash gives consistent results 16314 across platforms. 16315 16316- bpo-31506: Improve the error message logic for object.__new__ and 16317 object.__init__. Patch by Sanyam Khurana. 16318 16319- bpo-20361: ``-b`` and ``-bb`` now inject ``'default::BytesWarning'`` and 16320 ``error::BytesWarning`` entries into ``sys.warnoptions``, ensuring that 16321 they take precedence over any other warning filters configured via the 16322 ``-W`` option or the ``PYTHONWARNINGS`` environment variable. 16323 16324- bpo-32230: `-X dev` now injects a ``'default'`` entry into 16325 sys.warnoptions, ensuring that it behaves identically to actually passing 16326 ``-Wdefault`` at the command line. 16327 16328- bpo-29240: Add a new UTF-8 mode: implementation of the :pep:`540`. 16329 16330- bpo-32226: :pep:`560`: Add support for ``__mro_entries__`` and 16331 ``__class_getitem__``. Implemented by Ivan Levkivskyi. 16332 16333- bpo-32225: :pep:`562`: Add support for module ``__getattr__`` and 16334 ``__dir__``. Implemented by Ivan Levkivskyi. 16335 16336- bpo-31901: The `atexit` module now has its callback stored per 16337 interpreter. 16338 16339- bpo-31650: Implement :pep:`552` (Deterministic pycs). Python now supports 16340 invalidating bytecode cache files bashed on a source content hash rather 16341 than source last-modified time. 16342 16343- bpo-29469: Move constant folding from bytecode layer to AST layer. 16344 Original patch by Eugene Toder. 16345 16346Library 16347------- 16348 16349- bpo-32506: Now that dict is defined as keeping insertion order, drop 16350 OrderedDict and just use plain dict. 16351 16352- bpo-32279: Add params to dataclasses.make_dataclasses(): init, repr, eq, 16353 order, hash, and frozen. Pass them through to dataclass(). 16354 16355- bpo-32278: Make type information optional on dataclasses.make_dataclass(). 16356 If omitted, the string 'typing.Any' is used. 16357 16358- bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is 16359 a dataclass or an instance of one. 16360 16361- bpo-32468: Improve frame repr() to mention filename, code name and current 16362 line number. 16363 16364- bpo-23749: asyncio: Implement loop.start_tls() 16365 16366- bpo-32441: Return the new file descriptor (i.e., the second argument) from 16367 ``os.dup2``. Previously, ``None`` was always returned. 16368 16369- bpo-32422: ``functools.lru_cache`` uses less memory (3 words for each 16370 cached key) and takes about 1/3 time for cyclic GC. 16371 16372- bpo-31721: Prevent Python crash from happening when Future._log_traceback 16373 is set to True manually. Now it can only be set to False, or a ValueError 16374 is raised. 16375 16376- bpo-32415: asyncio: Add Task.get_loop() and Future.get_loop() 16377 16378- bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on 16379 interpreter shutdown. 16380 16381- bpo-32363: Make asyncio.Task.set_exception() and set_result() raise 16382 NotImplementedError. Task._step() and Future.__await__() raise proper 16383 exceptions when they are in an invalid state, instead of raising an 16384 AssertionError. 16385 16386- bpo-32357: Optimize asyncio.iscoroutine() and loop.create_task() for 16387 non-native coroutines (e.g. async/await compiled with Cython). 16388 'loop.create_task(python_coroutine)' used to be 20% faster than 16389 'loop.create_task(cython_coroutine)'. Now, the latter is as fast. 16390 16391- bpo-32356: asyncio.transport.resume_reading() and pause_reading() are now 16392 idempotent. New transport.is_reading() method is added. 16393 16394- bpo-32355: Optimize asyncio.gather(); now up to 15% faster. 16395 16396- bpo-32351: Use fastpath in asyncio.sleep if delay<0 (2x boost) 16397 16398- bpo-32348: Optimize asyncio.Future schedule/add/remove callback. The 16399 optimization shows 3-6% performance improvements of async/await code. 16400 16401- bpo-32331: Fix socket.settimeout() and socket.setblocking() to keep 16402 socket.type as is. Fix socket.socket() constructor to reset any bit flags 16403 applied to socket's type. This change only affects OSes that have 16404 SOCK_NONBLOCK and/or SOCK_CLOEXEC. 16405 16406- bpo-32248: Add :class:`importlib.abc.ResourceReader` as an ABC for loaders 16407 to provide a unified API for reading resources contained within packages. 16408 Also add :mod:`importlib.resources` as the port of 16409 ``importlib_resources``. 16410 16411- bpo-32311: Implement asyncio.create_task(coro) shortcut 16412 16413- bpo-32327: Convert asyncio functions that were documented as coroutines to 16414 coroutines. Affected functions: loop.sock_sendall, loop.sock_recv, 16415 loop.sock_accept, loop.getaddrinfo, loop.getnameinfo. 16416 16417- bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id 16418 (scope) to lower case for scoped IPv6 addresses in hostnames now. 16419 16420- bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary 16421 compatible with CRT v140. 16422 16423- bpo-29711: Fix ``stop_serving`` in asyncio proactor loop kill all 16424 listening servers 16425 16426- bpo-32308: :func:`re.sub()` now replaces empty matches adjacent to a 16427 previous non-empty match. 16428 16429- bpo-29970: Abort asyncio SSLProtocol connection if handshake not complete 16430 within 10s 16431 16432- bpo-32314: Implement asyncio.run(). 16433 16434- bpo-17852: Revert incorrect fix based on misunderstanding of 16435 _Py_PyAtExit() semantics. 16436 16437- bpo-32296: Implement asyncio._get_running_loop() and get_event_loop() in 16438 C. This makes them 4x faster. 16439 16440- bpo-32250: Implement ``asyncio.current_task()`` and 16441 ``asyncio.all_tasks()``. Add helpers intended to be used by alternative 16442 task implementations: ``asyncio._register_task``, ``asyncio._enter_task``, 16443 ``asyncio._leave_task`` and ``asyncio._unregister_task``. Deprecate 16444 ``asyncio.Task.current_task()`` and ``asyncio.Task.all_tasks()``. 16445 16446- bpo-32255: A single empty field is now always quoted when written into a 16447 CSV file. This allows to distinguish an empty row from a row consisting of 16448 a single empty field. Patch by Licht Takeuchi. 16449 16450- bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on 16451 platforms where ``chmod(..., follow_symlinks=False)`` is not supported. 16452 Patch by Anthony Sottile. 16453 16454- bpo-30050: New argument warn_on_full_buffer to signal.set_wakeup_fd lets 16455 you control whether Python prints a warning on stderr when the wakeup fd 16456 buffer overflows. 16457 16458- bpo-29137: The ``fpectl`` library has been removed. It was never enabled 16459 by default, never worked correctly on x86-64, and it changed the Python 16460 ABI in ways that caused unexpected breakage of C extensions. 16461 16462- bpo-32273: Move asyncio.test_utils to test.test_asyncio. 16463 16464- bpo-32272: Remove asyncio.async() function. 16465 16466- bpo-32269: Add asyncio.get_running_loop() function. 16467 16468- bpo-32265: All class and static methods of builtin types now are correctly 16469 classified by inspect.classify_class_attrs() and grouped in pydoc ouput. 16470 Added types.ClassMethodDescriptorType for unbound class methods of builtin 16471 types. 16472 16473- bpo-32253: Deprecate ``yield from lock``, ``await lock``, ``with (yield 16474 from lock)`` and ``with await lock`` for asyncio synchronization 16475 primitives. 16476 16477- bpo-22589: Changed MIME type of .bmp from 'image/x-ms-bmp' to 'image/bmp' 16478 16479- bpo-32193: Convert asyncio to use *async/await* syntax. Old styled ``yield 16480 from`` is still supported too. 16481 16482- bpo-32206: Add support to run modules with pdb 16483 16484- bpo-32227: ``functools.singledispatch`` now supports registering 16485 implementations using type annotations. 16486 16487- bpo-15873: Added new alternate constructors 16488 :meth:`datetime.datetime.fromisoformat`, 16489 :meth:`datetime.time.fromisoformat` and 16490 :meth:`datetime.date.fromisoformat` as the inverse operation of each 16491 classes's respective ``isoformat`` methods. 16492 16493- bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link 16494 list'. 16495 16496- bpo-32143: os.statvfs() includes the f_fsid field from statvfs(2) 16497 16498- bpo-26439: Fix ctypes.util.find_library() for AIX by implementing 16499 ctypes._aix.find_library() Patch by: Michael Felt 16500 16501- bpo-31993: The pickler now uses less memory when serializing large bytes 16502 and str objects into a file. Pickles created with protocol 4 will require 16503 less memory for unpickling large bytes and str objects. 16504 16505- bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner. 16506 16507- bpo-31778: ast.literal_eval() is now more strict. Addition and subtraction 16508 of arbitrary numbers no longer allowed. 16509 16510- bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now 16511 works even if the ``os`` module still is not imported. 16512 16513- bpo-30241: Add contextlib.AbstractAsyncContextManager. Patch by Jelle 16514 Zijlstra. 16515 16516- bpo-31699: Fix deadlocks in 16517 :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or 16518 results cause pickling or unpickling errors. This should make sure that 16519 calls to the :class:`ProcessPoolExecutor` API always eventually return. 16520 16521- bpo-15216: ``TextIOWrapper.reconfigure()`` supports changing *encoding*, 16522 *errors*, and *newline*. 16523 16524Documentation 16525------------- 16526 16527- bpo-32418: Add get_loop() method to Server and AbstractServer classes. 16528 16529Tests 16530----- 16531 16532- bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core 16533 dump files when testing crashes. getrlimit() returns zero on success. 16534 16535- bpo-32002: Adjust C locale coercion testing for the empty locale and POSIX 16536 locale cases to more readily adjust to platform dependent behaviour. 16537 16538Windows 16539------- 16540 16541- bpo-19764: Implement support for `subprocess.Popen(close_fds=True)` on 16542 Windows. Patch by Segev Finer. 16543 16544Tools/Demos 16545----------- 16546 16547- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using 16548 pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and 16549 lib2to3 work when run from a zipfile. 16550 16551C API 16552----- 16553 16554- bpo-32030: Py_Initialize() doesn't reset the memory allocators to default 16555 if the ``PYTHONMALLOC`` environment variable is not set. 16556 16557- bpo-29084: Undocumented C API for OrderedDict has been excluded from the 16558 limited C API. It was added by mistake and actually never worked in the 16559 limited C API. 16560 16561- bpo-32264: Moved the pygetopt.h header into internal/, since it has no 16562 public APIs. 16563 16564- bpo-32241: :c:func:`Py_SetProgramName` and :c:func:`Py_SetPythonHome` now 16565 take the ``const wchar *`` arguments instead of ``wchar *``. 16566 16567 16568What's New in Python 3.7.0 alpha 3? 16569=================================== 16570 16571*Release date: 2017-12-05* 16572 16573Core and Builtins 16574----------------- 16575 16576- bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code 16577 object constructor based on freevars and cellvars, rather than needing to 16578 be set correctly by the caller. This ensures it will be cleared 16579 automatically when additional cell references are injected into a modified 16580 code object and function. 16581 16582- bpo-10544: Yield expressions are now deprecated in comprehensions and 16583 generator expressions. They are still permitted in the definition of the 16584 outermost iterable, as that is evaluated directly in the enclosing scope. 16585 16586- bpo-32137: The repr of deeply nested dict now raises a RecursionError 16587 instead of crashing due to a stack overflow. 16588 16589- bpo-32096: Revert memory allocator changes in the C API: move structures 16590 back from _PyRuntime to Objects/obmalloc.c. The memory allocators are once 16591 again initialized statically, and so PyMem_RawMalloc() and 16592 Py_DecodeLocale() can be called before _PyRuntime_Initialize(). 16593 16594- bpo-32043: Add a new "developer mode": new "-X dev" command line option to 16595 enable debug checks at runtime. 16596 16597- bpo-32023: SyntaxError is now correctly raised when a generator expression 16598 without parenthesis is used instead of an inheritance list in a class 16599 definition. The duplication of the parentheses can be omitted only on 16600 calls. 16601 16602- bpo-32012: SyntaxError is now correctly raised when a generator expression 16603 without parenthesis is passed as an argument, but followed by a trailing 16604 comma. A generator expression always needs to be directly inside a set of 16605 parentheses and cannot have a comma on either side. 16606 16607- bpo-28180: A new internal ``_Py_SetLocaleFromEnv(category)`` helper 16608 function has been added in order to improve the consistency of behaviour 16609 across different ``libc`` implementations (e.g. Android doesn't support 16610 setting the locale from the environment by default). 16611 16612- bpo-31949: Fixed several issues in printing tracebacks 16613 (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now 16614 suppresses printing tracebacks. Setting sys.tracebacklimit to None now 16615 causes using the default limit. Setting sys.tracebacklimit to an integer 16616 larger than LONG_MAX now means using the limit LONG_MAX rather than the 16617 default limit. Fixed integer overflows in the case of more than ``2**31`` 16618 traceback items on Windows. Fixed output errors handling. 16619 16620- bpo-30696: Fix the interactive interpreter looping endlessly when no 16621 memory. 16622 16623- bpo-20047: Bytearray methods partition() and rpartition() now accept only 16624 bytes-like objects as separator, as documented. In particular they now 16625 raise TypeError rather of returning a bogus result when an integer is 16626 passed as a separator. 16627 16628- bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of 16629 ``__import__()`` or the ``__all__`` attribute of the module contain bytes 16630 instances. 16631 16632- bpo-31845: Environment variables are once more read correctly at 16633 interpreter startup. 16634 16635- bpo-28936: Ensure that lexically first syntax error involving a parameter 16636 and ``global`` or ``nonlocal`` is detected first at a given scope. Patch 16637 by Ivan Levkivskyi. 16638 16639- bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in 16640 codecs.escape_decode() when decode an escaped non-ascii byte. 16641 16642- bpo-31618: The per-frame tracing logic added in 3.7a1 has been altered so 16643 that ``frame->f_lineno`` is updated before either ``"line"`` or 16644 ``"opcode"`` events are emitted. Previously, opcode events were emitted 16645 first, and therefore would occasionally see stale line numbers on the 16646 frame. The behavior of this feature has changed slightly as a result: when 16647 both ``f_trace_lines`` and ``f_trace_opcodes`` are enabled, line events 16648 now occur first. 16649 16650- bpo-28603: Print the full context/cause chain of exceptions on interpreter 16651 exit, even if an exception in the chain is unhashable or compares equal to 16652 later ones. Patch by Zane Bitter. 16653 16654- bpo-31786: Fix timeout rounding in the select module to round correctly 16655 negative timeouts between -1.0 and 0.0. The functions now block waiting 16656 for events as expected. Previously, the call was incorrectly non-blocking. 16657 Patch by Pablo Galindo. 16658 16659- bpo-31781: Prevent crashes when calling methods of an uninitialized 16660 ``zipimport.zipimporter`` object. Patch by Oren Milman. 16661 16662- bpo-30399: Standard repr() of BaseException with a single argument no 16663 longer contains redundant trailing comma. 16664 16665- bpo-31626: Fixed a bug in debug memory allocator. There was a write to 16666 freed memory after shrinking a memory block. 16667 16668- bpo-30817: `PyErr_PrintEx()` clears now the ignored exception that may be 16669 raised by `_PySys_SetObjectId()`, for example when no memory. 16670 16671Library 16672------- 16673 16674- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying 16675 instances of generic classes, improve interaction of ``__init_subclass__`` 16676 with generics. Original PRs by Ivan Levkivskyi. 16677 16678- bpo-32214: PEP 557, Data Classes. Provides a decorator which adds 16679 boilerplate methods to classes which use type annotations so specify 16680 fields. 16681 16682- bpo-27240: The header folding algorithm for the new email policies has 16683 been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In 16684 particular, RFC2231 folding is now done correctly. 16685 16686- bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL 16687 when getting the file size. Fixed hang of all threads with inaccessible 16688 NFS server. Patch by Nir Soffer. 16689 16690- bpo-321010: Add :attr:`sys.flags.dev_mode` flag 16691 16692- bpo-32154: The ``asyncio.windows_utils.socketpair()`` function has been 16693 removed: use directly :func:`socket.socketpair` which is available on all 16694 platforms since Python 3.5 (before, it wasn't available on Windows). 16695 ``asyncio.windows_utils.socketpair()`` was just an alias to 16696 ``socket.socketpair`` on Python 3.5 and newer. 16697 16698- bpo-32089: warnings: In development (-X dev) and debug mode (pydebug 16699 build), use the "default" action for ResourceWarning, rather than the 16700 "always" action, in the default warnings filters. 16701 16702- bpo-32107: ``uuid.getnode()`` now preferentially returns universally 16703 administered MAC addresses if available, over locally administered MAC 16704 addresses. This makes a better guarantee for global uniqueness of UUIDs 16705 returned from ``uuid.uuid1()``. If only locally administered MAC 16706 addresses are available, the first such one found is returned. 16707 16708- bpo-23033: Wildcard is now supported in hostname when it is one and only 16709 character in the left most segment of hostname in second argument of 16710 :meth:`ssl.match_hostname`. Patch by Mandeep Singh. 16711 16712- bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return 16713 ``None`` when the value of property is ``VT_EMPTY``. Initial patch by 16714 Mark Mc Mahon. 16715 16716- bpo-28334: Use :func:`os.path.expanduser` to find the ``~/.netrc`` file in 16717 :class:`netrc.netrc`. If it does not exist, :exc:`FileNotFoundError` is 16718 raised. Patch by Dimitri Merejkowsky. 16719 16720- bpo-32121: Made ``tracemalloc.Traceback`` behave more like the traceback 16721 module, sorting the frames from oldest to most recent. 16722 ``Traceback.format()`` now accepts negative *limit*, truncating the result 16723 to the ``abs(limit)`` oldest frames. To get the old behaviour, one can use 16724 the new *most_recent_first* argument to ``Traceback.format()``. (Patch by 16725 Jesse Bakker.) 16726 16727- bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the 16728 :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>` 16729 method. Initial patch by Robin Wellner. 16730 16731- bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception 16732 message when it couldn't open or create an MSI file. Initial patch by 16733 William Tisäter. 16734 16735- bpo-19610: ``setup()`` now warns about invalid types for some fields. The 16736 ``distutils.dist.Distribution`` class now warns when ``classifiers``, 16737 ``keywords`` and ``platforms`` fields are not specified as a list or a 16738 string. 16739 16740- bpo-32071: Added the ``-k`` command-line option to ``python -m unittest`` 16741 to run only tests that match the given pattern(s). 16742 16743- bpo-10049: Added *nullcontext* no-op context manager to contextlib. This 16744 provides a simpler and faster alternative to ExitStack() when handling 16745 optional context managers. 16746 16747- bpo-28684: The new test.support.skip_unless_bind_unix_socket() decorator 16748 is used here to skip asyncio tests that fail because the platform lacks a 16749 functional bind() function for unix domain sockets (as it is the case for 16750 non root users on the recent Android versions that run now SELinux in 16751 enforcing mode). 16752 16753- bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n* 16754 characters/bytes for non-negative *n*. This makes it compatible with 16755 ``read()`` methods of other file-like objects. 16756 16757- bpo-27535: The warnings module doesn't leak memory anymore in the hidden 16758 warnings registry for the "ignore" action of warnings filters. 16759 warn_explicit() function doesn't add the warning key to the registry 16760 anymore for the "ignore" action. 16761 16762- bpo-32088: warnings: When Python is build is debug mode (``Py_DEBUG``), 16763 :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning` and 16764 :exc:`ImportWarning` warnings are now displayed by default. 16765 16766- bpo-1647489: Fixed searching regular expression patterns that could match 16767 an empty string. Non-empty string can now be correctly found after 16768 matching an empty string. 16769 16770- bpo-25054: Added support of splitting on a pattern that could match an 16771 empty string. 16772 16773- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays. 16774 Identical objects will be saved only once. Equal references will be load 16775 as identical objects. Added support for saving and loading recursive data 16776 structures. 16777 16778- bpo-32069: Drop legacy SSL transport from asyncio, ssl.MemoryBIO is always 16779 used anyway. 16780 16781- bpo-32066: asyncio: Support pathlib.Path in create_unix_connection; sock 16782 arg should be optional 16783 16784- bpo-32046: Updates 2to3 to convert from operator.isCallable(obj) to 16785 callable(obj). Patch by Dong-hee Na. 16786 16787- bpo-32018: inspect.signature should follow :pep:`8`, if the parameter has 16788 an annotation and a default value. Patch by Dong-hee Na. 16789 16790- bpo-32025: Add time.thread_time() and time.thread_time_ns() 16791 16792- bpo-32037: Integers that fit in a signed 32-bit integer will be now 16793 pickled with protocol 0 using the INT opcode. This will decrease the size 16794 of a pickle, speed up pickling and unpickling, and make these integers be 16795 unpickled as int instances in Python 2. 16796 16797- bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError 16798 pickleable. 16799 16800- bpo-32015: Fixed the looping of asyncio in the case of reconnection the 16801 socket during waiting async read/write from/to the socket. 16802 16803- bpo-32011: Restored support of loading marshal files with the TYPE_INT64 16804 code. These files can be produced in Python 2.7. 16805 16806- bpo-28369: Enhance add_reader/writer check that socket is not used by some 16807 transport. Before, only cases when add_reader/writer were called with an 16808 int FD were supported. Now the check is implemented correctly for all 16809 file-like objects. 16810 16811- bpo-31976: Fix race condition when flushing a file is slow, which can 16812 cause a segfault if closing the file from another thread. 16813 16814- bpo-31985: Formally deprecated aifc.openfp, sunau.openfp, and wave.openfp. 16815 Since change 7bc817d5ba917528e8bd07ec461c635291e7b06a in 1993, openfp in 16816 each of the three modules had been pointing to that module's open function 16817 as a matter of backwards compatibility, though it had been both untested 16818 and undocumented. 16819 16820- bpo-21862: cProfile command line now accepts `-m module_name` as an 16821 alternative to script path. Patch by Sanyam Khurana. 16822 16823- bpo-31970: Reduce performance overhead of asyncio debug mode. 16824 16825- bpo-31843: *database* argument of sqlite3.connect() now accepts a 16826 :term:`path-like object`, instead of just a string. 16827 16828- bpo-31945: Add Configurable *blocksize* to ``HTTPConnection`` and 16829 ``HTTPSConnection`` for improved upload throughput. Patch by Nir Soffer. 16830 16831- bpo-31943: Add a ``cancelled()`` method to :class:`asyncio.Handle`. Patch 16832 by Marat Sharafutdinov. 16833 16834- bpo-9678: Fixed determining the MAC address in the uuid module: Using 16835 ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and 16836 OpenBSD. Based on patch by Takayuki Shimizukawa. 16837 16838- bpo-30057: Fix potential missed signal in signal.signal(). 16839 16840- bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian 16841 platforms. Patch by Jack O'Connor. 16842 16843- bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor 16844 16845- bpo-31927: Fixed compilation of the socket module on NetBSD 8. Fixed 16846 assertion failure or reading arbitrary data when parse a AF_BLUETOOTH 16847 address on NetBSD and DragonFly BSD. 16848 16849- bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse() 16850 when the size of types chtype or mmask_t is less than the size of C long. 16851 curses.box() now accepts characters as arguments. Based on patch by Steve 16852 Fink. 16853 16854- bpo-31917: Add 3 new clock identifiers: :data:`time.CLOCK_BOOTTIME`, 16855 :data:`time.CLOCK_PROF` and :data:`time.CLOCK_UPTIME`. 16856 16857- bpo-31897: plistlib now catches more errors when read binary plists and 16858 raises InvalidFileException instead of unexpected exceptions. 16859 16860- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch 16861 by Masayuki Yamamoto. 16862 16863- bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and 16864 NetBSD. Fixed the comparison of the kqueue_event objects. 16865 16866- bpo-31891: Fixed building the curses module on NetBSD. 16867 16868- bpo-31884: added required constants to subprocess module for setting 16869 priority on windows 16870 16871- bpo-28281: Remove year (1-9999) limits on the Calendar.weekday() function. 16872 Patch by Mark Gollahon. 16873 16874- bpo-31702: crypt.mksalt() now allows to specify the number of rounds for 16875 SHA-256 and SHA-512 hashing. 16876 16877- bpo-30639: :func:`inspect.getfile` no longer computes the repr of unknown 16878 objects to display in an error message, to protect against badly behaved 16879 custom reprs. 16880 16881- bpo-30768: Fix the pthread+semaphore implementation of 16882 PyThread_acquire_lock_timed() when called with timeout > 0 and 16883 intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a 16884 signal (EINTR). See also the :pep:`475`. 16885 16886- bpo-31854: Add ``mmap.ACCESS_DEFAULT`` constant. 16887 16888- bpo-31834: Use optimized code for BLAKE2 only with SSSE3+. The pure SSE2 16889 implementation is slower than the pure C reference implementation. 16890 16891- bpo-28292: Calendar.itermonthdates() will now consistently raise an 16892 exception when a date falls outside of the 0001-01-01 through 9999-12-31 16893 range. To support applications that cannot tolerate such exceptions, the 16894 new methods itermonthdays3() and itermonthdays4() are added. The new 16895 methods return tuples and are not restricted by the range supported by 16896 datetime.date. 16897 16898- bpo-28564: The shutil.rmtree() function has been sped up to 20--40%. This 16899 was done using the os.scandir() function. 16900 16901- bpo-28416: Instances of pickle.Pickler subclass with the persistent_id() 16902 method and pickle.Unpickler subclass with the persistent_load() method no 16903 longer create reference cycles. 16904 16905- bpo-31653: Don't release the GIL if we can acquire a multiprocessing 16906 semaphore immediately. 16907 16908- bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed 16909 or None. 16910 16911- bpo-20825: Add `subnet_of` and `superset_of` containment tests to 16912 :class:`ipaddress.IPv6Network` and :class:`ipaddress.IPv4Network`. Patch 16913 by Michel Albert and Cheryl Sabella. 16914 16915- bpo-31827: Remove the os.stat_float_times() function. It was introduced in 16916 Python 2.3 for backward compatibility with Python 2.2, and was deprecated 16917 since Python 3.1. 16918 16919- bpo-31756: Add a ``subprocess.Popen(text=False)`` keyword argument to 16920 `subprocess` functions to be more explicit about when the library should 16921 attempt to decode outputs into text. Patch by Andrew Clegg. 16922 16923- bpo-31819: Add AbstractEventLoop.sock_recv_into(). 16924 16925- bpo-31457: If nested log adapters are used, the inner ``process()`` 16926 methods are no longer omitted. 16927 16928- bpo-31457: The ``manager`` property on LoggerAdapter objects is now 16929 properly settable. 16930 16931- bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire() 16932 and socket.socket.settimeout() to round correctly negative timeouts 16933 between -1.0 and 0.0. The functions now block waiting for events as 16934 expected. Previously, the call was incorrectly non-blocking. Patch by 16935 Pablo Galindo. 16936 16937- bpo-31803: time.clock() and time.get_clock_info('clock') now emit a 16938 DeprecationWarning warning. 16939 16940- bpo-31800: Extended support for parsing UTC offsets. strptime '%z' can now 16941 parse the output generated by datetime.isoformat, including seconds and 16942 microseconds. 16943 16944- bpo-28603: traceback: Fix a TypeError that occurred during printing of 16945 exception tracebacks when either the current exception or an exception in 16946 its context/cause chain is unhashable. Patch by Zane Bitter. 16947 16948- bpo-30541: Add new function to seal a mock and prevent the automatically 16949 creation of child mocks. Patch by Mario Corchero. 16950 16951- bpo-31784: Implement the :pep:`564`, add new 6 new functions with 16952 nanosecond resolution to the :mod:`time` module: 16953 :func:`~time.clock_gettime_ns`, :func:`~time.clock_settime_ns`, 16954 :func:`~time.monotonic_ns`, :func:`~time.perf_counter_ns`, 16955 :func:`~time.process_time_ns`, :func:`~time.time_ns`. 16956 16957- bpo-30143: 2to3 now generates a code that uses abstract collection classes 16958 from collections.abc rather than collections. 16959 16960- bpo-31770: Prevent a crash when calling the ``__init__()`` method of a 16961 ``sqlite3.Cursor`` object more than once. Patch by Oren Milman. 16962 16963- bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the 16964 ``Cursor`` object is uninitialized. Patch by Oren Milman. 16965 16966- bpo-31752: Fix possible crash in timedelta constructor called with custom 16967 integers. 16968 16969- bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get 16970 pollers timeout 16971 16972- bpo-31690: Allow the flags re.ASCII, re.LOCALE, and re.UNICODE to be used 16973 as group flags for regular expressions. 16974 16975- bpo-30349: FutureWarning is now emitted if a regular expression contains 16976 character set constructs that will change semantically in the future 16977 (nested sets and set operations). 16978 16979- bpo-31664: Added support for the Blowfish hashing in the crypt module. 16980 16981- bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in 16982 asyncio module. This method was previously modifying a wrong reference to 16983 the protocol. 16984 16985- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and 16986 earlier. 16987 16988- bpo-31307: Allow use of bytes objects for arguments to 16989 :meth:`configparser.ConfigParser.read`. Patch by Vincent Michel. 16990 16991- bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for 16992 arbitrary negative timeouts on all OSes where it can only be a 16993 non-negative integer or -1. Patch by Riccardo Coccioli. 16994 16995- bpo-31310: multiprocessing's semaphore tracker should be launched again if 16996 crashed. 16997 16998- bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and 16999 other user interruptions. If it crashes, restart it when necessary. 17000 17001- bpo-31245: Added support for AF_UNIX socket in asyncio 17002 `create_datagram_endpoint`. 17003 17004- bpo-30553: Add HTTP/2 status code 421 (Misdirected Request) to 17005 :class:`http.HTTPStatus`. Patch by Vitor Pereira. 17006 17007Documentation 17008------------- 17009 17010- bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket 17011 versionadded marker. 17012 17013Tests 17014----- 17015 17016- bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on 17017 APFS. 17018 17019- bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5. 17020 The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged 17021 into the kernel 4.5. 17022 17023- bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV and 17024 remove the test.support.requires_android_level decorator. 17025 17026- bpo-32136: The runtime embedding tests have been split out from 17027 ``Lib/test/test_capi.py`` into a new ``Lib/test/test_embed.py`` file. 17028 17029- bpo-28668: test.support.requires_multiprocessing_queue is removed. Skip 17030 tests with test.support.import_module('multiprocessing.synchronize') 17031 instead when the semaphore implementation is broken or missing. 17032 17033- bpo-32126: Skip test_get_event_loop_new_process in 17034 test.test_asyncio.test_events when sem_open() is not functional. 17035 17036- bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the 17037 names sample to always test the same files. It prevents false alarms when 17038 hunting reference leaks. 17039 17040Build 17041----- 17042 17043- bpo-28538: Revert the previous changes, the if_nameindex structure is 17044 defined by Unified Headers. 17045 17046- bpo-28762: Revert the last commit, the F_LOCK macro is defined by Android 17047 Unified Headers. 17048 17049- bpo-29040: Support building Android with Unified Headers. The first NDK 17050 release to support Unified Headers is android-ndk-r14. 17051 17052- bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the 17053 sysroot paths when cross-compiling. 17054 17055- bpo-31957: Fixes Windows SDK version detection when building for Windows. 17056 17057- bpo-31609: Fixes quotes in PCbuild/clean.bat 17058 17059- bpo-31934: Abort the build when building out of a not clean source tree. 17060 17061- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when 17062 there was more than one function and/or method in a .c file with the same 17063 name. 17064 17065- bpo-28791: Update Windows builds to use SQLite 3.21.0. 17066 17067- bpo-28791: Update OS X installer to use SQLite 3.21.0. 17068 17069- bpo-28643: Record profile-opt build progress with stamp files. 17070 17071- bpo-31866: Finish removing support for AtheOS. 17072 17073Windows 17074------- 17075 17076- bpo-1102: Return ``None`` when ``View.Fetch()`` returns 17077 ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by 17078 Anthony Tuininga. 17079 17080- bpo-31944: Fixes Modify button in Apps and Features dialog. 17081 17082- bpo-20486: Implement the ``Database.Close()`` method to help closing MSI 17083 database objects. 17084 17085- bpo-31857: Make the behavior of USE_STACKCHECK deterministic in a 17086 multi-threaded environment. 17087 17088macOS 17089----- 17090 17091- bpo-31392: Update macOS installer to use OpenSSL 1.0.2m 17092 17093IDLE 17094---- 17095 17096- bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event 17097 handling is driven by IDLE's run loop, a confusing and distracting 17098 queue.EMPTY traceback context is no longer added to tk event exception 17099 tracebacks. The traceback is now the same as when event handling is 17100 driven by user code. Patch based on a suggestion by Serhiy Storchaka. 17101 17102- bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet 17103 in configdialog was replaced by ttk.Notebook. 17104 17105- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch 17106 mostly by Cheryl Sabella. 17107 17108- bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor 17109 and output windows only see an empty last prompt line. This simplifies 17110 the code and fixes a minor bug when newline is inserted. Sys.ps1, if 17111 present, is read on Shell start-up, but is not set or changed. 17112 17113- bpo-31860: The font sample in the IDLE configuration dialog is now 17114 editable. Changes persist while IDLE remains open 17115 17116- bpo-31836: Test_code_module now passes if run after test_idle, which sets 17117 ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not. 17118 Test_code_module now properly tests both behaviors. Ditto for ps2. 17119 17120- bpo-28603: Fix a TypeError that caused a shell restart when printing a 17121 traceback that includes an exception that is unhashable. Patch by Zane 17122 Bitter. 17123 17124- bpo-13802: Use non-Latin characters in the IDLE's Font settings sample. 17125 Even if one selects a font that defines a limited subset of the unicode 17126 Basic Multilingual Plane, tcl/tk will use other fonts that define a 17127 character. The expanded example give users of non-Latin characters a 17128 better idea of what they might see in IDLE's shell and editors. To make 17129 room for the expanded sample, frames on the Font tab are re-arranged. The 17130 Font/Tabs help explains a bit about the additions. 17131 17132Tools/Demos 17133----------- 17134 17135- bpo-32159: Remove CVS and Subversion tools: remove svneol.py and 17136 treesync.py scripts. CPython migrated from CVS to Subversion, to 17137 Mercurial, and then to Git. CVS and Subversion are no longer used to 17138 develop CPython. 17139 17140- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also, 17141 remove the ``LOCALE`` option since it doesn't work with string patterns in 17142 Python 3. Patch by Christoph Sarnowski. 17143 17144C API 17145----- 17146 17147- bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in 17148 a non-Python thread before PyEval_InitThreads(), only call 17149 PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. 17150 17151- bpo-32125: The ``Py_UseClassExceptionsFlag`` flag has been removed. It was 17152 deprecated and wasn't used anymore since Python 2.0. 17153 17154- bpo-25612: Move the current exception state from the frame object to the 17155 co-routine. This simplifies the interpreter and fixes a couple of obscure 17156 bugs caused by having swap exception state when entering or exiting a 17157 generator. 17158 17159- bpo-23699: Add Py_RETURN_RICHCOMPARE macro to reduce boilerplate code in 17160 rich comparison functions. 17161 17162- bpo-30697: The `PyExc_RecursionErrorInst` singleton is removed and 17163 `PyErr_NormalizeException()` does not use it anymore. This singleton is 17164 persistent and its members being never cleared may cause a segfault during 17165 finalization of the interpreter. See also issue #22898. 17166 17167 17168What's New in Python 3.7.0 alpha 2? 17169=================================== 17170 17171*Release date: 2017-10-16* 17172 17173Core and Builtins 17174----------------- 17175 17176- bpo-31558: ``gc.freeze()`` is a new API that allows for moving all objects 17177 currently tracked by the garbage collector to a permanent generation, 17178 effectively removing them from future collection events. This can be used 17179 to protect those objects from having their PyGC_Head mutated. In effect, 17180 this enables great copy-on-write stability at fork(). 17181 17182- bpo-31642: Restored blocking "from package import module" by setting 17183 sys.modules["package.module"] to None. 17184 17185- bpo-31708: Allow use of asynchronous generator expressions in synchronous 17186 functions. 17187 17188- bpo-31709: Drop support of asynchronous __aiter__. 17189 17190- bpo-30404: The -u option now makes the stdout and stderr streams 17191 unbuffered rather than line-buffered. 17192 17193- bpo-31619: Fixed a ValueError when convert a string with large number of 17194 underscores to integer with binary base. 17195 17196- bpo-31602: Fix an assertion failure in `zipimporter.get_source()` in case 17197 of a bad `zlib.decompress()`. Patch by Oren Milman. 17198 17199- bpo-31592: Fixed an assertion failure in Python parser in case of a bad 17200 `unicodedata.normalize()`. Patch by Oren Milman. 17201 17202- bpo-31588: Raise a `TypeError` with a helpful error message when class 17203 creation fails due to a metaclass with a bad ``__prepare__()`` method. 17204 Patch by Oren Milman. 17205 17206- bpo-31574: Importlib was instrumented with two dtrace probes to profile 17207 import timing. 17208 17209- bpo-31566: Fix an assertion failure in `_warnings.warn()` in case of a bad 17210 ``__name__`` global. Patch by Oren Milman. 17211 17212- bpo-31506: Improved the error message logic for object.__new__ and 17213 object.__init__. 17214 17215- bpo-31505: Fix an assertion failure in `json`, in case 17216 `_json.make_encoder()` received a bad `encoder()` argument. Patch by Oren 17217 Milman. 17218 17219- bpo-31492: Fix assertion failures in case of failing to import from a 17220 module with a bad ``__name__`` attribute, and in case of failing to access 17221 an attribute of such a module. Patch by Oren Milman. 17222 17223- bpo-31478: Fix an assertion failure in `_random.Random.seed()` in case the 17224 argument has a bad ``__abs__()`` method. Patch by Oren Milman. 17225 17226- bpo-31336: Speed up class creation by 10-20% by reducing the overhead in 17227 the necessary special method lookups. Patch by Stefan Behnel. 17228 17229- bpo-31415: Add ``-X importtime`` option to show how long each import 17230 takes. It can be used to optimize application's startup time. Support the 17231 :envvar:`PYTHONPROFILEIMPORTTIME` as an equivalent way to enable this. 17232 17233- bpo-31410: Optimized calling wrapper and classmethod descriptors. 17234 17235- bpo-31353: :pep:`553` - Add a new built-in called ``breakpoint()`` which 17236 calls ``sys.breakpointhook()``. By default this imports ``pdb`` and calls 17237 ``pdb.set_trace()``, but users may override ``sys.breakpointhook()`` to 17238 call whatever debugger they want. The original value of the hook is saved 17239 in ``sys.__breakpointhook__``. 17240 17241- bpo-17852: Maintain a list of open buffered files, flush them before 17242 exiting the interpreter. Based on a patch from Armin Rigo. 17243 17244- bpo-31315: Fix an assertion failure in imp.create_dynamic(), when 17245 spec.name is not a string. Patch by Oren Milman. 17246 17247- bpo-31311: Fix a crash in the ``__setstate__()`` method of 17248 `ctypes._CData`, in case of a bad ``__dict__``. Patch by Oren Milman. 17249 17250- bpo-31293: Fix crashes in true division and multiplication of a timedelta 17251 object by a float with a bad as_integer_ratio() method. Patch by Oren 17252 Milman. 17253 17254- bpo-31285: Fix an assertion failure in `warnings.warn_explicit`, when the 17255 return value of the received loader's get_source() has a bad splitlines() 17256 method. Patch by Oren Milman. 17257 17258- bpo-30406: Make ``async`` and ``await`` proper keywords, as specified in 17259 :pep:`492`. 17260 17261Library 17262------- 17263 17264- bpo-30058: Fixed buffer overflow in select.kqueue.control(). 17265 17266- bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII 17267 characters. Now it uses ``-i`` regular expression local flag to avoid 17268 non-ASCII characters. 17269 17270- bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM 17271 exceptions. 17272 17273- bpo-31728: Prevent crashes in `_elementtree` due to unsafe cleanup of 17274 `Element.text` and `Element.tail`. Patch by Oren Milman. 17275 17276- bpo-31671: Now ``re.compile()`` converts passed RegexFlag to normal int 17277 object before compiling. bm_regex_compile benchmark shows 14% performance 17278 improvements. 17279 17280- bpo-30397: The types of compiled regular objects and match objects are now 17281 exposed as `re.Pattern` and `re.Match`. This adds information in pydoc 17282 output for the re module. 17283 17284- bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split() 17285 when pass a string larger than 2 GiB. 17286 17287- bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo(). 17288 17289- bpo-31648: Improvements to path predicates in ElementTree: Allow 17290 whitespace around predicate parts, i.e. "[a = 'text']" instead of 17291 requiring the less readable "[a='text']". Add support for text comparison 17292 of the current node, like "[.='text']". Patch by Stefan Behnel. 17293 17294- bpo-30806: Fix the string representation of a netrc object. 17295 17296- bpo-31638: Add optional argument ``compressed`` to 17297 ``zipapp.create_archive``, and add option ``--compress`` to the command 17298 line interface of ``zipapp``. 17299 17300- bpo-25351: Avoid venv activate failures with undefined variables 17301 17302- bpo-20519: Avoid ctypes use (if possible) and improve import time for 17303 uuid. 17304 17305- bpo-28293: The regular expression cache is no longer completely dumped 17306 when it is full. 17307 17308- bpo-31596: Added pthread_getcpuclockid() to the time module 17309 17310- bpo-27494: Make 2to3 accept a trailing comma in generator expressions. For 17311 example, ``set(x for x in [],)`` is now allowed. 17312 17313- bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() 17314 iterators. 17315 17316- bpo-30346: An iterator produced by itertools.groupby() iterator now 17317 becomes exhausted after advancing the groupby iterator. 17318 17319- bpo-31556: Cancel asyncio.wait_for future faster if timeout <= 0 17320 17321- bpo-31540: Allow passing a context object in 17322 :class:`concurrent.futures.ProcessPoolExecutor` constructor. Also, free 17323 job resources in :class:`concurrent.futures.ProcessPoolExecutor` earlier 17324 to improve memory usage when a worker waits for new jobs. 17325 17326- bpo-31516: ``threading.current_thread()`` should not return a dummy thread 17327 at shutdown. 17328 17329- bpo-31525: In the sqlite module, require the sqlite3_prepare_v2 API. Thus, 17330 the sqlite module now requires sqlite version at least 3.3.9. 17331 17332- bpo-26510: argparse subparsers are now required by default. This matches 17333 behaviour in Python 2. For optional subparsers, use the new parameter 17334 ``add_subparsers(required=False)``. Patch by Anthony Sottile. (As of 17335 3.7.0rc1, the default was changed to not required as had been the case 17336 since Python 3.3.) 17337 17338- bpo-27541: Reprs of subclasses of some collection and iterator classes 17339 (`bytearray`, `array.array`, `collections.deque`, 17340 `collections.defaultdict`, `itertools.count`, `itertools.repeat`) now 17341 contain actual type name insteads of hardcoded name of the base class. 17342 17343- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip 17344 bootstrapping has failed. 17345 17346- bpo-31389: ``pdb.set_trace()`` now takes an optional keyword-only argument 17347 ``header``. If given, this is printed to the console just before debugging 17348 begins. 17349 17350Documentation 17351------------- 17352 17353- bpo-31537: Fix incorrect usage of ``get_history_length`` in readline 17354 documentation example code. Patch by Brad Smith. 17355 17356- bpo-30085: The operator functions without double underscores are preferred 17357 for clarity. The one with underscores are only kept for 17358 back-compatibility. 17359 17360Build 17361----- 17362 17363- bpo-31696: Improve compiler version information in :data:`sys.version` 17364 when Python is built with Clang. 17365 17366- bpo-31625: Stop using ranlib on static libraries. Instead, we assume ar 17367 supports the 's' flag. 17368 17369- bpo-31624: Remove support for BSD/OS. 17370 17371- bpo-22140: Prevent double substitution of prefix in python-config.sh. 17372 17373- bpo-31569: Correct PCBuild/ case to PCbuild/ in build scripts and 17374 documentation. 17375 17376- bpo-31536: Avoid wholesale rebuild after `make regen-all` if nothing 17377 changed. 17378 17379IDLE 17380---- 17381 17382- bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget 17383 instead of an flist with a root widget opens the option of creating a 17384 browser frame that is only part of a window. Passing a full file name 17385 instead of pieces assumed to come from a .py file opens the possibility of 17386 browsing python files that do not end in .py. 17387 17388- bpo-31649: IDLE - Make _htest, _utest parameters keyword only. 17389 17390- bpo-31559: Remove test order dependence in idle_test.test_browser. 17391 17392- bpo-31459: Rename IDLE's module browser from Class Browser to Module 17393 Browser. The original module-level class and method browser became a 17394 module browser, with the addition of module-level functions, years ago. 17395 Nested classes and functions were added yesterday. For 17396 back-compatibility, the virtual event <<open-class-browser>>, which 17397 appears on the Keys tab of the Settings dialog, is not changed. Patch by 17398 Cheryl Sabella. 17399 17400- bpo-31500: Default fonts now are scaled on HiDPI displays. 17401 17402- bpo-1612262: IDLE module browser now shows nested classes and functions. 17403 Original patches for code and tests by Guilherme Polo and Cheryl Sabella, 17404 respectively. 17405 17406C API 17407----- 17408 17409- bpo-28280: Make `PyMapping_Keys()`, `PyMapping_Values()` and 17410 `PyMapping_Items()` always return a `list` (rather than a `list` or a 17411 `tuple`). Patch by Oren Milman. 17412 17413- bpo-31532: Fix memory corruption due to allocator mix in getpath.c between 17414 Py_GetPath() and Py_SetPath() 17415 17416- bpo-25658: Implement :pep:`539` for Thread Specific Storage (TSS) API: it 17417 is a new Thread Local Storage (TLS) API to CPython which would supersede 17418 use of the existing TLS API within the CPython interpreter, while 17419 deprecating the existing API. PEP written by Erik M. Bray, patch by 17420 Masayuki Yamamoto. 17421 17422 17423What's New in Python 3.7.0 alpha 1? 17424=================================== 17425 17426*Release date: 2017-09-19* 17427 17428Security 17429-------- 17430 17431- bpo-29781: SSLObject.version() now correctly returns None when handshake 17432 over BIO has not been performed yet. 17433 17434- bpo-29505: Add fuzz tests for float(str), int(str), unicode(str); for 17435 oss-fuzz. 17436 17437- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to 17438 get security fixes. 17439 17440- bpo-30730: Prevent environment variables injection in subprocess on 17441 Windows. Prevent passing other environment variables and command 17442 arguments. 17443 17444- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple 17445 security vulnerabilities including: CVE-2017-9233 (External entity 17446 infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), 17447 CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and 17448 CVE-2012-0876 (Counter hash flooding with SipHash). Note: the 17449 CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't 17450 impact Python, since Python already gets entropy from the OS to set the 17451 expat secret using ``XML_SetHashSalt()``. 17452 17453- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For 17454 example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the 17455 ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an 17456 authentication (``login@host``). 17457 17458- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of 17459 CVE-2016-0718 and CVE-2016-4472. See 17460 https://sourceforge.net/p/expat/bugs/537/ for more information. 17461 17462Core and Builtins 17463----------------- 17464 17465- bpo-31490: Fix an assertion failure in `ctypes` class definition, in case 17466 the class has an attribute whose name is specified in ``_anonymous_`` but 17467 not in ``_fields_``. Patch by Oren Milman. 17468 17469- bpo-31471: Fix an assertion failure in `subprocess.Popen()` on Windows, in 17470 case the env argument has a bad keys() method. Patch by Oren Milman. 17471 17472- bpo-31418: Fix an assertion failure in `PyErr_WriteUnraisable()` in case 17473 of an exception with a bad ``__module__`` attribute. Patch by Oren Milman. 17474 17475- bpo-31416: Fix assertion failures in case of a bad warnings.filters or 17476 warnings.defaultaction. Patch by Oren Milman. 17477 17478- bpo-28411: Change direct usage of PyInterpreterState.modules to 17479 PyImport_GetModuleDict(). Also introduce more uniformity in other code 17480 that deals with sys.modules. This helps reduce complications when working 17481 on sys.modules. 17482 17483- bpo-28411: Switch to the abstract API when dealing with 17484 ``PyInterpreterState.modules``. This allows later support for all dict 17485 subclasses and other Mapping implementations. Also add a 17486 ``PyImport_GetModule()`` function to reduce a bunch of duplicated code. 17487 17488- bpo-31411: Raise a TypeError instead of SystemError in case 17489 warnings.onceregistry is not a dictionary. Patch by Oren Milman. 17490 17491- bpo-31344: For finer control of tracing behaviour when testing the 17492 interpreter, two new frame attributes have been added to control the 17493 emission of particular trace events: ``f_trace_lines`` (``True`` by 17494 default) to turn off per-line trace events; and ``f_trace_opcodes`` 17495 (``False`` by default) to turn on per-opcode trace events. 17496 17497- bpo-31373: Fix several possible instances of undefined behavior due to 17498 floating-point demotions. 17499 17500- bpo-30465: Location information (``lineno`` and ``col_offset``) in 17501 f-strings is now (mostly) correct. This fixes tools like flake8 from 17502 showing warnings on the wrong line (typically the first line of the file). 17503 17504- bpo-30860: Consolidate CPython's global runtime state under a single 17505 struct. This improves discoverability of the runtime state. 17506 17507- bpo-31347: Fix possible undefined behavior in _PyObject_FastCall_Prepend. 17508 17509- bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev(). 17510 GNU C libray plans to remove the functions from sys/types.h. 17511 17512- bpo-31291: Fix an assertion failure in `zipimport.zipimporter.get_data` on 17513 Windows, when the return value of ``pathname.replace('/','\\')`` isn't a 17514 string. Patch by Oren Milman. 17515 17516- bpo-31271: Fix an assertion failure in the write() method of 17517 `io.TextIOWrapper`, when the encoder doesn't return a bytes object. Patch 17518 by Oren Milman. 17519 17520- bpo-31243: Fix a crash in some methods of `io.TextIOWrapper`, when the 17521 decoder's state is invalid. Patch by Oren Milman. 17522 17523- bpo-30721: ``print`` now shows correct usage hint for using Python 2 17524 redirection syntax. Patch by Sanyam Khurana. 17525 17526- bpo-31070: Fix a race condition in importlib _get_module_lock(). 17527 17528- bpo-30747: Add a non-dummy implementation of _Py_atomic_store and 17529 _Py_atomic_load on MSVC. 17530 17531- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which 17532 doesn't call ``PyObject_GC_UnTrack()``. 17533 17534- bpo-31071: Avoid masking original TypeError in call with * unpacking when 17535 other arguments are passed. 17536 17537- bpo-30978: str.format_map() now passes key lookup exceptions through. 17538 Previously any exception was replaced with a KeyError exception. 17539 17540- bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state. 17541 17542- bpo-30876: Relative import from unloaded package now reimports the package 17543 instead of failing with SystemError. Relative import from non-package now 17544 fails with ImportError rather than SystemError. 17545 17546- bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from 17547 signal handler, to avoid calling signal-unsafe functions. The tests I'm 17548 adding here fail without the rest of the patch, on Linux and OS X. This 17549 means our signal delivery logic had defects (some signals could be lost). 17550 17551- bpo-30765: Avoid blocking in pthread_mutex_lock() when 17552 PyThread_acquire_lock() is asked not to block. 17553 17554- bpo-31161: Make sure the 'Missing parentheses' syntax error message is 17555 only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters. 17556 17557- bpo-30814: Fixed a race condition when import a submodule from a package. 17558 17559- bpo-30736: The internal unicodedata database has been upgraded to Unicode 17560 10.0. 17561 17562- bpo-30604: Move co_extra_freefuncs from per-thread to per-interpreter to 17563 avoid crashes. 17564 17565- bpo-30597: ``print`` now shows expected input in custom error message when 17566 used as a Python 2 statement. Patch by Sanyam Khurana. 17567 17568- bpo-30682: Removed a too-strict assertion that failed for certain 17569 f-strings, such as eval("f'\\\n'") and eval("f'\\\r'"). 17570 17571- bpo-30501: The compiler now produces more optimal code for complex 17572 condition expressions in the "if", "while" and "assert" statement, the 17573 "if" expression, and generator expressions and comprehensions. 17574 17575- bpo-28180: Implement :pep:`538` (legacy C locale coercion). This means 17576 that when a suitable coercion target locale is available, both the core 17577 interpreter and locale-aware C extensions will assume the use of UTF-8 as 17578 the default text encoding, rather than ASCII. 17579 17580- bpo-30486: Allows setting cell values for __closure__. Patch by Lisa 17581 Roach. 17582 17583- bpo-30537: itertools.islice now accepts integer-like objects (having an 17584 __index__ method) as start, stop, and slice arguments 17585 17586- bpo-25324: Tokens needed for parsing in Python moved to C. ``COMMENT``, 17587 ``NL`` and ``ENCODING``. This way the tokens and tok_names in the token 17588 module don't get changed when you import the tokenize module. 17589 17590- bpo-29104: Fixed parsing backslashes in f-strings. 17591 17592- bpo-27945: Fixed various segfaults with dict when input collections are 17593 mutated during searching, inserting or comparing. Based on patches by 17594 Duane Griffin and Tim Mitchell. 17595 17596- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for 17597 non-interned attribute names. Based on patch by Eryk Sun. 17598 17599- bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the 17600 middle of resuming a chain of nested 'yield from' or 'await' calls, it's 17601 now correctly delivered to the innermost frame. 17602 17603- bpo-28974: ``object.__format__(x, '')`` is now equivalent to ``str(x)`` 17604 rather than ``format(str(self), '')``. 17605 17606- bpo-30024: Circular imports involving absolute imports with binding a 17607 submodule to a name are now supported. 17608 17609- bpo-12414: sys.getsizeof() on a code object now returns the sizes which 17610 includes the code struct and sizes of objects which it references. Patch 17611 by Dong-hee Na. 17612 17613- bpo-29839: len() now raises ValueError rather than OverflowError if 17614 __len__() returned a large negative integer. 17615 17616- bpo-11913: README.rst is now included in the list of distutils standard 17617 READMEs and therefore included in source distributions. 17618 17619- bpo-29914: Fixed default implementations of __reduce__ and 17620 __reduce_ex__(). object.__reduce__() no longer takes arguments, 17621 object.__reduce_ex__() now requires one argument. 17622 17623- bpo-29949: Fix memory usage regression of set and frozenset object. 17624 17625- bpo-29935: Fixed error messages in the index() method of tuple, list and 17626 deque when pass indices of wrong type. 17627 17628- bpo-29816: Shift operation now has less opportunity to raise 17629 OverflowError. ValueError always is raised rather than OverflowError for 17630 negative counts. Shifting zero with non-negative count always returns 17631 zero. 17632 17633- bpo-24821: Fixed the slowing down to 25 times in the searching of some 17634 unlucky Unicode characters. 17635 17636- bpo-29102: Add a unique ID to PyInterpreterState. This makes it easier to 17637 identify each subinterpreter. 17638 17639- bpo-29894: The deprecation warning is emitted if __complex__ returns an 17640 instance of a strict subclass of complex. In a future versions of Python 17641 this can be an error. 17642 17643- bpo-29859: Show correct error messages when any of the pthread_* calls in 17644 thread_pthread.h fails. 17645 17646- bpo-29849: Fix a memory leak when an ImportError is raised during from 17647 import. 17648 17649- bpo-28856: Fix an oversight that %b format for bytes should support 17650 objects follow the buffer protocol. 17651 17652- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused 17653 a regression by revealing an inconsistency in how sys.path is initialized 17654 when executing ``__main__`` from a zipfile, directory, or other import 17655 location. The interpreter now consistently avoids ever adding the import 17656 location's parent directory to ``sys.path``, and ensures no other 17657 ``sys.path`` entries are inadvertently modified when inserting the import 17658 location named on the command line. 17659 17660- bpo-29568: Escaped percent "%%" in the format string for classic string 17661 formatting no longer allows any characters between two percents. 17662 17663- bpo-29714: Fix a regression that bytes format may fail when containing 17664 zero bytes inside. 17665 17666- bpo-29695: bool(), float(), list() and tuple() no longer take keyword 17667 arguments. The first argument of int() can now be passes only as 17668 positional argument. 17669 17670- bpo-28893: Set correct __cause__ for errors about invalid awaitables 17671 returned from __aiter__ and __anext__. 17672 17673- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises 17674 :exc:`OverflowError`. 17675 17676- bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian 17677 Coleman. 17678 17679- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It 17680 should raise TypeError when kwargs is not a dict. But it might cause segv 17681 when args=NULL and kwargs is not a dict. 17682 17683- bpo-28598: Support __rmod__ for subclasses of str being called before 17684 str.__mod__. Patch by Martijn Pieters. 17685 17686- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by 17687 Matthieu Dartiailh. 17688 17689- bpo-29602: Fix incorrect handling of signed zeros in complex constructor 17690 for complex subclasses and for inputs having a __complex__ method. Patch 17691 by Serhiy Storchaka. 17692 17693- bpo-29347: Fixed possibly dereferencing undefined pointers when creating 17694 weakref objects. 17695 17696- bpo-29463: Add ``docstring`` field to Module, ClassDef, FunctionDef, and 17697 AsyncFunctionDef ast nodes. docstring is not first stmt in their body 17698 anymore. It affects ``co_firstlineno`` and ``co_lnotab`` of code object 17699 for module and class. (Reverted in :issue:`32911`.) 17700 17701- bpo-29438: Fixed use-after-free problem in key sharing dict. 17702 17703- bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from 17704 ... import ...``. 17705 17706- bpo-29546: Improve from-import error message with location 17707 17708- bpo-29478: If max_line_length=None is specified while using the Compat32 17709 policy, it is no longer ignored. Patch by Mircea Cosbuc. 17710 17711- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0]. 17712 17713- bpo-29337: Fixed possible BytesWarning when compare the code objects. 17714 Warnings could be emitted at compile time. 17715 17716- bpo-29327: Fixed a crash when pass the iterable keyword argument to 17717 sorted(). 17718 17719- bpo-29034: Fix memory leak and use-after-free in os module 17720 (path_converter). 17721 17722- bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception. 17723 17724- bpo-29049: Call _PyObject_GC_TRACK() lazily when calling Python function. 17725 Calling function is up to 5% faster. 17726 17727- bpo-28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII 17728 whitespace, not only spaces. Patch by Robert Xiao. 17729 17730- bpo-28932: Do not include <sys/random.h> if it does not exist. 17731 17732- bpo-25677: Correct the positioning of the syntax error caret for indented 17733 blocks. Based on patch by Michael Layzell. 17734 17735- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate 17736 form. 17737 17738- bpo-18896: Python function can now have more than 255 parameters. 17739 collections.namedtuple() now supports tuples with more than 255 elements. 17740 17741- bpo-28596: The preferred encoding is UTF-8 on Android. Patch written by 17742 Chi Hsuan Yen. 17743 17744- bpo-22257: Clean up interpreter startup (see :pep:`432`). 17745 17746- bpo-26919: On Android, operating system data is now always encoded/decoded 17747 to/from UTF-8, instead of the locale encoding to avoid inconsistencies 17748 with os.fsencode() and os.fsdecode() which are already using UTF-8. 17749 17750- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy 17751 bug triggerable by a monkey-patched len() function. 17752 17753- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must 17754 not convert combined table into split table. Patch written by INADA Naoki. 17755 17756- bpo-28739: f-string expressions are no longer accepted as docstrings and 17757 by ast.literal_eval() even if they do not include expressions. 17758 17759- bpo-28512: Fixed setting the offset attribute of SyntaxError by 17760 PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). 17761 17762- bpo-28918: Fix the cross compilation of xxlimited when Python has been 17763 built with Py_DEBUG defined. 17764 17765- bpo-23722: Rather than silently producing a class that doesn't support 17766 zero-argument ``super()`` in methods, failing to pass the new 17767 ``__classcell__`` namespace entry up to ``type.__new__`` now results in a 17768 ``DeprecationWarning`` and a class that supports zero-argument 17769 ``super()``. 17770 17771- bpo-28797: Modifying the class __dict__ inside the __set_name__ method of 17772 a descriptor that is used inside that class no longer prevents calling the 17773 __set_name__ method of other descriptors. 17774 17775- bpo-28799: Remove the ``PyEval_GetCallStats()`` function and deprecate the 17776 untested and undocumented ``sys.callstats()`` function. Remove the 17777 ``CALL_PROFILE`` special build: use the :func:`sys.setprofile` function, 17778 :mod:`cProfile` or :mod:`profile` to profile function calls. 17779 17780- bpo-12844: More than 255 arguments can now be passed to a function. 17781 17782- bpo-28782: Fix a bug in the implementation ``yield from`` when checking if 17783 the next instruction is YIELD_FROM. Regression introduced by WORDCODE 17784 (issue #26647). 17785 17786- bpo-28774: Fix error position of the unicode error in ASCII and Latin1 17787 encoders when a string returned by the error handler contains multiple 17788 non-encodable characters (non-ASCII for the ASCII codec, characters out of 17789 the U+0000-U+00FF range for Latin1). 17790 17791- bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict. 17792 Improve speed of dict literal with constant keys up to 30%. 17793 17794- bpo-28532: Show sys.version when -V option is supplied twice. 17795 17796- bpo-27100: The with-statement now checks for __enter__ before it checks 17797 for __exit__. This gives less confusing error messages when both methods 17798 are missing. Patch by Jonathan Ellington. 17799 17800- bpo-28746: Fix the set_inheritable() file descriptor method on platforms 17801 that do not have the ioctl FIOCLEX and FIONCLEX commands. 17802 17803- bpo-26920: Fix not getting the locale's charset upon initializing the 17804 interpreter, on platforms that do not have langinfo. 17805 17806- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X 17807 when decode astral characters. Patch by Xiang Zhang. 17808 17809- bpo-28665: Improve speed of the STORE_DEREF opcode by 40%. 17810 17811- bpo-19398: Extra slash no longer added to sys.path components in case of 17812 empty compile-time PYTHONPATH components. 17813 17814- bpo-28621: Sped up converting int to float by reusing faster bits counting 17815 implementation. Patch by Adrian Wielgosik. 17816 17817- bpo-28580: Optimize iterating split table values. Patch by Xiang Zhang. 17818 17819- bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch 17820 by Xiang Zhang. 17821 17822- bpo-28128: Deprecation warning for invalid str and byte escape sequences 17823 now prints better information about where the error occurs. Patch by 17824 Serhiy Storchaka and Eric Smith. 17825 17826- bpo-28509: dict.update() no longer allocate unnecessary large memory. 17827 17828- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug 17829 build. 17830 17831- bpo-28517: Fixed of-by-one error in the peephole optimizer that caused 17832 keeping unreachable code. 17833 17834- bpo-28214: Improved exception reporting for problematic __set_name__ 17835 attributes. 17836 17837- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception 17838 loss in PyTraceBack_Here(). 17839 17840- bpo-28183: Optimize and cleanup dict iteration. 17841 17842- bpo-26081: Added C implementation of asyncio.Future. Original patch by 17843 Yury Selivanov. 17844 17845- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). 17846 Patch by Xiang Zhang. 17847 17848- bpo-28376: The type of long range iterator is now registered as Iterator. 17849 Patch by Oren Milman. 17850 17851- bpo-28376: Creating instances of range_iterator by calling range_iterator 17852 type now is disallowed. Calling iter() on range instance is the only way. 17853 Patch by Oren Milman. 17854 17855- bpo-26906: Resolving special methods of uninitialized type now causes 17856 implicit initialization of the type instead of a fail. 17857 17858- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original 17859 patch by Niklas Koep. 17860 17861- bpo-24098: Fixed possible crash when AST is changed in process of 17862 compiling it. 17863 17864- bpo-28201: Dict reduces possibility of 2nd conflict in hash table when 17865 hashes have same lower bits. 17866 17867- bpo-28350: String constants with null character no longer interned. 17868 17869- bpo-26617: Fix crash when GC runs during weakref callbacks. 17870 17871- bpo-27942: String constants now interned recursively in tuples and 17872 frozensets. 17873 17874- bpo-28289: ImportError.__init__ now resets not specified attributes. 17875 17876- bpo-21578: Fixed misleading error message when ImportError called with 17877 invalid keyword args. 17878 17879- bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch 17880 by Soumya Sharma. 17881 17882- bpo-28086: Single var-positional argument of tuple subtype was passed 17883 unscathed to the C-defined function. Now it is converted to exact tuple. 17884 17885- bpo-28214: Now __set_name__ is looked up on the class instead of the 17886 instance. 17887 17888- bpo-27955: Fallback on reading /dev/urandom device when the getrandom() 17889 syscall fails with EPERM, for example when blocked by SECCOMP. 17890 17891- bpo-28192: Don't import readline in isolated mode. 17892 17893- bpo-27441: Remove some redundant assignments to ob_size in longobject.c. 17894 Thanks Oren Milman. 17895 17896- bpo-27222: Clean up redundant code in long_rshift function. Thanks Oren 17897 Milman. 17898 17899- Upgrade internal unicode databases to Unicode version 9.0.0. 17900 17901- bpo-28131: Fix a regression in zipimport's compile_source(). zipimport 17902 should use the same optimization level as the interpreter. 17903 17904- bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly 17905 optimize memcpy(). 17906 17907- bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a 17908 "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. 17909 17910- bpo-26182: Raise DeprecationWarning when async and await keywords are used 17911 as variable/attribute/class/function name. 17912 17913- bpo-26182: Fix a refleak in code that raises DeprecationWarning. 17914 17915- bpo-28721: Fix asynchronous generators aclose() and athrow() to handle 17916 StopAsyncIteration propagation properly. 17917 17918- bpo-26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes. 17919 17920Library 17921------- 17922 17923- bpo-31499: xml.etree: Fix a crash when a parser is part of a reference 17924 cycle. 17925 17926- bpo-31482: ``random.seed()`` now works with bytes in version=1 17927 17928- bpo-28556: typing.get_type_hints now finds the right globalns for classes 17929 and modules by default (when no ``globalns`` was specified by the caller). 17930 17931- bpo-28556: Speed improvements to the ``typing`` module. Original PRs by 17932 Ivan Levkivskyi and Mitar. 17933 17934- bpo-31544: The C accelerator module of ElementTree ignored exceptions 17935 raised when looking up TreeBuilder target methods in XMLParser(). 17936 17937- bpo-31234: socket.create_connection() now fixes manually a reference 17938 cycle: clear the variable storing the last exception on success. 17939 17940- bpo-31457: LoggerAdapter objects can now be nested. 17941 17942- bpo-31431: SSLContext.check_hostname now automatically sets 17943 SSLContext.verify_mode to ssl.CERT_REQUIRED instead of failing with a 17944 ValueError. 17945 17946- bpo-31233: socketserver.ThreadingMixIn now keeps a list of non-daemonic 17947 threads to wait until all these threads complete in server_close(). 17948 17949- bpo-28638: Changed the implementation strategy for 17950 collections.namedtuple() to substantially reduce the use of exec() in 17951 favor of precomputed methods. As a result, the *verbose* parameter and 17952 *_source* attribute are no longer supported. The benefits include 1) 17953 having a smaller memory footprint for applications using multiple named 17954 tuples, 2) faster creation of the named tuple class (approx 4x to 6x 17955 depending on how it is measured), and 3) minor speed-ups for instance 17956 creation using __new__, _make, and _replace. (The primary patch 17957 contributor is Jelle Zijlstra with further improvements by INADA Naoki, 17958 Serhiy Storchaka, and Raymond Hettinger.) 17959 17960- bpo-31400: Improves SSL error handling to avoid losing error numbers. 17961 17962- bpo-27629: Make return types of SSLContext.wrap_bio() and 17963 SSLContext.wrap_socket() customizable. 17964 17965- bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a 17966 context cannot be instantiated. 17967 17968- bpo-28182: The SSL module now raises SSLCertVerificationError when OpenSSL 17969 fails to verify the peer's certificate. The exception contains more 17970 information about the error. 17971 17972- bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of 17973 data. This fixes support for all bytes-like object. It is also more 17974 efficient and avoids costly copies. 17975 17976- bpo-14191: A new function 17977 ``argparse.ArgumentParser.parse_intermixed_args`` provides the ability to 17978 parse command lines where there user intermixes options and positional 17979 arguments. 17980 17981- bpo-31178: Fix string concatenation bug in rare error path in the 17982 subprocess module 17983 17984- bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up 17985 to 10% faster. 17986 17987- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of 17988 partial characters for UTF-8 input (libexpat bug 115): 17989 https://github.com/libexpat/libexpat/issues/115 17990 17991- bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3. 17992 17993- bpo-1198569: ``string.Template`` subclasses can optionally define 17994 ``braceidpattern`` if they want to specify different placeholder patterns 17995 inside and outside the braces. If None (the default) it falls back to 17996 ``idpattern``. 17997 17998- bpo-31326: concurrent.futures.ProcessPoolExecutor.shutdown() now 17999 explicitly closes the call queue. Moreover, shutdown(wait=True) now also 18000 join the call queue thread, to prevent leaking a dangling thread. 18001 18002- bpo-27144: The ``map()`` and ``as_completed()`` iterators in 18003 ``concurrent.futures`` now avoid keeping a reference to yielded objects. 18004 18005- bpo-31281: Fix ``fileinput.FileInput(files, inplace=True)`` when ``files`` 18006 contain ``pathlib.Path`` objects. 18007 18008- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer 18009 types. 18010 18011- bpo-27584: ``AF_VSOCK`` has been added to the socket interface which 18012 allows communication between virtual machines and their host. 18013 18014- bpo-22536: The subprocess module now sets the filename when 18015 FileNotFoundError is raised on POSIX systems due to the executable or cwd 18016 not being found. 18017 18018- bpo-29741: Update some methods in the _pyio module to also accept integer 18019 types. Patch by Oren Milman. 18020 18021- bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor 18022 now breaks a reference cycle between an exception object and the WorkItem 18023 object. 18024 18025- bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using 18026 sys.exc_info() in code handling exceptions. 18027 18028- bpo-23835: configparser: reading defaults in the ``ConfigParser()`` 18029 constructor is now using ``read_dict()``, making its behavior consistent 18030 with the rest of the parser. Non-string keys and values in the defaults 18031 dictionary are now being implicitly converted to strings. Patch by James 18032 Tocknell. 18033 18034- bpo-31238: pydoc: the stop() method of the private ServerThread class now 18035 waits until DocServer.serve_until_quit() completes and then explicitly 18036 sets its docserver attribute to None to break a reference cycle. 18037 18038- bpo-5001: Many asserts in `multiprocessing` are now more informative, and 18039 some error types have been changed to more specific ones. 18040 18041- bpo-31109: Convert zipimport to use Argument Clinic. 18042 18043- bpo-30102: The ssl and hashlib modules now call 18044 OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function 18045 detects CPU features and enables optimizations on some CPU architectures 18046 such as POWER8. Patch is based on research from Gustavo Serra Scalet. 18047 18048- bpo-18966: Non-daemonic threads created by a multiprocessing.Process are 18049 now joined on child exit. 18050 18051- bpo-31183: `dis` now works with asynchronous generator and coroutine 18052 objects. Patch by George Collins based on diagnosis by Luciano Ramalho. 18053 18054- bpo-5001: There are a number of uninformative asserts in the 18055 `multiprocessing` module, as noted in issue 5001. This change fixes two of 18056 the most potentially problematic ones, since they are in error-reporting 18057 code, in the `multiprocessing.managers.convert_to_error` function. (It 18058 also makes more informative a ValueError message.) The only potentially 18059 problematic change is that the AssertionError is now a TypeError; however, 18060 this should also help distinguish it from an AssertionError being 18061 *reported* by the function/its caller (such as in issue 31169). - Patch by 18062 Allen W. Smith (drallensmith on github). 18063 18064- bpo-31185: Fixed miscellaneous errors in asyncio speedup module. 18065 18066- bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all 18067 child processes completed to prevent leaking zombie processes. 18068 18069- bpo-31072: Add an ``include_file`` parameter to 18070 ``zipapp.create_archive()`` 18071 18072- bpo-24700: Optimize array.array comparison. It is now from 10x up to 70x 18073 faster when comparing arrays holding values of the same integer type. 18074 18075- bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu 18076 classes. Call the parent destroy() method even if the used attribute 18077 doesn't exist. The LabeledScale.destroy() method now also explicitly 18078 clears label and scale attributes to help the garbage collector to destroy 18079 all widgets. 18080 18081- bpo-31107: Fix `copyreg._slotnames()` mangled attribute calculation for 18082 classes whose name begins with an underscore. Patch by Shane Harvey. 18083 18084- bpo-31080: Allow `logging.config.fileConfig` to accept kwargs and/or args. 18085 18086- bpo-30897: ``pathlib.Path`` objects now include an ``is_mount()`` method 18087 (only implemented on POSIX). This is similar to ``os.path.ismount(p)``. 18088 Patch by Cooper Ry Lees. 18089 18090- bpo-31061: Fixed a crash when using asyncio and threads. 18091 18092- bpo-30987: Added support for CAN ISO-TP protocol in the socket module. 18093 18094- bpo-30522: Added a ``setStream`` method to ``logging.StreamHandler`` to 18095 allow the stream to be set after creation. 18096 18097- bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian 18098 Heimes. 18099 18100- bpo-5288: Support tzinfo objects with sub-minute offsets. 18101 18102- bpo-30919: Fix shared memory performance regression in multiprocessing in 18103 3.x. Shared memory used anonymous memory mappings in 2.x, while 3.x mmaps 18104 actual files. Try to be careful to do as little disk I/O as possible. 18105 18106- bpo-26732: Fix too many fds in processes started with the "forkserver" 18107 method. A child process would inherit as many fds as the number of 18108 still-running children. 18109 18110- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound 18111 builtin functions. Patch by Aaron Gallagher. 18112 18113- bpo-30961: Fix decrementing a borrowed reference in tracemalloc. 18114 18115- bpo-19896: Fix multiprocessing.sharedctypes to recognize typecodes ``'q'`` 18116 and ``'Q'``. 18117 18118- bpo-30946: Remove obsolete code in readline module for platforms where GNU 18119 readline is older than 2.1 or where select() is not available. 18120 18121- bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across 18122 instances of ``OptionMenu``. 18123 18124- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the 18125 thread completes, even if the thread was started by the same process which 18126 created the queue. 18127 18128- bpo-29854: Fix segfault in readline when using readline's history-size 18129 option. Patch by Nir Soffer. 18130 18131- bpo-30794: Added multiprocessing.Process.kill method to terminate using 18132 the SIGKILL signal on Unix. 18133 18134- bpo-30319: socket.close() now ignores ECONNRESET error. 18135 18136- bpo-30828: Fix out of bounds write in 18137 `asyncio.CFuture.remove_done_callback()`. 18138 18139- bpo-30302: Use keywords in the ``repr`` of ``datetime.timedelta``. 18140 18141- bpo-30807: signal.setitimer() may disable the timer when passed a tiny 18142 value. Tiny values (such as 1e-6) are valid non-zero values for 18143 setitimer(), which is specified as taking microsecond-resolution 18144 intervals. However, on some platform, our conversion routine could convert 18145 1e-6 into a zero interval, therefore disabling the timer instead of 18146 (re-)scheduling it. 18147 18148- bpo-30441: Fix bug when modifying os.environ while iterating over it 18149 18150- bpo-29585: Avoid importing ``sysconfig`` from ``site`` to improve startup 18151 speed. Python startup is about 5% faster on Linux and 30% faster on macOS. 18152 18153- bpo-29293: Add missing parameter "n" on 18154 multiprocessing.Condition.notify(). The doc claims 18155 multiprocessing.Condition behaves like threading.Condition, but its 18156 notify() method lacked the optional "n" argument (to specify the number of 18157 sleepers to wake up) that threading.Condition.notify() accepts. 18158 18159- bpo-30532: Fix email header value parser dropping folding white space in 18160 certain cases. 18161 18162- bpo-30596: Add a ``close()`` method to ``multiprocessing.Process``. 18163 18164- bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash 18165 functions such as md5 are not available in the linked OpenSSL library. As 18166 in some special FIPS-140 build environments. 18167 18168- bpo-29169: Update zlib to 1.2.11. 18169 18170- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that 18171 contains CR or LF. Patch by Dong-hee Na. 18172 18173- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called 18174 with bytes-like argument. 18175 18176- bpo-30746: Prohibited the '=' character in environment variable names in 18177 ``os.putenv()`` and ``os.spawn*()``. 18178 18179- bpo-30664: The description of a unittest subtest now preserves the order 18180 of keyword arguments of TestCase.subTest(). 18181 18182- bpo-21071: struct.Struct.format type is now :class:`str` instead of 18183 :class:`bytes`. 18184 18185- bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to 18186 have a non repr() based thread name by default when no thread_name_prefix 18187 is supplied. They will now identify themselves as 18188 "ThreadPoolExecutor-y_n". 18189 18190- bpo-29755: Fixed the lgettext() family of functions in the gettext module. 18191 They now always return bytes. 18192 18193- bpo-30616: Functional API of enum allows to create empty enums. Patched by 18194 Dong-hee Na 18195 18196- bpo-30038: Fix race condition between signal delivery and wakeup file 18197 descriptor. Patch by Nathaniel Smith. 18198 18199- bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings. 18200 18201- bpo-24744: pkgutil.walk_packages function now raises ValueError if *path* 18202 is a string. Patch by Sanyam Khurana. 18203 18204- bpo-24484: Avoid race condition in multiprocessing cleanup. 18205 18206- bpo-30589: Fix multiprocessing.Process.exitcode to return the opposite of 18207 the signal number when the process is killed by a signal (instead of 255) 18208 when using the "forkserver" method. 18209 18210- bpo-28994: The traceback no longer displayed for SystemExit raised in a 18211 callback registered by atexit. 18212 18213- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was 18214 called. 18215 18216- bpo-30645: Fix path calculation in `imp.load_package()`, fixing it for 18217 cases when a package is only shipped with bytecodes. Patch by Alexandru 18218 Ardelean. 18219 18220- bpo-11822: The dis.dis() function now is able to disassemble nested code 18221 objects. 18222 18223- bpo-30624: selectors does not take KeyboardInterrupt and SystemExit into 18224 account, leaving a fd in a bad state in case of error. Patch by Giampaolo 18225 Rodola'. 18226 18227- bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader 18228 in non-blocking mode if it succeeded to acquire the lock but the acquire 18229 took longer than the timeout. 18230 18231- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add 18232 support for ContextManager on all versions. Original PRs by Jelle Zijlstra 18233 and Ivan Levkivskyi 18234 18235- bpo-30605: re.compile() no longer raises a BytesWarning when compiling a 18236 bytes instance with misplaced inline modifier. Patch by Roy Williams. 18237 18238- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl 18239 implementation. Patch by Michaël Sghaïer. 18240 18241- bpo-29743: Closing transport during handshake process leaks open socket. 18242 Patch by Nikolay Kim 18243 18244- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu 18245 Sornay. 18246 18247- bpo-30014: modify() method of poll(), epoll() and devpoll() based classes 18248 of selectors module is around 10% faster. Patch by Giampaolo Rodola'. 18249 18250- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore 18251 EINVAL on stdin.write() if the child process is still running but closed 18252 the pipe. 18253 18254- bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers to 18255 deny __dict__ and __weakref__ creation. Patch by Aaron Hall. 18256 18257- bpo-30520: Loggers are now pickleable. 18258 18259- bpo-30557: faulthandler now correctly filters and displays exception codes 18260 on Windows 18261 18262- bpo-30526: Add TextIOWrapper.reconfigure() and a 18263 TextIOWrapper.write_through attribute. 18264 18265- bpo-30245: Fix possible overflow when organize struct.pack_into error 18266 message. Patch by Yuan Liu. 18267 18268- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot 18269 handle IPv6 addresses. 18270 18271- bpo-16500: Allow registering at-fork handlers. 18272 18273- bpo-30470: Deprecate invalid ctypes call protection on Windows. Patch by 18274 Mariatta Wijaya. 18275 18276- bpo-30414: multiprocessing.Queue._feed background running thread do not 18277 break from main loop on exception. 18278 18279- bpo-30003: Fix handling escape characters in HZ codec. Based on patch by 18280 Ma Lin. 18281 18282- bpo-30149: inspect.signature() now supports callables with 18283 variable-argument parameters wrapped with partialmethod. Patch by Dong-hee 18284 Na. 18285 18286- bpo-30436: importlib.find_spec() raises ModuleNotFoundError instead of 18287 AttributeError if the specified parent module is not a package (i.e. lacks 18288 a __path__ attribute). 18289 18290- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn* 18291 and *forkserver* start methods. 18292 18293- bpo-30375: Warnings emitted when compile a regular expression now always 18294 point to the line in the user code. Previously they could point into 18295 inners of the re module if emitted from inside of groups or conditionals. 18296 18297- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error 18298 (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. 18299 This error occurs sometimes on SSL connections. 18300 18301- bpo-29196: Removed previously deprecated in Python 2.4 classes Plist, Dict 18302 and _InternalDict in the plistlib module. Dict values in the result of 18303 functions readPlist() and readPlistFromBytes() are now normal dicts. You 18304 no longer can use attribute access to access items of these dictionaries. 18305 18306- bpo-9850: The :mod:`macpath` is now deprecated and will be removed in 18307 Python 3.8. 18308 18309- bpo-30299: Compiling regular expression in debug mode on CPython now 18310 displays the compiled bytecode in human readable form. 18311 18312- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running 18313 coroutine and the coroutine returned without any more ``await``. 18314 18315- bpo-30266: contextlib.AbstractContextManager now supports 18316 anti-registration by setting __enter__ = None or __exit__ = None, 18317 following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra. 18318 18319- bpo-30340: Enhanced regular expressions optimization. This increased the 18320 performance of matching some patterns up to 25 times. 18321 18322- bpo-30298: Weaken the condition of deprecation warnings for inline 18323 modifiers. Now allowed several subsequential inline modifiers at the start 18324 of the pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and 18325 comments now are allowed before and between inline modifiers (e.g. ``'(?x) 18326 (?i) (?s)...'``). 18327 18328- bpo-30285: Optimized case-insensitive matching and searching of regular 18329 expressions. 18330 18331- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma 18332 Lin. 18333 18334- bpo-29979: rewrite cgi.parse_multipart, reusing the FieldStorage class and 18335 making its results consistent with those of FieldStorage for 18336 multipart/form-data requests. Patch by Pierre Quentel. 18337 18338- bpo-30243: Removed the __init__ methods of _json's scanner and encoder. 18339 Misusing them could cause memory leaks or crashes. Now scanner and 18340 encoder objects are completely initialized in the __new__ methods. 18341 18342- bpo-30215: Compiled regular expression objects with the re.LOCALE flag no 18343 longer depend on the locale at compile time. Only the locale at matching 18344 time affects the result of matching. 18345 18346- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process 18347 when Ctrl-C is received. 18348 18349- bpo-30103: binascii.b2a_uu() and uu.encode() now support using ``'`'`` as 18350 zero instead of space. 18351 18352- bpo-28556: Various updates to typing module: add typing.NoReturn type, use 18353 WrapperDescriptorType, minor bug-fixes. Original PRs by Jim 18354 Fasarakis-Hilliard and Ivan Levkivskyi. 18355 18356- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux. 18357 18358- bpo-30228: The seek() and tell() methods of io.FileIO now set the internal 18359 seekable attribute to avoid one syscall on open() (in buffered or text 18360 mode). 18361 18362- bpo-30190: unittest's assertAlmostEqual and assertNotAlmostEqual provide a 18363 better message in case of failure which includes the difference between 18364 left and right arguments. (patch by Giampaolo Rodola') 18365 18366- bpo-30101: Add support for curses.A_ITALIC. 18367 18368- bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch 18369 by Nate Soares. 18370 18371- bpo-29960: Preserve generator state when _random.Random.setstate() raises 18372 an exception. Patch by Bryan Olson. 18373 18374- bpo-30070: Fixed leaks and crashes in errors handling in the parser 18375 module. 18376 18377- bpo-22352: Column widths in the output of dis.dis() are now adjusted for 18378 large line numbers and instruction offsets. 18379 18380- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when 18381 readline() or __next__() respectively return non-sizeable object. Fixed 18382 possible other errors caused by not checking results of PyObject_Size(), 18383 PySequence_Size(), or PyMapping_Size(). 18384 18385- bpo-30218: Fix PathLike support for shutil.unpack_archive. Patch by Jelle 18386 Zijlstra. 18387 18388- bpo-10076: Compiled regular expression and match objects in the re module 18389 now support copy.copy() and copy.deepcopy() (they are considered atomic). 18390 18391- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint 18392 is present. 18393 18394- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. 18395 Patch by Armin Rigo. 18396 18397- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in 18398 contextlib.contextmanager. Patch by Siddharth Velankar. 18399 18400- bpo-26187: Test that sqlite3 trace callback is not called multiple times 18401 when schema is changing. Indirectly fixed by switching to use 18402 sqlite3_prepare_v2() in bpo-9303. Patch by Aviv Palivoda. 18403 18404- bpo-30017: Allowed calling the close() method of the zip entry writer 18405 object multiple times. Writing to a closed writer now always produces a 18406 ValueError. 18407 18408- bpo-29998: Pickling and copying ImportError now preserves name and path 18409 attributes. 18410 18411- bpo-29995: re.escape() now escapes only regex special characters. 18412 18413- bpo-29962: Add math.remainder operation, implementing remainder as 18414 specified in IEEE 754. 18415 18416- bpo-29649: Improve struct.pack_into() exception messages for problems with 18417 the buffer size and offset. Patch by Andrew Nester. 18418 18419- bpo-29654: Support If-Modified-Since HTTP header (browser cache). Patch 18420 by Pierre Quentel. 18421 18422- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. 18423 Patch by Sanjay Sundaresan. 18424 18425- bpo-29953: Fixed memory leaks in the replace() method of datetime and time 18426 objects when pass out of bound fold argument. 18427 18428- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering 18429 long runs of empty iterables. 18430 18431- bpo-10030: Sped up reading encrypted ZIP files by 2 times. 18432 18433- bpo-29204: Element.getiterator() and the html parameter of XMLParser() 18434 were deprecated only in the documentation (since Python 3.2 and 3.4 18435 correspondingly). Now using them emits a deprecation warning. 18436 18437- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions 18438 and wrong types. 18439 18440- bpo-25996: Added support of file descriptors in os.scandir() on Unix. 18441 os.fwalk() is sped up by 2 times by using os.scandir(). 18442 18443- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an 18444 exception at the very first of an iterable may swallow the exception or 18445 make the program hang. Patch by Davin Potts and Xiang Zhang. 18446 18447- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a 18448 reference cycle to not keep objects alive longer than expected. 18449 18450- bpo-29901: The zipapp module now supports general path-like objects, not 18451 just pathlib.Path. 18452 18453- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when 18454 the OS gives priority to errors such as EACCES over EEXIST. 18455 18456- bpo-29861: Release references to tasks, their arguments and their results 18457 as soon as they are finished in multiprocessing.Pool. 18458 18459- bpo-19930: The mode argument of os.makedirs() no longer affects the file 18460 permission bits of newly-created intermediate-level directories. 18461 18462- bpo-29884: faulthandler: Restore the old sigaltstack during teardown. 18463 Patch by Christophe Zeitouny. 18464 18465- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. 18466 18467- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords 18468 are not strings. Patch by Michael Seifert. 18469 18470- bpo-8256: Fixed possible failing or crashing input() if attributes 18471 "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not 18472 strings. 18473 18474- bpo-28692: Using non-integer value for selecting a plural form in gettext 18475 is now deprecated. 18476 18477- bpo-26121: Use C library implementation for math functions erf() and 18478 erfc(). 18479 18480- bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino) 18481 using unsigned integers. 18482 18483- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting 18484 big intables (objects that have __int__) as elements. 18485 18486- bpo-29645: Speed up importing the webbrowser module. 18487 webbrowser.register() is now thread-safe. 18488 18489- bpo-28231: The zipfile module now accepts path-like objects for external 18490 paths. 18491 18492- bpo-26915: index() and count() methods of collections.abc.Sequence now 18493 check identity before checking equality when do comparisons. 18494 18495- bpo-28682: Added support for bytes paths in os.fwalk(). 18496 18497- bpo-29728: Add new :data:`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constant. 18498 Patch by Nathaniel J. Smith. 18499 18500- bpo-29623: Allow use of path-like object as a single argument in 18501 ConfigParser.read(). Patch by David Ellis. 18502 18503- bpo-9303: Migrate sqlite3 module to _v2 API. Patch by Aviv Palivoda. 18504 18505- bpo-28963: Fix out of bound iteration in 18506 asyncio.Future.remove_done_callback implemented in C. 18507 18508- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes 18509 before all pipes are closed. 18510 18511- bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to 18512 accept None argument as their pure Python implementation. 18513 18514- bpo-29703: Fix asyncio to support instantiation of new event loops in 18515 child processes. 18516 18517- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other 18518 exception) to exception(s) raised in the dispatched methods. Patch by Petr 18519 Motejlek. 18520 18521- bpo-7769: Method register_function() of 18522 xmlrpc.server.SimpleXMLRPCDispatcher and its subclasses can now be used as 18523 a decorator. 18524 18525- bpo-29376: Fix assertion error in threading._DummyThread.is_alive(). 18526 18527- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts 18528 PathLike objects. Patch by Sayan Chowdhury. 18529 18530- bpo-28518: Start a transaction implicitly before a DML statement. Patch by 18531 Aviv Palivoda. 18532 18533- bpo-29742: get_extra_info() raises exception if get called on closed ssl 18534 transport. Patch by Nikolay Kim. 18535 18536- bpo-16285: urllib.parse.quote is now based on RFC 3986 and hence includes 18537 '~' in the set of characters that is not quoted by default. Patch by 18538 Christian Theune and Ratnadeep Debnath. 18539 18540- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no 18541 longer affects a partial object after creation. 18542 18543- bpo-29110: Fix file object leak in aifc.open() when file is given as a 18544 filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. 18545 18546- bpo-22807: Add uuid.SafeUUID and uuid.UUID.is_safe to relay information 18547 from the platform about whether generated UUIDs are generated with a 18548 multiprocessing safe method. 18549 18550- bpo-29576: Improve some deprecations in importlib. Some deprecated methods 18551 now emit DeprecationWarnings and have better descriptive messages. 18552 18553- bpo-29534: Fixed different behaviour of Decimal.from_float() for _decimal 18554 and _pydecimal. Thanks Andrew Nester. 18555 18556- bpo-10379: locale.format_string now supports the 'monetary' keyword 18557 argument, and locale.format is deprecated. 18558 18559- bpo-29851: importlib.reload() now raises ModuleNotFoundError if the module 18560 lacks a spec. 18561 18562- bpo-28556: Various updates to typing module: typing.Counter, 18563 typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle 18564 Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. 18565 18566- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 18567 3.6.0: check minimum and maximum years. 18568 18569- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir 18570 18571- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the 18572 match object. Based on patch by WGH. 18573 18574- bpo-29377: Add WrapperDescriptorType, MethodWrapperType, and 18575 MethodDescriptorType built-in types to types module. Original patch by 18576 Manuel Krebber. 18577 18578- bpo-29218: Unused install_misc command is now removed. It has been 18579 documented as unused since 2000. Patch by Eric N. Vander Weele. 18580 18581- bpo-29368: The extend() method is now called instead of the append() 18582 method when unpickle collections.deque and other list-like objects. This 18583 can speed up unpickling to 2 times. 18584 18585- bpo-29338: The help of a builtin or extension class now includes the 18586 constructor signature if __text_signature__ is provided for the class. 18587 18588- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited 18589 to a stopped instead of terminated state (ex: when under ptrace). 18590 18591- bpo-29290: Fix a regression in argparse that help messages would wrap at 18592 non-breaking spaces. 18593 18594- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY. 18595 18596- bpo-29197: Removed deprecated function ntpath.splitunc(). 18597 18598- bpo-29210: Removed support of deprecated argument "exclude" in 18599 tarfile.TarFile.add(). 18600 18601- bpo-29219: Fixed infinite recursion in the repr of uninitialized 18602 ctypes.CDLL instances. 18603 18604- bpo-29192: Removed deprecated features in the http.cookies module. 18605 18606- bpo-29193: A format string argument for string.Formatter.format() is now 18607 positional-only. 18608 18609- bpo-29195: Removed support of deprecated undocumented keyword arguments in 18610 methods of regular expression objects. 18611 18612- bpo-28969: Fixed race condition in C implementation of 18613 functools.lru_cache. KeyError could be raised when cached function with 18614 full cache was simultaneously called from different threads with the same 18615 uncached arguments. 18616 18617- bpo-20804: The unittest.mock.sentinel attributes now preserve their 18618 identity when they are copied or pickled. 18619 18620- bpo-29142: In urllib.request, suffixes in no_proxy environment variable 18621 with leading dots could match related hostnames again (e.g. .b.c matches 18622 a.b.c). Patch by Milan Oberkirch. 18623 18624- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter 18625 anymore. Patch written by Jiajun Huang. 18626 18627- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a 18628 context. Patch by Sam Breese. 18629 18630- bpo-28985: Update authorizer constants in sqlite3 module. Patch by 18631 Dingyuan Wang. 18632 18633- bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows 18634 18635- bpo-13051: Fixed recursion errors in large or resized 18636 curses.textpad.Textbox. Based on patch by Tycho Andersen. 18637 18638- bpo-9770: curses.ascii predicates now work correctly with negative 18639 integers. 18640 18641- bpo-28427: old keys should not remove new values from WeakValueDictionary 18642 when collecting from another thread. 18643 18644- bpo-28923: Remove editor artifacts from Tix.py. 18645 18646- bpo-28871: Fixed a crash when deallocate deep ElementTree. 18647 18648- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and 18649 WeakValueDictionary.pop() when a GC collection happens in another thread. 18650 18651- bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence 18652 that doesn't own its elements as limits. 18653 18654- bpo-16255: subprocess.Popen uses /system/bin/sh on Android as the shell, 18655 instead of /bin/sh. 18656 18657- bpo-28779: multiprocessing.set_forkserver_preload() would crash the 18658 forkserver process if a preloaded module instantiated some multiprocessing 18659 objects such as locks. 18660 18661- bpo-26937: The chown() method of the tarfile.TarFile class does not fail 18662 now when the grp module cannot be imported, as for example on Android 18663 platforms. 18664 18665- bpo-28847: dbm.dumb now supports reading read-only files and no longer 18666 writes the index file when it is not changed. A deprecation warning is 18667 now emitted if the index file is missed and recreated in the 'r' and 'w' 18668 modes (will be an error in future Python releases). 18669 18670- bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in 18671 re.sub() replacement templates regular expressions now are errors. 18672 18673- bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call 18674 warnings.showwarning() if it was overridden inside the context manager. 18675 18676- bpo-27172: To assist with upgrades from 2.7, the previously documented 18677 deprecation of ``inspect.getfullargspec()`` has been reversed. This 18678 decision may be revisited again after the Python 2.7 branch is no longer 18679 officially supported. 18680 18681- bpo-28740: Add sys.getandroidapilevel(): return the build time API version 18682 of Android as an integer. Function only available on Android. 18683 18684- bpo-26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and 18685 :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by 18686 Omar Sandoval. 18687 18688- bpo-28752: Restored the __reduce__() methods of datetime objects. 18689 18690- bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created 18691 by re.compile(), become comparable (only x==y and x!=y operators). This 18692 change should fix the issue #18383: don't duplicate warning filters when 18693 the warnings module is reloaded (thing usually only done in unit tests). 18694 18695- bpo-20572: Remove the subprocess.Popen.wait endtime parameter. It was 18696 deprecated in 3.4 and undocumented prior to that. 18697 18698- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and 18699 from_buffer_copy() methods on abstract classes like Array. 18700 18701- bpo-28548: In the "http.server" module, parse the protocol version if 18702 possible, to avoid using HTTP 0.9 in some error responses. 18703 18704- bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch 18705 by Vajrasky Kok 18706 18707- bpo-28563: Fixed possible DoS and arbitrary code execution when handle 18708 plural form selections in the gettext module. The expression parser now 18709 supports exact syntax supported by GNU gettext. 18710 18711- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the 18712 garbage collector is invoked in other thread. Based on patch by Sebastian 18713 Cufre. 18714 18715- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if 18716 given empty data twice. Patch by Benjamin Fogle. 18717 18718- bpo-28549: Fixed segfault in curses's addch() with ncurses6. 18719 18720- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar 18721 file with compression before trying to open it without compression. 18722 Otherwise it had 50% chance failed with ignore_zeros=True. 18723 18724- bpo-23262: The webbrowser module now supports Firefox 36+ and derived 18725 browsers. Based on patch by Oleg Broytman. 18726 18727- bpo-24241: The webbrowser in an X environment now prefers using the 18728 default browser directly. Also, the webbrowser register() function now has 18729 a documented 'preferred' argument, to specify browsers to be returned by 18730 get() with no arguments. Patch by David Steele 18731 18732- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused 18733 by representing the scale as float value internally in Tk. tkinter.IntVar 18734 now works if float value is set to underlying Tk variable. 18735 18736- bpo-28255: calendar.TextCalendar.prweek() no longer prints a space after a 18737 weeks's calendar. calendar.TextCalendar.pryear() no longer prints 18738 redundant newline after a year's calendar. Based on patch by Xiang Zhang. 18739 18740- bpo-28255: calendar.TextCalendar.prmonth() no longer prints a space at the 18741 start of new line after printing a month's calendar. Patch by Xiang 18742 Zhang. 18743 18744- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. 18745 Based on patch by Kaarle Ritvanen. 18746 18747- bpo-28353: os.fwalk() no longer fails on broken links. 18748 18749- bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept 18750 non-None value is passed to it.send(val). 18751 18752- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix 18753 for readability. 18754 18755- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a 18756 workaround to Tix library bug. 18757 18758- bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive. 18759 18760- bpo-25953: re.sub() now raises an error for invalid numerical group 18761 reference in replacement template even if the pattern is not found in the 18762 string. Error message for invalid group reference now includes the group 18763 index and the position of the reference. Based on patch by SilentGhost. 18764 18765- bpo-28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead of 18766 1, 10, 100,... for autoranging. 18767 18768- bpo-28115: Command-line interface of the zipfile module now uses argparse. 18769 Added support of long options. 18770 18771- bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by 18772 Mariatta Wijaya. 18773 18774- bpo-28448: Fix C implemented asyncio.Future didn't work on Windows. 18775 18776- bpo-23214: In the "io" module, the argument to BufferedReader and 18777 BytesIO's read1() methods is now optional and can be -1, matching the 18778 BufferedIOBase specification. 18779 18780- bpo-28480: Fix error building socket module when multithreading is 18781 disabled. 18782 18783- bpo-28240: timeit: remove ``-c/--clock`` and ``-t/--time`` command line 18784 options which were deprecated since Python 3.3. 18785 18786- bpo-28240: timeit now repeats the benchmarks 5 times instead of only 3 to 18787 make benchmarks more reliable. 18788 18789- bpo-28240: timeit autorange now uses a single loop iteration if the 18790 benchmark takes less than 10 seconds, instead of 10 iterations. "python3 18791 -m timeit -s 'import time' 'time.sleep(1)'" now takes 4 seconds instead of 18792 40 seconds. 18793 18794- Distutils.sdist now looks for README and setup.py files with case 18795 sensitivity. This behavior matches that found in Setuptools 6.0 and later. 18796 See `setuptools 100 <https://github.com/pypa/setuptools/issues/100>`_ for 18797 rationale. 18798 18799- bpo-24452: Make webbrowser support Chrome on Mac OS X. Patch by Ned 18800 Batchelder. 18801 18802- bpo-20766: Fix references leaked by pdb in the handling of SIGINT 18803 handlers. 18804 18805- bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by 18806 Eryk Sun. 18807 18808- bpo-28317: The disassembler now decodes FORMAT_VALUE argument. 18809 18810- bpo-28380: unittest.mock Mock autospec functions now properly support 18811 assert_called, assert_not_called, and assert_called_once. 18812 18813- bpo-28229: lzma module now supports pathlib. 18814 18815- bpo-28321: Fixed writing non-BMP characters with binary format in 18816 plistlib. 18817 18818- bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan 18819 Furman. 18820 18821- bpo-28227: gzip now supports pathlib. Patch by Ethan Furman. 18822 18823- bpo-28332: Deprecated silent truncations in socket.htons and socket.ntohs. 18824 Original patch by Oren Milman. 18825 18826- bpo-27358: Optimized merging var-keyword arguments and improved error 18827 message when passing a non-mapping as a var-keyword argument. 18828 18829- bpo-28257: Improved error message when passing a non-iterable as a 18830 var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. 18831 18832- bpo-28322: Fixed possible crashes when unpickle itertools objects from 18833 incorrect pickle data. Based on patch by John Leitch. 18834 18835- bpo-28228: imghdr now supports pathlib. 18836 18837- bpo-28226: compileall now supports pathlib. 18838 18839- bpo-28314: Fix function declaration (C flags) for the getiterator() method 18840 of xml.etree.ElementTree.Element. 18841 18842- bpo-28148: Stop using localtime() and gmtime() in the time module. 18843 Introduced platform independent _PyTime_localtime API that is similar to 18844 POSIX localtime_r, but available on all platforms. Patch by Ed Schouten. 18845 18846- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 18847 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so 18848 that they don't call itermonthdates() which can cause datetime.date 18849 under/overflow. 18850 18851- bpo-28275: Fixed possible use after free in the decompress() methods of 18852 the LZMADecompressor and BZ2Decompressor classes. Original patch by John 18853 Leitch. 18854 18855- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() 18856 if pass invalid string-like object as a name. Patch by Xiang Zhang. 18857 18858- bpo-18844: random.choices() now has k as a keyword-only argument to 18859 improve the readability of common cases and come into line with the 18860 signature used in other languages. 18861 18862- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. 18863 Patch by Madison May. 18864 18865- bpo-27611: Fixed support of default root window in the tkinter.tix module. 18866 Added the master parameter in the DisplayStyle constructor. 18867 18868- bpo-27348: In the traceback module, restore the formatting of exception 18869 messages like "Exception: None". This fixes a regression introduced in 18870 3.5a2. 18871 18872- bpo-25651: Allow falsy values to be used for msg parameter of subTest(). 18873 18874- bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is 18875 interrupted by a signal and a signal handler raises a Python exception. 18876 18877- bpo-28200: Fix memory leak on Windows in the os module (fix 18878 path_converter() function). 18879 18880- bpo-25400: RobotFileParser now correctly returns default values for 18881 crawl_delay and request_rate. Initial patch by Peter Wirtz. 18882 18883- bpo-27932: Prevent memory leak in win32_ver(). 18884 18885- Fix UnboundLocalError in socket._sendfile_use_sendfile. 18886 18887- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of 18888 os.stat(). Patch by Eryk Sun. 18889 18890- bpo-22493: Warning message emitted by using inline flags in the middle of 18891 regular expression now contains a (truncated) regex pattern. Patch by Tim 18892 Graham. 18893 18894- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an 18895 empty bytestring is passed. 18896 18897- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. 18898 18899- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by 18900 Gergely Imreh and Markus Holtermann. 18901 18902- bpo-28114: Fix a crash in parse_envlist() when env contains byte strings. 18903 Patch by Eryk Sun. 18904 18905- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and 18906 binascii.a2b_qp(). 18907 18908- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by 18909 Kevin Conway. 18910 18911- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by 18912 Seth Michael Larson. 18913 18914- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by 18915 iceboy. 18916 18917- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki. 18918 18919- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect. 18920 18921- bpo-27759: Fix selectors incorrectly retain invalid file descriptors. 18922 Patch by Mark Williams. 18923 18924- bpo-28325: Remove vestigial MacOS 9 macurl2path module and its tests. 18925 18926- bpo-28368: Refuse monitoring processes if the child watcher has no loop 18927 attached. Patch by Vincent Michel. 18928 18929- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader, 18930 add_writer, etc. 18931 18932- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг 18933 Марк. 18934 18935- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor. 18936 18937- bpo-28372: Fix asyncio to support formatting of non-python coroutines. 18938 18939- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг 18940 Марк. 18941 18942- bpo-27972: Prohibit Tasks to await on themselves. 18943 18944- bpo-24142: Reading a corrupt config file left configparser in an invalid 18945 state. Original patch by Florian Höch. 18946 18947- bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract 18948 base classes to use keyword parameters in __init_subclass__. Patch by Nate 18949 Soares. 18950 18951- bpo-25532: inspect.unwrap() will now only try to unwrap an object 18952 sys.getrecursionlimit() times, to protect against objects which create a 18953 new object on every attribute access. 18954 18955- bpo-30177: path.resolve(strict=False) no longer cuts the path after the 18956 first element not present in the filesystem. Patch by Antoine Pietri. 18957 18958Documentation 18959------------- 18960 18961- bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and 18962 ZeroMQSocketHandler examples and adapt them to Python 3. 18963 18964- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL 18965 documentation. 18966 18967- bpo-31128: Allow the pydoc server to bind to arbitrary hostnames. 18968 18969- bpo-30803: Clarify doc on truth value testing. Original patch by Peter 18970 Thomassen. 18971 18972- bpo-30176: Add missing attribute related constants in curses 18973 documentation. 18974 18975- bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are 18976 now their respective type definitions, rather than the corresponding 18977 builtin function entries. Use :ref:`bytes <func-bytes>` and 18978 :ref:`bytearray <func-bytearray>` to reference the latter. In order to 18979 ensure this and future cross-reference updates are applied automatically, 18980 the daily documentation builds now disable the default output caching 18981 features in Sphinx. 18982 18983- bpo-26985: Add missing info of code object in inspect documentation. 18984 18985- bpo-19824: Improve the documentation for, and links to, template strings 18986 by emphasizing their utility for internationalization, and by clarifying 18987 some usage constraints. (See also: bpo-20314, bpo-12518) 18988 18989- bpo-28929: Link the documentation to its source file on GitHub. 18990 18991- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer 18992 to aiosmtpd, a third-party asyncio-based replacement. 18993 18994- bpo-26355: Add canonical header link on each page to corresponding major 18995 version of the documentation. Patch by Matthias Bussonnier. 18996 18997- bpo-29349: Fix Python 2 syntax in code for building the documentation. 18998 18999- bpo-23722: The data model reference and the porting section in the 3.6 19000 What's New guide now cover the additional ``__classcell__`` handling 19001 needed for custom metaclasses to fully support :pep:`487` and 19002 zero-argument ``super()``. 19003 19004- bpo-28513: Documented command-line interface of zipfile. 19005 19006Tests 19007----- 19008 19009- bpo-29639: test.support.HOST is now "localhost", a new HOSTv4 constant has 19010 been added for your ``127.0.0.1`` needs, similar to the existing HOSTv6 19011 constant. 19012 19013- bpo-31320: Silence traceback in test_ssl 19014 19015- bpo-31346: Prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER protocols 19016 for SSLContext. 19017 19018- bpo-25674: Remove sha256.tbs-internet.com ssl test 19019 19020- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest 19021 version behaves like OpenSSL 1.0.2 and no longer aborts handshake. 19022 19023- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the 19024 test suite using --use=all / -u all, exclude tzdata since it makes 19025 test_datetime too slow (15-20 min on some buildbots) which then times out 19026 on some buildbots. Fix also regrtest command line parser to allow passing 19027 -u extralargefile to run test_zipfile64. 19028 19029- bpo-30695: Add the `set_nomemory(start, stop)` and `remove_mem_hooks()` 19030 functions to the _testcapi module. 19031 19032- bpo-30357: test_thread: setUp() now uses support.threading_setup() and 19033 support.threading_cleanup() to wait until threads complete to avoid random 19034 side effects on following tests. Initial patch written by Grzegorz 19035 Grzywacz. 19036 19037- bpo-30197: Enhanced functions swap_attr() and swap_item() in the 19038 test.support module. They now work when delete replaced attribute or item 19039 inside the with statement. The old value of the attribute or item (or 19040 None if it doesn't exist) now will be assigned to the target of the "as" 19041 clause, if there is one. 19042 19043- bpo-24932: Use proper command line parsing in _testembed 19044 19045- bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line 19046 arguments. 19047 19048- bpo-28683: Fix the tests that bind() a unix socket and raise 19049 PermissionError on Android for a non-root user. 19050 19051- bpo-26936: Fix the test_socket failures on Android - getservbyname(), 19052 getservbyport() and getaddrinfo() are broken on some Android API levels. 19053 19054- bpo-28666: Now test.support.rmtree is able to remove unwritable or 19055 unreadable directories. 19056 19057- bpo-23839: Various caches now are cleared before running every test file. 19058 19059- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or 19060 missing the effective gid. 19061 19062- bpo-28409: regrtest: fix the parser of command line arguments. 19063 19064- bpo-28217: Adds _testconsole module to test console input. 19065 19066- bpo-26939: Add the support.setswitchinterval() function to fix 19067 test_functools hanging on the Android armv7 qemu emulator. 19068 19069Build 19070----- 19071 19072- bpo-31354: Allow --with-lto to be used on all builds, not just `make 19073 profile-opt`. 19074 19075- bpo-31370: Remove support for building --without-threads. This option is 19076 not really useful anymore in the 21st century. Removing lots of 19077 conditional paths allows us to simplify the code base, including in 19078 difficult to maintain low-level internal code. 19079 19080- bpo-31341: Per :pep:`11`, support for the IRIX operating system was 19081 removed. 19082 19083- bpo-30854: Fix compile error when compiling --without-threads. Patch by 19084 Masayuki Yamamoto. 19085 19086- bpo-30687: Locate msbuild.exe on Windows when building rather than 19087 vcvarsall.bat 19088 19089- bpo-20210: Support the *disabled* marker in Setup files. Extension modules 19090 listed after this marker are not built at all, neither by the Makefile nor 19091 by setup.py. 19092 19093- bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C 19094 ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies 19095 ``--with-assertions``. 19096 19097- bpo-28787: Fix out-of-tree builds of Python when configured with 19098 ``--with--dtrace``. 19099 19100- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``, 19101 ``make install`` and some other make targets when configured with 19102 ``--enable-optimizations``. 19103 19104- bpo-23404: Don't regenerate generated files based on file modification 19105 time anymore: the action is now explicit. Replace ``make touch`` with 19106 ``make regen-all``. 19107 19108- bpo-29643: Fix ``--enable-optimization`` didn't work. 19109 19110- bpo-27593: sys.version and the platform module python_build(), 19111 python_branch(), and python_revision() functions now use git information 19112 rather than hg when building from a repo. 19113 19114- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k. 19115 19116- bpo-27659: Prohibit implicit C function declarations: use 19117 ``-Werror=implicit-function-declaration`` when possible (GCC and Clang, 19118 but it depends on the compiler version). Patch written by Chi Hsuan Yen. 19119 19120- bpo-29384: Remove old Be OS helper scripts. 19121 19122- bpo-26851: Set Android compilation and link flags. 19123 19124- bpo-28768: Fix implicit declaration of function _setmode. Patch by 19125 Masayuki Yamamoto 19126 19127- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat 19128 19129- bpo-23903: Added missed names to PC/python3.def. 19130 19131- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK 19132 macro is not defined in android-ndk-r13. 19133 19134- bpo-28538: Fix the compilation error that occurs because if_nameindex() is 19135 available on Android API level 24, but the if_nameindex structure is not 19136 defined. 19137 19138- bpo-20211: Do not add the directory for installing C header files and the 19139 directory for installing object code libraries to the cross compilation 19140 search paths. Original patch by Thomas Petazzoni. 19141 19142- bpo-28849: Do not define sys.implementation._multiarch on Android. 19143 19144- bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and 19145 Michael Haubenwallner. 19146 19147- bpo-26359: Rename --with-optimiations to --enable-optimizations. 19148 19149- bpo-28444: Fix missing extensions modules when cross compiling. 19150 19151- bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2. 19152 19153- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. 19154 19155- bpo-21124: Fix building the _struct module on Cygwin by passing ``NULL`` 19156 instead of ``&PyType_Type`` to PyVarObject_HEAD_INIT. Patch by Masayuki 19157 Yamamoto. 19158 19159- bpo-13756: Fix building extensions modules on Cygwin. Patch by Roumen 19160 Petrov, based on original patch by Jason Tishler. 19161 19162- bpo-21085: Add configure check for siginfo_t.si_band, which Cygwin does 19163 not provide. Patch by Masayuki Yamamoto with review and rebase by Erik 19164 Bray. 19165 19166- bpo-28258: Fixed build with Estonian locale (python-config and distclean 19167 targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. 19168 19169- bpo-26661: setup.py now detects system libffi with multiarch wrapper. 19170 19171- bpo-27979: A full copy of libffi is no longer bundled for use when 19172 building _ctypes on non-OSX UNIX platforms. An installed copy of libffi 19173 is now required when building _ctypes on such platforms. 19174 19175- bpo-15819: Remove redundant include search directory option for building 19176 outside the source tree. 19177 19178- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS. 19179 Patch by Gareth Rees. 19180 19181Windows 19182------- 19183 19184- bpo-31392: Update Windows build to use OpenSSL 1.1.0f 19185 19186- bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows. 19187 19188- bpo-31358: zlib is no longer bundled in the CPython source, instead it is 19189 downloaded on demand just like bz2, lzma, OpenSSL, Tcl/Tk, and SQLite. 19190 19191- bpo-31340: Change to building with MSVC v141 (included with Visual Studio 19192 2017) 19193 19194- bpo-30581: os.cpu_count() now returns the correct number of processors on 19195 Windows when the number of logical processors is greater than 64. 19196 19197- bpo-30916: Pre-build OpenSSL, Tcl and Tk and include the binaries in the 19198 build. 19199 19200- bpo-30731: Add a missing xmlns to python.manifest so that it matches the 19201 schema. 19202 19203- bpo-30291: Allow requiring 64-bit interpreters from py.exe using -64 19204 suffix. Contributed by Steve (Gadget) Barnes. 19205 19206- bpo-30362: Adds list options (-0, -0p) to py.exe launcher. Contributed by 19207 Steve Barnes. 19208 19209- bpo-23451: Fix socket deprecation warnings in socketmodule.c. Patch by 19210 Segev Finer. 19211 19212- bpo-30450: The build process on Windows no longer depends on Subversion, 19213 instead pulling external code from GitHub via a Python script. If Python 19214 3.6 is not found on the system (via ``py -3.6``), NuGet is used to 19215 download a copy of 32-bit Python. 19216 19217- bpo-29579: Removes readme.txt from the installer. 19218 19219- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun) 19220 19221- bpo-28896: Deprecate WindowsRegistryFinder and disable it by default 19222 19223- bpo-28522: Fixes mishandled buffer reallocation in getpathp.c 19224 19225- bpo-28402: Adds signed catalog files for stdlib on Windows. 19226 19227- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk 19228 Sun) 19229 19230- bpo-28251: Improvements to help manuals on Windows. 19231 19232- bpo-28110: launcher.msi has different product codes between 32-bit and 19233 64-bit 19234 19235- bpo-28161: Opening CON for write access fails 19236 19237- bpo-28162: WindowsConsoleIO readall() fails if first line starts with 19238 Ctrl+Z 19239 19240- bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle 19241 19242- bpo-28164: _PyIO_get_console_type fails for various paths 19243 19244- bpo-28137: Renames Windows path file to ._pth 19245 19246- bpo-28138: Windows ._pth file should allow import site 19247 19248IDLE 19249---- 19250 19251- bpo-31493: IDLE code context -- fix code update and font update timers. 19252 Canceling timers prevents a warning message when test_idle completes. 19253 19254- bpo-31488: IDLE - Update non-key options in former extension classes. When 19255 applying configdialog changes, call .reload for each feature class. Change 19256 ParenMatch so updated options affect existing instances attached to 19257 existing editor windows. 19258 19259- bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace 19260 strips more than blank spaces. Multiline string literals are not skipped. 19261 19262- bpo-31480: IDLE - make tests pass with zzdummy extension disabled by 19263 default. 19264 19265- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk 19266 update in the background in order to make live interaction and 19267 experimentation with tkinter applications much easier. 19268 19269- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an 19270 int entry is not the same as deleting and inserting because int('') will 19271 fail. 19272 19273- bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and 19274 Help sections. 19275 19276- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor. 19277 Move some data and functions from the class to module level. Patch by 19278 Cheryl Sabella. 19279 19280- bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog. 19281 19282- bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About 19283 10 IDLE features were implemented as supposedly optional extensions. Their 19284 different behavior could be confusing or worse for users and not good for 19285 maintenance. Hence the conversion. The main difference for users is that 19286 user configurable key bindings for builtin features are now handled 19287 uniformly. Now, editing a binding in a keyset only affects its value in 19288 the keyset. All bindings are defined together in the system-specific 19289 default keysets in config-extensions.def. All custom keysets are saved as 19290 a whole in config-extension.cfg. All take effect as soon as one clicks 19291 Apply or Ok. The affected events are '<<force-open-completions>>', 19292 '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', 19293 '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and 19294 '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not 19295 affect their keyset-specific customization after 3.6.3. and vice versa. 19296 Initial patch by Charles Wohlganger. 19297 19298- bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by 19299 Cheryl Sabella. 19300 19301- bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl 19302 Sabella. 19303 19304- bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The 19305 slightly modified tests continue to pass. Patch by Cheryl Sabella. 19306 19307- bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by 19308 Victor Stinner. 19309 19310- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella. 19311 19312- bpo-19903: IDLE: Calltips use `inspect.signature` instead of 19313 `inspect.getfullargspec`. This improves calltips for builtins converted to 19314 use Argument Clinic. Patch by Louie Lu. 19315 19316- bpo-31083: IDLE - Add an outline of a TabPage class in configdialog. 19317 Update existing classes to match outline. Initial patch by Cheryl Sabella. 19318 19319- bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly 19320 modified tests continue to pass. Patch by Cheryl Sabella. 19321 19322- bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly 19323 modified tests continue to pass. Fix General tests. Patch mostly by Cheryl 19324 Sabella. 19325 19326- bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan 19327 Reedy and Cheryl Sabella. 19328 19329- bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping 19330 methods pertaining to each tab and the buttons will aid writing tests and 19331 improving the tabs and will enable splitting the groups into classes. 19332 19333- bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance 19334 tracers manages pairs consisting of a tk variable and a callback function. 19335 When tracing is turned on, setting the variable calls the function. Test 19336 coverage for the new class is 100%. 19337 19338- bpo-31003: IDLE: Add more tests for General tab. 19339 19340- bpo-30993: IDLE - Improve configdialog font page and tests. In 19341 configdialog: Document causal pathways in create_font_tab docstring. 19342 Simplify some attribute names. Move set_samples calls to var_changed_font 19343 (idea from Cheryl Sabella). Move related functions to positions after the 19344 create widgets function. In test_configdialog: Fix test_font_set so not 19345 order dependent. Fix renamed test_indent_scale so it tests the widget. 19346 Adjust tests for movement of set_samples call. Add tests for load 19347 functions. Put all font tests in one class and tab indent tests in 19348 another. Except for two lines, these tests completely cover the related 19349 functions. 19350 19351- bpo-30981: IDLE -- Add more configdialog font page tests. 19352 19353- bpo-28523: IDLE: replace 'colour' with 'color' in configdialog. 19354 19355- bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from 19356 46% to 96%. Patch by Louie Lu. 19357 19358- bpo-30934: Document coverage details for idlelib tests. Add section to 19359 idlelib/idle-test/README.txt. Include check that branches are taken both 19360 ways. Exclude IDLE-specific code that does not run during unit tests. 19361 19362- bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in 19363 docstrings This will facilitate improving the dialog and splitting up the 19364 class. Original patch by Cheryl Sabella. 19365 19366- bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by 19367 Louie Lu. 19368 19369- bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella. 19370 19371- bpo-30851: IDLE: Remove unused variables in configdialog. One is a 19372 duplicate, one is set but cannot be altered by users. Patch by Cheryl 19373 Sabella. 19374 19375- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as 19376 well as mouse. Initial patch by Louie Lu. 19377 19378- bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once. 19379 19380- bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in 19381 config; test. * In config, put dump test code in a function; run it and 19382 unittest in 'if __name__ == '__main__'. * Add class config.ConfigChanges 19383 based on changes_class_v4.py on bpo issue. * Add class 19384 test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise 19385 configdialog to use ConfigChanges; see tracker msg297804. * Revise 19386 test_configdialog to match configdialog changes. * Remove configdialog 19387 functions unused or moved to ConfigChanges. Cheryl Sabella contributed 19388 parts of the patch. 19389 19390- bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by 19391 Cheryl Sabella. 19392 19393- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more 19394 tests. Patch by Cheryl Sabella. 19395 19396- bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens' 19397 style to highlight both opener and closer. Make 'default' style, which is 19398 not default, a synonym for 'opener'. Make time-delay work the same with 19399 all styles. Add help for config dialog extensions tab, including help for 19400 parenmatch. Add new tests. Original patch by Charles Wohlganger. 19401 19402- bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella 19403 19404- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates 19405 properly. Original patch by Saimadhav Heblikar. 19406 19407- bpo-29910: IDLE no longer deletes a character after commenting out a 19408 region by a key shortcut. Add ``return 'break'`` for this and other 19409 potential conflicts between IDLE and default key bindings. 19410 19411- bpo-30728: Review and change idlelib.configdialog names. Lowercase method 19412 and attribute names. Replace 'colour' with 'color', expand overly cryptic 19413 names, delete unneeded underscores. Replace ``import *`` with specific 19414 imports. Patches by Cheryl Sabella. 19415 19416- bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them 19417 with tk. Add tests for all 3 validation functions. Original patch by G 19418 Polo. Tests added by Cheryl Sabella. 19419 19420- bpo-15786: Fix several problems with IDLE's autocompletion box. The 19421 following should now work: clicking on selection box items; using the 19422 scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no 19423 longer happen. Patch by Louie Lu. 19424 19425- bpo-25514: Add doc subsubsection about IDLE failure to start. Popup 19426 no-connection message directs users to this section. 19427 19428- bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and 19429 Terry Jan Reedy. 19430 19431- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by 19432 Cheryl Sabella and Terry Jan Reedy. 19433 19434- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to 19435 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy. 19436 19437- bpo-30303: Add _utest option to textview; add new tests. Increase coverage 19438 to 100%. Patches by Louie Lu and Terry Jan Reedy. 19439 19440- bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes). 19441 19442- bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and 19443 augment description of the configuration system. 19444 19445Tools/Demos 19446----------- 19447 19448- bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared 19449 builds now, too. :pep:`523` introduced _PyEval_EvalFrameDefault which 19450 inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the 19451 ability to use py-bt, py-up, and a few other Python-specific gdb 19452 integrations. The problem is fixed by only looking for 19453 _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno 19454 "Polaco" Penteado. 19455 19456- bpo-29748: Added the slice index converter in Argument Clinic. 19457 19458- bpo-24037: Argument Clinic now uses the converter `bool(accept={int})` 19459 rather than `int` for semantical booleans. This avoids repeating the 19460 default value for Python and C and will help in converting to `bool` in 19461 future. 19462 19463- bpo-29367: python-gdb.py now supports also ``method-wrapper`` 19464 (``wrapperobject``) objects. 19465 19466- bpo-28023: Fix python-gdb.py didn't support new dict implementation. 19467 19468- bpo-15369: The pybench and pystone microbenchmark have been removed from 19469 Tools. Please use the new Python benchmark suite 19470 https://github.com/python/performance which is more reliable and includes 19471 a portable version of pybench working on Python 2 and Python 3. 19472 19473- bpo-28102: The zipfile module CLI now prints usage to stderr. Patch by 19474 Stephen J. Turnbull. 19475 19476C API 19477----- 19478 19479- bpo-31338: Added the ``Py_UNREACHABLE()`` macro for code paths which are 19480 never expected to be reached. This and a few other useful macros are now 19481 documented in the C API manual. 19482 19483- bpo-30832: Remove own implementation for thread-local storage. CPython has 19484 provided the own implementation for thread-local storage (TLS) on 19485 Python/thread.c, it's used in the case which a platform has not supplied 19486 native TLS. However, currently all supported platforms (Windows and 19487 pthreads) have provided native TLS and defined the Py_HAVE_NATIVE_TLS 19488 macro with unconditional in any case. 19489 19490- bpo-30708: PyUnicode_AsWideCharString() now raises a ValueError if the 19491 second argument is NULL and the wchar_t\* string contains null characters. 19492 19493- bpo-16500: Deprecate PyOS_AfterFork() and add PyOS_BeforeFork(), 19494 PyOS_AfterFork_Parent() and PyOS_AfterFork_Child(). 19495 19496- bpo-6532: The type of results of PyThread_start_new_thread() and 19497 PyThread_get_thread_ident(), and the id parameter of 19498 PyThreadState_SetAsyncExc() changed from "long" to "unsigned long". 19499 19500- bpo-27867: Function PySlice_GetIndicesEx() is deprecated and replaced with 19501 a macro if Py_LIMITED_API is not set or set to the value between 19502 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher. Added 19503 functions PySlice_Unpack() and PySlice_AdjustIndices(). 19504 19505- bpo-29083: Fixed the declaration of some public API functions. 19506 PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in 19507 limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and 19508 Py_BuildValue() were not available in limited API of version < 3.3 when 19509 PY_SSIZE_T_CLEAN is defined. 19510 19511- bpo-28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8() 19512 is now of type ``const char *`` rather of ``char *``. 19513 19514- bpo-29058: All stable API extensions added after Python 3.2 are now 19515 available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of 19516 the minimum Python version supporting this API. 19517 19518- bpo-28822: The index parameters *start* and *end* of PyUnicode_FindChar() 19519 are now adjusted to behave like ``str[start:end]``. 19520 19521- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 19522 19523- bpo-28761: The fields name and doc of structures PyMemberDef, PyGetSetDef, 19524 PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of 19525 type ``const char *`` rather of ``char *``. 19526 19527- bpo-28748: Private variable _Py_PackageContext is now of type ``const char 19528 *`` rather of ``char *``. 19529 19530- bpo-19569: Compiler warnings are now emitted if use most of deprecated 19531 functions. 19532 19533- bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(), 19534 PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and 19535 PyUnicode_AsEncodedUnicode(). 19536 19537 19538What's New in Python 3.6.6 final? 19539================================= 19540 19541*Release date: 2018-06-27* 19542 19543There were no new changes in version 3.6.6. 19544 19545 19546 19547What's New in Python 3.6.6 release candidate 1? 19548=============================================== 19549 19550*Release date: 2018-06-11* 19551 19552Core and Builtins 19553----------------- 19554 19555- bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 19556 correctly 19557 19558- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter 19559 shutdown even when there was a custom handler set previously. Patch by 19560 Philipp Kerling. 19561 19562- bpo-33622: Fixed a leak when the garbage collector fails to add an object 19563 with the ``__del__`` method or referenced by it into the 19564 :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an 19565 exception is set and preserves it. 19566 19567- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c. 19568 19569- bpo-33391: Fix a leak in set_symmetric_difference(). 19570 19571- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer. 19572 19573- bpo-33231: Fix potential memory leak in ``normalizestring()``. 19574 19575- bpo-29922: Improved error messages in 'async with' when ``__aenter__()`` 19576 or ``__aexit__()`` return non-awaitable object. 19577 19578- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized 19579 when copying from key-sharing dict. 19580 19581- bpo-33041: Fixed jumping when the function contains an ``async for`` loop. 19582 19583- bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in 19584 socketmodule on Windows. 19585 19586- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a 19587 ctypes structured data type. Patch by Eryk Sun and Oren Milman. 19588 19589Library 19590------- 19591 19592- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by 19593 Steve Weber. 19594 19595- bpo-33812: Datetime instance d with non-None tzinfo, but with 19596 d.tzinfo.utcoffset(d) returning None is now treated as naive by the 19597 astimezone() method. 19598 19599- bpo-30805: Avoid race condition with debug logging 19600 19601- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence 19602 operations now raise :exc:`TypeError` instead of :exc:`SystemError` when 19603 performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz. 19604 19605- bpo-32684: Fix gather to propagate cancellation of itself even with 19606 return_exceptions. 19607 19608- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of 19609 asyncio.sslproto: start immediately the handshake instead of using 19610 call_soon(). Previously, data_received() could be called before the 19611 handshake started, causing the handshake to hang or fail. 19612 19613- bpo-31647: Fixed bug where calling write_eof() on a 19614 _SelectorSocketTransport after it's already closed raises AttributeError. 19615 19616- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines 19617 19618- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor 19619 19620- bpo-11874: Use a better regex when breaking usage into wrappable parts. 19621 Avoids bogus assertion errors from custom metavar strings. 19622 19623- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder 19624 that prevented the cache of parsed strings from clearing after finishing 19625 the decoding. Based on patch by c-fos. 19626 19627- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP 19628 locations 19629 19630- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on 19631 Windows. Patch by Zvi Effron 19632 19633- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in 19634 Windows proactor event loop. 19635 19636- bpo-28556: Minor fixes in typing module: add annotations to 19637 ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in 19638 ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova. 19639 19640- bpo-20087: Updated alias mapping with glibc 2.27 supported locales. 19641 19642- bpo-33422: Fix trailing quotation marks getting deleted when looking up 19643 byte/string literals on pydoc. Patch by Andrés Delfino. 19644 19645- bpo-33197: Update error message when constructing invalid 19646 inspect.Parameters Patch by Dong-hee Na. 19647 19648- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database 19649 object when it is called with a single argument. 19650 19651- bpo-33329: Fix multiprocessing regression on newer glibcs 19652 19653- bpo-991266: Fix quoting of the ``Comment`` attribute of 19654 :class:`http.cookies.SimpleCookie`. 19655 19656- bpo-33131: Upgrade bundled version of pip to 10.0.1. 19657 19658- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST 19659 object to a tree of tuples or lists with ``line_info=False`` and 19660 ``col_info=True``. 19661 19662- bpo-33263: Fix FD leak in `_SelectorSocketTransport` Patch by Vlad 19663 Starostin. 19664 19665- bpo-33256: Fix display of ``<module>`` call in the html produced by 19666 ``cgitb.html()``. Patch by Stéphane Blondon. 19667 19668- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty 19669 sequences consistently even when called from subclasses without a 19670 ``getrandbits()`` implementation. 19671 19672- bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught 19673 StopIteration in a generator into a return-statement. 19674 19675- bpo-33209: End framing at the end of C implementation of 19676 :func:`pickle.Pickler.dump`. 19677 19678- bpo-32861: The urllib.robotparser's ``__str__`` representation now 19679 includes wildcard entries and the "Crawl-delay" and "Request-rate" fields. 19680 Patch by Michael Lazar. 19681 19682- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false 19683 boolean value. Note iid=0 and iid=False would be same. Patch by Garvit 19684 Khatri. 19685 19686- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1. 19687 19688- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all 19689 threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch 19690 by Nir Soffer. 19691 19692- bpo-27683: Fix a regression in :mod:`ipaddress` that result of 19693 :meth:`hosts` is empty when the network is constructed by a tuple 19694 containing an integer mask and only 1 bit left for addresses. 19695 19696- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in 19697 subprocess if another low descriptor is closed. 19698 19699- bpo-31908: Fix output of cover files for ``trace`` module command-line 19700 tool. Previously emitted cover files only when ``--missing`` option was 19701 used. Patch by Michael Selik. 19702 19703- bpo-31457: If nested log adapters are used, the inner ``process()`` 19704 methods are no longer omitted. 19705 19706- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer. 19707 19708- bpo-31238: pydoc: the stop() method of the private ServerThread class now 19709 waits until DocServer.serve_until_quit() completes and then explicitly 19710 sets its docserver attribute to None to break a reference cycle. 19711 19712Documentation 19713------------- 19714 19715- bpo-33503: Fix broken pypi link 19716 19717- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``. 19718 19719- bpo-33378: Add Korean language switcher for https://docs.python.org/3/ 19720 19721- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be 19722 just any value. 19723 19724- bpo-33201: Modernize documentation for writing C extension types. 19725 19726- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document. 19727 ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is 19728 missed in the document. 19729 19730- bpo-33126: Document PyBuffer_ToContiguous(). 19731 19732- bpo-27212: Modify documentation for the :func:`islice` recipe to consume 19733 initial values up to the start index. 19734 19735- bpo-28247: Update :mod:`zipapp` documentation to describe how to make 19736 standalone applications. 19737 19738- bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and 19739 Berker Peksag. 19740 19741- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder`` 19742 implements ``MetaPathFinder``. (Patch by Himanshu Lakhara) 19743 19744- bpo-8243: Add a note about curses.addch and curses.addstr exception 19745 behavior when writing outside a window, or pad. 19746 19747- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED 19748 flags for ssl.SSLContext.verify_mode. 19749 19750Tests 19751----- 19752 19753- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that 19754 might be due to running on ZFS. 19755 19756- bpo-19417: Add test_bdb.py. 19757 19758Build 19759----- 19760 19761- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from 19762 ``OPT``. This option emitted annoying warnings when building extension 19763 modules written in C++. 19764 19765- bpo-33614: Ensures module definition files for the stable ABI on Windows 19766 are correctly regenerated. 19767 19768- bpo-33522: Enable CI builds on Visual Studio Team Services at 19769 https://python.visualstudio.com/cpython 19770 19771- bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing 19772 warnings about function casts like casting to PyCFunction in method 19773 definition lists. 19774 19775- bpo-33394: Enable the verbose build for extension modules, when GNU make 19776 is passed macros on the command line. 19777 19778Windows 19779------- 19780 19781- bpo-33184: Update Windows installer to OpenSSL 1.0.2o. 19782 19783macOS 19784----- 19785 19786- bpo-33184: Update macOS installer build to use OpenSSL 1.0.2o. 19787 19788IDLE 19789---- 19790 19791- bpo-33656: On Windows, add API call saying that tk scales for DPI. On 19792 Windows 8.1+ or 10, with DPI compatibility properties of the Python binary 19793 unchanged, and a monitor resolution greater than 96 DPI, this should make 19794 text and lines sharper. It should otherwise have no effect. 19795 19796- bpo-33768: Clicking on a context line moves that line to the top of the 19797 editor window. 19798 19799- bpo-33763: IDLE: Use read-only text widget for code context instead of 19800 label widget. 19801 19802- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel 19803 and scrollbar slider moved text by a fixed number of pixels, resulting in 19804 partial lines at the top of the editor box. The change also applies to 19805 the shell and grep output windows, but not to read-only text views. 19806 19807- bpo-33679: Enable theme-specific color configuration for Code Context. Use 19808 the Highlights tab to see the setting for built-in themes or add settings 19809 to custom themes. 19810 19811- bpo-33642: Display up to maxlines non-blank lines for Code Context. If 19812 there is no current context, show a single blank line. 19813 19814- bpo-33628: IDLE: Cleanup codecontext.py and its test. 19815 19816- bpo-33564: IDLE's code context now recognizes async as a block opener. 19817 19818- bpo-29706: IDLE now colors async and await as keywords in 3.6. They become 19819 full keywords in 3.7. 19820 19821- bpo-21474: Update word/identifier definition from ascii to unicode. In 19822 text and entry boxes, this affects selection by double-click, movement 19823 left/right by control-left/right, and deletion left/right by 19824 control-BACKSPACE/DEL. 19825 19826- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string 19827 prefix cannot be paired with either 'r' or 'f'. Consistently color as much 19828 of the prefix, starting at the right, as is valid. Revise and extend 19829 colorizer test. 19830 19831- bpo-32831: Add docstrings and tests for codecontext. 19832 19833Tools/Demos 19834----------- 19835 19836- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as 19837 docstrings and translatable strings, and rejects bytes literals and 19838 f-string expressions. 19839 19840- bpo-31920: Fixed handling directories as arguments in the ``pygettext`` 19841 script. Based on patch by Oleg Krasnikov. 19842 19843- bpo-29673: Fix pystackv and pystack gdbinit macros. 19844 19845- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable 19846 automatic backup creation (files with ``~`` suffix). 19847 19848- bpo-31583: Fix 2to3 for using with --add-suffix option but without 19849 --output-dir option for relative path to files in current directory. 19850 19851C API 19852----- 19853 19854- bpo-32374: Document that m_traverse for multi-phase initialized modules 19855 can be called with m_state=NULL, and add a sanity check 19856 19857 19858What's New in Python 3.6.5 final? 19859================================= 19860 19861*Release date: 2018-03-28* 19862 19863Tests 19864----- 19865 19866- bpo-32872: Avoid regrtest compatibility issue with namespace packages. 19867 19868Build 19869----- 19870 19871- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. 19872 19873 19874What's New in Python 3.6.5 release candidate 1? 19875=============================================== 19876 19877*Release date: 2018-03-13* 19878 19879Security 19880-------- 19881 19882- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows 19883 19884- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic 19885 backtracking. These regexes formed potential DOS vectors (REDOS). They 19886 have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch 19887 by Jamie Davis. 19888 19889Core and Builtins 19890----------------- 19891 19892- bpo-33026: Fixed jumping out of "with" block by setting f_lineno. 19893 19894- bpo-17288: Prevent jumps from 'return' and 'exception' trace events. 19895 19896- bpo-32889: Update Valgrind suppression list to account for the rename of 19897 ``Py_ADDRESS_IN_RANG`` to ``address_in_range``. 19898 19899- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step 19900 over (next command) native coroutines. Patch by Pablo Galindo. 19901 19902- bpo-32685: Improve suggestion when the Python 2 form of print statement is 19903 either present on the same line as the header of a compound statement or 19904 else terminated by a semi-colon instead of a newline. Patch by Nitish 19905 Chandra. 19906 19907- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by 19908 write out-of-bound errors when using customized decode error handlers. 19909 19910- bpo-26163: Improved frozenset() hash to create more distinct hash values 19911 when faced with datasets containing many similar values. 19912 19913- bpo-27169: The ``__debug__`` constant is now optimized out at compile 19914 time. This fixes also bpo-22091. 19915 19916- bpo-32329: ``sys.flags.hash_randomization`` is now properly set to 0 when 19917 hash randomization is turned off by ``PYTHONHASHSEED=0``. 19918 19919- bpo-30416: The optimizer is now protected from spending much time doing 19920 complex calculations and consuming much memory for creating large 19921 constants in constant folding. 19922 19923- bpo-18533: ``repr()`` on a dict containing its own ``values()`` or 19924 ``items()`` no longer raises ``RecursionError``; OrderedDict similarly. 19925 Instead, use ``...``, as for other recursive structures. Patch by Ben 19926 North. 19927 19928- bpo-32028: Leading whitespace is now correctly ignored when generating 19929 suggestions for converting Py2 print statements to Py3 builtin print 19930 function calls. Patch by Sanyam Khurana. 19931 19932- bpo-32137: The repr of deeply nested dict now raises a RecursionError 19933 instead of crashing due to a stack overflow. 19934 19935Library 19936------- 19937 19938- bpo-33064: lib2to3 now properly supports trailing commas after ``*args`` 19939 and ``**kwargs`` in function signatures. 19940 19941- bpo-31804: Avoid failing in multiprocessing.Process if the standard 19942 streams are closed or None at exit. 19943 19944- bpo-33037: Skip sending/receiving data after SSL transport closing. 19945 19946- bpo-30353: Fix ctypes pass-by-value for structs on 64-bit Cygwin/MinGW. 19947 19948- bpo-33009: Fix inspect.signature() for single-parameter partialmethods. 19949 19950- bpo-32969: Expose several missing constants in zlib and fix corresponding 19951 documentation. 19952 19953- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch 19954 by Joffrey Fuhrer. 19955 19956- bpo-30622: The ssl module now detects missing NPN support in LibreSSL. 19957 19958- bpo-32922: dbm.open() now encodes filename with the filesystem encoding 19959 rather than default encoding. 19960 19961- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3`` 19962 syscall exists or not. 19963 19964- bpo-21060: Rewrite confusing message from setup.py upload from "No dist 19965 file created in earlier command" to the more helpful "Must create and 19966 upload files in one command". 19967 19968- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a 19969 :exc:`ValueError` instead of canceling the first scheduled function. 19970 Patch by Cheryl Sabella. 19971 19972- bpo-32852: Make sure sys.argv remains as a list when running trace. 19973 19974- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored 19975 cancellation after notifying and cancelling a conditional lock. Patch by 19976 Bar Harel. 19977 19978- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules. 19979 (Contributed by Oren Milman) 19980 19981- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when 19982 only the last field is quoted. Patch by Jake Davis. 19983 19984- bpo-32394: socket: Remove TCP_FASTOPEN, TCP_KEEPCNT flags on older version 19985 Windows during run-time. 19986 19987- bpo-32777: Fix a rare but potential pre-exec child process deadlock in 19988 subprocess on POSIX systems when marking file descriptors inheritable on 19989 exec in the child process. This bug appears to have been introduced in 19990 3.4. 19991 19992- bpo-32647: The ctypes module used to depend on indirect linking for 19993 dlopen. The shared extension is now explicitly linked against libdl on 19994 platforms with dl. 19995 19996- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring 19997 and locking the same lock multiple times, without it being free. Patch by 19998 Bar Harel. 19999 20000- bpo-32727: Do not include name field in SMTP envelope from address. Patch 20001 by Stéphane Wirtel 20002 20003- bpo-27931: Fix email address header parsing error when the username is an 20004 empty quoted string. Patch by Xiang Zhang. 20005 20006- bpo-32304: distutils' upload command no longer corrupts tar files ending 20007 with a CR byte, and no longer tries to convert CR to CRLF in any of the 20008 upload text fields. 20009 20010- bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware 20011 address is encountered. 20012 20013- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND 20014 chunk is not found. Patch by Zackery Spytz. 20015 20016- bpo-32555: On FreeBSD and Solaris, os.strerror() now always decode the 20017 byte string from the current locale encoding, rather than using 20018 ASCII/surrogateescape in some cases. 20019 20020- bpo-32521: The nis module is now compatible with new libnsl and headers 20021 location. 20022 20023- bpo-32473: Improve ABCMeta._dump_registry() output readability 20024 20025- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and 20026 library in nis module. 20027 20028- bpo-32228: Ensure that ``truncate()`` preserves the file position (as 20029 reported by ``tell()``) after writes longer than the buffer size. 20030 20031- bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on 20032 interpreter shutdown. 20033 20034- bpo-32185: The SSL module no longer sends IP addresses in SNI TLS 20035 extension on platforms with OpenSSL 1.0.2+ or inet_pton. 20036 20037- bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id 20038 (scope) to lower case for scoped IPv6 addresses in hostnames now. 20039 20040- bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary 20041 compatible with CRT v140. 20042 20043- bpo-32255: A single empty field is now always quoted when written into a 20044 CSV file. This allows to distinguish an empty row from a row consisting of 20045 a single empty field. Patch by Licht Takeuchi. 20046 20047- bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on 20048 platforms where ``chmod(..., follow_symlinks=False)`` is not supported. 20049 Patch by Anthony Sottile. 20050 20051- bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link 20052 list'. 20053 20054- bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner. 20055 20056- bpo-31900: The :func:`locale.localeconv` function now sets temporarily the 20057 ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode 20058 ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII 20059 or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the 20060 ``LC_CTYPE`` locale. This temporary change affects other threads. Same 20061 change for the :meth:`str.format` method when formatting a number 20062 (:class:`int`, :class:`float`, :class:`float` and subclasses) with the 20063 ``n`` type (ex: ``'{:n}'.format(1234)``). 20064 20065- bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now 20066 works even if the ``os`` module still is not imported. 20067 20068Documentation 20069------------- 20070 20071- bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy. 20072 20073- bpo-32800: Update link to w3c doc for xml default namespaces. 20074 20075- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get` 20076 method raises :exc:`AttributeError`. 20077 20078- bpo-32614: Modify RE examples in documentation to use raw strings to 20079 prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight 20080 the deprecation. 20081 20082- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses. 20083 20084- bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and 20085 their C-API counterparts regarding which type of events are received in 20086 each function. Patch by Pablo Galindo Salgado. 20087 20088Tests 20089----- 20090 20091- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport 20092 of ``KqueueSelector`` loop was not being closed. 20093 20094- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built. 20095 20096- bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core 20097 dump files when testing crashes. getrlimit() returns zero on success. 20098 20099- bpo-31518: Debian Unstable has disabled TLS 1.0 and 1.1 for 20100 SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or 20101 PROTOCOL_TLSv1_2 to make them pass on Debian. 20102 20103Build 20104----- 20105 20106- bpo-32635: Fix segfault of the crypt module when libxcrypt is provided 20107 instead of libcrypt at the system. 20108 20109Windows 20110------- 20111 20112- bpo-33016: Fix potential use of uninitialized memory in 20113 nt._getfinalpathname 20114 20115- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current 20116 directory is set to a UNC path. 20117 20118- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. 20119 20120- bpo-32409: Ensures activate.bat can handle Unicode contents. 20121 20122- bpo-32457: Improves handling of denormalized executable path when 20123 launching Python. 20124 20125- bpo-32370: Use the correct encoding for ipconfig output in the uuid 20126 module. Patch by Segev Finer. 20127 20128- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly 20129 treating the ``PrintNameOffset`` field of the reparse data buffer as a 20130 number of characters instead of bytes. Patch by Craig Holmquist and SSE4. 20131 20132- bpo-32588: Create standalone _distutils_findvs module. 20133 20134macOS 20135----- 20136 20137- bpo-32726: Provide an additional, more modern macOS installer variant that 20138 supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied 20139 third-party libraries to OpenSSL 1.0.2n, XZ 5.2.3, and SQLite 3.22.0. The 20140 10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.8. 20141 20142IDLE 20143---- 20144 20145- bpo-32984: Set ``__file__`` while running a startup file. Like Python, 20146 IDLE optionally runs one startup file in the Shell window before 20147 presenting the first interactive input prompt. For IDLE, ``-s`` runs a 20148 file named in environmental variable :envvar:`IDLESTARTUP` or 20149 :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets 20150 ``__file__`` to the startup file name before running the file and unsets 20151 it before the first prompt. IDLE now does the same when run normally, 20152 without the ``-n`` option. 20153 20154- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse. 20155 20156- bpo-32916: Change ``str`` to ``code`` in pyparse. 20157 20158- bpo-32905: Remove unused code in pyparse module. 20159 20160- bpo-32874: Add tests for pyparse. 20161 20162- bpo-32837: Using the system and place-dependent default encoding for 20163 open() is a bad idea for IDLE's system and location-independent files. 20164 20165- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI 20166 test test_file_buttons() only looks at initial ascii-only lines, but 20167 failed on systems where open() defaults to 'ascii' because readline() 20168 internally reads and decodes far enough ahead to encounter a non-ascii 20169 character in CREDITS.txt. 20170 20171- bpo-32765: Update configdialog General tab docstring to add new widgets to 20172 the widget list. 20173 20174Tools/Demos 20175----------- 20176 20177- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using 20178 pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and 20179 lib2to3 work when run from a zipfile. 20180 20181- bpo-32222: Fix pygettext not extracting docstrings for functions with type 20182 annotated arguments. Patch by Toby Harradine. 20183 20184C API 20185----- 20186 20187- bpo-29084: Undocumented C API for OrderedDict has been excluded from the 20188 limited C API. It was added by mistake and actually never worked in the 20189 limited C API. 20190 20191 20192What's New in Python 3.6.4 final? 20193================================= 20194 20195*Release date: 2017-12-18* 20196 20197There were no new code changes in version 3.6.4 since v3.6.4rc1. 20198 20199 20200 20201What's New in Python 3.6.4 release candidate 1? 20202=============================================== 20203 20204*Release date: 2017-12-05* 20205 20206Core and Builtins 20207----------------- 20208 20209- bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code 20210 object constructor based on freevars and cellvars, rather than needing to 20211 be set correctly by the caller. This ensures it will be cleared 20212 automatically when additional cell references are injected into a modified 20213 code object and function. 20214 20215- bpo-31949: Fixed several issues in printing tracebacks 20216 (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now 20217 suppresses printing tracebacks. Setting sys.tracebacklimit to None now 20218 causes using the default limit. Setting sys.tracebacklimit to an integer 20219 larger than LONG_MAX now means using the limit LONG_MAX rather than the 20220 default limit. Fixed integer overflows in the case of more than ``2**31`` 20221 traceback items on Windows. Fixed output errors handling. 20222 20223- bpo-30696: Fix the interactive interpreter looping endlessly when no 20224 memory. 20225 20226- bpo-20047: Bytearray methods partition() and rpartition() now accept only 20227 bytes-like objects as separator, as documented. In particular they now 20228 raise TypeError rather of returning a bogus result when an integer is 20229 passed as a separator. 20230 20231- bpo-31852: Fix a segmentation fault caused by a combination of the async 20232 soft keyword and continuation lines. 20233 20234- bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of 20235 ``__import__()`` or the ``__all__`` attribute of the module contain bytes 20236 instances. 20237 20238- bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in 20239 codecs.escape_decode() when decode an escaped non-ascii byte. 20240 20241- bpo-28603: Print the full context/cause chain of exceptions on interpreter 20242 exit, even if an exception in the chain is unhashable or compares equal to 20243 later ones. Patch by Zane Bitter. 20244 20245- bpo-31786: Fix timeout rounding in the select module to round correctly 20246 negative timeouts between -1.0 and 0.0. The functions now block waiting 20247 for events as expected. Previously, the call was incorrectly non-blocking. 20248 Patch by Pablo Galindo. 20249 20250- bpo-31642: Restored blocking "from package import module" by setting 20251 sys.modules["package.module"] to None. 20252 20253- bpo-31626: Fixed a bug in debug memory allocator. There was a write to 20254 freed memory after shrinking a memory block. 20255 20256- bpo-31619: Fixed a ValueError when convert a string with large number of 20257 underscores to integer with binary base. 20258 20259- bpo-31592: Fixed an assertion failure in Python parser in case of a bad 20260 `unicodedata.normalize()`. Patch by Oren Milman. 20261 20262- bpo-31588: Raise a `TypeError` with a helpful error message when class 20263 creation fails due to a metaclass with a bad ``__prepare__()`` method. 20264 Patch by Oren Milman. 20265 20266- bpo-31566: Fix an assertion failure in `_warnings.warn()` in case of a bad 20267 ``__name__`` global. Patch by Oren Milman. 20268 20269- bpo-31505: Fix an assertion failure in `json`, in case 20270 `_json.make_encoder()` received a bad `encoder()` argument. Patch by Oren 20271 Milman. 20272 20273- bpo-31492: Fix assertion failures in case of failing to import from a 20274 module with a bad ``__name__`` attribute, and in case of failing to access 20275 an attribute of such a module. Patch by Oren Milman. 20276 20277- bpo-31490: Fix an assertion failure in `ctypes` class definition, in case 20278 the class has an attribute whose name is specified in ``_anonymous_`` but 20279 not in ``_fields_``. Patch by Oren Milman. 20280 20281- bpo-31478: Fix an assertion failure in `_random.Random.seed()` in case the 20282 argument has a bad ``__abs__()`` method. Patch by Oren Milman. 20283 20284- bpo-31315: Fix an assertion failure in imp.create_dynamic(), when 20285 spec.name is not a string. Patch by Oren Milman. 20286 20287- bpo-31311: Fix a crash in the ``__setstate__()`` method of 20288 `ctypes._CData`, in case of a bad ``__dict__``. Patch by Oren Milman. 20289 20290- bpo-31293: Fix crashes in true division and multiplication of a timedelta 20291 object by a float with a bad as_integer_ratio() method. Patch by Oren 20292 Milman. 20293 20294- bpo-31285: Fix an assertion failure in `warnings.warn_explicit`, when the 20295 return value of the received loader's get_source() has a bad splitlines() 20296 method. Patch by Oren Milman. 20297 20298- bpo-30817: `PyErr_PrintEx()` clears now the ignored exception that may be 20299 raised by `_PySys_SetObjectId()`, for example when no memory. 20300 20301Library 20302------- 20303 20304- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying 20305 instances of generic classes, improve interaction of ``__init_subclass__`` 20306 with generics. Original PRs by Ivan Levkivskyi. 20307 20308- bpo-27240: The header folding algorithm for the new email policies has 20309 been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In 20310 particular, RFC2231 folding is now done correctly. 20311 20312- bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL 20313 when getting the file size. Fixed hang of all threads with inaccessible 20314 NFS server. Patch by Nir Soffer. 20315 20316- bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return 20317 ``None`` when the value of property is ``VT_EMPTY``. Initial patch by 20318 Mark Mc Mahon. 20319 20320- bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the 20321 :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>` 20322 method. Initial patch by Robin Wellner. 20323 20324- bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception 20325 message when it couldn't open or create an MSI file. Initial patch by 20326 William Tisäter. 20327 20328- bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n* 20329 characters/bytes for non-negative *n*. This makes it compatible with 20330 ``read()`` methods of other file-like objects. 20331 20332- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays. 20333 Identical objects will be saved only once. Equal references will be load 20334 as identical objects. Added support for saving and loading recursive data 20335 structures. 20336 20337- bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError 20338 pickleable. 20339 20340- bpo-32015: Fixed the looping of asyncio in the case of reconnection the 20341 socket during waiting async read/write from/to the socket. 20342 20343- bpo-32011: Restored support of loading marshal files with the TYPE_INT64 20344 code. These files can be produced in Python 2.7. 20345 20346- bpo-31970: Reduce performance overhead of asyncio debug mode. 20347 20348- bpo-9678: Fixed determining the MAC address in the uuid module: Using 20349 ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and 20350 OpenBSD. Based on patch by Takayuki Shimizukawa. 20351 20352- bpo-30057: Fix potential missed signal in signal.signal(). 20353 20354- bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian 20355 platforms. Patch by Jack O'Connor. 20356 20357- bpo-31927: Fixed compilation of the socket module on NetBSD 8. Fixed 20358 assertion failure or reading arbitrary data when parse a AF_BLUETOOTH 20359 address on NetBSD and DragonFly BSD. 20360 20361- bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse() 20362 when the size of types chtype or mmask_t is less than the size of C long. 20363 curses.box() now accepts characters as arguments. Based on patch by Steve 20364 Fink. 20365 20366- bpo-31897: plistlib now catches more errors when read binary plists and 20367 raises InvalidFileException instead of unexpected exceptions. 20368 20369- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch 20370 by Masayuki Yamamoto. 20371 20372- bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and 20373 NetBSD. Fixed the comparison of the kqueue_event objects. 20374 20375- bpo-31891: Fixed building the curses module on NetBSD. 20376 20377- bpo-28416: Instances of pickle.Pickler subclass with the persistent_id() 20378 method and pickle.Unpickler subclass with the persistent_load() method no 20379 longer create reference cycles. 20380 20381- bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed 20382 or None. 20383 20384- bpo-31457: If nested log adapters are used, the inner ``process()`` 20385 methods are no longer omitted. 20386 20387- bpo-31457: The ``manager`` property on LoggerAdapter objects is now 20388 properly settable. 20389 20390- bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire() 20391 and socket.socket.settimeout() to round correctly negative timeouts 20392 between -1.0 and 0.0. The functions now block waiting for events as 20393 expected. Previously, the call was incorrectly non-blocking. Patch by 20394 Pablo Galindo. 20395 20396- bpo-28603: traceback: Fix a TypeError that occurred during printing of 20397 exception tracebacks when either the current exception or an exception in 20398 its context/cause chain is unhashable. Patch by Zane Bitter. 20399 20400- bpo-30058: Fixed buffer overflow in select.kqueue.control(). 20401 20402- bpo-31770: Prevent a crash when calling the ``__init__()`` method of a 20403 ``sqlite3.Cursor`` object more than once. Patch by Oren Milman. 20404 20405- bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII 20406 characters. Now it uses ``-i`` regular expression local flag to avoid 20407 non-ASCII characters. 20408 20409- bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the 20410 ``Cursor`` object is uninitialized. Patch by Oren Milman. 20411 20412- bpo-31752: Fix possible crash in timedelta constructor called with custom 20413 integers. 20414 20415- bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM 20416 exceptions. 20417 20418- bpo-31728: Prevent crashes in `_elementtree` due to unsafe cleanup of 20419 `Element.text` and `Element.tail`. Patch by Oren Milman. 20420 20421- bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get 20422 pollers timeout 20423 20424- bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in 20425 asyncio module. This method was previously modifying a wrong reference to 20426 the protocol. 20427 20428- bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split() 20429 when pass a string larger than 2 GiB. 20430 20431- bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo(). 20432 20433- bpo-30806: Fix the string representation of a netrc object. 20434 20435- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and 20436 earlier. 20437 20438- bpo-25351: Avoid venv activate failures with undefined variables 20439 20440- bpo-25532: inspect.unwrap() will now only try to unwrap an object 20441 sys.getrecursionlimit() times, to protect against objects which create a 20442 new object on every attribute access. 20443 20444- bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() 20445 iterators. 20446 20447- bpo-31516: ``threading.current_thread()`` should not return a dummy thread 20448 at shutdown. 20449 20450- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip 20451 bootstrapping has failed. 20452 20453- bpo-31482: ``random.seed()`` now works with bytes in version=1 20454 20455- bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for 20456 arbitrary negative timeouts on all OSes where it can only be a 20457 non-negative integer or -1. Patch by Riccardo Coccioli. 20458 20459- bpo-31310: multiprocessing's semaphore tracker should be launched again if 20460 crashed. 20461 20462- bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and 20463 other user interruptions. If it crashes, restart it when necessary. 20464 20465Documentation 20466------------- 20467 20468- bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket 20469 versionadded marker. 20470 20471- bpo-31537: Fix incorrect usage of ``get_history_length`` in readline 20472 documentation example code. Patch by Brad Smith. 20473 20474- bpo-30085: The operator functions without double underscores are preferred 20475 for clarity. The one with underscores are only kept for 20476 back-compatibility. 20477 20478Tests 20479----- 20480 20481- bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on 20482 APFS. 20483 20484- bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5. 20485 The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged 20486 into the kernel 4.5. 20487 20488- bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the 20489 names sample to always test the same files. It prevents false alarms when 20490 hunting reference leaks. 20491 20492- bpo-30695: Add the `set_nomemory(start, stop)` and `remove_mem_hooks()` 20493 functions to the _testcapi module. 20494 20495Build 20496----- 20497 20498- bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the 20499 sysroot paths when cross-compiling. 20500 20501- bpo-31957: Fixes Windows SDK version detection when building for Windows. 20502 20503- bpo-31609: Fixes quotes in PCbuild/clean.bat 20504 20505- bpo-31934: Abort the build when building out of a not clean source tree. 20506 20507- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when 20508 there was more than one function and/or method in a .c file with the same 20509 name. 20510 20511- bpo-28791: Update Windows builds to use SQLite 3.21.0. 20512 20513- bpo-28791: Update OS X installer to use SQLite 3.21.0. 20514 20515- bpo-22140: Prevent double substitution of prefix in python-config.sh. 20516 20517- bpo-31536: Avoid wholesale rebuild after `make regen-all` if nothing 20518 changed. 20519 20520Windows 20521------- 20522 20523- bpo-1102: Return ``None`` when ``View.Fetch()`` returns 20524 ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by 20525 Anthony Tuininga. 20526 20527- bpo-31944: Fixes Modify button in Apps and Features dialog. 20528 20529macOS 20530----- 20531 20532- bpo-31392: Update macOS installer to use OpenSSL 1.0.2m 20533 20534IDLE 20535---- 20536 20537- bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event 20538 handling is driven by IDLE's run loop, a confusing and distracting 20539 queue.EMPTY traceback context is no longer added to tk event exception 20540 tracebacks. The traceback is now the same as when event handling is 20541 driven by user code. Patch based on a suggestion by Serhiy Storchaka. 20542 20543- bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet 20544 in configdialog was replaced by ttk.Notebook. 20545 20546- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch 20547 mostly by Cheryl Sabella. 20548 20549- bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor 20550 and output windows only see an empty last prompt line. This simplifies 20551 the code and fixes a minor bug when newline is inserted. Sys.ps1, if 20552 present, is read on Shell start-up, but is not set or changed. 20553 20554- bpo-31860: The font sample in the IDLE configuration dialog is now 20555 editable. Changes persist while IDLE remains open 20556 20557- bpo-31836: Test_code_module now passes if run after test_idle, which sets 20558 ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not. 20559 Test_code_module now properly tests both behaviors. Ditto for ps2. 20560 20561- bpo-28603: Fix a TypeError that caused a shell restart when printing a 20562 traceback that includes an exception that is unhashable. Patch by Zane 20563 Bitter. 20564 20565- bpo-13802: Use non-Latin characters in the IDLE's Font settings sample. 20566 Even if one selects a font that defines a limited subset of the unicode 20567 Basic Multilingual Plane, tcl/tk will use other fonts that define a 20568 character. The expanded example give users of non-Latin characters a 20569 better idea of what they might see in IDLE's shell and editors. To make 20570 room for the expanded sample, frames on the Font tab are re-arranged. The 20571 Font/Tabs help explains a bit about the additions. 20572 20573- bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget 20574 instead of an flist with a root widget opens the option of creating a 20575 browser frame that is only part of a window. Passing a full file name 20576 instead of pieces assumed to come from a .py file opens the possibility of 20577 browsing python files that do not end in .py. 20578 20579- bpo-31649: IDLE - Make _htest, _utest parameters keyword only. 20580 20581- bpo-31559: Remove test order dependence in idle_test.test_browser. 20582 20583- bpo-31459: Rename IDLE's module browser from Class Browser to Module 20584 Browser. The original module-level class and method browser became a 20585 module browser, with the addition of module-level functions, years ago. 20586 Nested classes and functions were added yesterday. For 20587 back-compatibility, the virtual event <<open-class-browser>>, which 20588 appears on the Keys tab of the Settings dialog, is not changed. Patch by 20589 Cheryl Sabella. 20590 20591- bpo-31500: Default fonts now are scaled on HiDPI displays. 20592 20593- bpo-1612262: IDLE module browser now shows nested classes and functions. 20594 Original patches for code and tests by Guilherme Polo and Cheryl Sabella, 20595 respectively. 20596 20597Tools/Demos 20598----------- 20599 20600- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also, 20601 remove the ``LOCALE`` option since it doesn't work with string patterns in 20602 Python 3. Patch by Christoph Sarnowski. 20603 20604C API 20605----- 20606 20607- bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in 20608 a non-Python thread before PyEval_InitThreads(), only call 20609 PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. 20610 20611- bpo-31532: Fix memory corruption due to allocator mix in getpath.c between 20612 Py_GetPath() and Py_SetPath() 20613 20614- bpo-30697: The `PyExc_RecursionErrorInst` singleton is removed and 20615 `PyErr_NormalizeException()` does not use it anymore. This singleton is 20616 persistent and its members being never cleared may cause a segfault during 20617 finalization of the interpreter. See also issue #22898. 20618 20619 20620What's New in Python 3.6.3 final? 20621================================= 20622 20623*Release date: 2017-10-03* 20624 20625Library 20626------- 20627 20628- bpo-31641: Re-allow arbitrary iterables in 20629 `concurrent.futures.as_completed()`. Fixes regression in 3.6.3rc1. 20630 20631Build 20632----- 20633 20634- bpo-31662: Fix typos in Windows ``uploadrelease.bat`` script. Fix Windows 20635 Doc build issues in ``Doc/make.bat``. 20636 20637- bpo-31423: Fix building the PDF documentation with newer versions of 20638 Sphinx. 20639 20640 20641What's New in Python 3.6.3 release candidate 1? 20642=============================================== 20643 20644*Release date: 2017-09-18* 20645 20646Security 20647-------- 20648 20649- bpo-29781: SSLObject.version() now correctly returns None when handshake 20650 over BIO has not been performed yet. 20651 20652- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to 20653 get security fixes. 20654 20655Core and Builtins 20656----------------- 20657 20658- bpo-31471: Fix an assertion failure in `subprocess.Popen()` on Windows, in 20659 case the env argument has a bad keys() method. Patch by Oren Milman. 20660 20661- bpo-31418: Fix an assertion failure in `PyErr_WriteUnraisable()` in case 20662 of an exception with a bad ``__module__`` attribute. Patch by Oren Milman. 20663 20664- bpo-31416: Fix assertion failures in case of a bad warnings.filters or 20665 warnings.defaultaction. Patch by Oren Milman. 20666 20667- bpo-31411: Raise a TypeError instead of SystemError in case 20668 warnings.onceregistry is not a dictionary. Patch by Oren Milman. 20669 20670- bpo-31373: Fix several possible instances of undefined behavior due to 20671 floating-point demotions. 20672 20673- bpo-30465: Location information (``lineno`` and ``col_offset``) in 20674 f-strings is now (mostly) correct. This fixes tools like flake8 from 20675 showing warnings on the wrong line (typically the first line of the file). 20676 20677- bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev(). 20678 GNU C libray plans to remove the functions from sys/types.h. 20679 20680- bpo-31291: Fix an assertion failure in `zipimport.zipimporter.get_data` on 20681 Windows, when the return value of ``pathname.replace('/','\\')`` isn't a 20682 string. Patch by Oren Milman. 20683 20684- bpo-31271: Fix an assertion failure in the write() method of 20685 `io.TextIOWrapper`, when the encoder doesn't return a bytes object. Patch 20686 by Oren Milman. 20687 20688- bpo-31243: Fix a crash in some methods of `io.TextIOWrapper`, when the 20689 decoder's state is invalid. Patch by Oren Milman. 20690 20691- bpo-30721: ``print`` now shows correct usage hint for using Python 2 20692 redirection syntax. Patch by Sanyam Khurana. 20693 20694- bpo-31070: Fix a race condition in importlib _get_module_lock(). 20695 20696- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which 20697 doesn't call ``PyObject_GC_UnTrack()``. 20698 20699- bpo-31071: Avoid masking original TypeError in call with * unpacking when 20700 other arguments are passed. 20701 20702- bpo-30978: str.format_map() now passes key lookup exceptions through. 20703 Previously any exception was replaced with a KeyError exception. 20704 20705- bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state. 20706 20707- bpo-30876: Relative import from unloaded package now reimports the package 20708 instead of failing with SystemError. Relative import from non-package now 20709 fails with ImportError rather than SystemError. 20710 20711- bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from 20712 signal handler, to avoid calling signal-unsafe functions. The tests I'm 20713 adding here fail without the rest of the patch, on Linux and OS X. This 20714 means our signal delivery logic had defects (some signals could be lost). 20715 20716- bpo-30765: Avoid blocking in pthread_mutex_lock() when 20717 PyThread_acquire_lock() is asked not to block. 20718 20719- bpo-31161: Make sure the 'Missing parentheses' syntax error message is 20720 only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters. 20721 20722- bpo-30814: Fixed a race condition when import a submodule from a package. 20723 20724- bpo-30597: ``print`` now shows expected input in custom error message when 20725 used as a Python 2 statement. Patch by Sanyam Khurana. 20726 20727Library 20728------- 20729 20730- bpo-31499: xml.etree: Fix a crash when a parser is part of a reference 20731 cycle. 20732 20733- bpo-28556: typing.get_type_hints now finds the right globalns for classes 20734 and modules by default (when no ``globalns`` was specified by the caller). 20735 20736- bpo-28556: Speed improvements to the ``typing`` module. Original PRs by 20737 Ivan Levkivskyi and Mitar. 20738 20739- bpo-31544: The C accelerator module of ElementTree ignored exceptions 20740 raised when looking up TreeBuilder target methods in XMLParser(). 20741 20742- bpo-31234: socket.create_connection() now fixes manually a reference 20743 cycle: clear the variable storing the last exception on success. 20744 20745- bpo-31457: LoggerAdapter objects can now be nested. 20746 20747- bpo-31400: Improves SSL error handling to avoid losing error numbers. 20748 20749- bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a 20750 context cannot be instantiated. 20751 20752- bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of 20753 data. This fixes support for all bytes-like object. It is also more 20754 efficient and avoids costly copies. 20755 20756- bpo-31178: Fix string concatenation bug in rare error path in the 20757 subprocess module 20758 20759- bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up 20760 to 10% faster. 20761 20762- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of 20763 partial characters for UTF-8 input (libexpat bug 115): 20764 https://github.com/libexpat/libexpat/issues/115 20765 20766- bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3. 20767 20768- bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to 20769 have a non repr() based thread name by default when no thread_name_prefix 20770 is supplied. They will now identify themselves as 20771 "ThreadPoolExecutor-y_n". 20772 20773- bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash 20774 functions such as md5 are not available in the linked OpenSSL library. As 20775 in some special FIPS-140 build environments. 20776 20777- bpo-27144: The ``map()`` and ``as_completed()`` iterators in 20778 ``concurrent.futures`` now avoid keeping a reference to yielded objects. 20779 20780- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer 20781 types. 20782 20783- bpo-22536: The subprocess module now sets the filename when 20784 FileNotFoundError is raised on POSIX systems due to the executable or cwd 20785 not being found. 20786 20787- bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor 20788 now breaks a reference cycle between an exception object and the WorkItem 20789 object. 20790 20791- bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using 20792 sys.exc_info() in code handling exceptions. 20793 20794- bpo-30102: The ssl and hashlib modules now call 20795 OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function 20796 detects CPU features and enables optimizations on some CPU architectures 20797 such as POWER8. Patch is based on research from Gustavo Serra Scalet. 20798 20799- bpo-31185: Fixed miscellaneous errors in asyncio speedup module. 20800 20801- bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu 20802 classes. Call the parent destroy() method even if the used attribute 20803 doesn't exist. The LabeledScale.destroy() method now also explicitly 20804 clears label and scale attributes to help the garbage collector to destroy 20805 all widgets. 20806 20807- bpo-31107: Fix `copyreg._slotnames()` mangled attribute calculation for 20808 classes whose name begins with an underscore. Patch by Shane Harvey. 20809 20810- bpo-31061: Fixed a crash when using asyncio and threads. 20811 20812- bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian 20813 Heimes. 20814 20815- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that 20816 contains CR or LF. Patch by Dong-hee Na. 20817 20818- bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader 20819 in non-blocking mode if it succeeded to acquire the lock but the acquire 20820 took longer than the timeout. 20821 20822- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound 20823 builtin functions. Patch by Aaron Gallagher. 20824 20825- bpo-30961: Fix decrementing a borrowed reference in tracemalloc. 20826 20827- bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across 20828 instances of ``OptionMenu``. 20829 20830- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the 20831 thread completes, even if the thread was started by the same process which 20832 created the queue. 20833 20834- bpo-29854: Fix segfault in readline when using readline's history-size 20835 option. Patch by Nir Soffer. 20836 20837- bpo-30319: socket.close() now ignores ECONNRESET error. 20838 20839- bpo-30828: Fix out of bounds write in 20840 `asyncio.CFuture.remove_done_callback()`. 20841 20842- bpo-30807: signal.setitimer() may disable the timer when passed a tiny 20843 value. Tiny values (such as 1e-6) are valid non-zero values for 20844 setitimer(), which is specified as taking microsecond-resolution 20845 intervals. However, on some platform, our conversion routine could convert 20846 1e-6 into a zero interval, therefore disabling the timer instead of 20847 (re-)scheduling it. 20848 20849- bpo-30441: Fix bug when modifying os.environ while iterating over it 20850 20851- bpo-30532: Fix email header value parser dropping folding white space in 20852 certain cases. 20853 20854- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called 20855 with bytes-like argument. 20856 20857- bpo-30746: Prohibited the '=' character in environment variable names in 20858 ``os.putenv()`` and ``os.spawn*()``. 20859 20860- bpo-29755: Fixed the lgettext() family of functions in the gettext module. 20861 They now always return bytes. 20862 20863Documentation 20864------------- 20865 20866- bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and 20867 ZeroMQSocketHandler examples and adapt them to Python 3. 20868 20869- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL 20870 documentation. 20871 20872- bpo-30803: Clarify doc on truth value testing. Original patch by Peter 20873 Thomassen. 20874 20875Tests 20876----- 20877 20878- bpo-31320: Silence traceback in test_ssl 20879 20880- bpo-25674: Remove sha256.tbs-internet.com ssl test 20881 20882- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest 20883 version behaves like OpenSSL 1.0.2 and no longer aborts handshake. 20884 20885- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the 20886 test suite using --use=all / -u all, exclude tzdata since it makes 20887 test_datetime too slow (15-20 min on some buildbots) which then times out 20888 on some buildbots. Fix also regrtest command line parser to allow passing 20889 -u extralargefile to run test_zipfile64. 20890 20891Build 20892----- 20893 20894- bpo-30854: Fix compile error when compiling --without-threads. Patch by 20895 Masayuki Yamamoto. 20896 20897Windows 20898------- 20899 20900- bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows. 20901 20902- bpo-31340: Change to building with MSVC v141 (included with Visual Studio 20903 2017) 20904 20905- bpo-30581: os.cpu_count() now returns the correct number of processors on 20906 Windows when the number of logical processors is greater than 64. 20907 20908- bpo-30731: Add a missing xmlns to python.manifest so that it matches the 20909 schema. 20910 20911IDLE 20912---- 20913 20914- bpo-31493: IDLE code context -- fix code update and font update timers. 20915 Canceling timers prevents a warning message when test_idle completes. 20916 20917- bpo-31488: IDLE - Update non-key options in former extension classes. When 20918 applying configdialog changes, call .reload for each feature class. Change 20919 ParenMatch so updated options affect existing instances attached to 20920 existing editor windows. 20921 20922- bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace 20923 strips more than blank spaces. Multiline string literals are not skipped. 20924 20925- bpo-31480: IDLE - make tests pass with zzdummy extension disabled by 20926 default. 20927 20928- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk 20929 update in the background in order to make live interaction and 20930 experimentation with tkinter applications much easier. 20931 20932- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an 20933 int entry is not the same as deleting and inserting because int('') will 20934 fail. 20935 20936- bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and 20937 Help sections. 20938 20939- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor. 20940 Move some data and functions from the class to module level. Patch by 20941 Cheryl Sabella. 20942 20943- bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog. 20944 20945- bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About 20946 10 IDLE features were implemented as supposedly optional extensions. Their 20947 different behavior could be confusing or worse for users and not good for 20948 maintenance. Hence the conversion. The main difference for users is that 20949 user configurable key bindings for builtin features are now handled 20950 uniformly. Now, editing a binding in a keyset only affects its value in 20951 the keyset. All bindings are defined together in the system-specific 20952 default keysets in config-extensions.def. All custom keysets are saved as 20953 a whole in config-extension.cfg. All take effect as soon as one clicks 20954 Apply or Ok. The affected events are '<<force-open-completions>>', 20955 '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', 20956 '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and 20957 '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not 20958 affect their keyset-specific customization after 3.6.3. and vice versa. 20959 Initial patch by Charles Wohlganger. 20960 20961- bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by 20962 Cheryl Sabella. 20963 20964- bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl 20965 Sabella. 20966 20967- bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The 20968 slightly modified tests continue to pass. Patch by Cheryl Sabella. 20969 20970- bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by 20971 Victor Stinner. 20972 20973- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella. 20974 20975- bpo-19903: IDLE: Calltips use `inspect.signature` instead of 20976 `inspect.getfullargspec`. This improves calltips for builtins converted to 20977 use Argument Clinic. Patch by Louie Lu. 20978 20979- bpo-31083: IDLE - Add an outline of a TabPage class in configdialog. 20980 Update existing classes to match outline. Initial patch by Cheryl Sabella. 20981 20982- bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly 20983 modified tests continue to pass. Patch by Cheryl Sabella. 20984 20985- bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly 20986 modified tests continue to pass. Fix General tests. Patch mostly by Cheryl 20987 Sabella. 20988 20989- bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan 20990 Reedy and Cheryl Sabella. 20991 20992- bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping 20993 methods pertaining to each tab and the buttons will aid writing tests and 20994 improving the tabs and will enable splitting the groups into classes. 20995 20996- bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance 20997 tracers manages pairs consisting of a tk variable and a callback function. 20998 When tracing is turned on, setting the variable calls the function. Test 20999 coverage for the new class is 100%. 21000 21001- bpo-31003: IDLE: Add more tests for General tab. 21002 21003- bpo-30993: IDLE - Improve configdialog font page and tests. In 21004 configdialog: Document causal pathways in create_font_tab docstring. 21005 Simplify some attribute names. Move set_samples calls to var_changed_font 21006 (idea from Cheryl Sabella). Move related functions to positions after the 21007 create widgets function. In test_configdialog: Fix test_font_set so not 21008 order dependent. Fix renamed test_indent_scale so it tests the widget. 21009 Adjust tests for movement of set_samples call. Add tests for load 21010 functions. Put all font tests in one class and tab indent tests in 21011 another. Except for two lines, these tests completely cover the related 21012 functions. 21013 21014- bpo-30981: IDLE -- Add more configdialog font page tests. 21015 21016- bpo-28523: IDLE: replace 'colour' with 'color' in configdialog. 21017 21018- bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from 21019 46% to 96%. Patch by Louie Lu. 21020 21021- bpo-30934: Document coverage details for idlelib tests. Add section to 21022 idlelib/idle-test/README.txt. Include check that branches are taken both 21023 ways. Exclude IDLE-specific code that does not run during unit tests. 21024 21025- bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in 21026 docstrings This will facilitate improving the dialog and splitting up the 21027 class. Original patch by Cheryl Sabella. 21028 21029- bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by 21030 Louie Lu. 21031 21032- bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella. 21033 21034- bpo-30851: IDLE: Remove unused variables in configdialog. One is a 21035 duplicate, one is set but cannot be altered by users. Patch by Cheryl 21036 Sabella. 21037 21038- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as 21039 well as mouse. Initial patch by Louie Lu. 21040 21041- bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once. 21042 21043- bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in 21044 config; test. * In config, put dump test code in a function; run it and 21045 unittest in 'if __name__ == '__main__'. * Add class config.ConfigChanges 21046 based on changes_class_v4.py on bpo issue. * Add class 21047 test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise 21048 configdialog to use ConfigChanges; see tracker msg297804. * Revise 21049 test_configdialog to match configdialog changes. * Remove configdialog 21050 functions unused or moved to ConfigChanges. Cheryl Sabella contributed 21051 parts of the patch. 21052 21053- bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by 21054 Cheryl Sabella. 21055 21056- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more 21057 tests. Patch by Cheryl Sabella. 21058 21059- bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens' 21060 style to highlight both opener and closer. Make 'default' style, which is 21061 not default, a synonym for 'opener'. Make time-delay work the same with 21062 all styles. Add help for config dialog extensions tab, including help for 21063 parenmatch. Add new tests. Original patch by Charles Wohlganger. 21064 21065- bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella 21066 21067- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates 21068 properly. Original patch by Saimadhav Heblikar. 21069 21070- bpo-29910: IDLE no longer deletes a character after commenting out a 21071 region by a key shortcut. Add ``return 'break'`` for this and other 21072 potential conflicts between IDLE and default key bindings. 21073 21074- bpo-30728: Review and change idlelib.configdialog names. Lowercase method 21075 and attribute names. Replace 'colour' with 'color', expand overly cryptic 21076 names, delete unneeded underscores. Replace ``import *`` with specific 21077 imports. Patches by Cheryl Sabella. 21078 21079- bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them 21080 with tk. Add tests for all 3 validation functions. Original patch by G 21081 Polo. Tests added by Cheryl Sabella. 21082 21083Tools/Demos 21084----------- 21085 21086- bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared 21087 builds now, too. :pep:`523` introduced _PyEval_EvalFrameDefault which 21088 inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the 21089 ability to use py-bt, py-up, and a few other Python-specific gdb 21090 integrations. The problem is fixed by only looking for 21091 _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno 21092 "Polaco" Penteado. 21093 21094 21095What's New in Python 3.6.2 final? 21096================================= 21097 21098*Release date: 2017-07-17* 21099 21100No changes since release candidate 2 21101 21102 21103 21104What's New in Python 3.6.2 release candidate 2? 21105=============================================== 21106 21107*Release date: 2017-07-07* 21108 21109Security 21110-------- 21111 21112- bpo-30730: Prevent environment variables injection in subprocess on 21113 Windows. Prevent passing other environment variables and command 21114 arguments. 21115 21116- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple 21117 security vulnerabilities including: CVE-2017-9233 (External entity 21118 infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), 21119 CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and 21120 CVE-2012-0876 (Counter hash flooding with SipHash). Note: the 21121 CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't 21122 impact Python, since Python already gets entropy from the OS to set the 21123 expat secret using ``XML_SetHashSalt()``. 21124 21125- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For 21126 example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the 21127 ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an 21128 authentication (``login@host``). 21129 21130 21131What's New in Python 3.6.2 release candidate 1? 21132=============================================== 21133 21134*Release date: 2017-06-17* 21135 21136Core and Builtins 21137----------------- 21138 21139- bpo-30682: Removed a too-strict assertion that failed for certain 21140 f-strings, such as eval("f'\\\n'") and eval("f'\\\r'"). 21141 21142- bpo-30604: Move co_extra_freefuncs to not be per-thread to avoid crashes 21143 21144- bpo-29104: Fixed parsing backslashes in f-strings. 21145 21146- bpo-27945: Fixed various segfaults with dict when input collections are 21147 mutated during searching, inserting or comparing. Based on patches by 21148 Duane Griffin and Tim Mitchell. 21149 21150- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for 21151 non-interned attribute names. Based on patch by Eryk Sun. 21152 21153- bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the 21154 middle of resuming a chain of nested 'yield from' or 'await' calls, it's 21155 now correctly delivered to the innermost frame. 21156 21157- bpo-12414: sys.getsizeof() on a code object now returns the sizes which 21158 includes the code struct and sizes of objects which it references. Patch 21159 by Dong-hee Na. 21160 21161- bpo-29949: Fix memory usage regression of set and frozenset object. 21162 21163- bpo-29935: Fixed error messages in the index() method of tuple, list and 21164 deque when pass indices of wrong type. 21165 21166- bpo-29859: Show correct error messages when any of the pthread_* calls in 21167 thread_pthread.h fails. 21168 21169- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises 21170 :exc:`OverflowError`. 21171 21172- bpo-29600: Fix wrapping coroutine return values in StopIteration. 21173 21174- bpo-28856: Fix an oversight that %b format for bytes should support 21175 objects follow the buffer protocol. 21176 21177- bpo-29714: Fix a regression that bytes format may fail when containing 21178 zero bytes inside. 21179 21180- bpo-29478: If max_line_length=None is specified while using the Compat32 21181 policy, it is no longer ignored. Patch by Mircea Cosbuc. 21182 21183Library 21184------- 21185 21186- bpo-30616: Functional API of enum allows to create empty enums. Patched by 21187 Dong-hee Na 21188 21189- bpo-30038: Fix race condition between signal delivery and wakeup file 21190 descriptor. Patch by Nathaniel Smith. 21191 21192- bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings. 21193 21194- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a 21195 reference cycle to not keep objects alive longer than expected. 21196 21197- bpo-30149: inspect.signature() now supports callables with 21198 variable-argument parameters wrapped with partialmethod. Patch by Dong-hee 21199 Na. 21200 21201- bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases 21202 when a package is only shipped with bytecodes. Patch by Alexandru 21203 Ardelean. 21204 21205- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. 21206 Patch by Sanjay Sundaresan. 21207 21208- bpo-30605: re.compile() no longer raises a BytesWarning when compiling a 21209 bytes instance with misplaced inline modifier. Patch by Roy Williams. 21210 21211Security 21212-------- 21213 21214- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of 21215 CVE-2016-0718 and CVE-2016-4472. See 21216 https://sourceforge.net/p/expat/bugs/537/ for more information. 21217 21218Library 21219------- 21220 21221- bpo-24484: Avoid race condition in multiprocessing cleanup (#2159) 21222 21223- bpo-28994: The traceback no longer displayed for SystemExit raised in a 21224 callback registered by atexit. 21225 21226- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was 21227 called. 21228 21229- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add 21230 support for ContextManager on all versions. Original PRs by Jelle Zijlstra 21231 and Ivan Levkivskyi 21232 21233- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl 21234 implementation. Patch by Michaël Sghaïer. 21235 21236- bpo-29743: Closing transport during handshake process leaks open socket. 21237 Patch by Nikolay Kim 21238 21239- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu 21240 Sornay. 21241 21242- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore 21243 EINVAL on stdin.write() if the child process is still running but closed 21244 the pipe. 21245 21246- bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch 21247 by Nate Soares. 21248 21249- bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract 21250 base classes to use keyword parameters in __init_subclass__. Patch by Nate 21251 Soares. 21252 21253- bpo-30557: faulthandler now correctly filters and displays exception codes 21254 on Windows 21255 21256- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot 21257 handle IPv6 addresses. 21258 21259- bpo-29960: Preserve generator state when _random.Random.setstate() raises 21260 an exception. Patch by Bryan Olson. 21261 21262- bpo-30414: multiprocessing.Queue._feed background running thread do not 21263 break from main loop on exception. 21264 21265- bpo-30003: Fix handling escape characters in HZ codec. Based on patch by 21266 Ma Lin. 21267 21268- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn* 21269 and *forkserver* start methods. 21270 21271- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error 21272 (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. 21273 This error occurs sometimes on SSL connections. 21274 21275- bpo-30375: Warnings emitted when compile a regular expression now always 21276 point to the line in the user code. Previously they could point into 21277 inners of the re module if emitted from inside of groups or conditionals. 21278 21279- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running 21280 coroutine and the coroutine returned without any more ``await``. 21281 21282- bpo-30266: contextlib.AbstractContextManager now supports 21283 anti-registration by setting __enter__ = None or __exit__ = None, 21284 following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra. 21285 21286- bpo-30298: Weaken the condition of deprecation warnings for inline 21287 modifiers. Now allowed several subsequential inline modifiers at the start 21288 of the pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and 21289 comments now are allowed before and between inline modifiers (e.g. ``'(?x) 21290 (?i) (?s)...'``). 21291 21292- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma 21293 Lin. 21294 21295- bpo-26293: Change resulted because of zipfile breakage. (See also: 21296 bpo-29094) 21297 21298- bpo-30243: Removed the __init__ methods of _json's scanner and encoder. 21299 Misusing them could cause memory leaks or crashes. Now scanner and 21300 encoder objects are completely initialized in the __new__ methods. 21301 21302- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process 21303 when Ctrl-C is received. 21304 21305- bpo-28556: Various updates to typing module: add typing.NoReturn type, use 21306 WrapperDescriptorType, minor bug-fixes. Original PRs by Jim 21307 Fasarakis-Hilliard and Ivan Levkivskyi. 21308 21309- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux. 21310 21311- bpo-30070: Fixed leaks and crashes in errors handling in the parser 21312 module. 21313 21314- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when 21315 readline() or __next__() respectively return non-sizeable object. Fixed 21316 possible other errors caused by not checking results of PyObject_Size(), 21317 PySequence_Size(), or PyMapping_Size(). 21318 21319- bpo-30017: Allowed calling the close() method of the zip entry writer 21320 object multiple times. Writing to a closed writer now always produces a 21321 ValueError. 21322 21323- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint 21324 is present. 21325 21326- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. 21327 Patch by Armin Rigo. 21328 21329- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in 21330 contextlib.contextmanager. Patch by Siddharth Velankar. 21331 21332- bpo-29998: Pickling and copying ImportError now preserves name and path 21333 attributes. 21334 21335- bpo-29953: Fixed memory leaks in the replace() method of datetime and time 21336 objects when pass out of bound fold argument. 21337 21338- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering 21339 long runs of empty iterables. 21340 21341- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions 21342 and wrong types. 21343 21344- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an 21345 exception at the very first of an iterable may swallow the exception or 21346 make the program hang. Patch by Davin Potts and Xiang Zhang. 21347 21348- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when 21349 the OS gives priority to errors such as EACCES over EEXIST. 21350 21351- bpo-29861: Release references to tasks, their arguments and their results 21352 as soon as they are finished in multiprocessing.Pool. 21353 21354- bpo-29884: faulthandler: Restore the old sigaltstack during teardown. 21355 Patch by Christophe Zeitouny. 21356 21357- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. 21358 21359- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords 21360 are not strings. Patch by Michael Seifert. 21361 21362- bpo-29742: get_extra_info() raises exception if get called on closed ssl 21363 transport. Patch by Nikolay Kim. 21364 21365- bpo-8256: Fixed possible failing or crashing input() if attributes 21366 "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not 21367 strings. 21368 21369- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting 21370 big intables (objects that have __int__) as elements. Patch by Oren 21371 Milman. 21372 21373- bpo-28231: The zipfile module now accepts path-like objects for external 21374 paths. 21375 21376- bpo-26915: index() and count() methods of collections.abc.Sequence now 21377 check identity before checking equality when do comparisons. 21378 21379- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other 21380 exception) to exception(s) raised in the dispatched methods. Patch by Petr 21381 Motejlek. 21382 21383- bpo-30177: path.resolve(strict=False) no longer cuts the path after the 21384 first element not present in the filesystem. Patch by Antoine Pietri. 21385 21386IDLE 21387---- 21388 21389- bpo-15786: Fix several problems with IDLE's autocompletion box. The 21390 following should now work: clicking on selection box items; using the 21391 scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no 21392 longer happen. Patch by Louie Lu. 21393 21394- bpo-25514: Add doc subsubsection about IDLE failure to start. Popup 21395 no-connection message directs users to this section. 21396 21397- bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and 21398 Terry Jan Reedy. 21399 21400- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by 21401 Cheryl Sabella and Terry Jan Reedy. 21402 21403- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to 21404 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy. 21405 21406- bpo-30303: Add _utest option to textview; add new tests. Increase coverage 21407 to 100%. Patches by Louie Lu and Terry Jan Reedy. 21408 21409C API 21410----- 21411 21412- bpo-27867: Function PySlice_GetIndicesEx() no longer replaced with a macro 21413 if Py_LIMITED_API is not set. 21414 21415Build 21416----- 21417 21418- bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C 21419 ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies 21420 ``--with-assertions``. 21421 21422- bpo-28787: Fix out-of-tree builds of Python when configured with 21423 ``--with--dtrace``. 21424 21425- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``, 21426 ``make install`` and some other make targets when configured with 21427 ``--enable-optimizations``. 21428 21429- bpo-23404: Don't regenerate generated files based on file modification 21430 time anymore: the action is now explicit. Replace ``make touch`` with 21431 ``make regen-all``. 21432 21433- bpo-29643: Fix ``--enable-optimization`` didn't work. 21434 21435Documentation 21436------------- 21437 21438- bpo-30176: Add missing attribute related constants in curses 21439 documentation. 21440 21441- bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are 21442 now their respective type definitions, rather than the corresponding 21443 builtin function entries. Use :ref:`bytes <func-bytes>` and 21444 :ref:`bytearray <func-bytearray>` to reference the latter. In order to 21445 ensure this and future cross-reference updates are applied automatically, 21446 the daily documentation builds now disable the default output caching 21447 features in Sphinx. 21448 21449- bpo-26985: Add missing info of code object in inspect documentation. 21450 21451Tools/Demos 21452----------- 21453 21454- bpo-29367: python-gdb.py now supports also ``method-wrapper`` 21455 (``wrapperobject``) objects. 21456 21457Tests 21458----- 21459 21460- bpo-30357: test_thread: setUp() now uses support.threading_setup() and 21461 support.threading_cleanup() to wait until threads complete to avoid random 21462 side effects on following tests. Initial patch written by Grzegorz 21463 Grzywacz. 21464 21465- bpo-30197: Enhanced functions swap_attr() and swap_item() in the 21466 test.support module. They now work when delete replaced attribute or item 21467 inside the with statement. The old value of the attribute or item (or 21468 None if it doesn't exist) now will be assigned to the target of the "as" 21469 clause, if there is one. 21470 21471Windows 21472------- 21473 21474- bpo-30687: Locate msbuild.exe on Windows when building rather than 21475 vcvarsall.bat 21476 21477- bpo-30450: The build process on Windows no longer depends on Subversion, 21478 instead pulling external code from GitHub via a Python script. If Python 21479 3.6 is not found on the system (via ``py -3.6``), NuGet is used to 21480 download a copy of 32-bit Python. 21481 21482 21483What's New in Python 3.6.1 final? 21484================================= 21485 21486*Release date: 2017-03-21* 21487 21488Core and Builtins 21489----------------- 21490 21491- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused 21492 a regression by revealing an inconsistency in how sys.path is initialized 21493 when executing ``__main__`` from a zipfile, directory, or other import 21494 location. The interpreter now consistently avoids ever adding the import 21495 location's parent directory to ``sys.path``, and ensures no other 21496 ``sys.path`` entries are inadvertently modified when inserting the import 21497 location named on the command line. 21498 21499Build 21500----- 21501 21502- bpo-27593: fix format of git information used in sys.version 21503 21504- Fix incompatible comment in python.h 21505 21506 21507What's New in Python 3.6.1 release candidate 1? 21508=============================================== 21509 21510*Release date: 2017-03-04* 21511 21512Core and Builtins 21513----------------- 21514 21515- bpo-28893: Set correct __cause__ for errors about invalid awaitables 21516 returned from __aiter__ and __anext__. 21517 21518- bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian 21519 Coleman. 21520 21521- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It 21522 should raise TypeError when kwargs is not a dict. But it might cause segv 21523 when args=NULL and kwargs is not a dict. 21524 21525- bpo-28598: Support __rmod__ for subclasses of str being called before 21526 str.__mod__. Patch by Martijn Pieters. 21527 21528- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by 21529 Matthieu Dartiailh. 21530 21531- bpo-29602: Fix incorrect handling of signed zeros in complex constructor 21532 for complex subclasses and for inputs having a __complex__ method. Patch 21533 by Serhiy Storchaka. 21534 21535- bpo-29347: Fixed possibly dereferencing undefined pointers when creating 21536 weakref objects. 21537 21538- bpo-29438: Fixed use-after-free problem in key sharing dict. 21539 21540- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0]. 21541 21542- bpo-29337: Fixed possible BytesWarning when compare the code objects. 21543 Warnings could be emitted at compile time. 21544 21545- bpo-29327: Fixed a crash when pass the iterable keyword argument to 21546 sorted(). 21547 21548- bpo-29034: Fix memory leak and use-after-free in os module 21549 (path_converter). 21550 21551- bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception. 21552 21553- bpo-28932: Do not include <sys/random.h> if it does not exist. 21554 21555- bpo-25677: Correct the positioning of the syntax error caret for indented 21556 blocks. Based on patch by Michael Layzell. 21557 21558- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate 21559 form. 21560 21561- bpo-26919: On Android, operating system data is now always encoded/decoded 21562 to/from UTF-8, instead of the locale encoding to avoid inconsistencies 21563 with os.fsencode() and os.fsdecode() which are already using UTF-8. 21564 21565- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy 21566 bug triggerable by a monkey-patched len() function. 21567 21568- bpo-28739: f-string expressions are no longer accepted as docstrings and 21569 by ast.literal_eval() even if they do not include expressions. 21570 21571- bpo-28512: Fixed setting the offset attribute of SyntaxError by 21572 PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). 21573 21574- bpo-28918: Fix the cross compilation of xxlimited when Python has been 21575 built with Py_DEBUG defined. 21576 21577- bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict. 21578 Improve speed of dict literal with constant keys up to 30%. 21579 21580Library 21581------- 21582 21583- bpo-29169: Update zlib to 1.2.11. 21584 21585- bpo-29623: Allow use of path-like object as a single argument in 21586 ConfigParser.read(). Patch by David Ellis. 21587 21588- bpo-28963: Fix out of bound iteration in 21589 asyncio.Future.remove_done_callback implemented in C. 21590 21591- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes 21592 before all pipes are closed. 21593 21594- bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to 21595 accept None argument as their pure Python implementation. 21596 21597- bpo-29703: Fix asyncio to support instantiation of new event loops in 21598 child processes. 21599 21600- bpo-29376: Fix assertion error in threading._DummyThread.is_alive(). 21601 21602- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts 21603 PathLike objects. Patch by Sayan Chowdhury. 21604 21605- bpo-28518: Start a transaction implicitly before a DML statement. Patch by 21606 Aviv Palivoda. 21607 21608- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no 21609 longer affects a partial object after creation. 21610 21611- bpo-29110: Fix file object leak in aifc.open() when file is given as a 21612 filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. 21613 21614- bpo-28556: Various updates to typing module: typing.Counter, 21615 typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle 21616 Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. 21617 21618- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 21619 3.6.0: check minimum and maximum years. 21620 21621- bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when 21622 used with a rare combination of multiprocessing and custom codecs. 21623 21624- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir 21625 21626- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the 21627 match object. Based on patch by WGH. 21628 21629- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited 21630 to a stopped instead of terminated state (ex: when under ptrace). 21631 21632- bpo-29290: Fix a regression in argparse that help messages would wrap at 21633 non-breaking spaces. 21634 21635- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY. 21636 21637- bpo-29316: Restore the provisional status of typing module, add 21638 corresponding note to documentation. Patch by Ivan L. 21639 21640- bpo-29219: Fixed infinite recursion in the repr of uninitialized 21641 ctypes.CDLL instances. 21642 21643- bpo-29011: Fix an important omission by adding Deque to the typing module. 21644 21645- bpo-28969: Fixed race condition in C implementation of 21646 functools.lru_cache. KeyError could be raised when cached function with 21647 full cache was simultaneously called from different threads with the same 21648 uncached arguments. 21649 21650- bpo-29142: In urllib.request, suffixes in no_proxy environment variable 21651 with leading dots could match related hostnames again (e.g. .b.c matches 21652 a.b.c). Patch by Milan Oberkirch. 21653 21654- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter 21655 anymore. Patch written by Jiajun Huang. 21656 21657- bpo-29203: functools.lru_cache() now respects :pep:`468` and preserves the 21658 order of keyword arguments. f(a=1, b=2) is now cached separately from 21659 f(b=2, a=1) since both calls could potentially give different results. 21660 21661- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a 21662 context. Patch by Sam Breese. 21663 21664- bpo-29094: Offsets in a ZIP file created with extern file object and modes 21665 "w" and "x" now are relative to the start of the file. 21666 21667- bpo-29085: Allow random.Random.seed() to use high quality OS randomness 21668 rather than the pid and time. 21669 21670- bpo-29061: Fixed bug in secrets.randbelow() which would hang when given a 21671 negative input. Patch by Brendan Donegan. 21672 21673- bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows 21674 21675- bpo-13051: Fixed recursion errors in large or resized 21676 curses.textpad.Textbox. Based on patch by Tycho Andersen. 21677 21678- bpo-29119: Fix weakrefs in the pure python version of 21679 collections.OrderedDict move_to_end() method. Contributed by Andra 21680 Bogildea. 21681 21682- bpo-9770: curses.ascii predicates now work correctly with negative 21683 integers. 21684 21685- bpo-28427: old keys should not remove new values from WeakValueDictionary 21686 when collecting from another thread. 21687 21688- bpo-28923: Remove editor artifacts from Tix.py. 21689 21690- bpo-29055: Neaten-up empty population error on random.choice() by 21691 suppressing the upstream exception. 21692 21693- bpo-28871: Fixed a crash when deallocate deep ElementTree. 21694 21695- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and 21696 WeakValueDictionary.pop() when a GC collection happens in another thread. 21697 21698- bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence 21699 that doesn't own its elements as limits. 21700 21701- bpo-28779: multiprocessing.set_forkserver_preload() would crash the 21702 forkserver process if a preloaded module instantiated some multiprocessing 21703 objects such as locks. 21704 21705- bpo-28847: dbm.dumb now supports reading read-only files and no longer 21706 writes the index file when it is not changed. 21707 21708- bpo-26937: The chown() method of the tarfile.TarFile class does not fail 21709 now when the grp module cannot be imported, as for example on Android 21710 platforms. 21711 21712IDLE 21713---- 21714 21715- bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes). 21716 21717- bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and 21718 augment description of the configuration system. 21719 21720Windows 21721------- 21722 21723- bpo-29579: Removes readme.txt from the installer 21724 21725- bpo-29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev) 21726 21727- bpo-28164: Correctly handle special console filenames (patch by Eryk Sun) 21728 21729- bpo-29409: Implement :pep:`529` for io.FileIO (Patch by Eryk Sun) 21730 21731- bpo-29392: Prevent crash when passing invalid arguments into msvcrt 21732 module. 21733 21734- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun) 21735 21736- bpo-28896: Deprecate WindowsRegistryFinder and disable it by default. 21737 21738C API 21739----- 21740 21741- bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if 21742 Py_LIMITED_API is not set or set to the value between 0x03050400 and 21743 0x03060000 (not including) or 0x03060100 or higher. 21744 21745- bpo-29083: Fixed the declaration of some public API functions. 21746 PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in 21747 limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and 21748 Py_BuildValue() were not available in limited API of version < 3.3 when 21749 PY_SSIZE_T_CLEAN is defined. 21750 21751- bpo-29058: All stable API extensions added after Python 3.2 are now 21752 available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of 21753 the minimum Python version supporting this API. 21754 21755Documentation 21756------------- 21757 21758- bpo-28929: Link the documentation to its source file on GitHub. 21759 21760- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer 21761 to aiosmtpd, a third-party asyncio-based replacement. 21762 21763- bpo-26355: Add canonical header link on each page to corresponding major 21764 version of the documentation. Patch by Matthias Bussonnier. 21765 21766- bpo-29349: Fix Python 2 syntax in code for building the documentation. 21767 21768Tests 21769----- 21770 21771- bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip 21772 some tests of select.poll when running on macOS due to unresolved issues 21773 with the underlying system poll function on some macOS versions. 21774 21775- bpo-29571: to match the behaviour of the ``re.LOCALE`` flag, 21776 test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)`` 21777 to determine the candidate encoding for the test regex (allowing it to 21778 correctly skip the test when the default locale encoding is a multi-byte 21779 encoding) 21780 21781- bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line 21782 arguments. 21783 21784- bpo-28683: Fix the tests that bind() a unix socket and raise 21785 PermissionError on Android for a non-root user. 21786 21787- bpo-26939: Add the support.setswitchinterval() function to fix 21788 test_functools hanging on the Android armv7 qemu emulator. 21789 21790Build 21791----- 21792 21793- bpo-27593: sys.version and the platform module python_build(), 21794 python_branch(), and python_revision() functions now use git information 21795 rather than hg when building from a repo. 21796 21797- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k. 21798 21799- bpo-26851: Set Android compilation and link flags. 21800 21801- bpo-28768: Fix implicit declaration of function _setmode. Patch by 21802 Masayuki Yamamoto 21803 21804- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat 21805 21806- bpo-23903: Added missed names to PC/python3.def. 21807 21808- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK 21809 macro is not defined in android-ndk-r13. 21810 21811- bpo-28538: Fix the compilation error that occurs because if_nameindex() is 21812 available on Android API level 24, but the if_nameindex structure is not 21813 defined. 21814 21815- bpo-20211: Do not add the directory for installing C header files and the 21816 directory for installing object code libraries to the cross compilation 21817 search paths. Original patch by Thomas Petazzoni. 21818 21819- bpo-28849: Do not define sys.implementation._multiarch on Android. 21820 21821 21822What's New in Python 3.6.0 final? 21823================================= 21824 21825*Release date: 2016-12-23* 21826 21827No changes since release candidate 2 21828 21829 21830 21831What's New in Python 3.6.0 release candidate 2? 21832=============================================== 21833 21834*Release date: 2016-12-16* 21835 21836Core and Builtins 21837----------------- 21838 21839- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must 21840 not convert combined table into split table. Patch written by INADA Naoki. 21841 21842- bpo-28990: Fix asyncio SSL hanging if connection is closed before 21843 handshake is completed. (Patch by HoHo-Ho) 21844 21845Tools/Demos 21846----------- 21847 21848- bpo-28770: Fix python-gdb.py for fastcalls. 21849 21850Windows 21851------- 21852 21853- bpo-28896: Deprecate WindowsRegistryFinder. 21854 21855Build 21856----- 21857 21858- bpo-28898: Prevent gdb build errors due to HAVE_LONG_LONG redefinition. 21859 21860 21861What's New in Python 3.6.0 release candidate 1? 21862=============================================== 21863 21864*Release date: 2016-12-06* 21865 21866Core and Builtins 21867----------------- 21868 21869- bpo-23722: Rather than silently producing a class that doesn't support 21870 zero-argument ``super()`` in methods, failing to pass the new 21871 ``__classcell__`` namespace entry up to ``type.__new__`` now results in a 21872 ``DeprecationWarning`` and a class that supports zero-argument 21873 ``super()``. 21874 21875- bpo-28797: Modifying the class __dict__ inside the __set_name__ method of 21876 a descriptor that is used inside that class no longer prevents calling the 21877 __set_name__ method of other descriptors. 21878 21879- bpo-28782: Fix a bug in the implementation ``yield from`` when checking if 21880 the next instruction is YIELD_FROM. Regression introduced by WORDCODE 21881 (issue #26647). 21882 21883Library 21884------- 21885 21886- bpo-27030: Unknown escapes in re.sub() replacement template are allowed 21887 again. But they still are deprecated and will be disabled in 3.7. 21888 21889- bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call 21890 warnings.showwarning() if it was overridden inside the context manager. 21891 21892- bpo-27172: To assist with upgrades from 2.7, the previously documented 21893 deprecation of ``inspect.getfullargspec()`` has been reversed. This 21894 decision may be revisited again after the Python 2.7 branch is no longer 21895 officially supported. 21896 21897- bpo-26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and 21898 :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by 21899 Omar Sandoval. 21900 21901- bpo-24142: Reading a corrupt config file left configparser in an invalid 21902 state. Original patch by Florian Höch. 21903 21904- bpo-28843: Fix asyncio C Task to handle exceptions __traceback__. 21905 21906C API 21907----- 21908 21909- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 21910 21911Documentation 21912------------- 21913 21914- bpo-23722: The data model reference and the porting section in the What's 21915 New guide now cover the additional ``__classcell__`` handling needed for 21916 custom metaclasses to fully support :pep:`487` and zero-argument 21917 ``super()``. 21918 21919Tools/Demos 21920----------- 21921 21922- bpo-28023: Fix python-gdb.py didn't support new dict implementation. 21923 21924 21925What's New in Python 3.6.0 beta 4? 21926================================== 21927 21928*Release date: 2016-11-21* 21929 21930Core and Builtins 21931----------------- 21932 21933- bpo-28532: Show sys.version when -V option is supplied twice. 21934 21935- bpo-27100: The with-statement now checks for __enter__ before it checks 21936 for __exit__. This gives less confusing error messages when both methods 21937 are missing. Patch by Jonathan Ellington. 21938 21939- bpo-28746: Fix the set_inheritable() file descriptor method on platforms 21940 that do not have the ioctl FIOCLEX and FIONCLEX commands. 21941 21942- bpo-26920: Fix not getting the locale's charset upon initializing the 21943 interpreter, on platforms that do not have langinfo. 21944 21945- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X 21946 when decode astral characters. Patch by Xiang Zhang. 21947 21948- bpo-19398: Extra slash no longer added to sys.path components in case of 21949 empty compile-time PYTHONPATH components. 21950 21951- bpo-28665: Improve speed of the STORE_DEREF opcode by 40%. 21952 21953- bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch 21954 by Xiang Zhang. 21955 21956- bpo-27243: Change PendingDeprecationWarning -> DeprecationWarning. As it 21957 was agreed in the issue, __aiter__ returning an awaitable should result in 21958 PendingDeprecationWarning in 3.5 and in DeprecationWarning in 3.6. 21959 21960- bpo-26182: Fix a refleak in code that raises DeprecationWarning. 21961 21962- bpo-28721: Fix asynchronous generators aclose() and athrow() to handle 21963 StopAsyncIteration propagation properly. 21964 21965Library 21966------- 21967 21968- bpo-28752: Restored the __reduce__() methods of datetime objects. 21969 21970- bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created 21971 by re.compile(), become comparable (only x==y and x!=y operators). This 21972 change should fix the issue #18383: don't duplicate warning filters when 21973 the warnings module is reloaded (thing usually only done in unit tests). 21974 21975- bpo-20572: The subprocess.Popen.wait method's undocumented endtime 21976 parameter now raises a DeprecationWarning. 21977 21978- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and 21979 from_buffer_copy() methods on abstract classes like Array. 21980 21981- bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch 21982 by Vajrasky Kok 21983 21984- bpo-28563: Fixed possible DoS and arbitrary code execution when handle 21985 plural form selections in the gettext module. The expression parser now 21986 supports exact syntax supported by GNU gettext. 21987 21988- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the 21989 garbage collector is invoked in other thread. Based on patch by Sebastian 21990 Cufre. 21991 21992- bpo-28600: Optimize loop.call_soon. 21993 21994- bpo-28613: Fix get_event_loop() return the current loop if called from 21995 coroutines/callbacks. 21996 21997- bpo-28634: Fix asyncio.isfuture() to support unittest.Mock. 21998 21999- bpo-26081: Fix refleak in _asyncio.Future.__iter__().throw. 22000 22001- bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin 22002 Mayfield. 22003 22004- bpo-28652: Make loop methods reject socket kinds they do not support. 22005 22006- bpo-28653: Fix a refleak in functools.lru_cache. 22007 22008- bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects. 22009 22010- bpo-28704: Fix create_unix_server to support Path-like objects (PEP 519). 22011 22012- bpo-28720: Add collections.abc.AsyncGenerator. 22013 22014Documentation 22015------------- 22016 22017- bpo-28513: Documented command-line interface of zipfile. 22018 22019Tests 22020----- 22021 22022- bpo-28666: Now test.support.rmtree is able to remove unwritable or 22023 unreadable directories. 22024 22025- bpo-23839: Various caches now are cleared before running every test file. 22026 22027Build 22028----- 22029 22030- bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and 22031 Michael Haubenwallner. 22032 22033- bpo-26359: Rename --with-optimiations to --enable-optimizations. 22034 22035- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS. 22036 Patch by Gareth Rees. 22037 22038 22039What's New in Python 3.6.0 beta 3? 22040================================== 22041 22042*Release date: 2016-10-31* 22043 22044Core and Builtins 22045----------------- 22046 22047- bpo-28128: Deprecation warning for invalid str and byte escape sequences 22048 now prints better information about where the error occurs. Patch by 22049 Serhiy Storchaka and Eric Smith. 22050 22051- bpo-28509: dict.update() no longer allocate unnecessary large memory. 22052 22053- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug 22054 build. 22055 22056- bpo-28517: Fixed of-by-one error in the peephole optimizer that caused 22057 keeping unreachable code. 22058 22059- bpo-28214: Improved exception reporting for problematic __set_name__ 22060 attributes. 22061 22062- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception 22063 loss in PyTraceBack_Here(). 22064 22065- bpo-28471: Fix "Python memory allocator called without holding the GIL" 22066 crash in socket.setblocking. 22067 22068Library 22069------- 22070 22071- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if 22072 given empty data twice. Patch by Benjamin Fogle. 22073 22074- bpo-28549: Fixed segfault in curses's addch() with ncurses6. 22075 22076- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar 22077 file with compression before trying to open it without compression. 22078 Otherwise it had 50% chance failed with ignore_zeros=True. 22079 22080- bpo-23262: The webbrowser module now supports Firefox 36+ and derived 22081 browsers. Based on patch by Oleg Broytman. 22082 22083- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused 22084 by representing the scale as float value internally in Tk. tkinter.IntVar 22085 now works if float value is set to underlying Tk variable. 22086 22087- bpo-18844: The various ways of specifying weights for random.choices() now 22088 produce the same result sequences. 22089 22090- bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at 22091 the start of new line after printing a month's calendar. Patch by Xiang 22092 Zhang. 22093 22094- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. 22095 Based on patch by Kaarle Ritvanen. 22096 22097- bpo-28353: os.fwalk() no longer fails on broken links. 22098 22099- bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept 22100 non-None value is passed to it.send(val). 22101 22102- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix 22103 for readability. 22104 22105- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a 22106 workaround to Tix library bug. 22107 22108- bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive. 22109 22110- bpo-25953: re.sub() now raises an error for invalid numerical group 22111 reference in replacement template even if the pattern is not found in the 22112 string. Error message for invalid group reference now includes the group 22113 index and the position of the reference. Based on patch by SilentGhost. 22114 22115- bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by 22116 Mariatta Wijaya. 22117 22118- bpo-28448: Fix C implemented asyncio.Future didn't work on Windows. 22119 22120- bpo-28480: Fix error building socket module when multithreading is 22121 disabled. 22122 22123- bpo-24452: Make webbrowser support Chrome on Mac OS X. 22124 22125- bpo-20766: Fix references leaked by pdb in the handling of SIGINT 22126 handlers. 22127 22128- bpo-28492: Fix how StopIteration exception is raised in _asyncio.Future. 22129 22130- bpo-28500: Fix asyncio to handle async gens GC from another thread. 22131 22132- bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children 22133 are done. Patch by Johannes Ebke. 22134 22135- bpo-26796: Don't configure the number of workers for default threadpool 22136 executor. Initial patch by Hans Lawrenz. 22137 22138- bpo-28544: Implement asyncio.Task in C. 22139 22140Windows 22141------- 22142 22143- bpo-28522: Fixes mishandled buffer reallocation in getpathp.c 22144 22145Build 22146----- 22147 22148- bpo-28444: Fix missing extensions modules when cross compiling. 22149 22150- bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2. 22151 22152- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. 22153 22154Tests 22155----- 22156 22157- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or 22158 missing the effective gid. 22159 22160- bpo-28409: regrtest: fix the parser of command line arguments. 22161 22162 22163What's New in Python 3.6.0 beta 2? 22164================================== 22165 22166*Release date: 2016-10-10* 22167 22168Core and Builtins 22169----------------- 22170 22171- bpo-28183: Optimize and cleanup dict iteration. 22172 22173- bpo-26081: Added C implementation of asyncio.Future. Original patch by 22174 Yury Selivanov. 22175 22176- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). 22177 Patch by Xiang Zhang. 22178 22179- bpo-28376: The type of long range iterator is now registered as Iterator. 22180 Patch by Oren Milman. 22181 22182- bpo-28376: Creating instances of range_iterator by calling range_iterator 22183 type now is deprecated. Patch by Oren Milman. 22184 22185- bpo-28376: The constructor of range_iterator now checks that step is not 22186 0. Patch by Oren Milman. 22187 22188- bpo-26906: Resolving special methods of uninitialized type now causes 22189 implicit initialization of the type instead of a fail. 22190 22191- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original 22192 patch by Niklas Koep. 22193 22194- bpo-24098: Fixed possible crash when AST is changed in process of 22195 compiling it. 22196 22197- bpo-28201: Dict reduces possibility of 2nd conflict in hash table when 22198 hashes have same lower bits. 22199 22200- bpo-28350: String constants with null character no longer interned. 22201 22202- bpo-26617: Fix crash when GC runs during weakref callbacks. 22203 22204- bpo-27942: String constants now interned recursively in tuples and 22205 frozensets. 22206 22207- bpo-21578: Fixed misleading error message when ImportError called with 22208 invalid keyword args. 22209 22210- bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch 22211 by Soumya Sharma. 22212 22213- bpo-28086: Single var-positional argument of tuple subtype was passed 22214 unscathed to the C-defined function. Now it is converted to exact tuple. 22215 22216- bpo-28214: Now __set_name__ is looked up on the class instead of the 22217 instance. 22218 22219- bpo-27955: Fallback on reading /dev/urandom device when the getrandom() 22220 syscall fails with EPERM, for example when blocked by SECCOMP. 22221 22222- bpo-28192: Don't import readline in isolated mode. 22223 22224- Upgrade internal unicode databases to Unicode version 9.0.0. 22225 22226- bpo-28131: Fix a regression in zipimport's compile_source(). zipimport 22227 should use the same optimization level as the interpreter. 22228 22229- bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly 22230 optimize memcpy(). 22231 22232- bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a 22233 "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. 22234 22235- bpo-26182: Raise DeprecationWarning when async and await keywords are used 22236 as variable/attribute/class/function name. 22237 22238Library 22239------- 22240 22241- bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by 22242 Eryk Sun. 22243 22244- bpo-28317: The disassembler now decodes FORMAT_VALUE argument. 22245 22246- bpo-26293: Fixed writing ZIP files that starts not from the start of the 22247 file. Offsets in ZIP file now are relative to the start of the archive in 22248 conforming to the specification. 22249 22250- bpo-28380: unittest.mock Mock autospec functions now properly support 22251 assert_called, assert_not_called, and assert_called_once. 22252 22253- bpo-27181: remove statistics.geometric_mean and defer until 3.7. 22254 22255- bpo-28229: lzma module now supports pathlib. 22256 22257- bpo-28321: Fixed writing non-BMP characters with binary format in 22258 plistlib. 22259 22260- bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan 22261 Furman. 22262 22263- bpo-28227: gzip now supports pathlib. Patch by Ethan Furman. 22264 22265- bpo-27358: Optimized merging var-keyword arguments and improved error 22266 message when passing a non-mapping as a var-keyword argument. 22267 22268- bpo-28257: Improved error message when passing a non-iterable as a 22269 var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. 22270 22271- bpo-28322: Fixed possible crashes when unpickle itertools objects from 22272 incorrect pickle data. Based on patch by John Leitch. 22273 22274- bpo-28228: imghdr now supports pathlib. 22275 22276- bpo-28226: compileall now supports pathlib. 22277 22278- bpo-28314: Fix function declaration (C flags) for the getiterator() method 22279 of xml.etree.ElementTree.Element. 22280 22281- bpo-28148: Stop using localtime() and gmtime() in the time module. 22282 Introduced platform independent _PyTime_localtime API that is similar to 22283 POSIX localtime_r, but available on all platforms. Patch by Ed Schouten. 22284 22285- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 22286 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so 22287 that they don't call itermonthdates() which can cause datetime.date 22288 under/overflow. 22289 22290- bpo-28275: Fixed possible use after free in the decompress() methods of 22291 the LZMADecompressor and BZ2Decompressor classes. Original patch by John 22292 Leitch. 22293 22294- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() 22295 if pass invalid string-like object as a name. Patch by Xiang Zhang. 22296 22297- bpo-18844: random.choices() now has k as a keyword-only argument to 22298 improve the readability of common cases and come into line with the 22299 signature used in other languages. 22300 22301- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. 22302 Patch by Madison May. 22303 22304- bpo-27611: Fixed support of default root window in the tkinter.tix module. 22305 Added the master parameter in the DisplayStyle constructor. 22306 22307- bpo-27348: In the traceback module, restore the formatting of exception 22308 messages like "Exception: None". This fixes a regression introduced in 22309 3.5a2. 22310 22311- bpo-25651: Allow falsy values to be used for msg parameter of subTest(). 22312 22313- bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is 22314 interrupted by a signal and a signal handler raises a Python exception. 22315 22316- bpo-28200: Fix memory leak on Windows in the os module (fix 22317 path_converter() function). 22318 22319- bpo-25400: RobotFileParser now correctly returns default values for 22320 crawl_delay and request_rate. Initial patch by Peter Wirtz. 22321 22322- bpo-27932: Prevent memory leak in win32_ver(). 22323 22324- Fix UnboundLocalError in socket._sendfile_use_sendfile. 22325 22326- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of 22327 os.stat(). Patch by Eryk Sun. 22328 22329- bpo-22493: Warning message emitted by using inline flags in the middle of 22330 regular expression now contains a (truncated) regex pattern. Patch by Tim 22331 Graham. 22332 22333- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an 22334 empty bytestring is passed. 22335 22336- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. 22337 22338- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by 22339 Gergely Imreh and Markus Holtermann. 22340 22341- bpo-28114: Fix a crash in parse_envlist() when env contains byte strings. 22342 Patch by Eryk Sun. 22343 22344- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and 22345 binascii.a2b_qp(). 22346 22347- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by 22348 Kevin Conway. 22349 22350- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by 22351 Seth Michael Larson. 22352 22353- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by 22354 iceboy. 22355 22356- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki. 22357 22358- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect. 22359 22360- bpo-27759: Fix selectors incorrectly retain invalid file descriptors. 22361 Patch by Mark Williams. 22362 22363- bpo-28368: Refuse monitoring processes if the child watcher has no loop 22364 attached. Patch by Vincent Michel. 22365 22366- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader, 22367 add_writer, etc. 22368 22369- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг 22370 Марк. 22371 22372- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor. 22373 22374- bpo-28372: Fix asyncio to support formatting of non-python coroutines. 22375 22376- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг 22377 Марк. 22378 22379- bpo-27972: Prohibit Tasks to await on themselves. 22380 22381Windows 22382------- 22383 22384- bpo-28402: Adds signed catalog files for stdlib on Windows. 22385 22386- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk 22387 Sun) 22388 22389- bpo-28251: Improvements to help manuals on Windows. 22390 22391- bpo-28110: launcher.msi has different product codes between 32-bit and 22392 64-bit 22393 22394- bpo-28161: Opening CON for write access fails 22395 22396- bpo-28162: WindowsConsoleIO readall() fails if first line starts with 22397 Ctrl+Z 22398 22399- bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle 22400 22401- bpo-28164: _PyIO_get_console_type fails for various paths 22402 22403- bpo-28137: Renames Windows path file to ._pth 22404 22405- bpo-28138: Windows ._pth file should allow import site 22406 22407C API 22408----- 22409 22410- bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(), 22411 PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and 22412 PyUnicode_AsEncodedUnicode(). 22413 22414Build 22415----- 22416 22417- bpo-28258: Fixed build with Estonian locale (python-config and distclean 22418 targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. 22419 22420- bpo-26661: setup.py now detects system libffi with multiarch wrapper. 22421 22422- bpo-15819: Remove redundant include search directory option for building 22423 outside the source tree. 22424 22425Tests 22426----- 22427 22428- bpo-28217: Adds _testconsole module to test console input. 22429 22430 22431What's New in Python 3.6.0 beta 1? 22432================================== 22433 22434*Release date: 2016-09-12* 22435 22436Core and Builtins 22437----------------- 22438 22439- bpo-23722: The __class__ cell used by zero-argument super() is now 22440 initialized from type.__new__ rather than __build_class__, so class 22441 methods relying on that will now work correctly when called from metaclass 22442 methods during class creation. Patch by Martin Teichmann. 22443 22444- bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is 22445 compiled with NSMALLPOSINTS = 0. 22446 22447- bpo-27080: Implement formatting support for :pep:`515`. Initial patch by 22448 Chris Angelico. 22449 22450- bpo-27199: In tarfile, expose copyfileobj bufsize to improve throughput. 22451 Patch by Jason Fried. 22452 22453- bpo-27948: In f-strings, only allow backslashes inside the braces (where 22454 the expressions are). This is a breaking change from the 3.6 alpha 22455 releases, where backslashes are allowed anywhere in an f-string. Also, 22456 require that expressions inside f-strings be enclosed within literal 22457 braces, and not escapes like ``f'\x7b"hi"\x7d'``. 22458 22459- bpo-28046: Remove platform-specific directories from sys.path. 22460 22461- bpo-28071: Add early-out for differencing from an empty set. 22462 22463- bpo-25758: Prevents zipimport from unnecessarily encoding a filename 22464 (patch by Eryk Sun) 22465 22466- bpo-25856: The __module__ attribute of extension classes and functions now 22467 is interned. This leads to more compact pickle data with protocol 4. 22468 22469- bpo-27213: Rework CALL_FUNCTION* opcodes to produce shorter and more 22470 efficient bytecode. Patch by Demur Rumed, design by Serhiy Storchaka, 22471 reviewed by Serhiy Storchaka and Victor Stinner. 22472 22473- bpo-26331: Implement tokenizing support for :pep:`515`. Patch by Georg 22474 Brandl. 22475 22476- bpo-27999: Make "global after use" a SyntaxError, and ditto for nonlocal. 22477 Patch by Ivan Levkivskyi. 22478 22479- bpo-28003: Implement :pep:`525` -- Asynchronous Generators. 22480 22481- bpo-27985: Implement :pep:`526` -- Syntax for Variable Annotations. Patch 22482 by Ivan Levkivskyi. 22483 22484- bpo-26058: Add a new private version to the builtin dict type, incremented 22485 at each dictionary creation and at each dictionary change. Implementation 22486 of the PEP 509. 22487 22488- bpo-27364: A backslash-character pair that is not a valid escape sequence 22489 now generates a DeprecationWarning. Patch by Emanuel Barry. 22490 22491- bpo-27350: `dict` implementation is changed like PyPy. It is more compact 22492 and preserves insertion order. (Concept developed by Raymond Hettinger and 22493 patch by Inada Naoki.) 22494 22495- bpo-27911: Remove unnecessary error checks in 22496 ``exec_builtin_or_dynamic()``. 22497 22498- bpo-27078: Added BUILD_STRING opcode. Optimized f-strings evaluation. 22499 22500- bpo-17884: Python now requires systems with inttypes.h and stdint.h 22501 22502- bpo-27961: Require platforms to support ``long long``. Python hasn't 22503 compiled without ``long long`` for years, so this is basically a 22504 formality. 22505 22506- bpo-27355: Removed support for Windows CE. It was never finished, and 22507 Windows CE is no longer a relevant platform for Python. 22508 22509- Implement :pep:`523`. 22510 22511- bpo-27870: A left shift of zero by a large integer no longer attempts to 22512 allocate large amounts of memory. 22513 22514- bpo-25402: In int-to-decimal-string conversion, improve the estimate of 22515 the intermediate memory required, and remove an unnecessarily strict 22516 overflow check. Patch by Serhiy Storchaka. 22517 22518- bpo-27214: In long_invert, be more careful about modifying object returned 22519 by long_add, and remove an unnecessary check for small longs. Thanks Oren 22520 Milman for analysis and patch. 22521 22522- bpo-27506: Support passing the bytes/bytearray.translate() "delete" 22523 argument by keyword. 22524 22525- bpo-27812: Properly clear out a generator's frame's backreference to the 22526 generator to prevent crashes in frame.clear(). 22527 22528- bpo-27811: Fix a crash when a coroutine that has not been awaited is 22529 finalized with warnings-as-errors enabled. 22530 22531- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after 22532 use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes. 22533 22534- bpo-27792: The modulo operation applied to ``bool`` and other ``int`` 22535 subclasses now always returns an ``int``. Previously the return type 22536 depended on the input values. Patch by Xiang Zhang. 22537 22538- bpo-26984: int() now always returns an instance of exact int. 22539 22540- bpo-25604: Fix a minor bug in integer true division; this bug could 22541 potentially have caused off-by-one-ulp results on platforms with 22542 unreliable ldexp implementations. 22543 22544- bpo-24254: Make class definition namespace ordered by default. 22545 22546- bpo-27662: Fix an overflow check in ``List_New``: the original code was 22547 checking against ``Py_SIZE_MAX`` instead of the correct upper bound of 22548 ``Py_SSIZE_T_MAX``. Patch by Xiang Zhang. 22549 22550- bpo-27782: Multi-phase extension module import now correctly allows the 22551 ``m_methods`` field to be used to add module level functions to instances 22552 of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang. 22553 22554- bpo-27936: The round() function accepted a second None argument for some 22555 types but not for others. Fixed the inconsistency by accepting None for 22556 all numeric types. 22557 22558- bpo-27487: Warn if a submodule argument to "python -m" or 22559 runpy.run_module() is found in sys.modules after parent packages are 22560 imported, but before the submodule is executed. 22561 22562- bpo-27157: Make only type() itself accept the one-argument form. Patch by 22563 Eryk Sun and Emanuel Barry. 22564 22565- bpo-27558: Fix a SystemError in the implementation of "raise" statement. 22566 In a brand new thread, raise a RuntimeError since there is no active 22567 exception to reraise. Patch written by Xiang Zhang. 22568 22569- bpo-28008: Implement :pep:`530` -- asynchronous comprehensions. 22570 22571- bpo-27942: Fix memory leak in codeobject.c 22572 22573Library 22574------- 22575 22576- bpo-28732: Fix crash in os.spawnv() with no elements in args 22577 22578- bpo-28485: Always raise ValueError for negative 22579 compileall.compile_dir(workers=...) parameter, even when multithreading is 22580 unavailable. 22581 22582- bpo-28037: Use sqlite3_get_autocommit() instead of setting 22583 Connection->inTransaction manually. 22584 22585- bpo-25283: Attributes tm_gmtoff and tm_zone are now available on all 22586 platforms in the return values of time.localtime() and time.gmtime(). 22587 22588- bpo-24454: Regular expression match object groups are now accessible using 22589 __getitem__. "mo[x]" is equivalent to "mo.group(x)". 22590 22591- bpo-10740: sqlite3 no longer implicitly commit an open transaction before 22592 DDL statements. 22593 22594- bpo-17941: Add a *module* parameter to collections.namedtuple(). 22595 22596- bpo-22493: Inline flags now should be used only at the start of the 22597 regular expression. Deprecation warning is emitted if uses them in the 22598 middle of the regular expression. 22599 22600- bpo-26885: xmlrpc now supports unmarshalling additional data types used by 22601 Apache XML-RPC implementation for numerics and None. 22602 22603- bpo-28070: Fixed parsing inline verbose flag in regular expressions. 22604 22605- bpo-19500: Add client-side SSL session resumption to the ssl module. 22606 22607- bpo-28022: Deprecate ssl-related arguments in favor of SSLContext. The 22608 deprecation include manual creation of SSLSocket and certfile/keyfile (or 22609 similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. 22610 22611- bpo-28043: SSLContext has improved default settings: OP_NO_SSLv2, 22612 OP_NO_SSLv3, OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE, 22613 OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE and HIGH ciphers without MD5. 22614 22615- bpo-24693: Changed some RuntimeError's in the zipfile module to more 22616 appropriate types. Improved some error messages and debugging output. 22617 22618- bpo-17909: ``json.load`` and ``json.loads`` now support binary input 22619 encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka. 22620 22621- bpo-27137: the pure Python fallback implementation of 22622 ``functools.partial`` now matches the behaviour of its accelerated C 22623 counterpart for subclassing, pickling and text representation purposes. 22624 Patch by Emanuel Barry and Serhiy Storchaka. 22625 22626- Fix possible integer overflows and crashes in the mmap module with unusual 22627 usage patterns. 22628 22629- bpo-1703178: Fix the ability to pass the --link-objects option to the 22630 distutils build_ext command. 22631 22632- bpo-28019: itertools.count() no longer rounds non-integer step in range 22633 between 1.0 and 2.0 to 1. 22634 22635- bpo-18401: Pdb now supports the 'readrc' keyword argument to control 22636 whether .pdbrc files should be read. Patch by Martin Matusiak and Sam 22637 Kimbrel. 22638 22639- bpo-25969: Update the lib2to3 grammar to handle the unpacking 22640 generalizations added in 3.5. 22641 22642- bpo-14977: mailcap now respects the order of the lines in the mailcap 22643 files ("first match"), as required by RFC 1542. Patch by Michael Lazar. 22644 22645- bpo-28082: Convert re flag constants to IntFlag. 22646 22647- bpo-28025: Convert all ssl module constants to IntEnum and IntFlags. 22648 SSLContext properties now return flags and enums. 22649 22650- bpo-23591: Add Flag, IntFlag, and auto() to enum module. 22651 22652- bpo-433028: Added support of modifier spans in regular expressions. 22653 22654- bpo-24594: Validates persist parameter when opening MSI database 22655 22656- bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes 22657 (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.) 22658 22659- bpo-28047: Fixed calculation of line length used for the base64 CTE in the 22660 new email policies. 22661 22662- bpo-27576: Fix call order in OrderedDict.__init__(). 22663 22664- email.generator.DecodedGenerator now supports the policy keyword. 22665 22666- bpo-28027: Remove undocumented modules from ``Lib/plat-*``: IN, CDROM, 22667 DLFCN, TYPES, CDIO, and STROPTS. 22668 22669- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by 22670 Claude Paroz. 22671 22672- bpo-24277: The new email API is no longer provisional, and the docs have 22673 been reorganized and rewritten to emphasize the new API. 22674 22675- bpo-22450: urllib now includes an ``Accept: */*`` header among the default 22676 headers. This makes the results of REST API requests more consistent and 22677 predictable especially when proxy servers are involved. 22678 22679- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file 22680 between runs given the same Grammar.txt input regardless of the hash 22681 randomization setting. 22682 22683- bpo-28005: Allow ImportErrors in encoding implementation to propagate. 22684 22685- bpo-26667: Support path-like objects in importlib.util. 22686 22687- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers 22688 in the "ctypes" and "array" modules. 22689 22690- bpo-22233: Break email header lines *only* on the RFC specified CR and LF 22691 characters, not on arbitrary unicode line breaks. This also fixes a bug 22692 in HTTP header parsing. 22693 22694- bpo-27331: The email.mime classes now all accept an optional policy 22695 keyword. 22696 22697- bpo-27988: Fix email iter_attachments incorrect mutation of payload list. 22698 22699- bpo-16113: Add SHA-3 and SHAKE support to hashlib module. 22700 22701- Eliminate a tautological-pointer-compare warning in _scproxy.c. 22702 22703- bpo-27776: The :func:`os.urandom` function does now block on Linux 3.17 22704 and newer until the system urandom entropy pool is initialized to increase 22705 the security. This change is part of the :pep:`524`. 22706 22707- bpo-27778: Expose the Linux ``getrandom()`` syscall as a new 22708 :func:`os.getrandom` function. This change is part of the :pep:`524`. 22709 22710- bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name 22711 fields in X.509 certs. 22712 22713- bpo-18844: Add random.choices(). 22714 22715- bpo-25761: Improved error reporting about truncated pickle data in C 22716 implementation of unpickler. UnpicklingError is now raised instead of 22717 AttributeError and ValueError in some cases. 22718 22719- bpo-26798: Add BLAKE2 (blake2b and blake2s) to hashlib. 22720 22721- bpo-26032: Optimized globbing in pathlib by using os.scandir(); it is now 22722 about 1.5--4 times faster. 22723 22724- bpo-25596: Optimized glob() and iglob() functions in the glob module; they 22725 are now about 3--6 times faster. 22726 22727- bpo-27928: Add scrypt (password-based key derivation function) to hashlib 22728 module (requires OpenSSL 1.1.0). 22729 22730- bpo-27850: Remove 3DES from ssl module's default cipher list to counter 22731 measure sweet32 attack (CVE-2016-2183). 22732 22733- bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list. 22734 (Required OpenSSL 1.1.0 or LibreSSL). 22735 22736- bpo-25387: Check return value of winsound.MessageBeep. 22737 22738- bpo-27866: Add SSLContext.get_ciphers() method to get a list of all 22739 enabled ciphers. 22740 22741- bpo-27744: Add AF_ALG (Linux Kernel crypto) to socket module. 22742 22743- bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0. 22744 22745- bpo-11620: Fix support for SND_MEMORY in winsound.PlaySound. Based on a 22746 patch by Tim Lesher. 22747 22748- bpo-11734: Add support for IEEE 754 half-precision floats to the struct 22749 module. Based on a patch by Eli Stevens. 22750 22751- bpo-27919: Deprecated ``extra_path`` distribution option in distutils 22752 packaging. 22753 22754- bpo-23229: Add new ``cmath`` constants: ``cmath.inf`` and ``cmath.nan`` to 22755 match ``math.inf`` and ``math.nan``, and also ``cmath.infj`` and 22756 ``cmath.nanj`` to match the format used by complex repr. 22757 22758- bpo-27842: The csv.DictReader now returns rows of type OrderedDict. 22759 (Contributed by Steve Holden.) 22760 22761- Remove support for passing a file descriptor to os.access. It never worked 22762 but previously didn't raise. 22763 22764- bpo-12885: Fix error when distutils encounters symlink. 22765 22766- bpo-27881: Fixed possible bugs when setting 22767 sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang. 22768 22769- bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory 22770 creates not a cursor. Patch by Xiang Zhang. 22771 22772- bpo-19884: Avoid spurious output on OS X with Gnu Readline. 22773 22774- bpo-27706: Restore deterministic behavior of random.Random().seed() for 22775 string seeds using seeding version 1. Allows sequences of calls to 22776 random() to exactly match those obtained in Python 2. Patch by Nofar 22777 Schnider. 22778 22779- bpo-10513: Fix a regression in Connection.commit(). Statements should not 22780 be reset after a commit. 22781 22782- bpo-12319: Chunked transfer encoding support added to 22783 http.client.HTTPConnection requests. The 22784 urllib.request.AbstractHTTPHandler class does not enforce a Content-Length 22785 header any more. If a HTTP request has a file or iterable body, but no 22786 Content-Length header, the library now falls back to use chunked 22787 transfer-encoding. 22788 22789- A new version of typing.py from https://github.com/python/typing: - 22790 Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__ 22791 (upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove 22792 the dict constraint in ForwardRef._eval_type (upstream #252) 22793 22794- bpo-27832: Make ``_normalize`` parameter to ``Fraction`` constructor 22795 keyword-only, so that ``Fraction(2, 3, 4)`` now raises ``TypeError``. 22796 22797- bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of 22798 negative exponent and negative base. 22799 22800- bpo-21718: cursor.description is now available for queries using CTEs. 22801 22802- bpo-27819: In distutils sdists, simply produce the "gztar" (gzipped tar 22803 format) distributions on all platforms unless "formats" is supplied. 22804 22805- bpo-2466: posixpath.ismount now correctly recognizes mount points which 22806 the user does not have permission to access. 22807 22808- bpo-9998: On Linux, ctypes.util.find_library now looks in LD_LIBRARY_PATH 22809 for shared libraries. 22810 22811- bpo-27573: exit message for code.interact is now configurable. 22812 22813- bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to 22814 Paulo Andrade and Petr Viktorin for the analysis and patch. 22815 22816- bpo-6766: Distributed reference counting added to multiprocessing to 22817 support nesting of shared values / proxy objects. 22818 22819- bpo-21201: Improves readability of multiprocessing error message. Thanks 22820 to Wojciech Walczak for patch. 22821 22822- asyncio: Add set_protocol / get_protocol to Transports. 22823 22824- bpo-27456: asyncio: Set TCP_NODELAY by default. 22825 22826IDLE 22827---- 22828 22829- bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger 22830 Serwy, updated by Bayard Randel. 22831 22832- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen. 22833 22834- bpo-27891: Consistently group and sort imports within idlelib modules. 22835 22836- bpo-17642: add larger font sizes for classroom projection. 22837 22838- Add version to title of IDLE help window. 22839 22840- bpo-25564: In section on IDLE -- console differences, mention that using 22841 exec means that __builtins__ is defined for each statement. 22842 22843- bpo-27821: Fix 3.6.0a3 regression that prevented custom key sets from 22844 being selected when no custom theme was defined. 22845 22846C API 22847----- 22848 22849- bpo-26900: Excluded underscored names and other private API from limited 22850 API. 22851 22852- bpo-26027: Add support for path-like objects in PyUnicode_FSConverter() & 22853 PyUnicode_FSDecoder(). 22854 22855Tests 22856----- 22857 22858- bpo-27427: Additional tests for the math module. Patch by Francisco Couzo. 22859 22860- bpo-27953: Skip math and cmath tests that fail on OS X 10.4 due to a poor 22861 libm implementation of tan. 22862 22863- bpo-26040: Improve test_math and test_cmath coverage and rigour. Patch by 22864 Jeff Allen. 22865 22866- bpo-27787: Call gc.collect() before checking each test for "dangling 22867 threads", since the dangling threads are weak references. 22868 22869Build 22870----- 22871 22872- bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach) 22873 22874- bpo-27705: Update message in validate_ucrtbase.py 22875 22876- bpo-27976: Deprecate building _ctypes with the bundled copy of libffi on 22877 non-OSX UNIX platforms. 22878 22879- bpo-27983: Cause lack of llvm-profdata tool when using clang as required 22880 for PGO linking to be a configure time error rather than make time when 22881 ``--with-optimizations`` is enabled. Also improve our ability to find the 22882 llvm-profdata tool on MacOS and some Linuxes. 22883 22884- bpo-21590: Support for DTrace and SystemTap probes. 22885 22886- bpo-26307: The profile-opt build now applies PGO to the built-in modules. 22887 22888- bpo-26359: Add the --with-optimizations flag to turn on LTO and PGO build 22889 support when available. 22890 22891- bpo-27917: Set platform triplets for Android builds. 22892 22893- bpo-25825: Update references to the $(LIBPL) installation path on AIX. 22894 This path was changed in 3.2a4. 22895 22896- Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2. 22897 22898- bpo-21122: Fix LTO builds on OS X. 22899 22900- bpo-17128: Build OS X installer with a private copy of OpenSSL. Also 22901 provide a sample Install Certificates command script to install a set of 22902 root certificates from the third-party certifi module. 22903 22904Tools/Demos 22905----------- 22906 22907- bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the 22908 current "re" module, avoid invalid Python backslash escapes, and fix a bug 22909 parsing escaped C quote signs. 22910 22911Windows 22912------- 22913 22914- bpo-28065: Update xz dependency to 5.2.2 and build it from source. 22915 22916- bpo-25144: Ensures TargetDir is set before continuing with custom install. 22917 22918- bpo-1602: Windows console doesn't input or print Unicode (PEP 528) 22919 22920- bpo-27781: Change file system encoding on Windows to UTF-8 (PEP 529) 22921 22922- bpo-27731: Opt-out of MAX_PATH on Windows 10 22923 22924- bpo-6135: Adds encoding and errors parameters to subprocess. 22925 22926- bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec 22927 lookup. 22928 22929- bpo-27982: The functions of the winsound module now accept keyword 22930 arguments. 22931 22932- bpo-20366: Build full text search support into SQLite on Windows. 22933 22934- bpo-27756: Adds new icons for Python files and processes on Windows. 22935 Designs by Cherry Wang. 22936 22937- bpo-27883: Update sqlite to 3.14.1.0 on Windows. 22938 22939 22940What's New in Python 3.6.0 alpha 4? 22941=================================== 22942 22943*Release date: 2016-08-15* 22944 22945Core and Builtins 22946----------------- 22947 22948- bpo-27704: Optimized creating bytes and bytearray from byte-like objects 22949 and iterables. Speed up to 3 times for short objects. Original patch by 22950 Naoki Inada. 22951 22952- bpo-26823: Large sections of repeated lines in tracebacks are now 22953 abbreviated as "[Previous line repeated {count} more times]" by the 22954 builtin traceback rendering. Patch by Emanuel Barry. 22955 22956- bpo-27574: Decreased an overhead of parsing keyword arguments in functions 22957 implemented with using Argument Clinic. 22958 22959- bpo-22557: Now importing already imported modules is up to 2.5 times 22960 faster. 22961 22962- bpo-17596: Include <wincrypt.h> to help with Min GW building. 22963 22964- bpo-17599: On Windows, rename the privately defined REPARSE_DATA_BUFFER 22965 structure to avoid conflicting with the definition from Min GW. 22966 22967- bpo-27507: Add integer overflow check in bytearray.extend(). Patch by 22968 Xiang Zhang. 22969 22970- bpo-27581: Don't rely on wrapping for overflow check in 22971 PySequence_Tuple(). Patch by Xiang Zhang. 22972 22973- bpo-1621: Avoid signed integer overflow in list and tuple operations. 22974 Patch by Xiang Zhang. 22975 22976- bpo-27419: Standard __import__() no longer look up "__import__" in globals 22977 or builtins for importing submodules or "from import". Fixed a crash if 22978 raise a warning about unabling to resolve package from __spec__ or 22979 __package__. 22980 22981- bpo-27083: Respect the PYTHONCASEOK environment variable under Windows. 22982 22983- bpo-27514: Make having too many statically nested blocks a SyntaxError 22984 instead of SystemError. 22985 22986- bpo-27366: Implemented :pep:`487` (Simpler customization of class 22987 creation). Upon subclassing, the __init_subclass__ classmethod is called 22988 on the base class. Descriptors are initialized with __set_name__ after 22989 class creation. 22990 22991Library 22992------- 22993 22994- bpo-26027: Add :pep:`519`/__fspath__() support to the os and os.path 22995 modules. Includes code from Jelle Zijlstra. (See also: bpo-27524) 22996 22997- bpo-27598: Add Collections to collections.abc. Patch by Ivan Levkivskyi, 22998 docs by Neil Girdhar. 22999 23000- bpo-25958: Support "anti-registration" of special methods from various 23001 ABCs, like __hash__, __iter__ or __len__. All these (and several more) 23002 can be set to None in an implementation class and the behavior will be as 23003 if the method is not defined at all. (Previously, this mechanism existed 23004 only for __hash__, to make mutable classes unhashable.) Code contributed 23005 by Andrew Barnert and Ivan Levkivskyi. 23006 23007- bpo-16764: Support keyword arguments to zlib.decompress(). Patch by Xiang 23008 Zhang. 23009 23010- bpo-27736: Prevent segfault after interpreter re-initialization due to ref 23011 count problem introduced in code for Issue #27038 in 3.6.0a3. Patch by 23012 Xiang Zhang. 23013 23014- bpo-25628: The *verbose* and *rename* parameters for 23015 collections.namedtuple are now keyword-only. 23016 23017- bpo-12345: Add mathematical constant tau to math and cmath. See also 23018 :pep:`628`. 23019 23020- bpo-26823: traceback.StackSummary.format now abbreviates large sections of 23021 repeated lines as "[Previous line repeated {count} more times]" (this 23022 change then further affects other traceback display operations in the 23023 module). Patch by Emanuel Barry. 23024 23025- bpo-27664: Add to concurrent.futures.thread.ThreadPoolExecutor() the 23026 ability to specify a thread name prefix. 23027 23028- bpo-27181: Add geometric_mean and harmonic_mean to statistics module. 23029 23030- bpo-27573: code.interact now prints an message when exiting. 23031 23032- bpo-6422: Add autorange method to timeit.Timer objects. 23033 23034- bpo-27773: Correct some memory management errors server_hostname in 23035 _ssl.wrap_socket(). 23036 23037- bpo-26750: unittest.mock.create_autospec() now works properly for 23038 subclasses of property() and other data descriptors. Removes the never 23039 publicly used, never documented unittest.mock.DescriptorTypes tuple. 23040 23041- bpo-26754: Undocumented support of general bytes-like objects as path in 23042 compile() and similar functions is now deprecated. 23043 23044- bpo-26800: Undocumented support of general bytes-like objects as paths in 23045 os functions is now deprecated. 23046 23047- bpo-26981: Add _order_ compatibility shim to enum.Enum for Python 2/3 code 23048 bases. 23049 23050- bpo-27661: Added tzinfo keyword argument to datetime.combine. 23051 23052- In the curses module, raise an error if window.getstr() or window.instr() 23053 is passed a negative value. 23054 23055- bpo-27783: Fix possible usage of uninitialized memory in 23056 operator.methodcaller. 23057 23058- bpo-27774: Fix possible Py_DECREF on unowned object in _sre. 23059 23060- bpo-27760: Fix possible integer overflow in binascii.b2a_qp. 23061 23062- bpo-27758: Fix possible integer overflow in the _csv module for large 23063 record lengths. 23064 23065- bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the 23066 HTTP_PROXY variable when REQUEST_METHOD environment is set, which 23067 indicates that the script is in CGI mode. 23068 23069- bpo-7063: Remove dead code from the "array" module's slice handling. Patch 23070 by Chuck. 23071 23072- bpo-27656: Do not assume sched.h defines any SCHED_* constants. 23073 23074- bpo-27130: In the "zlib" module, fix handling of large buffers (typically 23075 4 GiB) when compressing and decompressing. Previously, inputs were 23076 limited to 4 GiB, and compression and decompression operations did not 23077 properly handle results of 4 GiB. 23078 23079- bpo-24773: Implemented :pep:`495` (Local Time Disambiguation). 23080 23081- Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select 23082 module. 23083 23084- bpo-27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select 23085 module. 23086 23087- bpo-1621: Avoid signed int negation overflow in the "audioop" module. 23088 23089- bpo-27533: Release GIL in nt._isdir 23090 23091- bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original 23092 patch by Alexandre Vassalotti. 23093 23094- bpo-27522: Avoid an unintentional reference cycle in email.feedparser. 23095 23096- bpo-27512: Fix a segfault when os.fspath() called an __fspath__() method 23097 that raised an exception. Patch by Xiang Zhang. 23098 23099IDLE 23100---- 23101 23102- bpo-27714: text_textview and test_autocomplete now pass when re-run in the 23103 same process. This occurs when test_idle fails when run with the -w 23104 option but without -jn. Fix warning from test_config. 23105 23106- bpo-27621: Put query response validation error messages in the query box 23107 itself instead of in a separate messagebox. Redo tests to match. Add Mac 23108 OSX refinements. Original patch by Mark Roseman. 23109 23110- bpo-27620: Escape key now closes Query box as cancelled. 23111 23112- bpo-27609: IDLE: tab after initial whitespace should tab, not 23113 autocomplete. This fixes problem with writing docstrings at least twice 23114 indented. 23115 23116- bpo-27609: Explicitly return None when there are also non-None returns. In 23117 a few cases, reverse a condition and eliminate a return. 23118 23119- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports. 23120 Users must include the same imports required to run directly in Python. 23121 23122- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the 23123 default key set depend on the platform. Add tests for the changes to the 23124 config module. 23125 23126- bpo-27452: add line counter and crc to IDLE configHandler test dump. 23127 23128Tests 23129----- 23130 23131- bpo-25805: Skip a test in test_pkgutil as needed that doesn't work when 23132 ``__name__ == __main__``. Patch by SilentGhost. 23133 23134- bpo-27472: Add test.support.unix_shell as the path to the default shell. 23135 23136- bpo-27369: In test_pyexpat, avoid testing an error message detail that 23137 changed in Expat 2.2.0. 23138 23139- bpo-27594: Prevent assertion error when running test_ast with coverage 23140 enabled: ensure code object has a valid first line number. Patch suggested 23141 by Ivan Levkivskyi. 23142 23143Windows 23144------- 23145 23146- bpo-27647: Update bundled Tcl/Tk to 8.6.6. 23147 23148- bpo-27610: Adds :pep:`514` metadata to Windows installer 23149 23150- bpo-27469: Adds a shell extension to the launcher so that drag and drop 23151 works correctly. 23152 23153- bpo-27309: Enables proper Windows styles in python[w].exe manifest. 23154 23155Build 23156----- 23157 23158- bpo-27713: Suppress spurious build warnings when updating importlib's 23159 bootstrap files. Patch by Xiang Zhang 23160 23161- bpo-25825: Correct the references to Modules/python.exp, which is required 23162 on AIX. The references were accidentally changed in 3.5.0a1. 23163 23164- bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi 23165 Hsuan Yen. 23166 23167- bpo-27641: The configure script now inserts comments into the makefile to 23168 prevent the pgen and _freeze_importlib executables from being 23169 cross-compiled. 23170 23171- bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be 23172 used for file generation during the build. 23173 23174- bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update 23175 FreedBSD version checks for the original ctype UTF-8 workaround. 23176 23177 23178What's New in Python 3.6.0 alpha 3? 23179=================================== 23180 23181*Release date: 2016-07-11* 23182 23183Core and Builtins 23184----------------- 23185 23186- bpo-27473: Fixed possible integer overflow in bytes and bytearray 23187 concatenations. Patch by Xiang Zhang. 23188 23189- bpo-23034: The output of a special Python build with defined COUNT_ALLOCS, 23190 SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It 23191 can be re-enabled using the "-X showalloccount" option. It now outputs to 23192 stderr instead of stdout. 23193 23194- bpo-27443: __length_hint__() of bytearray iterators no longer return a 23195 negative integer for a resized bytearray. 23196 23197- bpo-27007: The fromhex() class methods of bytes and bytearray subclasses 23198 now return an instance of corresponding subclass. 23199 23200Library 23201------- 23202 23203- bpo-26844: Fix error message for imp.find_module() to refer to 'path' 23204 instead of 'name'. Patch by Lev Maximov. 23205 23206- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an 23207 error about unclean EOF. 23208 23209- bpo-27466: Change time format returned by http.cookie.time2netscape, 23210 confirming the netscape cookie format and making it consistent with 23211 documentation. 23212 23213- bpo-21708: Deprecated dbm.dumb behavior that differs from common dbm 23214 behavior: creating a database in 'r' and 'w' modes and modifying a 23215 database in 'r' mode. 23216 23217- bpo-26721: Change the socketserver.StreamRequestHandler.wfile attribute to 23218 implement BufferedIOBase. In particular, the write() method no longer does 23219 partial writes. 23220 23221- bpo-22115: Added methods trace_add, trace_remove and trace_info in the 23222 tkinter.Variable class. They replace old methods trace_variable, trace, 23223 trace_vdelete and trace_vinfo that use obsolete Tcl commands and might not 23224 work in future versions of Tcl. Fixed old tracing methods: 23225 trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now 23226 always returns a list of pairs of strings, tracing in the "u" mode now 23227 works. 23228 23229- bpo-26243: Only the level argument to zlib.compress() is keyword argument 23230 now. The first argument is positional-only. 23231 23232- bpo-27038: Expose the DirEntry type as os.DirEntry. Code patch by Jelle 23233 Zijlstra. 23234 23235- bpo-27186: Update os.fspath()/PyOS_FSPath() to check the return value of 23236 __fspath__() to be either str or bytes. 23237 23238- bpo-18726: All optional parameters of the dump(), dumps(), load() and 23239 loads() functions and JSONEncoder and JSONDecoder class constructors in 23240 the json module are now keyword-only. 23241 23242- bpo-27319: Methods selection_set(), selection_add(), selection_remove() 23243 and selection_toggle() of ttk.TreeView now allow passing multiple items as 23244 multiple arguments instead of passing them as a tuple. Deprecated 23245 undocumented ability of calling the selection() method with arguments. 23246 23247- bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and 23248 ispunct(). 23249 23250- bpo-27294: Numerical state in the repr for Tkinter event objects is now 23251 represented as a combination of known flags. 23252 23253- bpo-27177: Match objects in the re module now support index-like objects 23254 as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang. 23255 23256- bpo-26754: Some functions (compile() etc) accepted a filename argument 23257 encoded as an iterable of integers. Now only strings and byte-like objects 23258 are accepted. 23259 23260- bpo-26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by 23261 Daniel Stokes. 23262 23263- bpo-27048: Prevents distutils failing on Windows when environment 23264 variables contain non-ASCII characters 23265 23266- bpo-27330: Fixed possible leaks in the ctypes module. 23267 23268- bpo-27238: Got rid of bare excepts in the turtle module. Original patch 23269 by Jelle Zijlstra. 23270 23271- bpo-27122: When an exception is raised within the context being managed by 23272 a contextlib.ExitStack() and one of the exit stack generators catches and 23273 raises it in a chain, do not re-raise the original exception when exiting, 23274 let the new chained one through. This avoids the :pep:`479` bug described 23275 in issue25782. 23276 23277Security 23278-------- 23279 23280- bpo-27278: Fix os.urandom() implementation using getrandom() on Linux. 23281 Truncate size to INT_MAX and loop until we collected enough random bytes, 23282 instead of casting a directly Py_ssize_t to int. 23283 23284Library 23285------- 23286 23287- bpo-16864: sqlite3.Cursor.lastrowid now supports REPLACE statement. 23288 Initial patch by Alex LordThorsen. 23289 23290- bpo-26386: Fixed ttk.TreeView selection operations with item id's 23291 containing spaces. 23292 23293- bpo-8637: Honor a pager set by the env var MANPAGER (in preference to one 23294 set by the env var PAGER). 23295 23296Security 23297-------- 23298 23299- bpo-22636: Avoid shell injection problems with ctypes.util.find_library(). 23300 23301Library 23302------- 23303 23304- bpo-16182: Fix various functions in the "readline" module to use the 23305 locale encoding, and fix get_begidx() and get_endidx() to return code 23306 point indexes. 23307 23308- bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton. 23309 23310IDLE 23311---- 23312 23313- bpo-27477: IDLE search dialogs now use ttk widgets. 23314 23315- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the 23316 default key set depend on the platform. Add tests for the changes to the 23317 config module. 23318 23319- bpo-27452: make command line "idle-test> python test_help.py" work. 23320 __file__ is relative when python is started in the file's directory. 23321 23322- bpo-27452: add line counter and crc to IDLE configHandler test dump. 23323 23324- bpo-27380: IDLE: add query.py with base Query dialog and ttk widgets. 23325 Module had subclasses SectionName, ModuleName, and HelpSource, which are 23326 used to get information from users by configdialog and file =>Load Module. 23327 Each subclass has itw own validity checks. Using ModuleName allows users 23328 to edit bad module names instead of starting over. Add tests and delete 23329 the two files combined into the new one. 23330 23331- bpo-27372: Test_idle no longer changes the locale. 23332 23333- bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names. 23334 23335- bpo-27245: IDLE: Cleanly delete custom themes and key bindings. 23336 Previously, when IDLE was started from a console or by import, a cascade 23337 of warnings was emitted. Patch by Serhiy Storchaka. 23338 23339- bpo-24137: Run IDLE, test_idle, and htest with tkinter default root 23340 disabled. Fix code and tests that fail with this restriction. Fix htests 23341 to not create a second and redundant root and mainloop. 23342 23343- bpo-27310: Fix IDLE.app failure to launch on OS X due to vestigial import. 23344 23345C API 23346----- 23347 23348- bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as 23349 an iterable of integers. Now only strings and byte-like objects are 23350 accepted. 23351 23352Build 23353----- 23354 23355- bpo-28066: Fix the logic that searches build directories for generated 23356 include files when building outside the source tree. 23357 23358- bpo-27442: Expose the Android API level that python was built against, in 23359 sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'. 23360 23361- bpo-27434: The interpreter that runs the cross-build, found in PATH, must 23362 now be of the same feature version (e.g. 3.6) as the source being built. 23363 23364- bpo-26930: Update Windows builds to use OpenSSL 1.0.2h. 23365 23366- bpo-23968: Rename the platform directory from plat-$(MACHDEP) to 23367 plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from 23368 config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install 23369 the platform specific _sysconfigdata module into the platform directory 23370 and rename it to include the ABIFLAGS. 23371 23372- Don't use largefile support for GNU/Hurd. 23373 23374Tools/Demos 23375----------- 23376 23377- bpo-27332: Fixed the type of the first argument of module-level functions 23378 generated by Argument Clinic. Patch by Petr Viktorin. 23379 23380- bpo-27418: Fixed Tools/importbench/importbench.py. 23381 23382Documentation 23383------------- 23384 23385- bpo-19489: Moved the search box from the sidebar to the header and footer 23386 of each page. Patch by Ammar Askar. 23387 23388- bpo-27285: Update documentation to reflect the deprecation of ``pyvenv`` 23389 and normalize on the term "virtual environment". Patch by Steve Piercy. 23390 23391Tests 23392----- 23393 23394- bpo-27027: Added test.support.is_android that is True when this is an 23395 Android build. 23396 23397 23398What's New in Python 3.6.0 alpha 2? 23399=================================== 23400 23401*Release date: 2016-06-13* 23402 23403Core and Builtins 23404----------------- 23405 23406- bpo-27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes. 23407 Patch by Demur Rumed. 23408 23409- bpo-27190: Raise NotSupportedError if sqlite3 is older than 3.3.1. Patch 23410 by Dave Sawyer. 23411 23412- bpo-27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. Calling 23413 function with generalized unpacking (PEP 448) and conflicting keyword 23414 names could cause undefined behavior. 23415 23416- bpo-27140: Added BUILD_CONST_KEY_MAP opcode. 23417 23418- bpo-27186: Add support for os.PathLike objects to open() (part of 23419 :pep:`519`). 23420 23421- bpo-27066: Fixed SystemError if a custom opener (for open()) returns a 23422 negative number without setting an exception. 23423 23424- bpo-26983: float() now always return an instance of exact float. The 23425 deprecation warning is emitted if __float__ returns an instance of a 23426 strict subclass of float. In a future versions of Python this can be an 23427 error. 23428 23429- bpo-27097: Python interpreter is now about 7% faster due to optimized 23430 instruction decoding. Based on patch by Demur Rumed. 23431 23432- bpo-26647: Python interpreter now uses 16-bit wordcode instead of 23433 bytecode. Patch by Demur Rumed. 23434 23435- bpo-23275: Allow assigning to an empty target list in round brackets: () = 23436 iterable. 23437 23438- bpo-27243: Update the __aiter__ protocol: instead of returning an 23439 awaitable that resolves to an asynchronous iterator, the asynchronous 23440 iterator should be returned directly. Doing the former will trigger a 23441 PendingDeprecationWarning. 23442 23443Library 23444------- 23445 23446- Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants 23447 exposed on the API which are not implemented on GNU/Hurd. They would not 23448 work at runtime anyway. 23449 23450- bpo-27025: Generated names for Tkinter widgets are now more meaningful and 23451 recognizable. 23452 23453- bpo-25455: Fixed crashes in repr of recursive ElementTree.Element and 23454 functools.partial objects. 23455 23456- bpo-27294: Improved repr for Tkinter event objects. 23457 23458- bpo-20508: Improve exception message of IPv{4,6}Network.__getitem__. Patch 23459 by Gareth Rees. 23460 23461Security 23462-------- 23463 23464- bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283. 23465 23466- Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by 23467 Team Oststrom. 23468 23469Library 23470------- 23471 23472- bpo-21386: Implement missing IPv4Address.is_global property. It was 23473 documented since 07a5610bae9d. Initial patch by Roger Luethi. 23474 23475- bpo-27029: Removed deprecated support of universal newlines mode from 23476 ZipFile.open(). 23477 23478- bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in 23479 regular expressions now are errors. The re.LOCALE flag now can be used 23480 only with bytes patterns. 23481 23482- bpo-27186: Add os.PathLike support to DirEntry (part of :pep:`519`). 23483 Initial patch by Jelle Zijlstra. 23484 23485- bpo-20900: distutils register command now decodes HTTP responses 23486 correctly. Initial patch by ingrid. 23487 23488- bpo-27186: Add os.PathLike support to pathlib, removing its provisional 23489 status (part of PEP 519). Initial patch by Dusty Phillips. 23490 23491- bpo-27186: Add support for os.PathLike objects to os.fsencode() and 23492 os.fsdecode() (part of :pep:`519`). 23493 23494- bpo-27186: Introduce os.PathLike and os.fspath() (part of :pep:`519`). 23495 23496- A new version of typing.py provides several new classes and features: 23497 @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, 23498 Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some 23499 of the new features are not yet implemented in mypy or other static 23500 analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable, 23501 AsyncIterator) have been added (in fact they made it into 3.5.1 but were 23502 never mentioned). 23503 23504- bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from 23505 sending a message body for 205 Reset Content. Also, don't send Content 23506 header fields in responses that don't have a body. Patch by Susumu 23507 Koshiba. 23508 23509- bpo-21313: Fix the "platform" module to tolerate when sys.version contains 23510 truncated build information. 23511 23512Security 23513-------- 23514 23515- bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with 23516 ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom 23517 entropy pool is not initialized yet. Patch written by Colm Buckley. 23518 23519Library 23520------- 23521 23522- bpo-23883: Added missing APIs to __all__ to match the documented APIs for 23523 the following modules: cgi, mailbox, mimetypes, plistlib and smtpd. 23524 Patches by Jacek Kołodziej. 23525 23526- bpo-27164: In the zlib module, allow decompressing raw Deflate streams 23527 with a predefined zdict. Based on patch by Xiang Zhang. 23528 23529- bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely 23530 write data to the client. Previously it could do partial writes and 23531 truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout 23532 doing partial writes, but this is deprecated. 23533 23534- bpo-21272: Use _sysconfigdata.py to initialize distutils.sysconfig. 23535 23536- bpo-19611: :mod:`inspect` now reports the implicit ``.0`` parameters 23537 generated by the compiler for comprehension and generator expression 23538 scopes as if they were positional-only parameters called ``implicit0``. 23539 Patch by Jelle Zijlstra. 23540 23541- bpo-26809: Add ``__all__`` to :mod:`string`. Patch by Emanuel Barry. 23542 23543- bpo-26373: subprocess.Popen.communicate now correctly ignores 23544 BrokenPipeError when the child process dies before .communicate() is 23545 called in more/all circumstances. 23546 23547- signal, socket, and ssl module IntEnum constant name lookups now return a 23548 consistent name for values having multiple names. Ex: signal.Signals(6) 23549 now refers to itself as signal.SIGALRM rather than flipping between that 23550 and signal.SIGIOT based on the interpreter's hash randomization seed. 23551 23552- bpo-27167: Clarify the subprocess.CalledProcessError error message text 23553 when the child process died due to a signal. 23554 23555- bpo-25931: Don't define socketserver.Forking* names on platforms such as 23556 Windows that do not support os.fork(). 23557 23558- bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch 23559 by Claudiu Popa. 23560 23561- bpo-26526: Replace custom parse tree validation in the parser module with 23562 a simple DFA validator. 23563 23564- bpo-27114: Fix SSLContext._load_windows_store_certs fails with 23565 PermissionError 23566 23567- bpo-18383: Avoid creating duplicate filters when using filterwarnings and 23568 simplefilter. Based on patch by Alex Shkop. 23569 23570- bpo-23026: winreg.QueryValueEx() now return an integer for REG_QWORD type. 23571 23572- bpo-26741: subprocess.Popen destructor now emits a ResourceWarning warning 23573 if the child process is still running. 23574 23575- bpo-27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to 23576 deserialize a lot of small objects. 23577 23578- bpo-21271: New keyword only parameters in reset_mock call. 23579 23580IDLE 23581---- 23582 23583- bpo-5124: Paste with text selected now replaces the selection on X11. This 23584 matches how paste works on Windows, Mac, most modern Linux apps, and ttk 23585 widgets. Original patch by Serhiy Storchaka. 23586 23587- bpo-24750: Switch all scrollbars in IDLE to ttk versions. Where needed, 23588 minimal tests are added to cover changes. 23589 23590- bpo-24759: IDLE requires tk 8.5 and availability ttk widgets. Delete now 23591 unneeded tk version tests and code for older versions. Add test for IDLE 23592 syntax colorizer. 23593 23594- bpo-27239: idlelib.macosx.isXyzTk functions initialize as needed. 23595 23596- bpo-27262: move Aqua unbinding code, which enable context menus, to 23597 macosx. 23598 23599- bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is 23600 a private implementation of test.test_idle and tool for maintainers. 23601 23602- bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These 23603 persisted after other warnings were suppressed in #20567. Apply Serhiy 23604 Storchaka's update_idletasks solution to four test files. Record this 23605 additional advice in idle_test/README.txt 23606 23607- bpo-20567: Revise idle_test/README.txt with advice about avoiding tk 23608 warning messages from tests. Apply advice to several IDLE tests. 23609 23610- bpo-24225: Update idlelib/README.txt with new file names and event 23611 handlers. 23612 23613- bpo-27156: Remove obsolete code not used by IDLE. 23614 23615- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move 23616 code for configuring text widget colors to a new function. 23617 23618- bpo-24225: Rename many `idlelib/*.py` and `idle_test/test_*.py` files. 23619 Edit files to replace old names with new names when the old name referred 23620 to the module rather than the class it contained. See the issue and IDLE 23621 section in What's New in 3.6 for more. 23622 23623- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts 23624 on Linux prevented the configuration dialog from opening. 23625 23626- bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav 23627 Heblikar. 23628 23629- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav 23630 Heblikar. 23631 23632- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley 23633 Martínez. 23634 23635- bpo-21703: Add test for undo delegator. Patch mostly by Saimadhav 23636 Heblikar . 23637 23638- bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. 23639 23640- bpo-23977: Add more asserts to test_delegator. 23641 23642Documentation 23643------------- 23644 23645- bpo-16484: Change the default PYTHONDOCS URL to "https:", and fix the 23646 resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik 23647 Nadikuditi. 23648 23649- bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5. 23650 23651- bpo-22558: Add remaining doc links to source code for Python-coded 23652 modules. Patch by Yoni Lavi. 23653 23654Tests 23655----- 23656 23657- bpo-25285: regrtest now uses subprocesses when the -j1 command line option 23658 is used: each test file runs in a fresh child process. Before, the -j1 23659 option was ignored. 23660 23661- bpo-25285: Tools/buildbot/test.bat script now uses -j1 by default to run 23662 each test file in fresh child process. 23663 23664Windows 23665------- 23666 23667- bpo-27064: The py.exe launcher now defaults to Python 3. The Windows 23668 launcher ``py.exe`` no longer prefers an installed Python 2 version over 23669 Python 3 by default when used interactively. 23670 23671Build 23672----- 23673 23674- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by 23675 Xavier de Gaye. 23676 23677- bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with 23678 OpenSSL 1.0.2h. 23679 23680Windows 23681------- 23682 23683- bpo-17500: Remove unused and outdated icons. (See also: 23684 https://github.com/python/pythondotorg/issues/945) 23685 23686C API 23687----- 23688 23689- bpo-27186: Add the PyOS_FSPath() function (part of :pep:`519`). 23690 23691- bpo-26282: PyArg_ParseTupleAndKeywords() now supports positional-only 23692 parameters. 23693 23694Tools/Demos 23695----------- 23696 23697- bpo-26282: Argument Clinic now supports positional-only and keyword 23698 parameters in the same function. 23699 23700 23701What's New in Python 3.6.0 alpha 1? 23702=================================== 23703 23704*Release date: 2016-05-16* 23705 23706Core and Builtins 23707----------------- 23708 23709- bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by 23710 Xavier de Gaye. 23711 23712- bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" 23713 format unit. 23714 23715- bpo-26991: Fix possible refleak when creating a function with annotations. 23716 23717- bpo-27039: Fixed bytearray.remove() for values greater than 127. Based on 23718 patch by Joe Jevnik. 23719 23720- bpo-23640: int.from_bytes() no longer bypasses constructors for 23721 subclasses. 23722 23723- bpo-27005: Optimized the float.fromhex() class method for exact float. It 23724 is now 2 times faster. 23725 23726- bpo-18531: Single var-keyword argument of dict subtype was passed 23727 unscathed to the C-defined function. Now it is converted to exact dict. 23728 23729- bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL 23730 pointer. 23731 23732- bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for 23733 interpolation unintentionally added with move to Python 3. Behavior no 23734 longer does any interpolation in .pypirc files, matching behavior in 23735 Python 2.7 and Setuptools 19.0. 23736 23737- bpo-26249: Memory functions of the :c:func:`PyMem_Malloc` domain 23738 (:c:data:`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc allocator 23739 <pymalloc>` rather than system :c:func:`malloc`. Applications calling 23740 :c:func:`PyMem_Malloc` without holding the GIL can now crash: use 23741 ``PYTHONMALLOC=debug`` environment variable to validate the usage of 23742 memory allocators in your application. 23743 23744- bpo-26802: Optimize function calls only using unpacking like 23745 ``func(*tuple)`` (no other positional argument, no keyword): avoid copying 23746 the tuple. Patch written by Joe Jevnik. 23747 23748- bpo-26659: Make the builtin slice type support cycle collection. 23749 23750- bpo-26718: super.__init__ no longer leaks memory if called multiple times. 23751 NOTE: A direct call of super.__init__ is not endorsed! 23752 23753- bpo-27138: Fix the doc comment for FileFinder.find_spec(). 23754 23755- bpo-27147: Mention :pep:`420` in the importlib docs. 23756 23757- bpo-25339: PYTHONIOENCODING now has priority over locale in setting the 23758 error handler for stdin and stdout. 23759 23760- bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes 23761 are generic sequence iterators, iterators of str, bytes, bytearray, list, 23762 tuple, set, frozenset, dict, OrderedDict, corresponding views and 23763 os.scandir() iterator. 23764 23765- bpo-26574: Optimize ``bytes.replace(b'', b'.')`` and 23766 ``bytearray.replace(b'', b'.')``. Patch written by Josh Snider. 23767 23768- bpo-26581: If coding cookie is specified multiple times on a line in 23769 Python source code file, only the first one is taken to account. 23770 23771- bpo-19711: Add tests for reloading namespace packages. 23772 23773- bpo-21099: Switch applicable importlib tests to use :pep:`451` API. 23774 23775- bpo-26563: Debug hooks on Python memory allocators now raise a fatal error 23776 if functions of the :c:func:`PyMem_Malloc` family are called without 23777 holding the GIL. 23778 23779- bpo-26564: On error, the debug hooks on Python memory allocators now use 23780 the :mod:`tracemalloc` module to get the traceback where a memory block 23781 was allocated. 23782 23783- bpo-26558: The debug hooks on Python memory allocator 23784 :c:func:`PyObject_Malloc` now detect when functions are called without 23785 holding the GIL. 23786 23787- bpo-26516: Add :envvar:`PYTHONMALLOC` environment variable to set the 23788 Python memory allocators and/or install debug hooks. 23789 23790- bpo-26516: The :c:func:`PyMem_SetupDebugHooks` function can now also be 23791 used on Python compiled in release mode. 23792 23793- bpo-26516: The :envvar:`PYTHONMALLOCSTATS` environment variable can now 23794 also be used on Python compiled in release mode. It now has no effect if 23795 set to an empty string. 23796 23797- bpo-26516: In debug mode, debug hooks are now also installed on Python 23798 memory allocators when Python is configured without pymalloc. 23799 23800- bpo-26464: Fix str.translate() when string is ASCII and first replacements 23801 removes character, but next replacement uses a non-ASCII character or a 23802 string longer than 1 character. Regression introduced in Python 3.5.0. 23803 23804- bpo-22836: Ensure exception reports from PyErr_Display() and 23805 PyErr_WriteUnraisable() are sensible even when formatting them produces 23806 secondary errors. This affects the reports produced by 23807 sys.__excepthook__() and when __del__() raises an exception. 23808 23809- bpo-26302: Correct behavior to reject comma as a legal character for 23810 cookie names. 23811 23812- bpo-26136: Upgrade the warning when a generator raises StopIteration from 23813 PendingDeprecationWarning to DeprecationWarning. Patch by Anish Shah. 23814 23815- bpo-26204: The compiler now ignores all constant statements: bytes, str, 23816 int, float, complex, name constants (None, False, True), Ellipsis and 23817 ast.Constant; not only str and int. For example, ``1.0`` is now ignored in 23818 ``def f(): 1.0``. 23819 23820- bpo-4806: Avoid masking the original TypeError exception when using star 23821 (``*``) unpacking in function calls. Based on patch by Hagen Fürstenau 23822 and Daniel Urban. 23823 23824- bpo-26146: Add a new kind of AST node: ``ast.Constant``. It can be used by 23825 external AST optimizers, but the compiler does not emit directly such 23826 node. 23827 23828- bpo-23601: Sped-up allocation of dict key objects by using Python's small 23829 object allocator. (Contributed by Julian Taylor.) 23830 23831- bpo-18018: Import raises ImportError instead of SystemError if a relative 23832 import is attempted without a known parent package. 23833 23834- bpo-25843: When compiling code, don't merge constants if they are equal 23835 but have a different types. For example, ``f1, f2 = lambda: 1, lambda: 23836 1.0`` is now correctly compiled to two different functions: ``f1()`` 23837 returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``float``), even if 23838 ``1`` and ``1.0`` are equal. 23839 23840- bpo-26107: The format of the ``co_lnotab`` attribute of code objects 23841 changes to support negative line number delta. 23842 23843- bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get 23844 the current Python thread state, but don't issue a fatal error if it is 23845 NULL. This new function must be used instead of accessing directly the 23846 _PyThreadState_Current variable. The variable is no more exposed since 23847 Python 3.5.1 to hide the exact implementation of atomic C types, to avoid 23848 compiler issues. 23849 23850- bpo-25791: If __package__ != __spec__.parent or if neither __package__ or 23851 __spec__ are defined then ImportWarning is raised. 23852 23853- bpo-22995: [UPDATE] Comment out the one of the pickleability tests in 23854 _PyObject_GetState() due to regressions observed in Cython-based projects. 23855 23856- bpo-25961: Disallowed null characters in the type name. 23857 23858- bpo-25973: Fix segfault when an invalid nonlocal statement binds a name 23859 starting with two underscores. 23860 23861- bpo-22995: Instances of extension types with a state that aren't 23862 subclasses of list or dict and haven't implemented any pickle-related 23863 methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or 23864 __getstate__), can no longer be pickled. Including memoryview. 23865 23866- bpo-20440: Massive replacing unsafe attribute setting code with special 23867 macro Py_SETREF. 23868 23869- bpo-25766: Special method __bytes__() now works in str subclasses. 23870 23871- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size. 23872 This allows sys.getsize() to work correctly with their subclasses with 23873 __slots__ defined. 23874 23875- bpo-25709: Fixed problem with in-place string concatenation and utf-8 23876 cache. 23877 23878- bpo-5319: New Py_FinalizeEx() API allowing Python to set an exit status of 23879 120 on failure to flush buffered streams. 23880 23881- bpo-25485: telnetlib.Telnet is now a context manager. 23882 23883- bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside 23884 __getattr__. 23885 23886- bpo-24731: Fixed crash on converting objects with special methods 23887 __bytes__, __trunc__, and __float__ returning instances of subclasses of 23888 bytes, int, and float to subclasses of bytes, int, and float 23889 correspondingly. 23890 23891- bpo-25630: Fix a possible segfault during argument parsing in functions 23892 that accept filesystem paths. 23893 23894- bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess 23895 internals regarding how fds_to_pass were passed to the child. The bug had 23896 no actual impact as subprocess.py already avoided it. 23897 23898- bpo-25388: Fixed tokenizer crash when processing undecodable source code 23899 with a null byte. 23900 23901- bpo-25462: The hash of the key now is calculated only once in most 23902 operations in C implementation of OrderedDict. 23903 23904- bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now 23905 rejects builtin types with not defined __new__. 23906 23907- bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec() 23908 and eval() are passed bytes-like objects. These objects are not 23909 necessarily terminated by a null byte, but the functions assumed they 23910 were. 23911 23912- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node 23913 when compiling AST from Python objects. 23914 23915- bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that 23916 was mutated by direct calls of dict methods. 23917 23918- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises 23919 KeyError in C implementations as well as in Python implementation. 23920 23921- bpo-25395: Fixed crash when highly nested OrderedDict structures were 23922 garbage collected. 23923 23924- bpo-25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now 23925 between 2x and 3.5x faster. 23926 23927- bpo-25399: Optimize bytearray % args using the new private _PyBytesWriter 23928 API. Formatting is now between 2.5 and 5 times faster. 23929 23930- bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new 23931 recursion limit is too low depending at the current recursion depth. 23932 Modify also the "lower-water mark" formula to make it monotonic. This mark 23933 is used to decide when the overflowed flag of the thread state is reset. 23934 23935- bpo-24402: Fix input() to prompt to the redirected stdout when 23936 sys.stdout.fileno() fails. 23937 23938- bpo-25349: Optimize bytes % args using the new private _PyBytesWriter API. 23939 Formatting is now up to 2 times faster. 23940 23941- bpo-24806: Prevent builtin types that are not allowed to be subclassed 23942 from being subclassed through multiple inheritance. 23943 23944- bpo-25301: The UTF-8 decoder is now up to 15 times as fast for error 23945 handlers: ``ignore``, ``replace`` and ``surrogateescape``. 23946 23947- bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data. 23948 23949- bpo-25267: The UTF-8 encoder is now up to 75 times as fast for error 23950 handlers: ``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass``. 23951 Patch co-written with Serhiy Storchaka. 23952 23953- bpo-25280: Import trace messages emitted in verbose (-v) mode are no 23954 longer formatted twice. 23955 23956- bpo-25227: Optimize ASCII and latin1 encoders with the ``surrogateescape`` 23957 error handler: the encoders are now up to 3 times as fast. Initial patch 23958 written by Serhiy Storchaka. 23959 23960- bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom() 23961 function instead of the getentropy() function. The getentropy() function 23962 is blocking to generate very good quality entropy, os.urandom() doesn't 23963 need such high-quality entropy. 23964 23965- bpo-9232: Modify Python's grammar to allow trailing commas in the argument 23966 list of a function declaration. For example, "def f(\*, a = 3,): pass" is 23967 now legal. Patch from Mark Dickinson. 23968 23969- bpo-24965: Implement :pep:`498` "Literal String Interpolation". This 23970 allows you to embed expressions inside f-strings, which are converted to 23971 normal strings at run time. Given x=3, then f'value={x}' == 'value=3'. 23972 Patch by Eric V. Smith. 23973 23974- bpo-26478: Fix semantic bugs when using binary operators with dictionary 23975 views and tuples. 23976 23977- bpo-26171: Fix possible integer overflow and heap corruption in 23978 zipimporter.get_data(). 23979 23980- bpo-25660: Fix TAB key behaviour in REPL with readline. 23981 23982- bpo-26288: Optimize PyLong_AsDouble. 23983 23984- bpo-26289: Optimize floor and modulo division for single-digit longs. 23985 Microbenchmarks show 2-2.5x improvement. Built-in 'divmod' function is 23986 now also ~10% faster. (See also: bpo-26315) 23987 23988- bpo-25887: Raise a RuntimeError when a coroutine object is awaited more 23989 than once. 23990 23991Library 23992------- 23993 23994- bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by 23995 SELinux and fails with EACCESS. The function now falls back to fcntl(). 23996 Patch written by Michał Bednarski. 23997 23998- bpo-27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure! 23999 24000- bpo-27031: Removed dummy methods in Tkinter widget classes: tk_menuBar() 24001 and tk_bindForTraversal(). 24002 24003- bpo-14132: Fix urllib.request redirect handling when the target only has a 24004 query string. Original fix by Ján Janech. 24005 24006- bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes 24007 found in redirect target URLs. Some servers send Location header fields 24008 with non-ASCII bytes, but "http.client" requires the request target to be 24009 ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch 24010 by Christian Heimes. 24011 24012- bpo-27033: The default value of the decode_data parameter for 24013 smtpd.SMTPChannel and smtpd.SMTPServer constructors is changed to False. 24014 24015- bpo-27034: Removed deprecated class asynchat.fifo. 24016 24017- bpo-26870: Added readline.set_auto_history(), which can stop entries being 24018 automatically added to the history list. Based on patch by Tyler 24019 Crompton. 24020 24021- bpo-26039: zipfile.ZipFile.open() can now be used to write data into a ZIP 24022 file, as well as for extracting data. Patch by Thomas Kluyver. 24023 24024- bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch 24025 contributed by Chi Hsuan Yen. 24026 24027- bpo-22274: In the subprocess module, allow stderr to be redirected to 24028 stdout even when stdout is not redirected. Patch by Akira Li. 24029 24030- bpo-26807: mock_open 'files' no longer error on readline at end of file. 24031 Patch from Yolanda Robla. 24032 24033- bpo-25745: Fixed leaking a userptr in curses panel destructor. 24034 24035- bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper 24036 in statistics.pvariance. 24037 24038- bpo-26002: Use bisect in statistics.median instead of a linear search. 24039 Patch by Upendra Kuma. 24040 24041- bpo-25974: Make use of new Decimal.as_integer_ratio() method in statistics 24042 module. Patch by Stefan Krah. 24043 24044- bpo-26996: Add secrets module as described in :pep:`506`. 24045 24046- bpo-26881: The modulefinder module now supports extended opcode arguments. 24047 24048- bpo-23815: Fixed crashes related to directly created instances of types in 24049 _tkinter and curses.panel modules. 24050 24051- bpo-17765: weakref.ref() no longer silently ignores keyword arguments. 24052 Patch by Georg Brandl. 24053 24054- bpo-26873: xmlrpc now raises ResponseError on unsupported type tags 24055 instead of silently return incorrect result. 24056 24057- bpo-26915: The __contains__ methods in the collections ABCs now check for 24058 identity before checking equality. This better matches the behavior of 24059 the concrete classes, allows sensible handling of NaNs, and makes it 24060 easier to reason about container invariants. 24061 24062- bpo-26711: Fixed the comparison of plistlib.Data with other types. 24063 24064- bpo-24114: Fix an uninitialized variable in `ctypes.util`. The bug only 24065 occurs on SunOS when the ctypes implementation searches for the `crle` 24066 program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos. 24067 24068- bpo-26864: In urllib.request, change the proxy bypass host checking 24069 against no_proxy to be case-insensitive, and to not match unrelated host 24070 names that happen to have a bypassed hostname as a suffix. Patch by Xiang 24071 Zhang. 24072 24073- bpo-24902: Print server URL on http.server startup. Initial patch by 24074 Felix Kaiser. 24075 24076- bpo-25788: fileinput.hook_encoded() now supports an "errors" argument for 24077 passing to open. Original patch by Joseph Hackman. 24078 24079- bpo-26634: recursive_repr() now sets __qualname__ of wrapper. Patch by 24080 Xiang Zhang. 24081 24082- bpo-26804: urllib.request will prefer lower_case proxy environment 24083 variables over UPPER_CASE or Mixed_Case ones. Patch contributed by 24084 Hans-Peter Jansen. 24085 24086- bpo-26837: assertSequenceEqual() now correctly outputs non-stringified 24087 differing items (like bytes in the -b mode). This affects 24088 assertListEqual() and assertTupleEqual(). 24089 24090- bpo-26041: Remove "will be removed in Python 3.7" from deprecation 24091 messages of platform.dist() and platform.linux_distribution(). Patch by 24092 Kumaripaba Miyurusara Athukorala. 24093 24094- bpo-26822: itemgetter, attrgetter and methodcaller objects no longer 24095 silently ignore keyword arguments. 24096 24097- bpo-26733: Disassembling a class now disassembles class and static 24098 methods. Patch by Xiang Zhang. 24099 24100- bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch 24101 :exc:`AttributeError` instead of :exc:`NameError`. Patch written by 24102 Emanuel Barry. 24103 24104- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name 24105 and link field limits for multibyte character encodings like utf-8. 24106 24107Security 24108-------- 24109 24110- bpo-26657: Fix directory traversal vulnerability with http.server on 24111 Windows. This fixes a regression that was introduced in 3.3.4rc1 and 24112 3.4.0rc1. Based on patch by Philipp Hagemeister. 24113 24114Library 24115------- 24116 24117- bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by 24118 Anthony Sottile. 24119 24120- bpo-26782: Add STARTUPINFO to subprocess.__all__ on Windows. 24121 24122- bpo-26404: Add context manager to socketserver. Patch by Aviv Palivoda. 24123 24124- bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading 24125 more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of 24126 1024 bytes per call. 24127 24128- bpo-26585: Eliminate http.server._quote_html() and use 24129 html.escape(quote=False). Patch by Xiang Zhang. 24130 24131- bpo-26685: Raise OSError if closing a socket fails. 24132 24133- bpo-16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'. 24134 24135- bpo-13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson. 24136 24137- bpo-26587: the site module now allows .pth files to specify files to be 24138 added to sys.path (e.g. zip files). 24139 24140- bpo-25609: Introduce contextlib.AbstractContextManager and 24141 typing.ContextManager. 24142 24143- bpo-26709: Fixed Y2038 problem in loading binary PLists. 24144 24145- bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our 24146 own SIGWINCH handler. Patch by Eric Price. 24147 24148- bpo-25951: Change SSLSocket.sendall() to return None, as explicitly 24149 documented for plain socket objects. Patch by Aviv Palivoda. 24150 24151- bpo-26586: In http.server, respond with "413 Request header fields too 24152 large" if there are too many header fields to parse, rather than killing 24153 the connection and raising an unhandled exception. Patch by Xiang Zhang. 24154 24155- bpo-26676: Added missing XMLPullParser to ElementTree.__all__. 24156 24157- bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable() 24158 to always return False. 24159 24160- bpo-26492: Exhausted iterator of array.array now conforms with the 24161 behavior of iterators of other mutable sequences: it lefts exhausted even 24162 if iterated array is extended. 24163 24164- bpo-26641: doctest.DocFileTest and doctest.testfile() now support packages 24165 (module splitted into multiple directories) for the package parameter. 24166 24167- bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of 24168 tuple (changeset 3603bae63c13 only works for classes) so we need to 24169 implement __ne__ ourselves. Patch by Andrew Plummer. 24170 24171- bpo-26644: Raise ValueError rather than SystemError when a negative length 24172 is passed to SSLSocket.recv() or read(). 24173 24174- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes 24175 instead of up to 1024. 24176 24177- bpo-26616: Fixed a bug in datetime.astimezone() method. 24178 24179- bpo-26637: The :mod:`importlib` module now emits an :exc:`ImportError` 24180 rather than a :exc:`TypeError` if :func:`__import__` is tried during the 24181 Python shutdown process but :data:`sys.path` is already cleared (set to 24182 ``None``). 24183 24184- bpo-21925: :func:`warnings.formatwarning` now catches exceptions when 24185 calling :func:`linecache.getline` and 24186 :func:`tracemalloc.get_object_traceback` to be able to log 24187 :exc:`ResourceWarning` emitted late during the Python shutdown process. 24188 24189- bpo-23848: On Windows, faulthandler.enable() now also installs an 24190 exception handler to dump the traceback of all Python threads on any 24191 Windows exception, not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT). 24192 24193- bpo-26530: Add C functions :c:func:`_PyTraceMalloc_Track` and 24194 :c:func:`_PyTraceMalloc_Untrack` to track memory blocks using the 24195 :mod:`tracemalloc` module. Add :c:func:`_PyTraceMalloc_GetTraceback` to 24196 get the traceback of an object. 24197 24198- bpo-26588: The _tracemalloc now supports tracing memory allocations of 24199 multiple address spaces (domains). 24200 24201- bpo-24266: Ctrl+C during Readline history search now cancels the search 24202 mode when compiled with Readline 7. 24203 24204- bpo-26590: Implement a safe finalizer for the _socket.socket type. It now 24205 releases the GIL to close the socket. 24206 24207- bpo-18787: spwd.getspnam() now raises a PermissionError if the user 24208 doesn't have privileges. 24209 24210- bpo-26560: Avoid potential ValueError in BaseHandler.start_response. 24211 Initial patch by Peter Inglesby. 24212 24213- bpo-26567: Add a new function :c:func:`PyErr_ResourceWarning` function to 24214 pass the destroyed object. Add a *source* attribute to 24215 :class:`warnings.WarningMessage`. Add warnings._showwarnmsg() which uses 24216 tracemalloc to get the traceback where source object was allocated. 24217 24218Security 24219-------- 24220 24221- bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is 24222 empty. Patch by Baji. 24223 24224Library 24225------- 24226 24227- bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex` 24228 to support importing packages. 24229 24230- bpo-26499: Account for remaining Content-Length in HTTPResponse.readline() 24231 and read1(). Based on patch by Silent Ghost. Also document that 24232 HTTPResponse now supports these methods. 24233 24234- bpo-25320: Handle sockets in directories unittest discovery is scanning. 24235 Patch from Victor van den Elzen. 24236 24237- bpo-16181: cookiejar.http2time() now returns None if year is higher than 24238 datetime.MAXYEAR. 24239 24240- bpo-26513: Fixes platform module detection of Windows Server 24241 24242- bpo-23718: Fixed parsing time in week 0 before Jan 1. Original patch by 24243 Tamás Bence Gedai. 24244 24245- bpo-26323: Add Mock.assert_called() and Mock.assert_called_once() methods 24246 to unittest.mock. Patch written by Amit Saha. 24247 24248- bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise 24249 NotImplementedError instead of ImportError. 24250 24251- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets. 24252 24253- bpo-15068: Got rid of excessive buffering in fileinput. The bufsize 24254 parameter is now deprecated and ignored. 24255 24256- bpo-19475: Added an optional argument timespec to the datetime isoformat() 24257 method to choose the precision of the time component. 24258 24259- bpo-2202: Fix UnboundLocalError in 24260 AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu 24261 Dupuy. 24262 24263- bpo-26167: Minimized overhead in copy.copy() and copy.deepcopy(). 24264 Optimized copying and deepcopying bytearrays, NotImplemented, slices, 24265 short lists, tuples, dicts, sets. 24266 24267- bpo-25718: Fixed pickling and copying the accumulate() iterator with total 24268 is None. 24269 24270- bpo-26475: Fixed debugging output for regular expressions with the (?x) 24271 flag. 24272 24273- bpo-26482: Allowed pickling recursive dequeues. 24274 24275- bpo-26335: Make mmap.write() return the number of bytes written like other 24276 write methods. Patch by Jakub Stasiak. 24277 24278- bpo-26457: Fixed the subnets() methods in IP network classes for the case 24279 when resulting prefix length is equal to maximal prefix length. Based on 24280 patch by Xiang Zhang. 24281 24282- bpo-26385: Remove the file if the internal open() call in 24283 NamedTemporaryFile() fails. Patch by Silent Ghost. 24284 24285- bpo-26402: Fix XML-RPC client to retry when the server shuts down a 24286 persistent connection. This was a regression related to the new 24287 http.client.RemoteDisconnected exception in 3.5.0a4. 24288 24289- bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with 24290 adobe=True. Patch by Swati Jaiswal. 24291 24292- bpo-26186: Remove an invalid type check in importlib.util.LazyLoader. 24293 24294- bpo-26367: importlib.__import__() raises ImportError like 24295 builtins.__import__() when ``level`` is specified but without an 24296 accompanying package specified. 24297 24298- bpo-26309: In the "socketserver" module, shut down the request (closing 24299 the connected socket) when verify_request() returns false. Patch by Aviv 24300 Palivoda. 24301 24302- bpo-23430: Change the socketserver module to only catch exceptions raised 24303 from a request handler that are derived from Exception (instead of 24304 BaseException). Therefore SystemExit and KeyboardInterrupt no longer 24305 trigger the handle_error() method, and will now to stop a single-threaded 24306 server. 24307 24308Security 24309-------- 24310 24311- bpo-25939: On Windows open the cert store readonly in 24312 ssl.enum_certificates. 24313 24314Library 24315------- 24316 24317- bpo-25995: os.walk() no longer uses FDs proportional to the tree depth. 24318 24319- bpo-25994: Added the close() method and the support of the context manager 24320 protocol for the os.scandir() iterator. 24321 24322- bpo-23992: multiprocessing: make MapResult not fail-fast upon exception. 24323 24324- bpo-26243: Support keyword arguments to zlib.compress(). Patch by Aviv 24325 Palivoda. 24326 24327- bpo-26117: The os.scandir() iterator now closes file descriptor not only 24328 when the iteration is finished, but when it was failed with error. 24329 24330- bpo-25949: __dict__ for an OrderedDict instance is now created only when 24331 needed. 24332 24333- bpo-25911: Restored support of bytes paths in os.walk() on Windows. 24334 24335- bpo-26045: Add UTF-8 suggestion to error message when posting a 24336 non-Latin-1 string with http.client. 24337 24338- bpo-26039: Added zipfile.ZipInfo.from_file() and zipinfo.ZipInfo.is_dir(). 24339 Patch by Thomas Kluyver. 24340 24341- bpo-12923: Reset FancyURLopener's redirect counter even if there is an 24342 exception. Based on patches by Brian Brazil and Daniel Rocco. 24343 24344- bpo-25945: Fixed a crash when unpickle the functools.partial object with 24345 wrong state. Fixed a leak in failed functools.partial constructor. "args" 24346 and "keywords" attributes of functools.partial have now always types tuple 24347 and dict correspondingly. 24348 24349- bpo-26202: copy.deepcopy() now correctly copies range() objects with 24350 non-atomic attributes. 24351 24352- bpo-23076: Path.glob() now raises a ValueError if it's called with an 24353 invalid pattern. Patch by Thomas Nyberg. 24354 24355- bpo-19883: Fixed possible integer overflows in zipimport. 24356 24357- bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and 24358 gethostbyname_ex() functions of the socket module now decode the hostname 24359 from the ANSI code page rather than UTF-8. 24360 24361- bpo-26099: The site module now writes an error into stderr if 24362 sitecustomize module can be imported but executing the module raise an 24363 ImportError. Same change for usercustomize. 24364 24365- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8 24366 encoding. 24367 24368- bpo-25935: Garbage collector now breaks reference loops with OrderedDict. 24369 24370- bpo-16620: Fixed AttributeError in msilib.Directory.glob(). 24371 24372- bpo-26013: Added compatibility with broken protocol 2 pickles created in 24373 old Python 3 versions (3.4.3 and lower). 24374 24375- bpo-26129: Deprecated accepting non-integers in grp.getgrgid(). 24376 24377- bpo-25850: Use cross-compilation by default for 64-bit Windows. 24378 24379- bpo-25822: Add docstrings to the fields of urllib.parse results. Patch 24380 contributed by Swati Jaiswal. 24381 24382- bpo-22642: Convert trace module option parsing mechanism to argparse. 24383 Patch contributed by SilentGhost. 24384 24385- bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing 24386 before $() vars. 24387 24388- bpo-26069: Remove the deprecated apis in the trace module. 24389 24390- bpo-22138: Fix mock.patch behavior when patching descriptors. Restore 24391 original values after patching. Patch contributed by Sean McCully. 24392 24393- bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode 24394 option if it is safe to do so. 24395 24396- bpo-26012: Don't traverse into symlinks for ``**`` pattern in 24397 pathlib.Path.[r]glob(). 24398 24399- bpo-24120: Ignore PermissionError when traversing a tree with 24400 pathlib.Path.[r]glob(). Patch by Ulrich Petri. 24401 24402- bpo-21815: Accept ] characters in the data portion of imap responses, in 24403 order to handle the flags with square brackets accepted and produced by 24404 servers such as gmail. 24405 24406- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer 24407 attribute (restores backward compatibility). 24408 24409- bpo-25971: Optimized creating Fractions from floats by 2 times and from 24410 Decimals by 3 times. 24411 24412- bpo-25802: Document as deprecated the remaining implementations of 24413 importlib.abc.Loader.load_module(). 24414 24415- bpo-25928: Add Decimal.as_integer_ratio(). 24416 24417- bpo-25447: Copying the lru_cache() wrapper object now always works, 24418 independently from the type of the wrapped object (by returning the 24419 original object unchanged). 24420 24421- bpo-25768: Have the functions in compileall return booleans instead of 24422 ints and add proper documentation and tests for the return values. 24423 24424- bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser. 24425 24426- bpo-25860: os.fwalk() no longer skips remaining directories when error 24427 occurs. Original patch by Samson Lee. 24428 24429- bpo-25914: Fixed and simplified OrderedDict.__sizeof__. 24430 24431- bpo-25869: Optimized deepcopying ElementTree; it is now 20 times faster. 24432 24433- bpo-25873: Optimized iterating ElementTree. Iterating elements 24434 Element.iter() is now 40% faster, iterating text Element.itertext() is now 24435 up to 2.5 times faster. 24436 24437- bpo-25902: Fixed various refcount issues in ElementTree iteration. 24438 24439- bpo-22227: The TarFile iterator is reimplemented using generator. This 24440 implementation is simpler that using class. 24441 24442- bpo-25638: Optimized ElementTree.iterparse(); it is now 2x faster. 24443 Optimized ElementTree parsing; it is now 10% faster. 24444 24445- bpo-25761: Improved detecting errors in broken pickle data. 24446 24447- bpo-25717: Restore the previous behaviour of tolerating most fstat() 24448 errors when opening files. This was a regression in 3.5a1, and stopped 24449 anonymous temporary files from working in special cases. 24450 24451- bpo-24903: Fix regression in number of arguments compileall accepts when 24452 '-d' is specified. The check on the number of arguments has been dropped 24453 completely as it never worked correctly anyway. 24454 24455- bpo-25764: In the subprocess module, preserve any exception caused by 24456 fork() failure when preexec_fn is used. 24457 24458- bpo-25771: Tweak the exception message for importlib.util.resolve_name() 24459 when 'package' isn't specified but necessary. 24460 24461- bpo-6478: _strptime's regexp cache now is reset after changing timezone 24462 with time.tzset(). 24463 24464- bpo-14285: When executing a package with the "python -m package" option, 24465 and package initialization fails, a proper traceback is now reported. The 24466 "runpy" module now lets exceptions from package initialization pass back 24467 to the caller, rather than raising ImportError. 24468 24469- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message 24470 ". . . is a package and cannot be directly executed" if the package could 24471 not even be initialized (e.g. due to a bad ``*.pyc`` file). 24472 24473- bpo-25177: Fixed problem with the mean of very small and very large 24474 numbers. As a side effect, statistics.mean and statistics.variance should 24475 be significantly faster. 24476 24477- bpo-25718: Fixed copying object with state with boolean value is false. 24478 24479- bpo-10131: Fixed deep copying of minidom documents. Based on patch by 24480 Marian Ganisin. 24481 24482- bpo-7990: dir() on ElementTree.Element now lists properties: "tag", 24483 "text", "tail" and "attrib". Original patch by Santoso Wijaya. 24484 24485- bpo-25725: Fixed a reference leak in pickle.loads() when unpickling 24486 invalid data including tuple instructions. 24487 24488- bpo-25663: In the Readline completer, avoid listing duplicate global 24489 names, and search the global namespace before searching builtins. 24490 24491- bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error. 24492 24493- bpo-23914: Fixed SystemError raised by unpickler on broken pickle data. 24494 24495- bpo-25691: Fixed crash on deleting ElementTree.Element attributes. 24496 24497- bpo-25624: ZipFile now always writes a ZIP_STORED header for directory 24498 entries. Patch by Dingyuan Wang. 24499 24500- bpo-25626: Change three zlib functions to accept sizes that fit in 24501 Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a 24502 regression in 3.5 where GzipFile.read() failed to read chunks larger than 24503 2 or 4 GiB. The change affects the zlib.Decompress.decompress() 24504 max_length parameter, the zlib.decompress() bufsize parameter, and the 24505 zlib.Decompress.flush() length parameter. 24506 24507- bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True) 24508 when the OS gives priority to errors such as EACCES over EEXIST. 24509 24510- bpo-25593: Change semantics of EventLoop.stop() in asyncio. 24511 24512- bpo-6973: When we know a subprocess.Popen process has died, do not allow 24513 the send_signal(), terminate(), or kill() methods to do anything as they 24514 could potentially signal a different process. 24515 24516- bpo-23883: Added missing APIs to __all__ to match the documented APIs for 24517 the following modules: calendar, csv, enum, fileinput, ftplib, logging, 24518 optparse, tarfile, threading and wave. Also added a 24519 test.support.check__all__() helper. Patches by Jacek Kołodziej, Mauro S. 24520 M. Rodrigues and Joel Taddei. 24521 24522- bpo-25590: In the Readline completer, only call getattr() once per 24523 attribute. Also complete names of attributes such as properties and slots 24524 which are listed by dir() but not yet created on an instance. 24525 24526- bpo-25498: Fix a crash when garbage-collecting ctypes objects created by 24527 wrapping a memoryview. This was a regression made in 3.5a1. Based on 24528 patch by Eryksun. 24529 24530- bpo-25584: Added "escape" to the __all__ list in the glob module. 24531 24532- bpo-25584: Fixed recursive glob() with patterns starting with ``**``. 24533 24534- bpo-25446: Fix regression in smtplib's AUTH LOGIN support. 24535 24536- bpo-18010: Fix the pydoc web server's module search function to handle 24537 exceptions from importing packages. 24538 24539- bpo-25554: Got rid of circular references in regular expression parsing. 24540 24541- bpo-18973: Command-line interface of the calendar module now uses argparse 24542 instead of optparse. 24543 24544- bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at 24545 the end if the FileInput was opened with binary mode. Patch by Ryosuke 24546 Ito. 24547 24548- bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties. 24549 Original patch by John Mark Vandenberg. 24550 24551- bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4. 24552 24553- bpo-21827: Fixed textwrap.dedent() for the case when largest common 24554 whitespace is a substring of smallest leading whitespace. Based on patch 24555 by Robert Li. 24556 24557- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled 24558 (by returning the original object unchanged). 24559 24560- bpo-25390: typing: Don't crash on Union[str, Pattern]. 24561 24562- bpo-25441: asyncio: Raise error from drain() when socket is closed. 24563 24564- bpo-25410: Cleaned up and fixed minor bugs in C implementation of 24565 OrderedDict. 24566 24567- bpo-25411: Improved Unicode support in SMTPHandler through better use of 24568 the email package. Thanks to user simon04 for the patch. 24569 24570- Move the imp module from a PendingDeprecationWarning to 24571 DeprecationWarning. 24572 24573- bpo-25407: Remove mentions of the formatter module being removed in Python 24574 3.6. 24575 24576- bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end() 24577 that caused segmentation fault or hang in iterating after moving several 24578 items to the start of ordered dict. 24579 24580- bpo-25382: pickletools.dis() now outputs implicit memo index for the 24581 MEMOIZE opcode. 24582 24583- bpo-25357: Add an optional newline parameter to binascii.b2a_base64(). 24584 base64.b64encode() uses it to avoid a memory copy. 24585 24586- bpo-24164: Objects that need calling ``__new__`` with keyword arguments, 24587 can now be pickled using pickle protocols older than protocol version 4. 24588 24589- bpo-25364: zipfile now works in threads disabled builds. 24590 24591- bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both 24592 decode_data and enable_SMTPUTF8 are set to true. 24593 24594- bpo-16099: RobotFileParser now supports Crawl-delay and Request-rate 24595 extensions. Patch by Nikolay Bogoychev. 24596 24597- bpo-25316: distutils raises OSError instead of DistutilsPlatformError when 24598 MSVC is not installed. 24599 24600- bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in 24601 pickletools.opcodes. 24602 24603- bpo-23972: Updates asyncio datagram create method allowing reuseport and 24604 reuseaddr socket options to be set prior to binding the socket. Mirroring 24605 the existing asyncio create_server method the reuseaddr option for 24606 datagram sockets defaults to True if the O/S is 'posix' (except if the 24607 platform is Cygwin). Patch by Chris Laws. 24608 24609- bpo-25304: Add asyncio.run_coroutine_threadsafe(). This lets you submit a 24610 coroutine to a loop from another thread, returning a 24611 concurrent.futures.Future. By Vincent Michel. 24612 24613- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the 24614 first question mark (?) rather than the last. Patch from Xiang Zhang. 24615 24616- bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query 24617 part of the URL as if it were a path. Patch from Xiang Zhang. 24618 24619- bpo-25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not 24620 supported. Check if it is supported, it may not be supported on OpenBSD 24621 for example. 24622 24623- bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong 24624 results in some cases. 24625 24626- bpo-25203: Failed readline.set_completer_delims() no longer left the 24627 module in inconsistent state. 24628 24629- bpo-25011: rlcompleter now omits private and special attribute names 24630 unless the prefix starts with underscores. 24631 24632- bpo-25209: rlcompleter now can add a space or a colon after completed 24633 keyword. 24634 24635- bpo-22241: timezone.utc name is now plain 'UTC', not 'UTC-00:00'. 24636 24637- bpo-23517: fromtimestamp() and utcfromtimestamp() methods of 24638 datetime.datetime now round microseconds to nearest with ties going to 24639 nearest even integer (ROUND_HALF_EVEN), as round(float), instead of 24640 rounding towards -Infinity (ROUND_FLOOR). 24641 24642- bpo-23552: Timeit now warns when there is substantial (4x) variance 24643 between best and worst times. Patch from Serhiy Storchaka. 24644 24645- bpo-24633: site-packages/README -> README.txt. 24646 24647- bpo-24879: help() and pydoc can now list named tuple fields in the order 24648 they were defined rather than alphabetically. The ordering is determined 24649 by the _fields attribute if present. 24650 24651- bpo-24874: Improve speed of itertools.cycle() and make its pickle more 24652 compact. 24653 24654- Fix crash in itertools.cycle.__setstate__() when the first argument wasn't 24655 a list. 24656 24657- bpo-20059: urllib.parse raises ValueError on all invalid ports. Patch by 24658 Martin Panter. 24659 24660- bpo-24360: Improve __repr__ of argparse.Namespace() for invalid 24661 identifiers. Patch by Matthias Bussonnier. 24662 24663- bpo-23426: run_setup was broken in distutils. Patch from Alexander 24664 Belopolsky. 24665 24666- bpo-13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. 24667 24668- bpo-2091: open() accepted a 'U' mode string containing '+', but 'U' can 24669 only be used with 'r'. Patch from Jeff Balogh and John O'Connor. 24670 24671- bpo-8585: improved tests for zipimporter2. Patch from Mark Lawrence. 24672 24673- bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely. 24674 Patch from Nicola Palumbo and Laurent De Buyst. 24675 24676- bpo-24426: Fast searching optimization in regular expressions now works 24677 for patterns that starts with capturing groups. Fast searching 24678 optimization now can't be disabled at compile time. 24679 24680- bpo-23661: unittest.mock side_effects can now be exceptions again. This 24681 was a regression vs Python 3.4. Patch from Ignacio Rossi 24682 24683- bpo-13248: Remove deprecated inspect.getmoduleinfo function. 24684 24685- bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer(). 24686 24687- bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating 24688 ssl.SSLContext. 24689 24690- bpo-25569: Fix memory leak in SSLSocket.getpeercert(). 24691 24692- bpo-25471: Sockets returned from accept() shouldn't appear to be 24693 nonblocking. 24694 24695- bpo-25319: When threading.Event is reinitialized, the underlying condition 24696 should use a regular lock rather than a recursive lock. 24697 24698- Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu 24699 Davis. 24700 24701- bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк 24702 Коренберг. 24703 24704- bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X 24705 versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis. 24706 24707- bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on 24708 current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. 24709 24710- bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input. 24711 Patch by Jack O'Connor. 24712 24713- bpo-27040: Add loop.get_exception_handler method 24714 24715- bpo-27041: asyncio: Add loop.create_future method 24716 24717IDLE 24718---- 24719 24720- bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav 24721 Heblikar. 24722 24723- In the 'IDLE-console differences' section of the IDLE doc, clarify how 24724 running with IDLE affects sys.modules and the standard streams. 24725 24726- bpo-25507: fix incorrect change in IOBinding that prevented printing. 24727 Augment IOBinding htest to include all major IOBinding functions. 24728 24729- bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION 24730 MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode 24731 CREDITS.txt to utf-8 and open it with 'utf-8'. 24732 24733- bpo-15348: Stop the debugger engine (normally in a user process) before 24734 closing the debugger window (running in the IDLE process). This prevents 24735 the RuntimeErrors that were being caught and ignored. 24736 24737- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the 24738 debugger is active (15347); b) closing the debugger with the [X] button 24739 (15348); and c) activating the debugger when already active (24455). The 24740 patch by Mark Roseman does this by making two changes. 1. Suspend and 24741 resume the gui.interaction method with the tcl vwait mechanism intended 24742 for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow 24743 any existing interaction to terminate first. 24744 24745- Change 'The program' to 'Your program' in an IDLE 'kill program?' message 24746 to make it clearer that the program referred to is the currently running 24747 user program, not IDLE itself. 24748 24749- bpo-24750: Improve the appearance of the IDLE editor window status bar. 24750 Patch by Mark Roseman. 24751 24752- bpo-25313: Change the handling of new built-in text color themes to better 24753 address the compatibility problem introduced by the addition of IDLE Dark. 24754 Consistently use the revised idleConf.CurrentTheme everywhere in idlelib. 24755 24756- bpo-24782: Extension configuration is now a tab in the IDLE Preferences 24757 dialog rather than a separate dialog. The former tabs are now a sorted 24758 list. Patch by Mark Roseman. 24759 24760- bpo-22726: Re-activate the config dialog help button with some content 24761 about the other buttons and the new IDLE Dark theme. 24762 24763- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is 24764 more or less IDLE Classic inverted, with a cobalt blue background. 24765 Strings, comments, keywords, ... are still green, red, orange, ... . To 24766 use it with IDLEs released before November 2015, hit the 'Save as New 24767 Custom Theme' button and enter a new name, such as 'Custom Dark'. The 24768 custom theme will work with any IDLE release, and can be modified. 24769 24770- bpo-25224: README.txt is now an idlelib index for IDLE developers and 24771 curious users. The previous user content is now in the IDLE doc chapter. 24772 'IDLE' now means 'Integrated Development and Learning Environment'. 24773 24774- bpo-24820: Users can now set breakpoint colors in Settings -> Custom 24775 Highlighting. Original patch by Mark Roseman. 24776 24777- bpo-24972: Inactive selection background now matches active selection 24778 background, as configured by users, on all systems. Found items are now 24779 always highlighted on Windows. Initial patch by Mark Roseman. 24780 24781- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected 24782 by a tk regression. Initial patch by Mark Roseman. 24783 24784- bpo-24988: Idle ScrolledList context menus (used in debugger) now work on 24785 Mac Aqua. Patch by Mark Roseman. 24786 24787- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by 24788 Mark Roseman. 24789 24790- bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac 24791 OSX, make them a 'sheet'. Patch by Mark Roseman. 24792 24793- bpo-25198: Enhance the initial html viewer now used for Idle Help. 24794 Properly indent fixed-pitch text (patch by Mark Roseman). Give code 24795 snippet a very Sphinx-like light blueish-gray background. Re-use initial 24796 width and height set by users for shell and editor. When the Table of 24797 Contents (TOC) menu is used, put the section header at the top of the 24798 screen. 24799 24800- bpo-25225: Condense and rewrite Idle doc section on text colors. 24801 24802- bpo-21995: Explain some differences between IDLE and console Python. 24803 24804- bpo-22820: Explain need for *print* when running file from Idle editor. 24805 24806- bpo-25224: Doc: augment Idle feature list and no-subprocess section. 24807 24808- bpo-25219: Update doc for Idle command line options. Some were missing and 24809 notes were not correct. 24810 24811- bpo-24861: Most of idlelib is private and subject to change. Use 24812 idleib.idle.* to start Idle. See idlelib.__init__.__doc__. 24813 24814- bpo-25199: Idle: add synchronization comments for future maintainers. 24815 24816- bpo-16893: Replace help.txt with help.html for Idle doc display. The new 24817 idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks 24818 better than help.txt and will better document Idle as released. The 24819 tkinter html viewer that works for this file was written by Rose Roseman. 24820 The now unused EditorWindow.HelpDialog class and helt.txt file are 24821 deprecated. 24822 24823- bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6. 24824 24825- bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts). 24826 24827Documentation 24828------------- 24829 24830- bpo-26736: Used HTTPS for external links in the documentation if possible. 24831 24832- bpo-6953: Rework the Readline module documentation to group related 24833 functions together, and add more details such as what underlying Readline 24834 functions and variables are accessed. 24835 24836- bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt. 24837 24838- bpo-24952: Clarify the default size argument of stack_size() in the 24839 "threading" and "_thread" modules. Patch from Mattip. 24840 24841- bpo-26014: Update 3.x packaging documentation: * "See also" links to the 24842 new docs are now provided in the legacy pages * links to setuptools 24843 documentation have been updated 24844 24845Tests 24846----- 24847 24848- bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory 24849 Loyse and Jelle Zijlstra. 24850 24851- bpo-26295: When using "python3 -m test --testdir=TESTDIR", regrtest 24852 doesn't add "test." prefix to test module names. 24853 24854- bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) 24855 was untested. 24856 24857- bpo-26015: Added new tests for pickling iterators of mutable sequences. 24858 24859- bpo-26325: Added test.support.check_no_resource_warning() to check that no 24860 ResourceWarning is emitted. 24861 24862- bpo-25940: Changed test_ssl to use its internal local server more. This 24863 avoids relying on svn.python.org, which recently changed root certificate. 24864 24865- bpo-25616: Tests for OrderedDict are extracted from test_collections into 24866 separate file test_ordered_dict. 24867 24868- bpo-25449: Added tests for OrderedDict subclasses. 24869 24870- bpo-25188: Add -P/--pgo to test.regrtest to suppress error output when 24871 running the test suite for the purposes of a PGO build. Initial patch by 24872 Alecsandru Patrascu. 24873 24874- bpo-22806: Add ``python -m test --list-tests`` command to list tests. 24875 24876- bpo-18174: ``python -m test --huntrleaks ...`` now also checks for leak of 24877 file descriptors. Patch written by Richard Oudkerk. 24878 24879- bpo-25260: Fix ``python -m test --coverage`` on Windows. Remove the list 24880 of ignored directories. 24881 24882- ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass 24883 along to regrtest.py. Previously there was a limit of 9. 24884 24885- bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files 24886 cannot be written. 24887 24888Build 24889----- 24890 24891- bpo-21277: Don't try to link _ctypes with a ffi_convenience library. 24892 24893- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier 24894 de Gaye. 24895 24896- bpo-26932: Fixed support of RTLD_* constants defined as enum values, not 24897 via macros (in particular on Android). Patch by Chi Hsuan Yen. 24898 24899- bpo-22359: Disable the rules for running _freeze_importlib and pgen when 24900 cross-compiling. The output of these programs is normally saved with the 24901 source code anyway, and is still regenerated when doing a native build. 24902 Patch by Xavier de Gaye. 24903 24904- bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except 24905 on Mac OS X. Patch written by Chi Hsuan Yen. 24906 24907- bpo-25702: A --with-lto configure option has been added that will enable 24908 link time optimizations at build time during a make profile-opt. Some 24909 compilers and toolchains are known to not produce stable code when using 24910 LTO, be sure to test things thoroughly before relying on it. It can 24911 provide a few % speed up over profile-opt alone. 24912 24913- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old 24914 versions. 24915 24916- bpo-17603: Avoid error about nonexistent fileblocks.o file by using a 24917 lower-level check for st_blocks in struct stat. 24918 24919- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern 24920 Thiel. 24921 24922- bpo-26465: Update Windows builds to use OpenSSL 1.0.2g. 24923 24924- bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to 24925 ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The 24926 old ``PCbuild\build_pgo.bat`` script is removed. 24927 24928- bpo-25827: Add support for building with ICC to ``configure``, including a 24929 new ``--with-icc`` flag. 24930 24931- bpo-25696: Fix installation of Python on UNIX with make -j9. 24932 24933- bpo-24986: It is now possible to build Python on Windows without errors 24934 when external libraries are not available. 24935 24936- bpo-24421: Compile Modules/_math.c once, before building extensions. 24937 Previously it could fail to compile properly if the math and cmath builds 24938 were concurrent. 24939 24940- bpo-26465: Update OS X 10.5+ 32-bit-only installer to build and link with 24941 OpenSSL 1.0.2g. 24942 24943- bpo-26268: Update Windows builds to use OpenSSL 1.0.2f. 24944 24945- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries. 24946 24947- bpo-24324: Do not enable unreachable code warnings when using gcc as the 24948 option does not work correctly in older versions of gcc and has been 24949 silently removed as of gcc-4.5. 24950 24951Windows 24952------- 24953 24954- bpo-27053: Updates make_zip.py to correctly generate library ZIP file. 24955 24956- bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases 24957 that don't include the contents of the include directory (that is, 1.0.2e 24958 and later). 24959 24960- bpo-26071: bdist_wininst created binaries fail to start and find 32bit 24961 Python 24962 24963- bpo-26073: Update the list of magic numbers in launcher 24964 24965- bpo-26065: Excludes venv from library when generating embeddable distro. 24966 24967- bpo-25022: Removed very outdated PC/example_nt/ directory. 24968 24969Tools/Demos 24970----------- 24971 24972- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code 24973 is loaded, but get C types on demand. The C types can change if 24974 python-gdb.py is loaded before the Python executable. Patch written by 24975 Thomas Ilsche. 24976 24977- bpo-26271: Fix the Freeze tool to properly use flags passed through 24978 configure. Patch by Daniel Shaulov. 24979 24980- bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py. 24981 Patch by Guo Ci Teo. 24982 24983- bpo-26316: Fix variable name typo in Argument Clinic. 24984 24985- bpo-25440: Fix output of python-config --extension-suffix. 24986 24987- bpo-25154: The pyvenv script has been deprecated in favour of `python3 -m 24988 venv`. 24989 24990C API 24991----- 24992 24993- bpo-26312: SystemError is now raised in all programming bugs with using 24994 PyArg_ParseTupleAndKeywords(). RuntimeError did raised before in some 24995 programming bugs. 24996 24997- bpo-26198: ValueError is now raised instead of TypeError on buffer 24998 overflow in parsing "es#" and "et#" format units. SystemError is now 24999 raised instead of TypeError on programmatical error in parsing format 25000 string. 25001 25002 25003What's New in Python 3.5.5 final? 25004================================= 25005 25006*Release date: 2018-02-04* 25007 25008There were no new changes in version 3.5.5. 25009 25010 25011 25012What's New in Python 3.5.5 release candidate 1? 25013=============================================== 25014 25015*Release date: 2018-01-23* 25016 25017Security 25018-------- 25019 25020- bpo-32551: The ``sys.path[0]`` initialization change for bpo-29139 caused 25021 a regression by revealing an inconsistency in how sys.path is initialized 25022 when executing ``__main__`` from a zipfile, directory, or other import 25023 location. This is considered a potential security issue, as it may lead to 25024 privileged processes unexpectedly loading code from user controlled 25025 directories in situations where that was not previously the case. The 25026 interpreter now consistently avoids ever adding the import location's 25027 parent directory to ``sys.path``, and ensures no other ``sys.path`` 25028 entries are inadvertently modified when inserting the import location 25029 named on the command line. (Originally reported as bpo-29723 against 25030 Python 3.6rc1, but it was missed at the time that the then upcoming Python 25031 3.5.4 release would also be affected) 25032 25033- bpo-30657: Fixed possible integer overflow in PyBytes_DecodeEscape, 25034 CVE-2017-1000158. Original patch by Jay Bosamiya; rebased to Python 3 by 25035 Miro Hrončok. 25036 25037- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to 25038 get security fixes. 25039 25040Core and Builtins 25041----------------- 25042 25043- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which 25044 doesn't call ``PyObject_GC_UnTrack()``. 25045 25046Library 25047------- 25048 25049- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays. 25050 Identical objects will be saved only once. Equal references will be load 25051 as identical objects. Added support for saving and loading recursive data 25052 structures. 25053 25054- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of 25055 partial characters for UTF-8 input (libexpat bug 115): 25056 https://github.com/libexpat/libexpat/issues/115 25057 25058 25059What's New in Python 3.5.4 final? 25060================================= 25061 25062*Release date: 2017-08-07* 25063 25064Library 25065------- 25066 25067- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that 25068 contains CR or LF. Patch by Dong-hee Na. 25069 25070 25071What's New in Python 3.5.4 release candidate 1? 25072=============================================== 25073 25074*Release date: 2017-07-23* 25075 25076Security 25077-------- 25078 25079- bpo-30730: Prevent environment variables injection in subprocess on 25080 Windows. Prevent passing other environment variables and command 25081 arguments. 25082 25083- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple 25084 security vulnerabilities including: CVE-2017-9233 (External entity 25085 infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), 25086 CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and 25087 CVE-2012-0876 (Counter hash flooding with SipHash). Note: the 25088 CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't 25089 impact Python, since Python already gets entropy from the OS to set the 25090 expat secret using ``XML_SetHashSalt()``. 25091 25092- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For 25093 example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the 25094 ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an 25095 authentication (``login@host``). 25096 25097- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of 25098 CVE-2016-0718 and CVE-2016-4472. See 25099 https://sourceforge.net/p/expat/bugs/537/ for more information. 25100 25101Core and Builtins 25102----------------- 25103 25104- bpo-30876: Relative import from unloaded package now reimports the package 25105 instead of failing with SystemError. Relative import from non-package now 25106 fails with ImportError rather than SystemError. 25107 25108- bpo-30765: Avoid blocking in pthread_mutex_lock() when 25109 PyThread_acquire_lock() is asked not to block. 25110 25111- bpo-27945: Fixed various segfaults with dict when input collections are 25112 mutated during searching, inserting or comparing. Based on patches by 25113 Duane Griffin and Tim Mitchell. 25114 25115- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for 25116 non-interned attribute names. Based on patch by Eryk Sun. 25117 25118- bpo-29935: Fixed error messages in the index() method of tuple, list and 25119 deque when pass indices of wrong type. 25120 25121- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises 25122 :exc:`OverflowError`. 25123 25124- bpo-29600: Fix wrapping coroutine return values in StopIteration. 25125 25126- bpo-29537: Restore runtime compatibility with bytecode files generated by 25127 CPython 3.5.0 to 3.5.2, and adjust the eval loop to avoid the problems 25128 that could be caused by the malformed variant of the 25129 BUILD_MAP_UNPACK_WITH_CALL opcode that they may contain. Patch by Petr 25130 Viktorin, Serhiy Storchaka, and Nick Coghlan. 25131 25132- bpo-28598: Support __rmod__ for subclasses of str being called before 25133 str.__mod__. Patch by Martijn Pieters. 25134 25135- bpo-29602: Fix incorrect handling of signed zeros in complex constructor 25136 for complex subclasses and for inputs having a __complex__ method. Patch 25137 by Serhiy Storchaka. 25138 25139- bpo-29347: Fixed possibly dereferencing undefined pointers when creating 25140 weakref objects. 25141 25142- bpo-29438: Fixed use-after-free problem in key sharing dict. 25143 25144- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0]. 25145 25146- bpo-29337: Fixed possible BytesWarning when compare the code objects. 25147 Warnings could be emitted at compile time. 25148 25149- bpo-29478: If max_line_length=None is specified while using the Compat32 25150 policy, it is no longer ignored. Patch by Mircea Cosbuc. 25151 25152Library 25153------- 25154 25155- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound 25156 builtin functions. Patch by Aaron Gallagher. 25157 25158- bpo-30961: Fix decrementing a borrowed reference in tracemalloc. 25159 25160- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the 25161 thread completes, even if the thread was started by the same process which 25162 created the queue. 25163 25164- bpo-29854: Fix segfault in readline when using readline's history-size 25165 option. Patch by Nir Soffer. 25166 25167- bpo-30807: signal.setitimer() may disable the timer when passed a tiny 25168 value. Tiny values (such as 1e-6) are valid non-zero values for 25169 setitimer(), which is specified as taking microsecond-resolution 25170 intervals. However, on some platform, our conversion routine could convert 25171 1e-6 into a zero interval, therefore disabling the timer instead of 25172 (re-)scheduling it. 25173 25174- bpo-30441: Fix bug when modifying os.environ while iterating over it 25175 25176- bpo-30532: Fix email header value parser dropping folding white space in 25177 certain cases. 25178 25179- bpo-29169: Update zlib to 1.2.11. 25180 25181- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called 25182 with bytes-like argument. 25183 25184- bpo-30746: Prohibited the '=' character in environment variable names in 25185 ``os.putenv()`` and ``os.spawn*()``. 25186 25187- bpo-29755: Fixed the lgettext() family of functions in the gettext module. 25188 They now always return bytes. 25189 25190- bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases 25191 when a package is only shipped with bytecodes. Patch by Alexandru 25192 Ardelean. 25193 25194- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a 25195 reference cycle to not keep objects alive longer than expected. 25196 25197- bpo-30149: inspect.signature() now supports callables with 25198 variable-argument parameters wrapped with partialmethod. Patch by Dong-hee 25199 Na. 25200 25201- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. 25202 Patch by Sanjay Sundaresan. 25203 25204- bpo-24484: Avoid race condition in multiprocessing cleanup. 25205 25206- bpo-28994: The traceback no longer displayed for SystemExit raised in a 25207 callback registered by atexit. 25208 25209- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was 25210 called. 25211 25212- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add 25213 support for ContextManager on all versions. Original PRs by Jelle Zijlstra 25214 and Ivan Levkivskyi 25215 25216- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl 25217 implementation. Patch by Michaël Sghaïer. 25218 25219- bpo-29743: Closing transport during handshake process leaks open socket. 25220 Patch by Nikolay Kim 25221 25222- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu 25223 Sornay. 25224 25225- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore 25226 EINVAL on stdin.write() if the child process is still running but closed 25227 the pipe. 25228 25229- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot 25230 handle IPv6 addresses. 25231 25232- bpo-29960: Preserve generator state when _random.Random.setstate() raises 25233 an exception. Patch by Bryan Olson. 25234 25235- bpo-30414: multiprocessing.Queue._feed background running thread do not 25236 break from main loop on exception. 25237 25238- bpo-30003: Fix handling escape characters in HZ codec. Based on patch by 25239 Ma Lin. 25240 25241- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn* 25242 and *forkserver* start methods. 25243 25244- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error 25245 (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. 25246 This error occurs sometimes on SSL connections. 25247 25248- bpo-30375: Warnings emitted when compile a regular expression now always 25249 point to the line in the user code. Previously they could point into 25250 inners of the re module if emitted from inside of groups or conditionals. 25251 25252- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running 25253 coroutine and the coroutine returned without any more ``await``. 25254 25255- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma 25256 Lin. 25257 25258- bpo-26293: Change resulted because of zipfile breakage. (See also: 25259 bpo-29094) 25260 25261- bpo-30243: Removed the __init__ methods of _json's scanner and encoder. 25262 Misusing them could cause memory leaks or crashes. Now scanner and 25263 encoder objects are completely initialized in the __new__ methods. 25264 25265- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process 25266 when Ctrl-C is received. 25267 25268- bpo-28556: Various updates to typing module: add typing.NoReturn type, use 25269 WrapperDescriptorType, minor bug-fixes. Original PRs by Jim 25270 Fasarakis-Hilliard and Ivan Levkivskyi. 25271 25272- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux. 25273 25274- bpo-30070: Fixed leaks and crashes in errors handling in the parser 25275 module. 25276 25277- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when 25278 readline() or __next__() respectively return non-sizeable object. Fixed 25279 possible other errors caused by not checking results of PyObject_Size(), 25280 PySequence_Size(), or PyMapping_Size(). 25281 25282- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint 25283 is present. 25284 25285- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. 25286 Patch by Armin Rigo. 25287 25288- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in 25289 contextlib.contextmanager. Patch by Siddharth Velankar. 25290 25291- bpo-29998: Pickling and copying ImportError now preserves name and path 25292 attributes. 25293 25294- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering 25295 long runs of empty iterables. 25296 25297- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions 25298 and wrong types. 25299 25300- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an 25301 exception at the very first of an iterable may swallow the exception or 25302 make the program hang. Patch by Davin Potts and Xiang Zhang. 25303 25304- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when 25305 the OS gives priority to errors such as EACCES over EEXIST. 25306 25307- bpo-29861: Release references to tasks, their arguments and their results 25308 as soon as they are finished in multiprocessing.Pool. 25309 25310- bpo-29884: faulthandler: Restore the old sigaltstack during teardown. 25311 Patch by Christophe Zeitouny. 25312 25313- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. 25314 25315- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords 25316 are not strings. Patch by Michael Seifert. 25317 25318- bpo-29742: get_extra_info() raises exception if get called on closed ssl 25319 transport. Patch by Nikolay Kim. 25320 25321- bpo-8256: Fixed possible failing or crashing input() if attributes 25322 "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not 25323 strings. 25324 25325- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting 25326 big intables (objects that have __int__) as elements. Patch by Oren 25327 Milman. 25328 25329- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other 25330 exception) to exception(s) raised in the dispatched methods. Patch by Petr 25331 Motejlek. 25332 25333- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes 25334 before all pipes are closed. 25335 25336- bpo-29703: Fix asyncio to support instantiation of new event loops in 25337 child processes. 25338 25339- bpo-29376: Fix assertion error in threading._DummyThread.is_alive(). 25340 25341- bpo-29110: Fix file object leak in aifc.open() when file is given as a 25342 filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. 25343 25344- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter 25345 anymore. Patch written by Jiajun Huang. 25346 25347- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no 25348 longer affects a partial object after creation. 25349 25350- bpo-28556: Various updates to typing module: typing.Counter, 25351 typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle 25352 Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. 25353 25354- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 25355 3.6.0: check minimum and maximum years. 25356 25357- bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when 25358 used with a rare combination of multiprocessing and custom codecs. 25359 25360- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir 25361 25362- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the 25363 match object. Based on patch by WGH. 25364 25365- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited 25366 to a stopped instead of terminated state (ex: when under ptrace). 25367 25368- bpo-29290: Fix a regression in argparse that help messages would wrap at 25369 non-breaking spaces. 25370 25371- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY. 25372 25373- bpo-29011: Fix an important omission by adding Deque to the typing module. 25374 25375- bpo-29219: Fixed infinite recursion in the repr of uninitialized 25376 ctypes.CDLL instances. 25377 25378- bpo-28969: Fixed race condition in C implementation of 25379 functools.lru_cache. KeyError could be raised when cached function with 25380 full cache was simultaneously called from different threads with the same 25381 uncached arguments. 25382 25383- bpo-29142: In urllib.request, suffixes in no_proxy environment variable 25384 with leading dots could match related hostnames again (e.g. .b.c matches 25385 a.b.c). Patch by Milan Oberkirch. 25386 25387Documentation 25388------------- 25389 25390- bpo-30176: Add missing attribute related constants in curses 25391 documentation. 25392 25393- bpo-26985: Add missing info of code object in inspect documentation. 25394 25395- bpo-28929: Link the documentation to its source file on GitHub. 25396 25397- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer 25398 to aiosmtpd, a third-party asyncio-based replacement. 25399 25400- bpo-26355: Add canonical header link on each page to corresponding major 25401 version of the documentation. Patch by Matthias Bussonnier. 25402 25403- bpo-29349: Fix Python 2 syntax in code for building the documentation. 25404 25405Tests 25406----- 25407 25408- bpo-30822: Fix regrtest command line parser to allow passing -u 25409 extralargefile to run test_zipfile64. 25410 25411- bpo-30383: regrtest: Enhance regrtest and backport features from the 25412 master branch. Add options: --coverage, --testdir, --list-tests (list test 25413 files, don't run them), --list-cases (list test identifiers, don't run 25414 them, :issue:`30523`), --matchfile (load a list of test filters from a 25415 text file, :issue:`30540`), --slowest (alias to --slow). Enhance output: 25416 add timestamp, test result, currently running tests, "Tests result: xxx" 25417 summary with total duration, etc. Fix reference leak hunting in regrtest, 25418 --huntrleaks: regrtest now warms up caches, create explicitly all internal 25419 singletons which are created on demand to prevent false positives when 25420 checking for reference leaks. (:issue:`30675`). 25421 25422- bpo-30357: test_thread: setUp() now uses support.threading_setup() and 25423 support.threading_cleanup() to wait until threads complete to avoid random 25424 side effects on following tests. Initial patch written by Grzegorz 25425 Grzywacz. 25426 25427- bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip 25428 some tests of select.poll when running on macOS due to unresolved issues 25429 with the underlying system poll function on some macOS versions. 25430 25431- bpo-30197: Enhanced functions swap_attr() and swap_item() in the 25432 test.support module. They now work when delete replaced attribute or item 25433 inside the with statement. The old value of the attribute or item (or 25434 None if it doesn't exist) now will be assigned to the target of the "as" 25435 clause, if there is one. 25436 25437- bpo-29571: to match the behaviour of the ``re.LOCALE`` flag, 25438 test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)`` 25439 to determine the candidate encoding for the test regex (allowing it to 25440 correctly skip the test when the default locale encoding is a multi-byte 25441 encoding) 25442 25443Build 25444----- 25445 25446- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``, 25447 ``make install`` and some other make targets when configured with 25448 ``--enable-optimizations``. 25449 25450- bpo-23404: Don't regenerate generated files based on file modification 25451 time anymore: the action is now explicit. Replace ``make touch`` with 25452 ``make regen-all``. 25453 25454- bpo-29643: Fix ``--enable-optimization`` didn't work. 25455 25456Windows 25457------- 25458 25459- bpo-30687: Locate msbuild.exe on Windows when building rather than 25460 vcvarsall.bat 25461 25462- bpo-29392: Prevent crash when passing invalid arguments into msvcrt 25463 module. 25464 25465C API 25466----- 25467 25468- bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if 25469 Py_LIMITED_API is set to the value between 0x03050400 and 0x03060000 (not 25470 including) or 0x03060100 or higher. 25471 25472- bpo-29083: Fixed the declaration of some public API functions. 25473 PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in 25474 limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and 25475 Py_BuildValue() were not available in limited API of version < 3.3 when 25476 PY_SSIZE_T_CLEAN is defined. 25477 25478 25479What's New in Python 3.5.3 final? 25480================================= 25481 25482*Release date: 2017-01-17* 25483 25484There were no code changes between 3.5.3rc1 and 3.5.3 final. 25485 25486 25487 25488What's New in Python 3.5.3 release candidate 1? 25489=============================================== 25490 25491*Release date: 2017-01-02* 25492 25493Core and Builtins 25494----------------- 25495 25496- bpo-29073: bytearray formatting no longer truncates on first null byte. 25497 25498- bpo-28932: Do not include <sys/random.h> if it does not exist. 25499 25500- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must 25501 not convert combined table into split table. 25502 25503- bpo-25677: Correct the positioning of the syntax error caret for indented 25504 blocks. Based on patch by Michael Layzell. 25505 25506- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate 25507 form. 25508 25509- bpo-28512: Fixed setting the offset attribute of SyntaxError by 25510 PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). 25511 25512- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy 25513 bug caused by a monkey-patched len() function. 25514 25515- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X 25516 when decode astral characters. Patch by Xiang Zhang. 25517 25518- bpo-19398: Extra slash no longer added to sys.path components in case of 25519 empty compile-time PYTHONPATH components. 25520 25521- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug 25522 build. 25523 25524- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception 25525 loss in PyTraceBack_Here(). 25526 25527- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). 25528 Patch by Xiang Zhang. 25529 25530- bpo-28376: The type of long range iterator is now registered as Iterator. 25531 Patch by Oren Milman. 25532 25533- bpo-28376: The constructor of range_iterator now checks that step is not 25534 0. Patch by Oren Milman. 25535 25536- bpo-26906: Resolving special methods of uninitialized type now causes 25537 implicit initialization of the type instead of a fail. 25538 25539- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original 25540 patch by Niklas Koep. 25541 25542- bpo-24098: Fixed possible crash when AST is changed in process of 25543 compiling it. 25544 25545- bpo-28350: String constants with null character no longer interned. 25546 25547- bpo-26617: Fix crash when GC runs during weakref callbacks. 25548 25549- bpo-27942: String constants now interned recursively in tuples and 25550 frozensets. 25551 25552- bpo-21578: Fixed misleading error message when ImportError called with 25553 invalid keyword args. 25554 25555- bpo-28203: Fix incorrect type in error message from ``complex(1.0, 25556 {2:3})``. Patch by Soumya Sharma. 25557 25558- bpo-27955: Fallback on reading /dev/urandom device when the getrandom() 25559 syscall fails with EPERM, for example when blocked by SECCOMP. 25560 25561- bpo-28131: Fix a regression in zipimport's compile_source(). zipimport 25562 should use the same optimization level as the interpreter. 25563 25564- bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is 25565 compiled with NSMALLPOSINTS = 0. 25566 25567- bpo-25758: Prevents zipimport from unnecessarily encoding a filename 25568 (patch by Eryk Sun) 25569 25570- bpo-28189: dictitems_contains no longer swallows compare errors. (Patch by 25571 Xiang Zhang) 25572 25573- bpo-27812: Properly clear out a generator's frame's backreference to the 25574 generator to prevent crashes in frame.clear(). 25575 25576- bpo-27811: Fix a crash when a coroutine that has not been awaited is 25577 finalized with warnings-as-errors enabled. 25578 25579- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after 25580 use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes. 25581 25582- bpo-26020: set literal evaluation order did not match documented 25583 behaviour. 25584 25585- bpo-27782: Multi-phase extension module import now correctly allows the 25586 ``m_methods`` field to be used to add module level functions to instances 25587 of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang. 25588 25589- bpo-27936: The round() function accepted a second None argument for some 25590 types but not for others. Fixed the inconsistency by accepting None for 25591 all numeric types. 25592 25593- bpo-27487: Warn if a submodule argument to "python -m" or 25594 runpy.run_module() is found in sys.modules after parent packages are 25595 imported, but before the submodule is executed. 25596 25597- bpo-27558: Fix a SystemError in the implementation of "raise" statement. 25598 In a brand new thread, raise a RuntimeError since there is no active 25599 exception to reraise. Patch written by Xiang Zhang. 25600 25601- bpo-27419: Standard __import__() no longer look up "__import__" in globals 25602 or builtins for importing submodules or "from import". Fixed handling an 25603 error of non-string package name. 25604 25605- bpo-27083: Respect the PYTHONCASEOK environment variable under Windows. 25606 25607- bpo-27514: Make having too many statically nested blocks a SyntaxError 25608 instead of SystemError. 25609 25610- bpo-27473: Fixed possible integer overflow in bytes and bytearray 25611 concatenations. Patch by Xiang Zhang. 25612 25613- bpo-27507: Add integer overflow check in bytearray.extend(). Patch by 25614 Xiang Zhang. 25615 25616- bpo-27581: Don't rely on wrapping for overflow check in 25617 PySequence_Tuple(). Patch by Xiang Zhang. 25618 25619- bpo-27443: __length_hint__() of bytearray iterators no longer return a 25620 negative integer for a resized bytearray. 25621 25622- bpo-27942: Fix memory leak in codeobject.c 25623 25624Library 25625------- 25626 25627- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a 25628 context. Patch by Sam Breese. 25629 25630- bpo-29094: Offsets in a ZIP file created with extern file object and modes 25631 "w" and "x" now are relative to the start of the file. 25632 25633- bpo-13051: Fixed recursion errors in large or resized 25634 curses.textpad.Textbox. Based on patch by Tycho Andersen. 25635 25636- bpo-29119: Fix weakrefs in the pure python version of 25637 collections.OrderedDict move_to_end() method. Contributed by Andra 25638 Bogildea. 25639 25640- bpo-9770: curses.ascii predicates now work correctly with negative 25641 integers. 25642 25643- bpo-28427: old keys should not remove new values from WeakValueDictionary 25644 when collecting from another thread. 25645 25646- bpo-28923: Remove editor artifacts from Tix.py. 25647 25648- bpo-28871: Fixed a crash when deallocate deep ElementTree. 25649 25650- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and 25651 WeakValueDictionary.pop() when a GC collection happens in another thread. 25652 25653- bpo-20191: Fixed a crash in resource.prlimit() when pass a sequence that 25654 doesn't own its elements as limits. 25655 25656- bpo-28779: multiprocessing.set_forkserver_preload() would crash the 25657 forkserver process if a preloaded module instantiated some multiprocessing 25658 objects such as locks. 25659 25660- bpo-28847: dbm.dumb now supports reading read-only files and no longer 25661 writes the index file when it is not changed. 25662 25663- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and 25664 from_buffer_copy() methods on abstract classes like Array. 25665 25666- bpo-28732: Fix crash in os.spawnv() with no elements in args 25667 25668- bpo-28485: Always raise ValueError for negative 25669 compileall.compile_dir(workers=...) parameter, even when multithreading is 25670 unavailable. 25671 25672- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the 25673 garbage collector is invoked in other thread. Based on patch by Sebastian 25674 Cufre. 25675 25676- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if 25677 given empty data twice. Patch by Benjamin Fogle. 25678 25679- bpo-28549: Fixed segfault in curses's addch() with ncurses6. 25680 25681- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar 25682 file with compression before trying to open it without compression. 25683 Otherwise it had 50% chance failed with ignore_zeros=True. 25684 25685- bpo-23262: The webbrowser module now supports Firefox 36+ and derived 25686 browsers. Based on patch by Oleg Broytman. 25687 25688- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused 25689 by representing the scale as float value internally in Tk. tkinter.IntVar 25690 now works if float value is set to underlying Tk variable. 25691 25692- bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at 25693 the start of new line after printing a month's calendar. Patch by Xiang 25694 Zhang. 25695 25696- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. 25697 Based on patch by Kaarle Ritvanen. 25698 25699- bpo-28353: os.fwalk() no longer fails on broken links. 25700 25701- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a 25702 workaround to Tix library bug. 25703 25704- bpo-28488: shutil.make_archive() no longer add entry "./" to ZIP archive. 25705 25706- bpo-24452: Make webbrowser support Chrome on Mac OS X. 25707 25708- bpo-20766: Fix references leaked by pdb in the handling of SIGINT 25709 handlers. 25710 25711- bpo-26293: Fixed writing ZIP files that starts not from the start of the 25712 file. Offsets in ZIP file now are relative to the start of the archive in 25713 conforming to the specification. 25714 25715- bpo-28321: Fixed writing non-BMP characters with binary format in 25716 plistlib. 25717 25718- bpo-28322: Fixed possible crashes when unpickle itertools objects from 25719 incorrect pickle data. Based on patch by John Leitch. 25720 25721- Fix possible integer overflows and crashes in the mmap module with unusual 25722 usage patterns. 25723 25724- bpo-1703178: Fix the ability to pass the --link-objects option to the 25725 distutils build_ext command. 25726 25727- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 25728 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so 25729 that they don't call itermonthdates() which can cause datetime.date 25730 under/overflow. 25731 25732- bpo-28275: Fixed possible use after free in the decompress() methods of 25733 the LZMADecompressor and BZ2Decompressor classes. Original patch by John 25734 Leitch. 25735 25736- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() 25737 if pass invalid string-like object as a name. Patch by Xiang Zhang. 25738 25739- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. 25740 Patch by Madison May. 25741 25742- bpo-27611: Fixed support of default root window in the tkinter.tix module. 25743 25744- bpo-27348: In the traceback module, restore the formatting of exception 25745 messages like "Exception: None". This fixes a regression introduced in 25746 3.5a2. 25747 25748- bpo-25651: Allow falsy values to be used for msg parameter of subTest(). 25749 25750- bpo-27932: Prevent memory leak in win32_ver(). 25751 25752- Fix UnboundLocalError in socket._sendfile_use_sendfile. 25753 25754- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of 25755 os.stat(). Patch by Eryk Sun. 25756 25757- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an 25758 empty bytestring is passed. 25759 25760- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. 25761 25762- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by 25763 Gergely Imreh and Markus Holtermann. 25764 25765- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and 25766 binascii.a2b_qp(). 25767 25768- bpo-19003: m email.generator now replaces only ``\r`` and/or ``\n`` line 25769 endings, per the RFC, instead of all unicode line endings. 25770 25771- bpo-28019: itertools.count() no longer rounds non-integer step in range 25772 between 1.0 and 2.0 to 1. 25773 25774- bpo-25969: Update the lib2to3 grammar to handle the unpacking 25775 generalizations added in 3.5. 25776 25777- bpo-14977: mailcap now respects the order of the lines in the mailcap 25778 files ("first match"), as required by RFC 1542. Patch by Michael Lazar. 25779 25780- bpo-24594: Validates persist parameter when opening MSI database 25781 25782- bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes 25783 (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.) 25784 25785- bpo-28047: Fixed calculation of line length used for the base64 CTE in the 25786 new email policies. 25787 25788- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by 25789 Claude Paroz. 25790 25791- bpo-22450: urllib now includes an ``Accept: */*`` header among the default 25792 headers. This makes the results of REST API requests more consistent and 25793 predictable especially when proxy servers are involved. 25794 25795- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file 25796 between runs given the same Grammar.txt input regardless of the hash 25797 randomization setting. 25798 25799- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers 25800 in the "ctypes" and "array" modules. 25801 25802- bpo-22233: Break email header lines *only* on the RFC specified CR and LF 25803 characters, not on arbitrary unicode line breaks. This also fixes a bug 25804 in HTTP header parsing. 25805 25806- bpo-27988: Fix email iter_attachments incorrect mutation of payload list. 25807 25808- bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name 25809 fields in X.509 certs. 25810 25811- bpo-27850: Remove 3DES from ssl module's default cipher list to counter 25812 measure sweet32 attack (CVE-2016-2183). 25813 25814- bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list. 25815 (Required OpenSSL 1.1.0 or LibreSSL). 25816 25817- bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0. 25818 25819- Remove support for passing a file descriptor to os.access. It never worked 25820 but previously didn't raise. 25821 25822- bpo-12885: Fix error when distutils encounters symlink. 25823 25824- bpo-27881: Fixed possible bugs when setting 25825 sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang. 25826 25827- bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory 25828 creates not a cursor. Patch by Xiang Zhang. 25829 25830- bpo-19884: Avoid spurious output on OS X with Gnu Readline. 25831 25832- bpo-27706: Restore deterministic behavior of random.Random().seed() for 25833 string seeds using seeding version 1. Allows sequences of calls to 25834 random() to exactly match those obtained in Python 2. Patch by Nofar 25835 Schnider. 25836 25837- bpo-10513: Fix a regression in Connection.commit(). Statements should not 25838 be reset after a commit. 25839 25840- A new version of typing.py from https://github.com/python/typing: 25841 Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__ 25842 (upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the 25843 dict constraint in ForwardRef._eval_type (upstream #252). 25844 25845- bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of 25846 negative exponent and negative base. 25847 25848- bpo-21718: cursor.description is now available for queries using CTEs. 25849 25850- bpo-2466: posixpath.ismount now correctly recognizes mount points which 25851 the user does not have permission to access. 25852 25853- bpo-27773: Correct some memory management errors server_hostname in 25854 _ssl.wrap_socket(). 25855 25856- bpo-26750: unittest.mock.create_autospec() now works properly for 25857 subclasses of property() and other data descriptors. 25858 25859- In the curses module, raise an error if window.getstr() or window.instr() 25860 is passed a negative value. 25861 25862- bpo-27783: Fix possible usage of uninitialized memory in 25863 operator.methodcaller. 25864 25865- bpo-27774: Fix possible Py_DECREF on unowned object in _sre. 25866 25867- bpo-27760: Fix possible integer overflow in binascii.b2a_qp. 25868 25869- bpo-27758: Fix possible integer overflow in the _csv module for large 25870 record lengths. 25871 25872- bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the 25873 HTTP_PROXY variable when REQUEST_METHOD environment is set, which 25874 indicates that the script is in CGI mode. 25875 25876- bpo-27656: Do not assume sched.h defines any SCHED_* constants. 25877 25878- bpo-27130: In the "zlib" module, fix handling of large buffers (typically 25879 4 GiB) when compressing and decompressing. Previously, inputs were 25880 limited to 4 GiB, and compression and decompression operations did not 25881 properly handle results of 4 GiB. 25882 25883- bpo-27533: Release GIL in nt._isdir 25884 25885- bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original 25886 patch by Alexandre Vassalotti. 25887 25888- bpo-27522: Avoid an unintentional reference cycle in email.feedparser. 25889 25890- bpo-26844: Fix error message for imp.find_module() to refer to 'path' 25891 instead of 'name'. Patch by Lev Maximov. 25892 25893- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an 25894 error about unclean EOF. 25895 25896- bpo-27466: Change time format returned by http.cookie.time2netscape, 25897 confirming the netscape cookie format and making it consistent with 25898 documentation. 25899 25900- bpo-26664: Fix activate.fish by removing mis-use of ``$``. 25901 25902- bpo-22115: Fixed tracing Tkinter variables: trace_vdelete() with wrong 25903 mode no longer break tracing, trace_vinfo() now always returns a list of 25904 pairs of strings, tracing in the "u" mode now works. 25905 25906- Fix a scoping issue in importlib.util.LazyLoader which triggered an 25907 UnboundLocalError when lazy-loading a module that was already put into 25908 sys.modules. 25909 25910- bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and 25911 ispunct(). 25912 25913- bpo-26754: Some functions (compile() etc) accepted a filename argument 25914 encoded as an iterable of integers. Now only strings and byte-like objects 25915 are accepted. 25916 25917- bpo-27048: Prevents distutils failing on Windows when environment 25918 variables contain non-ASCII characters 25919 25920- bpo-27330: Fixed possible leaks in the ctypes module. 25921 25922- bpo-27238: Got rid of bare excepts in the turtle module. Original patch 25923 by Jelle Zijlstra. 25924 25925- bpo-27122: When an exception is raised within the context being managed by 25926 a contextlib.ExitStack() and one of the exit stack generators catches and 25927 raises it in a chain, do not re-raise the original exception when exiting, 25928 let the new chained one through. This avoids the :pep:`479` bug described 25929 in issue25782. 25930 25931Security 25932-------- 25933 25934- bpo-27278: Fix os.urandom() implementation using getrandom() on Linux. 25935 Truncate size to INT_MAX and loop until we collected enough random bytes, 25936 instead of casting a directly Py_ssize_t to int. 25937 25938Library 25939------- 25940 25941- bpo-26386: Fixed ttk.TreeView selection operations with item id's 25942 containing spaces. 25943 25944Security 25945-------- 25946 25947- bpo-22636: Avoid shell injection problems with ctypes.util.find_library(). 25948 25949Library 25950------- 25951 25952- bpo-16182: Fix various functions in the "readline" module to use the 25953 locale encoding, and fix get_begidx() and get_endidx() to return code 25954 point indexes. 25955 25956- bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton. 25957 25958- bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to 25959 Paulo Andrade and Petr Viktorin for the analysis and patch. 25960 25961- bpo-21201: Improves readability of multiprocessing error message. Thanks 25962 to Wojciech Walczak for patch. 25963 25964- bpo-27456: asyncio: Set TCP_NODELAY by default. 25965 25966- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by 25967 Kevin Conway. 25968 25969- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by 25970 Seth Michael Larson. 25971 25972- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by 25973 iceboy. 25974 25975- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki. 25976 25977- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect. 25978 25979- bpo-27759: Fix selectors incorrectly retain invalid file descriptors. 25980 Patch by Mark Williams. 25981 25982- bpo-28368: Refuse monitoring processes if the child watcher has no loop 25983 attached. Patch by Vincent Michel. 25984 25985- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader, 25986 add_writer, etc. 25987 25988- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг 25989 Марк. 25990 25991- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor. 25992 25993- bpo-28372: Fix asyncio to support formatting of non-python coroutines. 25994 25995- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг 25996 Марк. 25997 25998- bpo-27972: Prohibit Tasks to await on themselves. 25999 26000- bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children 26001 are done. Patch by Johannes Ebke. 26002 26003- bpo-26796: Don't configure the number of workers for default threadpool 26004 executor. Initial patch by Hans Lawrenz. 26005 26006- bpo-28600: Optimize loop.call_soon(). 26007 26008- bpo-28613: Fix get_event_loop() return the current loop if called from 26009 coroutines/callbacks. 26010 26011- bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin 26012 Mayfield. 26013 26014- bpo-28652: Make loop methods reject socket kinds they do not support. 26015 26016- bpo-28653: Fix a refleak in functools.lru_cache. 26017 26018- bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects. 26019 26020- bpo-24142: Reading a corrupt config file left the parser in an invalid 26021 state. Original patch by Florian Höch. 26022 26023- bpo-28990: Fix SSL hanging if connection is closed before handshake 26024 completed. (Patch by HoHo-Ho) 26025 26026IDLE 26027---- 26028 26029- bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger 26030 Serwy, updated by Bayard Randel. 26031 26032- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen. 26033 26034- Add version to title of IDLE help window. 26035 26036- bpo-25564: In section on IDLE -- console differences, mention that using 26037 exec means that __builtins__ is defined for each statement. 26038 26039- bpo-27714: text_textview and test_autocomplete now pass when re-run in the 26040 same process. This occurs when test_idle fails when run with the -w 26041 option but without -jn. Fix warning from test_config. 26042 26043- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports. 26044 Users must include the same imports required to run directly in Python. 26045 26046- bpo-27452: add line counter and crc to IDLE configHandler test dump. 26047 26048- bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names. 26049 26050- bpo-27245: IDLE: Cleanly delete custom themes and key bindings. 26051 Previously, when IDLE was started from a console or by import, a cascade 26052 of warnings was emitted. Patch by Serhiy Storchaka. 26053 26054C API 26055----- 26056 26057- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 26058 26059- bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as 26060 an iterable of integers. Now only strings and bytes-like objects are 26061 accepted. 26062 26063Documentation 26064------------- 26065 26066- bpo-28513: Documented command-line interface of zipfile. 26067 26068Tests 26069----- 26070 26071- bpo-28950: Disallow -j0 to be combined with -T/-l/-M in regrtest command 26072 line arguments. 26073 26074- bpo-28666: Now test.support.rmtree is able to remove unwritable or 26075 unreadable directories. 26076 26077- bpo-23839: Various caches now are cleared before running every test file. 26078 26079- bpo-28409: regrtest: fix the parser of command line arguments. 26080 26081- bpo-27787: Call gc.collect() before checking each test for "dangling 26082 threads", since the dangling threads are weak references. 26083 26084- bpo-27369: In test_pyexpat, avoid testing an error message detail that 26085 changed in Expat 2.2.0. 26086 26087Tools/Demos 26088----------- 26089 26090- bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the 26091 current "re" module, avoid invalid Python backslash escapes, and fix a bug 26092 parsing escaped C quote signs. 26093 26094- bpo-27332: Fixed the type of the first argument of module-level functions 26095 generated by Argument Clinic. Patch by Petr Viktorin. 26096 26097- bpo-27418: Fixed Tools/importbench/importbench.py. 26098 26099Windows 26100------- 26101 26102- bpo-28251: Improvements to help manuals on Windows. 26103 26104- bpo-28110: launcher.msi has different product codes between 32-bit and 26105 64-bit 26106 26107- bpo-25144: Ensures TargetDir is set before continuing with custom install. 26108 26109- bpo-27469: Adds a shell extension to the launcher so that drag and drop 26110 works correctly. 26111 26112- bpo-27309: Enabled proper Windows styles in python[w].exe manifest. 26113 26114Build 26115----- 26116 26117- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat 26118 26119- bpo-23903: Added missed names to PC/python3.def. 26120 26121- bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and 26122 Michael Haubenwallner. 26123 26124- bpo-26359: Rename --with-optimiations to --enable-optimizations. 26125 26126- bpo-28444: Fix missing extensions modules when cross compiling. 26127 26128- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. 26129 26130- bpo-28258: Fixed build with Estonian locale (python-config and distclean 26131 targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. 26132 26133- bpo-26661: setup.py now detects system libffi with multiarch wrapper. 26134 26135- bpo-28066: Fix the logic that searches build directories for generated 26136 include files when building outside the source tree. 26137 26138- bpo-15819: Remove redundant include search directory option for building 26139 outside the source tree. 26140 26141- bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach) 26142 26143- bpo-27705: Update message in validate_ucrtbase.py 26144 26145- bpo-27983: Cause lack of llvm-profdata tool when using clang as required 26146 for PGO linking to be a configure time error rather than make time when 26147 --with-optimizations is enabled. Also improve our ability to find the 26148 llvm-profdata tool on MacOS and some Linuxes. 26149 26150- bpo-26307: The profile-opt build now applies PGO to the built-in modules. 26151 26152- bpo-26359: Add the --with-optimizations configure flag. 26153 26154- bpo-27713: Suppress spurious build warnings when updating importlib's 26155 bootstrap files. Patch by Xiang Zhang 26156 26157- bpo-25825: Correct the references to Modules/python.exp and ld_so_aix, 26158 which are required on AIX. This updates references to an installation 26159 path that was changed in 3.2a4, and undoes changed references to the build 26160 tree that were made in 3.5.0a1. 26161 26162- bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi 26163 Hsuan Yen. 26164 26165- bpo-27641: The configure script now inserts comments into the makefile to 26166 prevent the pgen and _freeze_importlib executables from being 26167 cross-compiled. 26168 26169- bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be 26170 used for file generation during the build. 26171 26172- bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update 26173 FreedBSD version checks for the original ctype UTF-8 workaround. 26174 26175- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS. 26176 Patch by Gareth Rees. 26177 26178 26179What's New in Python 3.5.2 final? 26180================================= 26181 26182*Release date: 2016-06-26* 26183 26184Core and Builtins 26185----------------- 26186 26187- bpo-26930: Update Windows builds to use OpenSSL 1.0.2h. 26188 26189Tests 26190----- 26191 26192- bpo-26867: Ubuntu's openssl OP_NO_SSLv3 is forced on by default; fix test. 26193 26194IDLE 26195---- 26196 26197- bpo-27365: Allow non-ascii in idlelib/NEWS.txt - minimal part for 3.5.2. 26198 26199 26200What's New in Python 3.5.2 release candidate 1? 26201=============================================== 26202 26203*Release date: 2016-06-12* 26204 26205Core and Builtins 26206----------------- 26207 26208- bpo-27066: Fixed SystemError if a custom opener (for open()) returns a 26209 negative number without setting an exception. 26210 26211- bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by 26212 Xavier de Gaye. 26213 26214- bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" 26215 format unit. 26216 26217- bpo-26991: Fix possible refleak when creating a function with annotations. 26218 26219- bpo-27039: Fixed bytearray.remove() for values greater than 127. Patch by 26220 Joe Jevnik. 26221 26222- bpo-23640: int.from_bytes() no longer bypasses constructors for 26223 subclasses. 26224 26225- bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL 26226 pointer. 26227 26228- bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for 26229 interpolation unintentionally added with move to Python 3. Behavior no 26230 longer does any interpolation in .pypirc files, matching behavior in 26231 Python 2.7 and Setuptools 19.0. 26232 26233- bpo-26659: Make the builtin slice type support cycle collection. 26234 26235- bpo-26718: super.__init__ no longer leaks memory if called multiple times. 26236 NOTE: A direct call of super.__init__ is not endorsed! 26237 26238- bpo-25339: PYTHONIOENCODING now has priority over locale in setting the 26239 error handler for stdin and stdout. 26240 26241- bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes 26242 are generic sequence iterators, iterators of str, bytes, bytearray, list, 26243 tuple, set, frozenset, dict, OrderedDict, corresponding views and 26244 os.scandir() iterator. 26245 26246- bpo-26581: If coding cookie is specified multiple times on a line in 26247 Python source code file, only the first one is taken to account. 26248 26249- bpo-26464: Fix str.translate() when string is ASCII and first replacements 26250 removes character, but next replacement uses a non-ASCII character or a 26251 string longer than 1 character. Regression introduced in Python 3.5.0. 26252 26253- bpo-22836: Ensure exception reports from PyErr_Display() and 26254 PyErr_WriteUnraisable() are sensible even when formatting them produces 26255 secondary errors. This affects the reports produced by 26256 sys.__excepthook__() and when __del__() raises an exception. 26257 26258- bpo-26302: Correct behavior to reject comma as a legal character for 26259 cookie names. 26260 26261- bpo-4806: Avoid masking the original TypeError exception when using star 26262 (``*``) unpacking in function calls. Based on patch by Hagen Fürstenau 26263 and Daniel Urban. 26264 26265- bpo-27138: Fix the doc comment for FileFinder.find_spec(). 26266 26267- bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get 26268 the current Python thread state, but don't issue a fatal error if it is 26269 NULL. This new function must be used instead of accessing directly the 26270 _PyThreadState_Current variable. The variable is no more exposed since 26271 Python 3.5.1 to hide the exact implementation of atomic C types, to avoid 26272 compiler issues. 26273 26274- bpo-26194: Deque.insert() gave odd results for bounded deques that had 26275 reached their maximum size. Now an IndexError will be raised when 26276 attempting to insert into a full deque. 26277 26278- bpo-25843: When compiling code, don't merge constants if they are equal 26279 but have a different types. For example, ``f1, f2 = lambda: 1, lambda: 26280 1.0`` is now correctly compiled to two different functions: ``f1()`` 26281 returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``int``), even if 26282 ``1`` and ``1.0`` are equal. 26283 26284- bpo-22995: [UPDATE] Comment out the one of the pickleability tests in 26285 _PyObject_GetState() due to regressions observed in Cython-based projects. 26286 26287- bpo-25961: Disallowed null characters in the type name. 26288 26289- bpo-25973: Fix segfault when an invalid nonlocal statement binds a name 26290 starting with two underscores. 26291 26292- bpo-22995: Instances of extension types with a state that aren't 26293 subclasses of list or dict and haven't implemented any pickle-related 26294 methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or 26295 __getstate__), can no longer be pickled. Including memoryview. 26296 26297- bpo-20440: Massive replacing unsafe attribute setting code with special 26298 macro Py_SETREF. 26299 26300- bpo-25766: Special method __bytes__() now works in str subclasses. 26301 26302- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size. 26303 This allows sys.getsize() to work correctly with their subclasses with 26304 __slots__ defined. 26305 26306- bpo-25709: Fixed problem with in-place string concatenation and utf-8 26307 cache. 26308 26309- bpo-27147: Mention :pep:`420` in the importlib docs. 26310 26311- bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside 26312 __getattr__. 26313 26314- bpo-24731: Fixed crash on converting objects with special methods 26315 __bytes__, __trunc__, and __float__ returning instances of subclasses of 26316 bytes, int, and float to subclasses of bytes, int, and float 26317 correspondingly. 26318 26319- bpo-26478: Fix semantic bugs when using binary operators with dictionary 26320 views and tuples. 26321 26322- bpo-26171: Fix possible integer overflow and heap corruption in 26323 zipimporter.get_data(). 26324 26325- bpo-25660: Fix TAB key behaviour in REPL with readline. 26326 26327- bpo-25887: Raise a RuntimeError when a coroutine object is awaited more 26328 than once. 26329 26330- bpo-27243: Update the __aiter__ protocol: instead of returning an 26331 awaitable that resolves to an asynchronous iterator, the asynchronous 26332 iterator should be returned directly. Doing the former will trigger a 26333 PendingDeprecationWarning. 26334 26335Security 26336-------- 26337 26338- bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283. 26339 26340- Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by 26341 Team Oststrom 26342 26343Library 26344------- 26345 26346- bpo-21386: Implement missing IPv4Address.is_global property. It was 26347 documented since 07a5610bae9d. Initial patch by Roger Luethi. 26348 26349- bpo-20900: distutils register command now decodes HTTP responses 26350 correctly. Initial patch by ingrid. 26351 26352- A new version of typing.py provides several new classes and features: 26353 @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, 26354 Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some 26355 of the new features are not yet implemented in mypy or other static 26356 analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable, 26357 AsyncIterator) have been added (in fact they made it into 3.5.1 but were 26358 never mentioned). 26359 26360- bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from 26361 sending a message body for 205 Reset Content. Also, don't send Content 26362 header fields in responses that don't have a body. Patch by Susumu 26363 Koshiba. 26364 26365- bpo-21313: Fix the "platform" module to tolerate when sys.version contains 26366 truncated build information. 26367 26368Security 26369-------- 26370 26371- bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with 26372 ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom 26373 entropy pool is not initialized yet. Patch written by Colm Buckley. 26374 26375Library 26376------- 26377 26378- bpo-27164: In the zlib module, allow decompressing raw Deflate streams 26379 with a predefined zdict. Based on patch by Xiang Zhang. 26380 26381- bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely 26382 write data to the client. Previously it could do partial writes and 26383 truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout 26384 doing partial writes, but this is deprecated. 26385 26386- bpo-26809: Add ``__all__`` to :mod:`string`. Patch by Emanuel Barry. 26387 26388- bpo-26373: subprocess.Popen.communicate now correctly ignores 26389 BrokenPipeError when the child process dies before .communicate() is 26390 called in more/all circumstances. 26391 26392- bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch 26393 by Claudiu Popa. 26394 26395- bpo-27114: Fix SSLContext._load_windows_store_certs fails with 26396 PermissionError 26397 26398- bpo-18383: Avoid creating duplicate filters when using filterwarnings and 26399 simplefilter. Based on patch by Alex Shkop. 26400 26401- bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by 26402 SELinux and fails with EACCESS. The function now falls back to fcntl(). 26403 Patch written by Michał Bednarski. 26404 26405- bpo-27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure! 26406 26407- bpo-14132: Fix urllib.request redirect handling when the target only has a 26408 query string. Original fix by Ján Janech. 26409 26410- bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes 26411 found in redirect target URLs. Some servers send Location header fields 26412 with non-ASCII bytes, but "http.client" requires the request target to be 26413 ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch 26414 by Christian Heimes. 26415 26416- bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch 26417 contributed by Chi Hsuan Yen. 26418 26419- bpo-22274: In the subprocess module, allow stderr to be redirected to 26420 stdout even when stdout is not redirected. Patch by Akira Li. 26421 26422- bpo-26807: mock_open 'files' no longer error on readline at end of file. 26423 Patch from Yolanda Robla. 26424 26425- bpo-25745: Fixed leaking a userptr in curses panel destructor. 26426 26427- bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper 26428 in statistics.pvariance. 26429 26430- bpo-26881: The modulefinder module now supports extended opcode arguments. 26431 26432- bpo-23815: Fixed crashes related to directly created instances of types in 26433 _tkinter and curses.panel modules. 26434 26435- bpo-17765: weakref.ref() no longer silently ignores keyword arguments. 26436 Patch by Georg Brandl. 26437 26438- bpo-26873: xmlrpc now raises ResponseError on unsupported type tags 26439 instead of silently return incorrect result. 26440 26441- bpo-26711: Fixed the comparison of plistlib.Data with other types. 26442 26443- bpo-24114: Fix an uninitialized variable in `ctypes.util`. The bug only 26444 occurs on SunOS when the ctypes implementation searches for the `crle` 26445 program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos. 26446 26447- bpo-26864: In urllib.request, change the proxy bypass host checking 26448 against no_proxy to be case-insensitive, and to not match unrelated host 26449 names that happen to have a bypassed hostname as a suffix. Patch by Xiang 26450 Zhang. 26451 26452- bpo-26634: recursive_repr() now sets __qualname__ of wrapper. Patch by 26453 Xiang Zhang. 26454 26455- bpo-26804: urllib.request will prefer lower_case proxy environment 26456 variables over UPPER_CASE or Mixed_Case ones. Patch contributed by 26457 Hans-Peter Jansen. 26458 26459- bpo-26837: assertSequenceEqual() now correctly outputs non-stringified 26460 differing items (like bytes in the -b mode). This affects 26461 assertListEqual() and assertTupleEqual(). 26462 26463- bpo-26041: Remove "will be removed in Python 3.7" from deprecation 26464 messages of platform.dist() and platform.linux_distribution(). Patch by 26465 Kumaripaba Miyurusara Athukorala. 26466 26467- bpo-26822: itemgetter, attrgetter and methodcaller objects no longer 26468 silently ignore keyword arguments. 26469 26470- bpo-26733: Disassembling a class now disassembles class and static 26471 methods. Patch by Xiang Zhang. 26472 26473- bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch 26474 :exc:`AttributeError` instead of :exc:`NameError`. Patch written by 26475 Emanuel Barry. 26476 26477- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name 26478 and link field limits for multibyte character encodings like utf-8. 26479 26480Security 26481-------- 26482 26483- bpo-26657: Fix directory traversal vulnerability with http.server on 26484 Windows. This fixes a regression that was introduced in 3.3.4rc1 and 26485 3.4.0rc1. Based on patch by Philipp Hagemeister. 26486 26487Library 26488------- 26489 26490- bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by 26491 Anthony Sottile. 26492 26493- bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading 26494 more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of 26495 1024 bytes per call. 26496 26497- bpo-16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'. 26498 26499- bpo-13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson. 26500 26501- bpo-26709: Fixed Y2038 problem in loading binary PLists. 26502 26503- bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our 26504 own SIGWINCH handler. Patch by Eric Price. 26505 26506- bpo-26586: In http.server, respond with "413 Request header fields too 26507 large" if there are too many header fields to parse, rather than killing 26508 the connection and raising an unhandled exception. Patch by Xiang Zhang. 26509 26510- bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable() 26511 to always return False. 26512 26513- bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of 26514 tuple (changeset 3603bae63c13 only works for classes) so we need to 26515 implement __ne__ ourselves. Patch by Andrew Plummer. 26516 26517- bpo-26644: Raise ValueError rather than SystemError when a negative length 26518 is passed to SSLSocket.recv() or read(). 26519 26520- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes 26521 instead of up to 1024. 26522 26523- bpo-26616: Fixed a bug in datetime.astimezone() method. 26524 26525- bpo-21925: :func:`warnings.formatwarning` now catches exceptions on 26526 ``linecache.getline(...)`` to be able to log :exc:`ResourceWarning` 26527 emitted late during the Python shutdown process. 26528 26529- bpo-24266: Ctrl+C during Readline history search now cancels the search 26530 mode when compiled with Readline 7. 26531 26532- bpo-26560: Avoid potential ValueError in BaseHandler.start_response. 26533 Initial patch by Peter Inglesby. 26534 26535Security 26536-------- 26537 26538- bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is 26539 empty. Patch by Baji. 26540 26541Library 26542------- 26543 26544- bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex` 26545 to support importing packages. 26546 26547- bpo-26499: Account for remaining Content-Length in HTTPResponse.readline() 26548 and read1(). Based on patch by Silent Ghost. Also document that 26549 HTTPResponse now supports these methods. 26550 26551- bpo-25320: Handle sockets in directories unittest discovery is scanning. 26552 Patch from Victor van den Elzen. 26553 26554- bpo-16181: cookiejar.http2time() now returns None if year is higher than 26555 datetime.MAXYEAR. 26556 26557- bpo-26513: Fixes platform module detection of Windows Server 26558 26559- bpo-23718: Fixed parsing time in week 0 before Jan 1. Original patch by 26560 Tamás Bence Gedai. 26561 26562- bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise 26563 NotImplementedError instead of ImportError. 26564 26565- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets. 26566 26567- bpo-15068: Got rid of excessive buffering in the fileinput module. The 26568 bufsize parameter is no longer used. 26569 26570- bpo-2202: Fix UnboundLocalError in 26571 AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu 26572 Dupuy. 26573 26574- bpo-25718: Fixed pickling and copying the accumulate() iterator with total 26575 is None. 26576 26577- bpo-26475: Fixed debugging output for regular expressions with the (?x) 26578 flag. 26579 26580- bpo-26457: Fixed the subnets() methods in IP network classes for the case 26581 when resulting prefix length is equal to maximal prefix length. Based on 26582 patch by Xiang Zhang. 26583 26584- bpo-26385: Remove the file if the internal open() call in 26585 NamedTemporaryFile() fails. Patch by Silent Ghost. 26586 26587- bpo-26402: Fix XML-RPC client to retry when the server shuts down a 26588 persistent connection. This was a regression related to the new 26589 http.client.RemoteDisconnected exception in 3.5.0a4. 26590 26591- bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with 26592 adobe=True. Patch by Swati Jaiswal. 26593 26594- bpo-26186: Remove an invalid type check in importlib.util.LazyLoader. 26595 26596- bpo-26367: importlib.__import__() raises SystemError like 26597 builtins.__import__() when ``level`` is specified but without an 26598 accompanying package specified. 26599 26600- bpo-26309: In the "socketserver" module, shut down the request (closing 26601 the connected socket) when verify_request() returns false. Patch by Aviv 26602 Palivoda. 26603 26604Security 26605-------- 26606 26607- bpo-25939: On Windows open the cert store readonly in 26608 ssl.enum_certificates. 26609 26610Library 26611------- 26612 26613- bpo-25995: os.walk() no longer uses FDs proportional to the tree depth. 26614 26615- bpo-26117: The os.scandir() iterator now closes file descriptor not only 26616 when the iteration is finished, but when it was failed with error. 26617 26618- bpo-25911: Restored support of bytes paths in os.walk() on Windows. 26619 26620- bpo-26045: Add UTF-8 suggestion to error message when posting a 26621 non-Latin-1 string with http.client. 26622 26623- bpo-12923: Reset FancyURLopener's redirect counter even if there is an 26624 exception. Based on patches by Brian Brazil and Daniel Rocco. 26625 26626- bpo-25945: Fixed a crash when unpickle the functools.partial object with 26627 wrong state. Fixed a leak in failed functools.partial constructor. "args" 26628 and "keywords" attributes of functools.partial have now always types tuple 26629 and dict correspondingly. 26630 26631- bpo-26202: copy.deepcopy() now correctly copies range() objects with 26632 non-atomic attributes. 26633 26634- bpo-23076: Path.glob() now raises a ValueError if it's called with an 26635 invalid pattern. Patch by Thomas Nyberg. 26636 26637- bpo-19883: Fixed possible integer overflows in zipimport. 26638 26639- bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and 26640 gethostbyname_ex() functions of the socket module now decode the hostname 26641 from the ANSI code page rather than UTF-8. 26642 26643- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8 26644 encoding. 26645 26646- bpo-25935: Garbage collector now breaks reference loops with OrderedDict. 26647 26648- bpo-16620: Fixed AttributeError in msilib.Directory.glob(). 26649 26650- bpo-26013: Added compatibility with broken protocol 2 pickles created in 26651 old Python 3 versions (3.4.3 and lower). 26652 26653- bpo-25850: Use cross-compilation by default for 64-bit Windows. 26654 26655- bpo-17633: Improve zipimport's support for namespace packages. 26656 26657- bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing 26658 before $() vars. 26659 26660- bpo-22138: Fix mock.patch behavior when patching descriptors. Restore 26661 original values after patching. Patch contributed by Sean McCully. 26662 26663- bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode 26664 option if it is safe to do so. 26665 26666- bpo-26012: Don't traverse into symlinks for ``**`` pattern in 26667 pathlib.Path.[r]glob(). 26668 26669- bpo-24120: Ignore PermissionError when traversing a tree with 26670 pathlib.Path.[r]glob(). Patch by Ulrich Petri. 26671 26672- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer 26673 attribute (restores backward compatibility). 26674 26675- bpo-25447: Copying the lru_cache() wrapper object now always works, 26676 independently from the type of the wrapped object (by returning the 26677 original object unchanged). 26678 26679- bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser. 26680 26681- bpo-25860: os.fwalk() no longer skips remaining directories when error 26682 occurs. Original patch by Samson Lee. 26683 26684- bpo-25914: Fixed and simplified OrderedDict.__sizeof__. 26685 26686- bpo-25902: Fixed various refcount issues in ElementTree iteration. 26687 26688- bpo-25717: Restore the previous behaviour of tolerating most fstat() 26689 errors when opening files. This was a regression in 3.5a1, and stopped 26690 anonymous temporary files from working in special cases. 26691 26692- bpo-24903: Fix regression in number of arguments compileall accepts when 26693 '-d' is specified. The check on the number of arguments has been dropped 26694 completely as it never worked correctly anyway. 26695 26696- bpo-25764: In the subprocess module, preserve any exception caused by 26697 fork() failure when preexec_fn is used. 26698 26699- bpo-6478: _strptime's regexp cache now is reset after changing timezone 26700 with time.tzset(). 26701 26702- bpo-14285: When executing a package with the "python -m package" option, 26703 and package initialization fails, a proper traceback is now reported. The 26704 "runpy" module now lets exceptions from package initialization pass back 26705 to the caller, rather than raising ImportError. 26706 26707- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message 26708 ". . . is a package and cannot be directly executed" if the package could 26709 not even be initialized (e.g. due to a bad ``*.pyc`` file). 26710 26711- bpo-25177: Fixed problem with the mean of very small and very large 26712 numbers. As a side effect, statistics.mean and statistics.variance should 26713 be significantly faster. 26714 26715- bpo-25718: Fixed copying object with state with boolean value is false. 26716 26717- bpo-10131: Fixed deep copying of minidom documents. Based on patch by 26718 Marian Ganisin. 26719 26720- bpo-25725: Fixed a reference leak in pickle.loads() when unpickling 26721 invalid data including tuple instructions. 26722 26723- bpo-25663: In the Readline completer, avoid listing duplicate global 26724 names, and search the global namespace before searching builtins. 26725 26726- bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error. 26727 26728- bpo-23914: Fixed SystemError raised by unpickler on broken pickle data. 26729 26730- bpo-25691: Fixed crash on deleting ElementTree.Element attributes. 26731 26732- bpo-25624: ZipFile now always writes a ZIP_STORED header for directory 26733 entries. Patch by Dingyuan Wang. 26734 26735- Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu 26736 Davis. 26737 26738- bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк 26739 Коренберг. 26740 26741- bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X 26742 versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis. 26743 26744- bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on 26745 current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. 26746 26747- bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input. 26748 Patch by Jack O'Connor. 26749 26750- bpo-27040: Add loop.get_exception_handler method 26751 26752- bpo-27041: asyncio: Add loop.create_future method 26753 26754- bpo-27223: asyncio: Fix _read_ready and _write_ready to respect 26755 _conn_lost. Patch by Łukasz Langa. 26756 26757- bpo-22970: asyncio: Fix inconsistency cancelling Condition.wait. Patch by 26758 David Coles. 26759 26760IDLE 26761---- 26762 26763- bpo-5124: Paste with text selected now replaces the selection on X11. This 26764 matches how paste works on Windows, Mac, most modern Linux apps, and ttk 26765 widgets. Original patch by Serhiy Storchaka. 26766 26767- bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is 26768 a private implementation of test.test_idle and tool for maintainers. 26769 26770- bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These 26771 persisted after other warnings were suppressed in #20567. Apply Serhiy 26772 Storchaka's update_idletasks solution to four test files. Record this 26773 additional advice in idle_test/README.txt 26774 26775- bpo-20567: Revise idle_test/README.txt with advice about avoiding tk 26776 warning messages from tests. Apply advice to several IDLE tests. 26777 26778- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move 26779 code for configuring text widget colors to a new function. 26780 26781- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts 26782 on Linux prevented the configuration dialog from opening. 26783 26784- bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav 26785 Heblikar. 26786 26787- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav 26788 Heblikar. 26789 26790- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley 26791 Martínez. 26792 26793- bpo-21703: Add test for IDLE's undo delegator. Original patch by Saimadhav 26794 Heblikar . 26795 26796- bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. 26797 26798- bpo-23977: Add more asserts to test_delegator. 26799 26800- bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav 26801 Heblikar. 26802 26803- In the 'IDLE-console differences' section of the IDLE doc, clarify how 26804 running with IDLE affects sys.modules and the standard streams. 26805 26806- bpo-25507: fix incorrect change in IOBinding that prevented printing. 26807 Augment IOBinding htest to include all major IOBinding functions. 26808 26809- bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION 26810 MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode 26811 CREDITS.txt to utf-8 and open it with 'utf-8'. 26812 26813Documentation 26814------------- 26815 26816- bpo-19489: Moved the search box from the sidebar to the header and footer 26817 of each page. Patch by Ammar Askar. 26818 26819- bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5. 26820 26821- bpo-26736: Used HTTPS for external links in the documentation if possible. 26822 26823- bpo-6953: Rework the Readline module documentation to group related 26824 functions together, and add more details such as what underlying Readline 26825 functions and variables are accessed. 26826 26827- bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt. 26828 26829- bpo-25500: Fix documentation to not claim that __import__ is searched for 26830 in the global scope. 26831 26832- bpo-26014: Update 3.x packaging documentation: * "See also" links to the 26833 new docs are now provided in the legacy pages * links to setuptools 26834 documentation have been updated 26835 26836Tests 26837----- 26838 26839- bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory 26840 Loyse and Jelle Zijlstra. 26841 26842- bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) 26843 was untested. 26844 26845- bpo-26015: Added new tests for pickling iterators of mutable sequences. 26846 26847- bpo-26325: Added test.support.check_no_resource_warning() to check that no 26848 ResourceWarning is emitted. 26849 26850- bpo-25940: Changed test_ssl to use self-signed.pythontest.net. This 26851 avoids relying on svn.python.org, which recently changed root certificate. 26852 26853- bpo-25616: Tests for OrderedDict are extracted from test_collections into 26854 separate file test_ordered_dict. 26855 26856- bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files 26857 cannot be written. 26858 26859Build 26860----- 26861 26862- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier 26863 de Gaye. 26864 26865- bpo-22359: Disable the rules for running _freeze_importlib and pgen when 26866 cross-compiling. The output of these programs is normally saved with the 26867 source code anyway, and is still regenerated when doing a native build. 26868 Patch by Xavier de Gaye. 26869 26870- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by 26871 Xavier de Gaye. 26872 26873- bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except 26874 on Mac OS X. Patch written by Xavier de Gaye. 26875 26876- bpo-25702: A --with-lto configure option has been added that will enable 26877 link time optimizations at build time during a make profile-opt. Some 26878 compilers and toolchains are known to not produce stable code when using 26879 LTO, be sure to test things thoroughly before relying on it. It can 26880 provide a few % speed up over profile-opt alone. 26881 26882- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old 26883 versions. 26884 26885- bpo-17603: Avoid error about nonexistent fileblocks.o file by using a 26886 lower-level check for st_blocks in struct stat. 26887 26888- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern 26889 Thiel. 26890 26891- bpo-26465: Update Windows builds to use OpenSSL 1.0.2g. 26892 26893- bpo-24421: Compile Modules/_math.c once, before building extensions. 26894 Previously it could fail to compile properly if the math and cmath builds 26895 were concurrent. 26896 26897- bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to 26898 ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The 26899 old ``PCbuild\build_pgo.bat`` script is now deprecated, and simply calls 26900 ``PCbuild\build.bat --pgo %*``. 26901 26902- bpo-25827: Add support for building with ICC to ``configure``, including a 26903 new ``--with-icc`` flag. 26904 26905- bpo-25696: Fix installation of Python on UNIX with make -j9. 26906 26907- bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with 26908 OpenSSL 1.0.2h. 26909 26910- bpo-26268: Update Windows builds to use OpenSSL 1.0.2f. 26911 26912- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries. 26913 26914- bpo-24324: Do not enable unreachable code warnings when using gcc as the 26915 option does not work correctly in older versions of gcc and has been 26916 silently removed as of gcc-4.5. 26917 26918Windows 26919------- 26920 26921- bpo-27053: Updates make_zip.py to correctly generate library ZIP file. 26922 26923- bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases 26924 that don't include the contents of the include directory (that is, 1.0.2e 26925 and later). 26926 26927- bpo-26071: bdist_wininst created binaries fail to start and find 32bit 26928 Python 26929 26930- bpo-26073: Update the list of magic numbers in launcher 26931 26932- bpo-26065: Excludes venv from library when generating embeddable distro. 26933 26934Tools/Demos 26935----------- 26936 26937- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code 26938 is loaded, but get C types on demand. The C types can change if 26939 python-gdb.py is loaded before the Python executable. Patch written by 26940 Thomas Ilsche. 26941 26942- bpo-26271: Fix the Freeze tool to properly use flags passed through 26943 configure. Patch by Daniel Shaulov. 26944 26945- bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py. 26946 Patch by Guo Ci Teo. 26947 26948- bpo-26316: Fix variable name typo in Argument Clinic. 26949 26950Windows 26951------- 26952 26953- bpo-17500: Remove unused and outdated icons. (See also: 26954 https://github.com/python/pythondotorg/issues/945) 26955 26956 26957What's New in Python 3.5.1 final? 26958================================= 26959 26960*Release date: 2015-12-06* 26961 26962Core and Builtins 26963----------------- 26964 26965- bpo-25709: Fixed problem with in-place string concatenation and utf-8 26966 cache. 26967 26968Windows 26969------- 26970 26971- bpo-25715: Python 3.5.1 installer shows wrong upgrade path and incorrect 26972 logic for launcher detection. 26973 26974 26975What's New in Python 3.5.1 release candidate 1? 26976=============================================== 26977 26978*Release date: 2015-11-22* 26979 26980Core and Builtins 26981----------------- 26982 26983- bpo-25630: Fix a possible segfault during argument parsing in functions 26984 that accept filesystem paths. 26985 26986- bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess 26987 internals regarding how fds_to_pass were passed to the child. The bug had 26988 no actual impact as subprocess.py already avoided it. 26989 26990- bpo-25388: Fixed tokenizer crash when processing undecodable source code 26991 with a null byte. 26992 26993- bpo-25462: The hash of the key now is calculated only once in most 26994 operations in C implementation of OrderedDict. 26995 26996- bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now 26997 rejects builtin types with not defined __new__. 26998 26999- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node 27000 when compiling AST from Python objects. 27001 27002- bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec() 27003 and eval() are passed bytes-like objects. These objects are not 27004 necessarily terminated by a null byte, but the functions assumed they 27005 were. 27006 27007- bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that 27008 was mutated by direct calls of dict methods. 27009 27010- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises 27011 KeyError in C implementations as well as in Python implementation. 27012 27013- bpo-25395: Fixed crash when highly nested OrderedDict structures were 27014 garbage collected. 27015 27016- bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new 27017 recursion limit is too low depending at the current recursion depth. 27018 Modify also the "lower-water mark" formula to make it monotonic. This mark 27019 is used to decide when the overflowed flag of the thread state is reset. 27020 27021- bpo-24402: Fix input() to prompt to the redirected stdout when 27022 sys.stdout.fileno() fails. 27023 27024- bpo-24806: Prevent builtin types that are not allowed to be subclassed 27025 from being subclassed through multiple inheritance. 27026 27027- bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data. 27028 27029- bpo-25280: Import trace messages emitted in verbose (-v) mode are no 27030 longer formatted twice. 27031 27032- bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom() 27033 function instead of the getentropy() function. The getentropy() function 27034 is blocking to generate very good quality entropy, os.urandom() doesn't 27035 need such high-quality entropy. 27036 27037- bpo-25182: The stdprinter (used as sys.stderr before the io module is 27038 imported at startup) now uses the backslashreplace error handler. 27039 27040- bpo-25131: Make the line number and column offset of set/dict literals and 27041 comprehensions correspond to the opening brace. 27042 27043- bpo-25150: Hide the private _Py_atomic_xxx symbols from the public 27044 Python.h header to fix a compilation error with OpenMP. 27045 PyThreadState_GET() becomes an alias to PyThreadState_Get() to avoid ABI 27046 incompatibilities. 27047 27048Library 27049------- 27050 27051- bpo-25626: Change three zlib functions to accept sizes that fit in 27052 Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a 27053 regression in 3.5 where GzipFile.read() failed to read chunks larger than 27054 2 or 4 GiB. The change affects the zlib.Decompress.decompress() 27055 max_length parameter, the zlib.decompress() bufsize parameter, and the 27056 zlib.Decompress.flush() length parameter. 27057 27058- bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True) 27059 when the OS gives priority to errors such as EACCES over EEXIST. 27060 27061- bpo-25593: Change semantics of EventLoop.stop() in asyncio. 27062 27063- bpo-6973: When we know a subprocess.Popen process has died, do not allow 27064 the send_signal(), terminate(), or kill() methods to do anything as they 27065 could potentially signal a different process. 27066 27067- bpo-25590: In the Readline completer, only call getattr() once per 27068 attribute. 27069 27070- bpo-25498: Fix a crash when garbage-collecting ctypes objects created by 27071 wrapping a memoryview. This was a regression made in 3.5a1. Based on 27072 patch by Eryksun. 27073 27074- bpo-25584: Added "escape" to the __all__ list in the glob module. 27075 27076- bpo-25584: Fixed recursive glob() with patterns starting with ``**``. 27077 27078- bpo-25446: Fix regression in smtplib's AUTH LOGIN support. 27079 27080- bpo-18010: Fix the pydoc web server's module search function to handle 27081 exceptions from importing packages. 27082 27083- bpo-25554: Got rid of circular references in regular expression parsing. 27084 27085- bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at 27086 the end if the FileInput was opened with binary mode. Patch by Ryosuke 27087 Ito. 27088 27089- bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties. 27090 Original patch by John Mark Vandenberg. 27091 27092- bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4. 27093 27094- bpo-21827: Fixed textwrap.dedent() for the case when largest common 27095 whitespace is a substring of smallest leading whitespace. Based on patch 27096 by Robert Li. 27097 27098- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled 27099 (by returning the original object unchanged). 27100 27101- bpo-25390: typing: Don't crash on Union[str, Pattern]. 27102 27103- bpo-25441: asyncio: Raise error from drain() when socket is closed. 27104 27105- bpo-25410: Cleaned up and fixed minor bugs in C implementation of 27106 OrderedDict. 27107 27108- bpo-25411: Improved Unicode support in SMTPHandler through better use of 27109 the email package. Thanks to user simon04 for the patch. 27110 27111- bpo-25407: Remove mentions of the formatter module being removed in Python 27112 3.6. 27113 27114- bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end() 27115 that caused segmentation fault or hang in iterating after moving several 27116 items to the start of ordered dict. 27117 27118- bpo-25364: zipfile now works in threads disabled builds. 27119 27120- bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both 27121 decode_data and enable_SMTPUTF8 are set to true. 27122 27123- bpo-25316: distutils raises OSError instead of DistutilsPlatformError when 27124 MSVC is not installed. 27125 27126- bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in 27127 pickletools.opcodes. 27128 27129- bpo-23972: Updates asyncio datagram create method allowing reuseport and 27130 reuseaddr socket options to be set prior to binding the socket. Mirroring 27131 the existing asyncio create_server method the reuseaddr option for 27132 datagram sockets defaults to True if the O/S is 'posix' (except if the 27133 platform is Cygwin). Patch by Chris Laws. 27134 27135- bpo-25304: Add asyncio.run_coroutine_threadsafe(). This lets you submit a 27136 coroutine to a loop from another thread, returning a 27137 concurrent.futures.Future. By Vincent Michel. 27138 27139- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the 27140 first question mark (?) rather than the last. Patch from Xiang Zhang. 27141 27142- bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query 27143 part of the URL as if it were a path. Patch from Xiang Zhang. 27144 27145- bpo-24483: C implementation of functools.lru_cache() now calculates key's 27146 hash only once. 27147 27148- bpo-22958: Constructor and update method of weakref.WeakValueDictionary 27149 now accept the self and the dict keyword arguments. 27150 27151- bpo-22609: Constructor of collections.UserDict now accepts the self 27152 keyword argument. 27153 27154- bpo-25111: Fixed comparison of traceback.FrameSummary. 27155 27156- bpo-25262: Added support for BINBYTES8 opcode in Python implementation of 27157 unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8 27158 opcodes no longer silently ignored on 32-bit platforms in C 27159 implementation. 27160 27161- bpo-25034: Fix string.Formatter problem with auto-numbering and nested 27162 format_specs. Patch by Anthon van der Neut. 27163 27164- bpo-25233: Rewrite the guts of asyncio.Queue and asyncio.Semaphore to be 27165 more understandable and correct. 27166 27167- bpo-25203: Failed readline.set_completer_delims() no longer left the 27168 module in inconsistent state. 27169 27170- bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong 27171 results in some cases. 27172 27173- bpo-23329: Allow the ssl module to be built with older versions of 27174 LibreSSL. 27175 27176- Prevent overflow in _Unpickler_Read. 27177 27178- bpo-25047: The XML encoding declaration written by Element Tree now 27179 respects the letter case given by the user. This restores the ability to 27180 write encoding names in uppercase like "UTF-8", which worked in Python 2. 27181 27182- bpo-25135: Make deque_clear() safer by emptying the deque before clearing. 27183 This helps avoid possible reentrancy issues. 27184 27185- bpo-19143: platform module now reads Windows version from kernel32.dll to 27186 avoid compatibility shims. 27187 27188- bpo-25092: Fix datetime.strftime() failure when errno was already set to 27189 EINVAL. 27190 27191- bpo-23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods 27192 of datetime.datetime: microseconds are now rounded to nearest with ties 27193 going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding 27194 towards minus infinity (ROUND_FLOOR). It's important that these methods 27195 use the same rounding mode than datetime.timedelta to keep the property: 27196 (datetime(1970,1,1) + timedelta(seconds=t)) == 27197 datetime.utcfromtimestamp(t). It also the rounding mode used by 27198 round(float) for example. 27199 27200- bpo-25155: Fix datetime.datetime.now() and datetime.datetime.utcnow() on 27201 Windows to support date after year 2038. It was a regression introduced in 27202 Python 3.5.0. 27203 27204- bpo-25108: Omitted internal frames in traceback functions print_stack(), 27205 format_stack(), and extract_stack() called without arguments. 27206 27207- bpo-25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows. 27208 27209- bpo-24684: socket.socket.getaddrinfo() now calls 27210 PyUnicode_AsEncodedString() instead of calling the encode() method of the 27211 host, to handle correctly custom string with an encode() method which 27212 doesn't return a byte string. The encoder of the IDNA codec is now called 27213 directly instead of calling the encode() method of the string. 27214 27215- bpo-25060: Correctly compute stack usage of the BUILD_MAP opcode. 27216 27217- bpo-24857: Comparing call_args to a long sequence now correctly returns a 27218 boolean result instead of raising an exception. Patch by A Kaptur. 27219 27220- bpo-23144: Make sure that HTMLParser.feed() returns all the data, even 27221 when convert_charrefs is True. 27222 27223- bpo-24982: shutil.make_archive() with the "zip" format now adds entries 27224 for directories (including empty directories) in ZIP file. 27225 27226- bpo-25019: Fixed a crash caused by setting non-string key of expat parser. 27227 Based on patch by John Leitch. 27228 27229- bpo-16180: Exit pdb if file has syntax error, instead of trapping user in 27230 an infinite loop. Patch by Xavier de Gaye. 27231 27232- bpo-24891: Fix a race condition at Python startup if the file descriptor 27233 of stdin (0), stdout (1) or stderr (2) is closed while Python is creating 27234 sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set 27235 to None if the creation of the object failed, instead of raising an 27236 OSError exception. Initial patch written by Marco Paolini. 27237 27238- bpo-24992: Fix error handling and a race condition (related to garbage 27239 collection) in collections.OrderedDict constructor. 27240 27241- bpo-24881: Fixed setting binary mode in Python implementation of FileIO on 27242 Windows and Cygwin. Patch from Akira Li. 27243 27244- bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer(). 27245 27246- bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating 27247 ssl.SSLContext. 27248 27249- bpo-25569: Fix memory leak in SSLSocket.getpeercert(). 27250 27251- bpo-25471: Sockets returned from accept() shouldn't appear to be 27252 nonblocking. 27253 27254- bpo-25319: When threading.Event is reinitialized, the underlying condition 27255 should use a regular lock rather than a recursive lock. 27256 27257- bpo-21112: Fix regression in unittest.expectedFailure on subclasses. Patch 27258 from Berker Peksag. 27259 27260- bpo-24764: cgi.FieldStorage.read_multi() now ignores the Content-Length 27261 header in part headers. Patch written by Peter Landry and reviewed by 27262 Pierre Quentel. 27263 27264- bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and 27265 Bryce Darling. 27266 27267- bpo-24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu. 27268 27269- bpo-21159: Improve message in 27270 configparser.InterpolationMissingOptionError. Patch from Łukasz Langa. 27271 27272- bpo-20362: Honour TestCase.longMessage correctly in assertRegex. Patch 27273 from Ilia Kurenkov. 27274 27275- bpo-23572: Fixed functools.singledispatch on classes with falsy 27276 metaclasses. Patch by Ethan Furman. 27277 27278- asyncio: ensure_future() now accepts awaitable objects. 27279 27280IDLE 27281---- 27282 27283- bpo-15348: Stop the debugger engine (normally in a user process) before 27284 closing the debugger window (running in the IDLE process). This prevents 27285 the RuntimeErrors that were being caught and ignored. 27286 27287- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the 27288 debugger is active (15347); b) closing the debugger with the [X] button 27289 (15348); and c) activating the debugger when already active (24455). The 27290 patch by Mark Roseman does this by making two changes. 1. Suspend and 27291 resume the gui.interaction method with the tcl vwait mechanism intended 27292 for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow 27293 any existing interaction to terminate first. 27294 27295- Change 'The program' to 'Your program' in an IDLE 'kill program?' message 27296 to make it clearer that the program referred to is the currently running 27297 user program, not IDLE itself. 27298 27299- bpo-24750: Improve the appearance of the IDLE editor window status bar. 27300 Patch by Mark Roseman. 27301 27302- bpo-25313: Change the handling of new built-in text color themes to better 27303 address the compatibility problem introduced by the addition of IDLE Dark. 27304 Consistently use the revised idleConf.CurrentTheme everywhere in idlelib. 27305 27306- bpo-24782: Extension configuration is now a tab in the IDLE Preferences 27307 dialog rather than a separate dialog. The former tabs are now a sorted 27308 list. Patch by Mark Roseman. 27309 27310- bpo-22726: Re-activate the config dialog help button with some content 27311 about the other buttons and the new IDLE Dark theme. 27312 27313- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is 27314 more or less IDLE Classic inverted, with a cobalt blue background. 27315 Strings, comments, keywords, ... are still green, red, orange, ... . To 27316 use it with IDLEs released before November 2015, hit the 'Save as New 27317 Custom Theme' button and enter a new name, such as 'Custom Dark'. The 27318 custom theme will work with any IDLE release, and can be modified. 27319 27320- bpo-25224: README.txt is now an idlelib index for IDLE developers and 27321 curious users. The previous user content is now in the IDLE doc chapter. 27322 'IDLE' now means 'Integrated Development and Learning Environment'. 27323 27324- bpo-24820: Users can now set breakpoint colors in Settings -> Custom 27325 Highlighting. Original patch by Mark Roseman. 27326 27327- bpo-24972: Inactive selection background now matches active selection 27328 background, as configured by users, on all systems. Found items are now 27329 always highlighted on Windows. Initial patch by Mark Roseman. 27330 27331- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected 27332 by a tk regression. Initial patch by Mark Roseman. 27333 27334- bpo-24988: Idle ScrolledList context menus (used in debugger) now work on 27335 Mac Aqua. Patch by Mark Roseman. 27336 27337- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by 27338 Mark Roseman. 27339 27340- bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac 27341 OSX, make them a 'sheet'. Patch by Mark Roseman. 27342 27343- bpo-25198: Enhance the initial html viewer now used for Idle Help. 27344 Properly indent fixed-pitch text (patch by Mark Roseman). Give code 27345 snippet a very Sphinx-like light blueish-gray background. Re-use initial 27346 width and height set by users for shell and editor. When the Table of 27347 Contents (TOC) menu is used, put the section header at the top of the 27348 screen. 27349 27350- bpo-25225: Condense and rewrite Idle doc section on text colors. 27351 27352- bpo-21995: Explain some differences between IDLE and console Python. 27353 27354- bpo-22820: Explain need for *print* when running file from Idle editor. 27355 27356- bpo-25224: Doc: augment Idle feature list and no-subprocess section. 27357 27358- bpo-25219: Update doc for Idle command line options. Some were missing and 27359 notes were not correct. 27360 27361- bpo-24861: Most of idlelib is private and subject to change. Use 27362 idleib.idle.* to start Idle. See idlelib.__init__.__doc__. 27363 27364- bpo-25199: Idle: add synchronization comments for future maintainers. 27365 27366- bpo-16893: Replace help.txt with help.html for Idle doc display. The new 27367 idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks 27368 better than help.txt and will better document Idle as released. The 27369 tkinter html viewer that works for this file was written by Mark Roseman. 27370 The now unused EditorWindow.HelpDialog class and helt.txt file are 27371 deprecated. 27372 27373- bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6. 27374 27375- bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts). 27376 27377Documentation 27378------------- 27379 27380- bpo-22558: Add remaining doc links to source code for Python-coded 27381 modules. Patch by Yoni Lavi. 27382 27383- bpo-12067: Rewrite Comparisons section in the Expressions chapter of the 27384 language reference. Some of the details of comparing mixed types were 27385 incorrect or ambiguous. NotImplemented is only relevant at a lower level 27386 than the Expressions chapter. Added details of comparing range() objects, 27387 and default behaviour and consistency suggestions for user-defined 27388 classes. Patch from Andy Maier. 27389 27390- bpo-24952: Clarify the default size argument of stack_size() in the 27391 "threading" and "_thread" modules. Patch from Mattip. 27392 27393- bpo-23725: Overhaul tempfile docs. Note deprecated status of mktemp. Patch 27394 from Zbigniew Jędrzejewski-Szmek. 27395 27396- bpo-24808: Update the types of some PyTypeObject fields. Patch by Joseph 27397 Weston. 27398 27399- bpo-22812: Fix unittest discovery examples. Patch from Pam McA'Nulty. 27400 27401Tests 27402----- 27403 27404- bpo-25449: Added tests for OrderedDict subclasses. 27405 27406- bpo-25099: Make test_compileall not fail when an entry on sys.path cannot 27407 be written to (commonly seen in administrative installs on Windows). 27408 27409- bpo-23919: Prevents assert dialogs appearing in the test suite. 27410 27411- ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass 27412 along to regrtest.py. Previously there was a limit of 9. 27413 27414Build 27415----- 27416 27417- bpo-24915: Add LLVM support for PGO builds and use the test suite to 27418 generate the profile data. Initial patch by Alecsandru Patrascu of Intel. 27419 27420- bpo-24910: Windows MSIs now have unique display names. 27421 27422- bpo-24986: It is now possible to build Python on Windows without errors 27423 when external libraries are not available. 27424 27425Windows 27426------- 27427 27428- bpo-25450: Updates shortcuts to start Python in installation directory. 27429 27430- bpo-25164: Changes default all-users install directory to match per-user 27431 directory. 27432 27433- bpo-25143: Improves installer error messages for unsupported platforms. 27434 27435- bpo-25163: Display correct directory in installer when using non-default 27436 settings. 27437 27438- bpo-25361: Disables use of SSE2 instructions in Windows 32-bit build 27439 27440- bpo-25089: Adds logging to installer for case where launcher is not 27441 selected on upgrade. 27442 27443- bpo-25165: Windows uninstallation should not remove launcher if other 27444 versions remain 27445 27446- bpo-25112: py.exe launcher is missing icons 27447 27448- bpo-25102: Windows installer does not precompile for -O or -OO. 27449 27450- bpo-25081: Makes Back button in installer go back to upgrade page when 27451 upgrading. 27452 27453- bpo-25091: Increases font size of the installer. 27454 27455- bpo-25126: Clarifies that the non-web installer will download some 27456 components. 27457 27458- bpo-25213: Restores requestedExecutionLevel to manifest to disable UAC 27459 virtualization. 27460 27461- bpo-25022: Removed very outdated PC/example_nt/ directory. 27462 27463Tools/Demos 27464----------- 27465 27466- bpo-25440: Fix output of python-config --extension-suffix. 27467 27468 27469What's New in Python 3.5.0 final? 27470================================= 27471 27472*Release date: 2015-09-13* 27473 27474Build 27475----- 27476 27477- bpo-25071: Windows installer should not require TargetDir parameter when 27478 installing quietly. 27479 27480 27481What's New in Python 3.5.0 release candidate 4? 27482=============================================== 27483 27484*Release date: 2015-09-09* 27485 27486Library 27487------- 27488 27489- bpo-25029: Fixes MemoryError in test_strptime. 27490 27491Build 27492----- 27493 27494- bpo-25027: Reverts partial-static build options and adds vcruntime140.dll 27495 to Windows installation. 27496 27497 27498What's New in Python 3.5.0 release candidate 3? 27499=============================================== 27500 27501*Release date: 2015-09-07* 27502 27503Core and Builtins 27504----------------- 27505 27506- bpo-24305: Prevent import subsystem stack frames from being counted by the 27507 warnings.warn(stacklevel=) parameter. 27508 27509- bpo-24912: Prevent __class__ assignment to immutable built-in objects. 27510 27511- bpo-24975: Fix AST compilation for :pep:`448` syntax. 27512 27513Library 27514------- 27515 27516- bpo-24917: time_strftime() buffer over-read. 27517 27518- bpo-24748: To resolve a compatibility problem found with py2exe and 27519 pywin32, imp.load_dynamic() once again ignores previously loaded modules 27520 to support Python modules replacing themselves with extension modules. 27521 Patch by Petr Viktorin. 27522 27523- bpo-24635: Fixed a bug in typing.py where isinstance([], typing.Iterable) 27524 would return True once, then False on subsequent calls. 27525 27526- bpo-24989: Fixed buffer overread in BytesIO.readline() if a position is 27527 set beyond size. Based on patch by John Leitch. 27528 27529- bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and 27530 Bryce Darling. 27531 27532 27533What's New in Python 3.5.0 release candidate 2? 27534=============================================== 27535 27536*Release date: 2015-08-25* 27537 27538Core and Builtins 27539----------------- 27540 27541- bpo-24769: Interpreter now starts properly when dynamic loading is 27542 disabled. Patch by Petr Viktorin. 27543 27544- bpo-21167: NAN operations are now handled correctly when python is 27545 compiled with ICC even if -fp-model strict is not specified. 27546 27547- bpo-24492: A "package" lacking a __name__ attribute when trying to perform 27548 a ``from .. import ...`` statement will trigger an ImportError instead of 27549 an AttributeError. 27550 27551Library 27552------- 27553 27554- bpo-24847: Removes vcruntime140.dll dependency from Tcl/Tk. 27555 27556- bpo-24839: platform._syscmd_ver raises DeprecationWarning 27557 27558- bpo-24867: Fix Task.get_stack() for 'async def' coroutines 27559 27560 27561What's New in Python 3.5.0 release candidate 1? 27562=============================================== 27563 27564*Release date: 2015-08-09* 27565 27566Core and Builtins 27567----------------- 27568 27569- bpo-24667: Resize odict in all cases that the underlying dict resizes. 27570 27571Library 27572------- 27573 27574- bpo-24824: Signatures of codecs.encode() and codecs.decode() now are 27575 compatible with pydoc. 27576 27577- bpo-24634: Importing uuid should not try to load libc on Windows 27578 27579- bpo-24798: _msvccompiler.py doesn't properly support manifests 27580 27581- bpo-4395: Better testing and documentation of binary operators. Patch by 27582 Martin Panter. 27583 27584- bpo-23973: Update typing.py from GitHub repo. 27585 27586- bpo-23004: mock_open() now reads binary data correctly when the type of 27587 read_data is bytes. Initial patch by Aaron Hill. 27588 27589- bpo-23888: Handle fractional time in cookie expiry. Patch by ssh. 27590 27591- bpo-23652: Make it possible to compile the select module against the libc 27592 headers from the Linux Standard Base, which do not include some EPOLL 27593 macros. Patch by Matt Frank. 27594 27595- bpo-22932: Fix timezones in email.utils.formatdate. Patch from Dmitry 27596 Shachnev. 27597 27598- bpo-23779: imaplib raises TypeError if authenticator tries to abort. Patch 27599 from Craig Holmquist. 27600 27601- bpo-23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch 27602 written by Matthieu Gautier. 27603 27604- bpo-23254: Document how to close the TCPServer listening socket. Patch 27605 from Martin Panter. 27606 27607- bpo-19450: Update Windows and OS X installer builds to use SQLite 3.8.11. 27608 27609- bpo-17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella. 27610 27611- bpo-24791: Fix grammar regression for call syntax: 'g(\*a or b)'. 27612 27613IDLE 27614---- 27615 27616- bpo-23672: Allow Idle to edit and run files with astral chars in name. 27617 Patch by Mohd Sanad Zaki Rizvi. 27618 27619- bpo-24745: Idle editor default font. Switch from Courier to 27620 platform-sensitive TkFixedFont. This should not affect current customized 27621 font selections. If there is a problem, edit 27622 $HOME/.idlerc/config-main.cfg and remove 'fontxxx' entries from [Editor 27623 Window]. Patch by Mark Roseman. 27624 27625- bpo-21192: Idle editor. When a file is run, put its name in the restart 27626 bar. Do not print false prompts. Original patch by Adnan Umer. 27627 27628- bpo-13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy. 27629 27630Documentation 27631------------- 27632 27633- bpo-24129: Clarify the reference documentation for name resolution. This 27634 includes removing the assumption that readers will be familiar with the 27635 name resolution scheme Python used prior to the introduction of lexical 27636 scoping for function namespaces. Patch by Ivan Levkivskyi. 27637 27638- bpo-20769: Improve reload() docs. Patch by Dorian Pula. 27639 27640- bpo-23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan. 27641 27642- bpo-24729: Correct IO tutorial to match implementation regarding encoding 27643 parameter to open function. 27644 27645Tests 27646----- 27647 27648- bpo-24751: When running regrtest with the ``-w`` command line option, a 27649 test run is no longer marked as a failure if all tests succeed when 27650 re-run. 27651 27652 27653What's New in Python 3.5.0 beta 4? 27654================================== 27655 27656*Release date: 2015-07-26* 27657 27658Core and Builtins 27659----------------- 27660 27661- bpo-23573: Restored optimization of bytes.rfind() and bytearray.rfind() 27662 for single-byte argument on Linux. 27663 27664- bpo-24569: Make :pep:`448` dictionary evaluation more consistent. 27665 27666- bpo-24583: Fix crash when set is mutated while being updated. 27667 27668- bpo-24407: Fix crash when dict is mutated while being updated. 27669 27670- bpo-24619: New approach for tokenizing async/await. As a consequence, it 27671 is now possible to have one-line 'async def foo(): await ..' functions. 27672 27673- bpo-24687: Plug refleak on SyntaxError in function parameters annotations. 27674 27675- bpo-15944: memoryview: Allow arbitrary formats when casting to bytes. 27676 Patch by Martin Panter. 27677 27678Library 27679------- 27680 27681- bpo-23441: rcompleter now prints a tab character instead of displaying 27682 possible completions for an empty word. Initial patch by Martin Sekera. 27683 27684- bpo-24683: Fixed crashes in _json functions called with arguments of 27685 inappropriate type. 27686 27687- bpo-21697: shutil.copytree() now correctly handles symbolic links that 27688 point to directories. Patch by Eduardo Seabra and Thomas Kluyver. 27689 27690- bpo-14373: Fixed segmentation fault when gc.collect() is called during 27691 constructing lru_cache (C implementation). 27692 27693- bpo-24695: Fix a regression in traceback.print_exception(). If 27694 exc_traceback is None we shouldn't print a traceback header like described 27695 in the documentation. 27696 27697- bpo-24620: Random.setstate() now validates the value of state last 27698 element. 27699 27700- bpo-22485: Fixed an issue that caused `inspect.getsource` to return 27701 incorrect results on nested functions. 27702 27703- bpo-22153: Improve unittest docs. Patch from Martin Panter and evilzero. 27704 27705- bpo-24580: Symbolic group references to open group in re patterns now are 27706 explicitly forbidden as well as numeric group references. 27707 27708- bpo-24206: Fixed __eq__ and __ne__ methods of inspect classes. 27709 27710- bpo-24631: Fixed regression in the timeit module with multiline setup. 27711 27712- bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely. 27713 Patch from Nicola Palumbo and Laurent De Buyst. 27714 27715- bpo-23661: unittest.mock side_effects can now be exceptions again. This 27716 was a regression vs Python 3.4. Patch from Ignacio Rossi 27717 27718- bpo-24608: chunk.Chunk.read() now always returns bytes, not str. 27719 27720- bpo-18684: Fixed reading out of the buffer in the re module. 27721 27722- bpo-24259: tarfile now raises a ReadError if an archive is truncated 27723 inside a data segment. 27724 27725- bpo-15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional 27726 initial-response argument to the SMTP AUTH command. 27727 27728- bpo-24669: Fix inspect.getsource() for 'async def' functions. Patch by Kai 27729 Groner. 27730 27731- bpo-24688: ast.get_docstring() for 'async def' functions. 27732 27733Build 27734----- 27735 27736- bpo-24603: Update Windows builds and OS X 10.5 installer to use OpenSSL 27737 1.0.2d. 27738 27739 27740What's New in Python 3.5.0 beta 3? 27741================================== 27742 27743*Release date: 2015-07-05* 27744 27745Core and Builtins 27746----------------- 27747 27748- bpo-24467: Fixed possible buffer over-read in bytearray. The bytearray 27749 object now always allocates place for trailing null byte and it's buffer 27750 now is always null-terminated. 27751 27752- Upgrade to Unicode 8.0.0. 27753 27754- bpo-24345: Add Py_tp_finalize slot for the stable ABI. 27755 27756- bpo-24400: Introduce a distinct type for :pep:`492` coroutines; add 27757 types.CoroutineType, inspect.getcoroutinestate, 27758 inspect.getcoroutinelocals; coroutines no longer use CO_GENERATOR flag; 27759 sys.set_coroutine_wrapper works only for 'async def' coroutines; 27760 inspect.iscoroutine no longer uses collections.abc.Coroutine, it's 27761 intended to test for pure 'async def' coroutines only; add new opcode: 27762 GET_YIELD_FROM_ITER; fix generators wrapper used in types.coroutine to be 27763 instance of collections.abc.Generator; collections.abc.Awaitable and 27764 collections.abc.Coroutine can no longer be used to detect generator-based 27765 coroutines--use inspect.isawaitable instead. 27766 27767- bpo-24450: Add gi_yieldfrom to generators and cr_await to coroutines. 27768 Contributed by Benno Leslie and Yury Selivanov. 27769 27770- bpo-19235: Add new RecursionError exception. Patch by Georg Brandl. 27771 27772Library 27773------- 27774 27775- bpo-21750: mock_open.read_data can now be read from each instance, as it 27776 could in Python 3.3. 27777 27778- bpo-24552: Fix use after free in an error case of the _pickle module. 27779 27780- bpo-24514: tarfile now tolerates number fields consisting of only 27781 whitespace. 27782 27783- bpo-19176: Fixed doctype() related bugs in C implementation of 27784 ElementTree. A deprecation warning no longer issued by XMLParser subclass 27785 with default doctype() method. Direct call of doctype() now issues a 27786 warning. Parser's doctype() now is not called if target's doctype() is 27787 called. Based on patch by Martin Panter. 27788 27789- bpo-20387: Restore semantic round-trip correctness in tokenize/untokenize 27790 for tab-indented blocks. 27791 27792- bpo-24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm() 27793 functions of the audioop module. 27794 27795- bpo-24336: The contextmanager decorator now works with functions with 27796 keyword arguments called "func" and "self". Patch by Martin Panter. 27797 27798- bpo-24522: Fix possible integer overflow in json accelerator module. 27799 27800- bpo-24489: ensure a previously set C errno doesn't disturb cmath.polar(). 27801 27802- bpo-24408: Fixed AttributeError in measure() and metrics() methods of 27803 tkinter.Font. 27804 27805- bpo-14373: C implementation of functools.lru_cache() now can be used with 27806 methods. 27807 27808- bpo-24347: Set KeyError if PyDict_GetItemWithError returns NULL. 27809 27810- bpo-24348: Drop superfluous incref/decref. 27811 27812- bpo-24359: Check for changed OrderedDict size during iteration. 27813 27814- bpo-24368: Support keyword arguments in OrderedDict methods. 27815 27816- bpo-24362: Simplify the C OrderedDict fast nodes resize logic. 27817 27818- bpo-24377: Fix a ref leak in OrderedDict.__repr__. 27819 27820- bpo-24369: Defend against key-changes during iteration. 27821 27822Tests 27823----- 27824 27825- bpo-24373: _testmultiphase and xxlimited now use tp_traverse and 27826 tp_finalize to avoid reference leaks encountered when combining tp_dealloc 27827 with PyType_FromSpec (see issue #16690 for details) 27828 27829Documentation 27830------------- 27831 27832- bpo-24458: Update documentation to cover multi-phase initialization for 27833 extension modules (PEP 489). Patch by Petr Viktorin. 27834 27835- bpo-24351: Clarify what is meant by "identifier" in the context of 27836 string.Template instances. 27837 27838Build 27839----- 27840 27841- bpo-24432: Update Windows builds and OS X 10.5 installer to use OpenSSL 27842 1.0.2c. 27843 27844 27845What's New in Python 3.5.0 beta 2? 27846================================== 27847 27848*Release date: 2015-05-31* 27849 27850Core and Builtins 27851----------------- 27852 27853- bpo-24284: The startswith and endswith methods of the str class no longer 27854 return True when finding the empty string and the indexes are completely 27855 out of range. 27856 27857- bpo-24115: Update uses of PyObject_IsTrue(), PyObject_Not(), 27858 PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() 27859 to check for and handle errors correctly. 27860 27861- bpo-24328: Fix importing one character extension modules. 27862 27863- bpo-11205: In dictionary displays, evaluate the key before the value. 27864 27865- bpo-24285: Fixed regression that prevented importing extension modules 27866 from inside packages. Patch by Petr Viktorin. 27867 27868Library 27869------- 27870 27871- bpo-23247: Fix a crash in the StreamWriter.reset() of CJK codecs. 27872 27873- bpo-24270: Add math.isclose() and cmath.isclose() functions as per 27874 :pep:`485`. Contributed by Chris Barker and Tal Einat. 27875 27876- bpo-5633: Fixed timeit when the statement is a string and the setup is 27877 not. 27878 27879- bpo-24326: Fixed audioop.ratecv() with non-default weightB argument. 27880 Original patch by David Moore. 27881 27882- bpo-16991: Add a C implementation of OrderedDict. 27883 27884- bpo-23934: Fix inspect.signature to fail correctly for builtin types 27885 lacking signature information. Initial patch by James Powell. 27886 27887 27888What's New in Python 3.5.0 beta 1? 27889================================== 27890 27891*Release date: 2015-05-24* 27892 27893Core and Builtins 27894----------------- 27895 27896- bpo-24276: Fixed optimization of property descriptor getter. 27897 27898- bpo-24268: PEP 489: Multi-phase extension module initialization. Patch by 27899 Petr Viktorin. 27900 27901- bpo-23955: Add pyvenv.cfg option to suppress registry/environment lookup 27902 for generating sys.path on Windows. 27903 27904- bpo-24257: Fixed system error in the comparison of faked 27905 types.SimpleNamespace. 27906 27907- bpo-22939: Fixed integer overflow in iterator object. Patch by Clement 27908 Rouault. 27909 27910- bpo-23985: Fix a possible buffer overrun when deleting a slice from the 27911 front of a bytearray and then appending some other bytes data. 27912 27913- bpo-24102: Fixed exception type checking in standard error handlers. 27914 27915- bpo-15027: The UTF-32 encoder is now 3x to 7x faster. 27916 27917- bpo-23290: Optimize set_merge() for cases where the target is empty. 27918 (Contributed by Serhiy Storchaka.) 27919 27920- bpo-2292: PEP 448: Additional Unpacking Generalizations. 27921 27922- bpo-24096: Make warnings.warn_explicit more robust against mutation of the 27923 warnings.filters list. 27924 27925- bpo-23996: Avoid a crash when a delegated generator raises an unnormalized 27926 StopIteration exception. Patch by Stefan Behnel. 27927 27928- bpo-23910: Optimize property() getter calls. Patch by Joe Jevnik. 27929 27930- bpo-23911: Move path-based importlib bootstrap code to a separate frozen 27931 module. 27932 27933- bpo-24192: Fix namespace package imports. 27934 27935- bpo-24022: Fix tokenizer crash when processing undecodable source code. 27936 27937- bpo-9951: Added a hex() method to bytes, bytearray, and memoryview. 27938 27939- bpo-22906: PEP 479: Change StopIteration handling inside generators. 27940 27941- bpo-24017: PEP 492: Coroutines with async and await syntax. 27942 27943Library 27944------- 27945 27946- bpo-14373: Added C implementation of functools.lru_cache(). Based on 27947 patches by Matt Joiner and Alexey Kachayev. 27948 27949- bpo-24230: The tempfile module now accepts bytes for prefix, suffix and 27950 dir parameters and returns bytes in such situations (matching the os 27951 module APIs). 27952 27953- bpo-22189: collections.UserString now supports __getnewargs__(), 27954 __rmod__(), casefold(), format_map(), isprintable(), and maketrans(). 27955 Patch by Joe Jevnik. 27956 27957- bpo-24244: Prevents termination when an invalid format string is 27958 encountered on Windows in strftime. 27959 27960- bpo-23973: PEP 484: Add the typing module. 27961 27962- bpo-23086: The collections.abc.Sequence() abstract base class added 27963 *start* and *stop* parameters to the index() mixin. Patch by Devin 27964 Jeanpierre. 27965 27966- bpo-20035: Replaced the ``tkinter._fix`` module used for setting up the 27967 Tcl/Tk environment on Windows with a private function in the ``_tkinter`` 27968 module that makes no permanent changes to the environment. 27969 27970- bpo-24257: Fixed segmentation fault in sqlite3.Row constructor with faked 27971 cursor type. 27972 27973- bpo-15836: assertRaises(), assertRaisesRegex(), assertWarns() and 27974 assertWarnsRegex() assertments now check the type of the first argument to 27975 prevent possible user error. Based on patch by Daniel Wagner-Hall. 27976 27977- bpo-9858: Add missing method stubs to _io.RawIOBase. Patch by Laura 27978 Rupprecht. 27979 27980- bpo-22955: attrgetter, itemgetter and methodcaller objects in the operator 27981 module now support pickling. Added readable and evaluable repr for these 27982 objects. Based on patch by Josh Rosenberg. 27983 27984- bpo-22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again when 27985 a directory with the chosen name already exists on Windows as well as on 27986 Unix. tempfile.mkstemp() now fails early if parent directory is not valid 27987 (not exists or is a file) on Windows. 27988 27989- bpo-23780: Improved error message in os.path.join() with single argument. 27990 27991- bpo-6598: Increased time precision and random number range in 27992 email.utils.make_msgid() to strengthen the uniqueness of the message ID. 27993 27994- bpo-24091: Fixed various crashes in corner cases in C implementation of 27995 ElementTree. 27996 27997- bpo-21931: msilib.FCICreate() now raises TypeError in the case of a bad 27998 argument instead of a ValueError with a bogus FCI error number. Patch by 27999 Jeffrey Armstrong. 28000 28001- bpo-13866: *quote_via* argument added to urllib.parse.urlencode. 28002 28003- bpo-20098: New mangle_from policy option for email, default True for 28004 compat32, but False for all other policies. 28005 28006- bpo-24211: The email library now supports RFC 6532: it can generate 28007 headers using utf-8 instead of encoded words. 28008 28009- bpo-16314: Added support for the LZMA compression in distutils. 28010 28011- bpo-21804: poplib now supports RFC 6856 (UTF8). 28012 28013- bpo-18682: Optimized pprint functions for builtin scalar types. 28014 28015- bpo-22027: smtplib now supports RFC 6531 (SMTPUTF8). 28016 28017- bpo-23488: Random generator objects now consume 2x less memory on 64-bit. 28018 28019- bpo-1322: platform.dist() and platform.linux_distribution() functions are 28020 now deprecated. Initial patch by Vajrasky Kok. 28021 28022- bpo-22486: Added the math.gcd() function. The fractions.gcd() function 28023 now is deprecated. Based on patch by Mark Dickinson. 28024 28025- bpo-24064: Property() docstrings are now writeable. (Patch by Berker 28026 Peksag.) 28027 28028- bpo-22681: Added support for the koi8_t encoding. 28029 28030- bpo-22682: Added support for the kz1048 encoding. 28031 28032- bpo-23796: peek and read1 methods of BufferedReader now raise ValueError 28033 if they called on a closed object. Patch by John Hergenroeder. 28034 28035- bpo-21795: smtpd now supports the 8BITMIME extension whenever the new 28036 *decode_data* constructor argument is set to False. 28037 28038- bpo-24155: optimize heapq.heapify() for better cache performance when 28039 heapifying large lists. 28040 28041- bpo-21800: imaplib now supports RFC 5161 (enable), RFC 6855 28042 (utf8/internationalized email) and automatically encodes non-ASCII 28043 usernames and passwords to UTF8. 28044 28045- bpo-20274: When calling a _sqlite.Connection, it now complains if passed 28046 any keyword arguments. Previously it silently ignored them. 28047 28048- bpo-20274: Remove ignored and erroneous "kwargs" parameters from three 28049 METH_VARARGS methods on _sqlite.Connection. 28050 28051- bpo-24134: assertRaises(), assertRaisesRegex(), assertWarns() and 28052 assertWarnsRegex() checks now emits a deprecation warning when callable is 28053 None or keyword arguments except msg is passed in the context manager 28054 mode. 28055 28056- bpo-24018: Add a collections.abc.Generator abstract base class. 28057 Contributed by Stefan Behnel. 28058 28059- bpo-23880: Tkinter's getint() and getdouble() now support Tcl_Obj. 28060 Tkinter's getdouble() now supports any numbers (in particular int). 28061 28062- bpo-22619: Added negative limit support in the traceback module. Based on 28063 patch by Dmitry Kazakov. 28064 28065- bpo-24094: Fix possible crash in json.encode with poorly behaved dict 28066 subclasses. 28067 28068- bpo-9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes. 28069 Patch written by William Orr. 28070 28071- bpo-17445: add difflib.diff_bytes() to support comparison of byte strings 28072 (fixes a regression from Python 2). 28073 28074- bpo-23917: Fall back to sequential compilation when ProcessPoolExecutor 28075 doesn't exist. Patch by Claudiu Popa. 28076 28077- bpo-23008: Fixed resolving attributes with boolean value is False in 28078 pydoc. 28079 28080- Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't increment 28081 unfinished tasks (this bug was introduced when JoinableQueue was merged 28082 with Queue). 28083 28084- bpo-23908: os functions now reject paths with embedded null character on 28085 Windows instead of silently truncating them. 28086 28087- bpo-23728: binascii.crc_hqx() could return an integer outside of the range 28088 0-0xffff for empty data. 28089 28090- bpo-23887: urllib.error.HTTPError now has a proper repr() representation. 28091 Patch by Berker Peksag. 28092 28093- asyncio: New event loop APIs: set_task_factory() and get_task_factory(). 28094 28095- asyncio: async() function is deprecated in favour of ensure_future(). 28096 28097- bpo-24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore 28098 support new 'async with' syntax. Contributed by Yury Selivanov. 28099 28100- bpo-24179: Support 'async for' for asyncio.StreamReader. Contributed by 28101 Yury Selivanov. 28102 28103- bpo-24184: Add AsyncIterator and AsyncIterable ABCs to collections.abc. 28104 Contributed by Yury Selivanov. 28105 28106- bpo-22547: Implement informative __repr__ for inspect.BoundArguments. 28107 Contributed by Yury Selivanov. 28108 28109- bpo-24190: Implement inspect.BoundArgument.apply_defaults() method. 28110 Contributed by Yury Selivanov. 28111 28112- bpo-20691: Add 'follow_wrapped' argument to 28113 inspect.Signature.from_callable() and inspect.signature(). Contributed by 28114 Yury Selivanov. 28115 28116- bpo-24248: Deprecate inspect.Signature.from_function() and 28117 inspect.Signature.from_builtin(). 28118 28119- bpo-23898: Fix inspect.classify_class_attrs() to support attributes with 28120 overloaded __eq__ and __bool__. Patch by Mike Bayer. 28121 28122- bpo-24298: Fix inspect.signature() to correctly unwrap wrappers around 28123 bound methods. 28124 28125IDLE 28126---- 28127 28128- bpo-23184: remove unused names and imports in idlelib. Initial patch by Al 28129 Sweigart. 28130 28131Tests 28132----- 28133 28134- bpo-21520: test_zipfile no longer fails if the word 'bad' appears anywhere 28135 in the name of the current directory. 28136 28137- bpo-9517: Move script_helper into the support package. Patch by Christie 28138 Wilson. 28139 28140Documentation 28141------------- 28142 28143- bpo-22155: Add File Handlers subsection with createfilehandler to tkinter 28144 doc. Remove obsolete example from FAQ. Patch by Martin Panter. 28145 28146- bpo-24029: Document the name binding behavior for submodule imports. 28147 28148- bpo-24077: Fix typo in man page for -I command option: -s, not -S 28149 28150Tools/Demos 28151----------- 28152 28153- bpo-24000: Improved Argument Clinic's mapping of converters to legacy 28154 "format units". Updated the documentation to match. 28155 28156- bpo-24001: Argument Clinic converters now use accept={type} instead of 28157 types={'type'} to specify the types the converter accepts. 28158 28159- bpo-23330: h2py now supports arbitrary filenames in #include. 28160 28161- bpo-24031: make patchcheck now supports git checkouts, too. 28162 28163 28164What's New in Python 3.5.0 alpha 4? 28165=================================== 28166 28167*Release date: 2015-04-19* 28168 28169Core and Builtins 28170----------------- 28171 28172- bpo-22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now 28173 include the architecture triplet in the extension name, to make it easy to 28174 test builds for different ABIs in the same working tree. Under OS X, the 28175 extension name now includes :pep:`3149`-style information. 28176 28177- bpo-22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. Patch 28178 courtesy of Joe Jevnik. 28179 28180- bpo-23731: Implement :pep:`488`: removal of .pyo files. 28181 28182- bpo-23726: Don't enable GC for user subclasses of non-GC types that don't 28183 add any new fields. Patch by Eugene Toder. 28184 28185- bpo-23309: Avoid a deadlock at shutdown if a daemon thread is aborted 28186 while it is holding a lock to a buffered I/O object, and the main thread 28187 tries to use the same I/O object (typically stdout or stderr). A fatal 28188 error is emitted instead. 28189 28190- bpo-22977: Fixed formatting Windows error messages on Wine. Patch by 28191 Martin Panter. 28192 28193- bpo-23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on 28194 non-integer input. 28195 28196- bpo-24044: Fix possible null pointer dereference in list.sort in out of 28197 memory conditions. 28198 28199- bpo-21354: PyCFunction_New function is exposed by python DLL again. 28200 28201Library 28202------- 28203 28204- bpo-23840: tokenize.open() now closes the temporary binary file on error 28205 to fix a resource warning. 28206 28207- bpo-16914: new debuglevel 2 in smtplib adds timestamps to debug output. 28208 28209- bpo-7159: urllib.request now supports sending auth credentials 28210 automatically after the first 401. This enhancement is a superset of the 28211 enhancement from issue #19494 and supersedes that change. 28212 28213- bpo-23703: Fix a regression in urljoin() introduced in 901e4e52b20a. Patch 28214 by Demian Brecht. 28215 28216- bpo-4254: Adds _curses.update_lines_cols(). Patch by Arnon Yaari 28217 28218- bpo-19933: Provide default argument for ndigits in round. Patch by 28219 Vajrasky Kok. 28220 28221- bpo-23193: Add a numeric_owner parameter to tarfile.TarFile.extract and 28222 tarfile.TarFile.extractall. Patch by Michael Vogt and Eric Smith. 28223 28224- bpo-23342: Add a subprocess.run() function than returns a CalledProcess 28225 instance for a more consistent API than the existing call* functions. 28226 28227- bpo-21217: inspect.getsourcelines() now tries to compute the start and end 28228 lines from the code object, fixing an issue when a lambda function is used 28229 as decorator argument. Patch by Thomas Ballinger and Allison Kaptur. 28230 28231- bpo-24521: Fix possible integer overflows in the pickle module. 28232 28233- bpo-22931: Allow '[' and ']' in cookie values. 28234 28235- The keywords attribute of functools.partial is now always a dictionary. 28236 28237- bpo-23811: Add missing newline to the PyCompileError error message. Patch 28238 by Alex Shkop. 28239 28240- bpo-21116: Avoid blowing memory when allocating a multiprocessing shared 28241 array that's larger than 50% of the available RAM. Patch by Médéric 28242 Boquien. 28243 28244- bpo-22982: Improve BOM handling when seeking to multiple positions of a 28245 writable text file. 28246 28247- bpo-23464: Removed deprecated asyncio JoinableQueue. 28248 28249- bpo-23529: Limit the size of decompressed data when reading from GzipFile, 28250 BZ2File or LZMAFile. This defeats denial of service attacks using 28251 compressed bombs (i.e. compressed payloads which decompress to a huge 28252 size). Patch by Martin Panter and Nikolaus Rath. 28253 28254- bpo-21859: Added Python implementation of io.FileIO. 28255 28256- bpo-23865: close() methods in multiple modules now are idempotent and more 28257 robust at shutdown. If they need to release multiple resources, all are 28258 released even if errors occur. 28259 28260- bpo-23400: Raise same exception on both Python 2 and 3 if sem_open is not 28261 available. Patch by Davin Potts. 28262 28263- bpo-10838: The subprocess now module includes SubprocessError and 28264 TimeoutError in its list of exported names for the users wild enough to 28265 use ``from subprocess import *``. 28266 28267- bpo-23411: Added DefragResult, ParseResult, SplitResult, 28268 DefragResultBytes, ParseResultBytes, and SplitResultBytes to 28269 urllib.parse.__all__. Patch by Martin Panter. 28270 28271- bpo-23881: urllib.request.ftpwrapper constructor now closes the socket if 28272 the FTP connection failed to fix a ResourceWarning. 28273 28274- bpo-23853: :meth:`socket.socket.sendall` does no more reset the socket 28275 timeout each time data is sent successfully. The socket timeout is now the 28276 maximum total duration to send all data. 28277 28278- bpo-22721: An order of multiline pprint output of set or dict containing 28279 orderable and non-orderable elements no longer depends on iteration order 28280 of set or dict. 28281 28282- bpo-15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always 28283 returns bool. tkinter.BooleanVar now validates input values (accepted 28284 bool, int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns 28285 bool. 28286 28287- bpo-10590: xml.sax.parseString() now supports string argument. 28288 28289- bpo-23338: Fixed formatting ctypes error messages on Cygwin. Patch by 28290 Makoto Kato. 28291 28292- bpo-15582: inspect.getdoc() now follows inheritance chains. 28293 28294- bpo-2175: SAX parsers now support a character stream of InputSource 28295 object. 28296 28297- bpo-16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and 28298 arbitrary precision integers added in Tcl 8.5. 28299 28300- bpo-23834: Fix socket.sendto(), use the C Py_ssize_t type to store the 28301 result of sendto() instead of the C int type. 28302 28303- bpo-23618: :meth:`socket.socket.connect` now waits until the connection 28304 completes instead of raising :exc:`InterruptedError` if the connection is 28305 interrupted by signals, signal handlers don't raise an exception and the 28306 socket is blocking or has a timeout. :meth:`socket.socket.connect` still 28307 raise :exc:`InterruptedError` for non-blocking sockets. 28308 28309- bpo-21526: Tkinter now supports new boolean type in Tcl 8.5. 28310 28311- bpo-23836: Fix the faulthandler module to handle reentrant calls to its 28312 signal handlers. 28313 28314- bpo-23838: linecache now clears the cache and returns an empty result on 28315 MemoryError. 28316 28317- bpo-10395: Added os.path.commonpath(). Implemented in posixpath and 28318 ntpath. Based on patch by Rafik Draoui. 28319 28320- bpo-23611: Serializing more "lookupable" objects (such as unbound methods 28321 or nested classes) now are supported with pickle protocols < 4. 28322 28323- bpo-13583: sqlite3.Row now supports slice indexing. 28324 28325- bpo-18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed 28326 ambiguous reverse mappings. Added many new mappings. Import mapping is 28327 no longer applied to modules already mapped with full name mapping. 28328 28329- bpo-23485: select.select() is now retried automatically with the 28330 recomputed timeout when interrupted by a signal, except if the signal 28331 handler raises an exception. This change is part of the :pep:`475`. 28332 28333- bpo-23752: When built from an existing file descriptor, io.FileIO() now 28334 only calls fstat() once. Before fstat() was called twice, which was not 28335 necessary. 28336 28337- bpo-23704: collections.deque() objects now support __add__, __mul__, and 28338 __imul__(). 28339 28340- bpo-23171: csv.Writer.writerow() now supports arbitrary iterables. 28341 28342- bpo-23745: The new email header parser now handles duplicate MIME 28343 parameter names without error, similar to how get_param behaves. 28344 28345- bpo-22117: Fix os.utime(), it now rounds the timestamp towards minus 28346 infinity (-inf) instead of rounding towards zero. 28347 28348- bpo-23310: Fix MagicMock's initializer to work with __methods__, just like 28349 configure_mock(). Patch by Kasia Jachim. 28350 28351Build 28352----- 28353 28354- bpo-23817: FreeBSD now uses "1.0" in the SOVERSION as other operating 28355 systems, instead of just "1". 28356 28357- bpo-23501: Argument Clinic now generates code into separate files by 28358 default. 28359 28360Tests 28361----- 28362 28363- bpo-23799: Added test.support.start_threads() for running and cleaning up 28364 multiple threads. 28365 28366- bpo-22390: test.regrtest now emits a warning if temporary files or 28367 directories are left after running a test. 28368 28369Tools/Demos 28370----------- 28371 28372- bpo-18128: pygettext now uses standard +NNNN format in the 28373 POT-Creation-Date header. 28374 28375- bpo-23935: Argument Clinic's understanding of format units accepting 28376 bytes, bytearrays, and buffers is now consistent with both the 28377 documentation and the implementation. 28378 28379- bpo-23944: Argument Clinic now wraps long impl prototypes at column 78. 28380 28381- bpo-20586: Argument Clinic now ensures that functions without docstrings 28382 have signatures. 28383 28384- bpo-23492: Argument Clinic now generates argument parsing code with 28385 PyArg_Parse instead of PyArg_ParseTuple if possible. 28386 28387- bpo-23500: Argument Clinic is now smarter about generating the "#ifndef" 28388 (empty) definition of the methoddef macro: it's only generated once, even 28389 if Argument Clinic processes the same symbol multiple times, and it's 28390 emitted at the end of all processing rather than immediately after the 28391 first use. 28392 28393C API 28394----- 28395 28396- bpo-23998: PyImport_ReInitLock() now checks for lock allocation error 28397 28398 28399What's New in Python 3.5.0 alpha 3? 28400=================================== 28401 28402*Release date: 2015-03-28* 28403 28404Core and Builtins 28405----------------- 28406 28407- bpo-23573: Increased performance of string search operations (str.find, 28408 str.index, str.count, the in operator, str.split, str.partition) with 28409 arguments of different kinds (UCS1, UCS2, UCS4). 28410 28411- bpo-23753: Python doesn't support anymore platforms without stat() or 28412 fstat(), these functions are always required. 28413 28414- bpo-23681: The -b option now affects comparisons of bytes with int. 28415 28416- bpo-23632: Memoryviews now allow tuple indexing (including for 28417 multi-dimensional memoryviews). 28418 28419- bpo-23192: Fixed generator lambdas. Patch by Bruno Cauet. 28420 28421- bpo-23629: Fix the default __sizeof__ implementation for variable-sized 28422 objects. 28423 28424Library 28425------- 28426 28427- bpo-14260: The groupindex attribute of regular expression pattern object 28428 now is non-modifiable mapping. 28429 28430- bpo-23792: Ignore KeyboardInterrupt when the pydoc pager is active. This 28431 mimics the behavior of the standard unix pagers, and prevents pipepager 28432 from shutting down while the pager itself is still running. 28433 28434- bpo-23775: pprint() of OrderedDict now outputs the same representation as 28435 repr(). 28436 28437- bpo-23765: Removed IsBadStringPtr calls in ctypes 28438 28439- bpo-22364: Improved some re error messages using regex for hints. 28440 28441- bpo-23742: ntpath.expandvars() no longer loses unbalanced single quotes. 28442 28443- bpo-21717: The zipfile.ZipFile.open function now supports 'x' (exclusive 28444 creation) mode. 28445 28446- bpo-21802: The reader in BufferedRWPair now is closed even when closing 28447 writer failed in BufferedRWPair.close(). 28448 28449- bpo-23622: Unknown escapes in regular expressions that consist of ``'\'`` 28450 and ASCII letter now raise a deprecation warning and will be forbidden in 28451 Python 3.6. 28452 28453- bpo-23671: string.Template now allows specifying the "self" parameter as a 28454 keyword argument. string.Formatter now allows specifying the "self" and 28455 the "format_string" parameters as keyword arguments. 28456 28457- bpo-23502: The pprint module now supports mapping proxies. 28458 28459- bpo-17530: pprint now wraps long bytes objects and bytearrays. 28460 28461- bpo-22687: Fixed some corner cases in breaking words in tetxtwrap. Got rid 28462 of quadratic complexity in breaking long words. 28463 28464- bpo-4727: The copy module now uses pickle protocol 4 (PEP 3154) and 28465 supports copying of instances of classes whose __new__ method takes 28466 keyword-only arguments. 28467 28468- bpo-23491: Added a zipapp module to support creating executable zip file 28469 archives of Python code. Registered ".pyz" and ".pyzw" extensions on 28470 Windows for these archives (PEP 441). 28471 28472- bpo-23657: Avoid explicit checks for str in zipapp, adding support for 28473 pathlib.Path objects as arguments. 28474 28475- bpo-23688: Added support of arbitrary bytes-like objects and avoided 28476 unnecessary copying of memoryview in gzip.GzipFile.write(). Original patch 28477 by Wolfgang Maier. 28478 28479- bpo-23252: Added support for writing ZIP files to unseekable streams. 28480 28481- bpo-23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. 28482 28483- bpo-23539: If body is None, http.client.HTTPConnection.request now sets 28484 Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors 28485 from some web servers. 28486 28487- bpo-22351: The nntplib.NNTP constructor no longer leaves the connection 28488 and socket open until the garbage collector cleans them up. Patch by 28489 Martin Panter. 28490 28491- bpo-23704: collections.deque() objects now support methods for index(), 28492 insert(), and copy(). This allows deques to be registered as a 28493 MutableSequence and it improves their substitutability for lists. 28494 28495- bpo-23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are 28496 now retried when interrupted by a signal not in the *sigset* parameter, if 28497 the signal handler does not raise an exception. signal.sigtimedwait() 28498 recomputes the timeout with a monotonic clock when it is retried. 28499 28500- bpo-23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and 28501 codecs, that accepted only read-only bytes-like object now accept writable 28502 bytes-like object too. 28503 28504- bpo-23646: If time.sleep() is interrupted by a signal, the sleep is now 28505 retried with the recomputed delay, except if the signal handler raises an 28506 exception (PEP 475). 28507 28508- bpo-23136: _strptime now uniformly handles all days in week 0, including 28509 Dec 30 of previous year. Based on patch by Jim Carroll. 28510 28511- bpo-23700: Iterator of NamedTemporaryFile now keeps a reference to 28512 NamedTemporaryFile instance. Patch by Bohuslav Kabrda. 28513 28514- bpo-22903: The fake test case created by unittest.loader when it fails 28515 importing a test module is now picklable. 28516 28517- bpo-22181: On Linux, os.urandom() now uses the new getrandom() syscall if 28518 available, syscall introduced in the Linux kernel 3.17. It is more 28519 reliable and more secure, because it avoids the need of a file descriptor 28520 and waits until the kernel has enough entropy. 28521 28522- bpo-2211: Updated the implementation of the http.cookies.Morsel class. 28523 Setting attributes key, value and coded_value directly now is deprecated. 28524 update() and setdefault() now transform and check keys. Comparing for 28525 equality now takes into account attributes key, value and coded_value. 28526 copy() now returns a Morsel, not a dict. repr() now contains all 28527 attributes. Optimized checking keys and quoting values. Added new tests. 28528 Original patch by Demian Brecht. 28529 28530- bpo-18983: Allow selection of output units in timeit. Patch by Julian 28531 Gindi. 28532 28533- bpo-23631: Fix traceback.format_list when a traceback has been mutated. 28534 28535- bpo-23568: Add rdivmod support to MagicMock() objects. Patch by Håkan 28536 Lövdahl. 28537 28538- bpo-2052: Add charset parameter to HtmlDiff.make_file(). 28539 28540- bpo-23668: Support os.truncate and os.ftruncate on Windows. 28541 28542- bpo-23138: Fixed parsing cookies with absent keys or values in cookiejar. 28543 Patch by Demian Brecht. 28544 28545- bpo-23051: multiprocessing.Pool methods imap() and imap_unordered() now 28546 handle exceptions raised by an iterator. Patch by Alon Diamant and Davin 28547 Potts. 28548 28549- bpo-23581: Add matmul support to MagicMock. Patch by Håkan Lövdahl. 28550 28551- bpo-23566: enable(), register(), dump_traceback() and 28552 dump_traceback_later() functions of faulthandler now accept file 28553 descriptors. Patch by Wei Wu. 28554 28555- bpo-22928: Disabled HTTP header injections in http.client. Original patch 28556 by Demian Brecht. 28557 28558- bpo-23615: Modules bz2, tarfile and tokenize now can be reloaded with 28559 imp.reload(). Patch by Thomas Kluyver. 28560 28561- bpo-23605: os.walk() now calls os.scandir() instead of os.listdir(). The 28562 usage of os.scandir() reduces the number of calls to os.stat(). Initial 28563 patch written by Ben Hoyt. 28564 28565Build 28566----- 28567 28568- bpo-23585: make patchcheck will ensure the interpreter is built. 28569 28570Tests 28571----- 28572 28573- bpo-23583: Added tests for standard IO streams in IDLE. 28574 28575- bpo-22289: Prevent test_urllib2net failures due to ftp connection timeout. 28576 28577Tools/Demos 28578----------- 28579 28580- bpo-22826: The result of open() in Tools/freeze/bkfile.py is now better 28581 compatible with regular files (in particular it now supports the context 28582 management protocol). 28583 28584 28585What's New in Python 3.5.0 alpha 2? 28586=================================== 28587 28588*Release date: 2015-03-09* 28589 28590Core and Builtins 28591----------------- 28592 28593- bpo-23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError 28594 if a function returns a result and raises an exception. The SystemError is 28595 chained to the previous exception. 28596 28597Library 28598------- 28599 28600- bpo-22524: New os.scandir() function, part of the :pep:`471`: 28601 "os.scandir() function -- a better and faster directory iterator". Patch 28602 written by Ben Hoyt. 28603 28604- bpo-23103: Reduced the memory consumption of IPv4Address and IPv6Address. 28605 28606- bpo-21793: BaseHTTPRequestHandler again logs response code as numeric, not 28607 as stringified enum. Patch by Demian Brecht. 28608 28609- bpo-23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST 28610 flag on certificate stores when it is available. 28611 28612- bpo-23576: Avoid stalling in SSL reads when EOF has been reached in the 28613 SSL layer but the underlying connection hasn't been closed. 28614 28615- bpo-23504: Added an __all__ to the types module. 28616 28617- bpo-23563: Optimized utility functions in urllib.parse. 28618 28619- bpo-7830: Flatten nested functools.partial. 28620 28621- bpo-20204: Added the __module__ attribute to _tkinter classes. 28622 28623- bpo-19980: Improved help() for non-recognized strings. help('') now shows 28624 the help on str. help('help') now shows the help on help(). Original 28625 patch by Mark Lawrence. 28626 28627- bpo-23521: Corrected pure python implementation of timedelta division. 28628 Eliminated OverflowError from ``timedelta * float`` for some floats; 28629 Corrected rounding in timedelta true division. 28630 28631- bpo-21619: Popen objects no longer leave a zombie after exit in the with 28632 statement if the pipe was broken. Patch by Martin Panter. 28633 28634- bpo-22936: Make it possible to show local variables in tracebacks for both 28635 the traceback module and unittest. 28636 28637- bpo-15955: Add an option to limit the output size in bz2.decompress(). 28638 Patch by Nikolaus Rath. 28639 28640- bpo-6639: Module-level turtle functions no longer raise TclError after 28641 closing the window. 28642 28643- bpo-814253: Group references and conditional group references now work in 28644 lookbehind assertions in regular expressions. (See also: bpo-9179) 28645 28646- bpo-23215: Multibyte codecs with custom error handlers that ignores errors 28647 consumed too much memory and raised SystemError or MemoryError. Original 28648 patch by Aleksi Torhamo. 28649 28650- bpo-5700: io.FileIO() called flush() after closing the file. flush() was 28651 not called in close() if closefd=False. 28652 28653- bpo-23374: Fixed pydoc failure with non-ASCII files when stdout encoding 28654 differs from file system encoding (e.g. on Mac OS). 28655 28656- bpo-23481: Remove RC4 from the SSL module's default cipher list. 28657 28658- bpo-21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty 28659 docstrings. 28660 28661- bpo-22885: Fixed arbitrary code execution vulnerability in the dbm.dumb 28662 module. Original patch by Claudiu Popa. 28663 28664- bpo-23239: ssl.match_hostname() now supports matching of IP addresses. 28665 28666- bpo-23146: Fix mishandling of absolute Windows paths with forward slashes 28667 in pathlib. 28668 28669- bpo-23096: Pickle representation of floats with protocol 0 now is the same 28670 for both Python and C implementations. 28671 28672- bpo-19105: pprint now more efficiently uses free space at the right. 28673 28674- bpo-14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by 28675 Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson. 28676 28677- bpo-21717: tarfile.open() now supports 'x' (exclusive creation) mode. 28678 28679- bpo-23344: marshal.dumps() is now 20-25% faster on average. 28680 28681- bpo-20416: marshal.dumps() with protocols 3 and 4 is now 40-50% faster on 28682 average. 28683 28684- bpo-23421: Fixed compression in tarfile CLI. Patch by wdv4758h. 28685 28686- bpo-23367: Fix possible overflows in the unicodedata module. 28687 28688- bpo-23361: Fix possible overflow in Windows subprocess creation code. 28689 28690- logging.handlers.QueueListener now takes a respect_handler_level keyword 28691 argument which, if set to True, will pass messages to handlers taking 28692 handler levels into account. 28693 28694- bpo-19705: turtledemo now has a visual sorting algorithm demo. Original 28695 patch from Jason Yeo. 28696 28697- bpo-23801: Fix issue where cgi.FieldStorage did not always ignore the 28698 entire preamble to a multipart body. 28699 28700Build 28701----- 28702 28703- bpo-23445: pydebug builds now use "gcc -Og" where possible, to make the 28704 resulting executable faster. 28705 28706- bpo-23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a. 28707 28708C API 28709----- 28710 28711- bpo-20204: Deprecation warning is now raised for builtin types without the 28712 __module__ attribute. 28713 28714Windows 28715------- 28716 28717- bpo-23465: Implement :pep:`486` - Make the Python Launcher aware of 28718 virtual environments. Patch by Paul Moore. 28719 28720- bpo-23437: Make user scripts directory versioned on Windows. Patch by Paul 28721 Moore. 28722 28723 28724What's New in Python 3.5.0 alpha 1? 28725=================================== 28726 28727*Release date: 2015-02-08* 28728 28729Core and Builtins 28730----------------- 28731 28732- bpo-23285: PEP 475 - EINTR handling. 28733 28734- bpo-22735: Fix many edge cases (including crashes) involving custom mro() 28735 implementations. 28736 28737- bpo-22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer() 28738 and PyObject_AsWriteBuffer(). 28739 28740- bpo-21295: Revert some changes (issue #16795) to AST line numbers and 28741 column offsets that constituted a regression. 28742 28743- bpo-22986: Allow changing an object's __class__ between a dynamic type and 28744 static type in some cases. 28745 28746- bpo-15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and 28747 PyUnicode_EncodeCodePage() now raise an exception if the object is not a 28748 Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case 28749 on platforms other than Windows. Patch written by Campbell Barton. 28750 28751- bpo-21408: The default __ne__() now returns NotImplemented if __eq__() 28752 returned NotImplemented. Original patch by Martin Panter. 28753 28754- bpo-23321: Fixed a crash in str.decode() when error handler returned 28755 replacement string longer than malformed input data. 28756 28757- bpo-22286: The "backslashreplace" error handlers now works with decoding 28758 and translating. 28759 28760- bpo-23253: Delay-load ShellExecute[AW] in os.startfile for reduced startup 28761 overhead on Windows. 28762 28763- bpo-22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for 28764 atomic memory access if available. Patch written by Vitor de Lima and 28765 Gustavo Temple. 28766 28767- bpo-20284: %-interpolation (aka printf) formatting added for bytes and 28768 bytearray. 28769 28770- bpo-23048: Fix jumping out of an infinite while loop in the pdb. 28771 28772- bpo-20335: bytes constructor now raises TypeError when encoding or errors 28773 is specified with non-string argument. Based on patch by Renaud Blanch. 28774 28775- bpo-22834: If the current working directory ends up being set to a 28776 non-existent directory then import will no longer raise FileNotFoundError. 28777 28778- bpo-22869: Move the interpreter startup & shutdown code to a new dedicated 28779 pylifecycle.c module 28780 28781- bpo-22847: Improve method cache efficiency. 28782 28783- bpo-22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff 28784 bytes on a 32-bit platform. 28785 28786- bpo-22653: Fix an assertion failure in debug mode when doing a reentrant 28787 dict insertion in debug mode. 28788 28789- bpo-22643: Fix integer overflow in Unicode case operations (upper, lower, 28790 title, swapcase, casefold). 28791 28792- bpo-17636: Circular imports involving relative imports are now supported. 28793 28794- bpo-22604: Fix assertion error in debug mode when dividing a complex 28795 number by (nan+0j). 28796 28797- bpo-21052: Do not raise ImportWarning when sys.path_hooks or sys.meta_path 28798 are set to None. 28799 28800- bpo-16518: Use 'bytes-like object required' in error messages that 28801 previously used the far more cryptic "'x' does not support the buffer 28802 protocol. 28803 28804- bpo-22470: Fixed integer overflow issues in "backslashreplace", 28805 "xmlcharrefreplace", and "surrogatepass" error handlers. 28806 28807- bpo-22540: speed up `PyObject_IsInstance` and `PyObject_IsSubclass` in the 28808 common case that the second argument has metaclass `type`. 28809 28810- bpo-18711: Add a new `PyErr_FormatV` function, similar to `PyErr_Format` 28811 but accepting a `va_list` argument. 28812 28813- bpo-22520: Fix overflow checking when generating the repr of a unicode 28814 object. 28815 28816- bpo-22519: Fix overflow checking in PyBytes_Repr. 28817 28818- bpo-22518: Fix integer overflow issues in latin-1 encoding. 28819 28820- bpo-16324: _charset parameter of MIMEText now also accepts 28821 email.charset.Charset instances. Initial patch by Claude Paroz. 28822 28823- bpo-1764286: Fix inspect.getsource() to support decorated functions. Patch 28824 by Claudiu Popa. 28825 28826- bpo-18554: os.__all__ includes posix functions. 28827 28828- bpo-21391: Use os.path.abspath in the shutil module. 28829 28830- bpo-11471: avoid generating a JUMP_FORWARD instruction at the end of an 28831 if-block if there is no else-clause. Original patch by Eugene Toder. 28832 28833- bpo-22215: Now ValueError is raised instead of TypeError when str or bytes 28834 argument contains not permitted null character or byte. 28835 28836- bpo-22258: Fix the internal function set_inheritable() on Illumos. This 28837 platform exposes the function ``ioctl(FIOCLEX)``, but calling it fails 28838 with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable() 28839 now falls back to the slower ``fcntl()`` (``F_GETFD`` and then 28840 ``F_SETFD``). 28841 28842- bpo-21389: Displaying the __qualname__ of the underlying function in the 28843 repr of a bound method. 28844 28845- bpo-22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM 28846 and returns -1 (error) on integer overflow. 28847 28848- bpo-20184: Argument Clinic based signature introspection added for 30 of 28849 the builtin functions. 28850 28851- bpo-22116: C functions and methods (of the 'builtin_function_or_method' 28852 type) can now be weakref'ed. Patch by Wei Wu. 28853 28854- bpo-22077: Improve index error messages for bytearrays, bytes, lists, and 28855 tuples by adding 'or slices'. Added ', not <typename>' for bytearrays. 28856 Original patch by Claudiu Popa. 28857 28858- bpo-20179: Apply Argument Clinic to bytes and bytearray. Patch by Tal 28859 Einat. 28860 28861- bpo-22082: Clear interned strings in slotdefs. 28862 28863- Upgrade Unicode database to Unicode 7.0.0. 28864 28865- bpo-21897: Fix a crash with the f_locals attribute with closure variables 28866 when frame.clear() has been called. 28867 28868- bpo-21205: Add a new ``__qualname__`` attribute to generator, the 28869 qualified name, and use it in the representation of a generator 28870 (``repr(gen)``). The default name of the generator (``__name__`` 28871 attribute) is now get from the function instead of the code. Use 28872 ``gen.gi_code.co_name`` to get the name of the code. 28873 28874- bpo-21669: With the aid of heuristics in SyntaxError.__init__, the parser 28875 now attempts to generate more meaningful (or at least more search engine 28876 friendly) error messages when "exec" and "print" are used as statements. 28877 28878- bpo-21642: In the conditional if-else expression, allow an integer written 28879 with no space between itself and the ``else`` keyword (e.g. ``True if 28880 42else False``) to be valid syntax. 28881 28882- bpo-21523: Fix over-pessimistic computation of the stack effect of some 28883 opcodes in the compiler. This also fixes a quadratic compilation time 28884 issue noticeable when compiling code with a large number of "and" and "or" 28885 operators. 28886 28887- bpo-21418: Fix a crash in the builtin function super() when called without 28888 argument and without current frame (ex: embedded Python). 28889 28890- bpo-21425: Fix flushing of standard streams in the interactive 28891 interpreter. 28892 28893- bpo-21435: In rare cases, when running finalizers on objects in cyclic 28894 trash a bad pointer dereference could occur due to a subtle flaw in 28895 internal iteration logic. 28896 28897- bpo-21377: PyBytes_Concat() now tries to concatenate in-place when the 28898 first argument has a reference count of 1. Patch by Nikolaus Rath. 28899 28900- bpo-20355: -W command line options now have higher priority than the 28901 PYTHONWARNINGS environment variable. Patch by Arfrever. 28902 28903- bpo-21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c. 28904 28905- bpo-20904: Support setting FPU precision on m68k. 28906 28907- bpo-21209: Fix sending tuples to custom generator objects with the yield 28908 from syntax. 28909 28910- bpo-21193: pow(a, b, c) now raises ValueError rather than TypeError when b 28911 is negative. Patch by Josh Rosenberg. 28912 28913- bpo-21176: PEP 465: Add the '@' operator for matrix multiplication. 28914 28915- bpo-21134: Fix segfault when str is called on an uninitialized 28916 UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object. 28917 28918- bpo-19537: Fix PyUnicode_DATA() alignment under m68k. Patch by Andreas 28919 Schwab. 28920 28921- bpo-20929: Add a type cast to avoid shifting a negative number. 28922 28923- bpo-20731: Properly position in source code files even if they are opened 28924 in text mode. Patch by Serhiy Storchaka. 28925 28926- bpo-20637: Key-sharing now also works for instance dictionaries of 28927 subclasses. Patch by Peter Ingebretson. 28928 28929- bpo-8297: Attributes missing from modules now include the module name in 28930 the error text. Original patch by ysj.ray. 28931 28932- bpo-19995: %c, %o, %x, and %X now raise TypeError on non-integer input. 28933 28934- bpo-19655: The ASDL parser - used by the build process to generate code 28935 for managing the Python AST in C - was rewritten. The new parser is self 28936 contained and does not require to carry long the spark.py parser-generator 28937 library; spark.py was removed from the source base. 28938 28939- bpo-12546: Allow ``\x00`` to be used as a fill character when using str, 28940 int, float, and complex __format__ methods. 28941 28942- bpo-20480: Add ipaddress.reverse_pointer. Patch by Leon Weber. 28943 28944- bpo-13598: Modify string.Formatter to support auto-numbering of 28945 replacement fields. It now matches the behavior of str.format() in this 28946 regard. Patches by Phil Elson and Ramchandra Apte. 28947 28948- bpo-8931: Make alternate formatting ('#') for type 'c' raise an exception. 28949 In versions prior to 3.5, '#' with 'c' had no effect. Now specifying it is 28950 an error. Patch by Torsten Landschoff. 28951 28952- bpo-23165: Perform overflow checks before allocating memory in the 28953 _Py_char2wchar function. 28954 28955Library 28956------- 28957 28958- bpo-23399: pyvenv creates relative symlinks where possible. 28959 28960- bpo-20289: cgi.FieldStorage() now supports the context management 28961 protocol. 28962 28963- bpo-13128: Print response headers for CONNECT requests when debuglevel > 28964 0. Patch by Demian Brecht. 28965 28966- bpo-15381: Optimized io.BytesIO to make less allocations and copyings. 28967 28968- bpo-22818: Splitting on a pattern that could match an empty string now 28969 raises a warning. Patterns that can only match empty strings are now 28970 rejected. 28971 28972- bpo-23099: Closing io.BytesIO with exported buffer is rejected now to 28973 prevent corrupting exported buffer. 28974 28975- bpo-23326: Removed __ne__ implementations. Since fixing default __ne__ 28976 implementation in issue #21408 they are redundant. 28977 28978- bpo-23363: Fix possible overflow in itertools.permutations. 28979 28980- bpo-23364: Fix possible overflow in itertools.product. 28981 28982- bpo-23366: Fixed possible integer overflow in itertools.combinations. 28983 28984- bpo-23369: Fixed possible integer overflow in 28985 _json.encode_basestring_ascii. 28986 28987- bpo-23353: Fix the exception handling of generators in 28988 PyEval_EvalFrameEx(). At entry, save or swap the exception state even if 28989 PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception 28990 state is now always restored or swapped, not only if why is WHY_YIELD or 28991 WHY_RETURN. Patch co-written with Antoine Pitrou. 28992 28993- bpo-14099: Restored support of writing ZIP files to tellable but 28994 non-seekable streams. 28995 28996- bpo-14099: Writing to ZipFile and reading multiple ZipExtFiles is 28997 threadsafe now. 28998 28999- bpo-19361: JSON decoder now raises JSONDecodeError instead of ValueError. 29000 29001- bpo-18518: timeit now rejects statements which can't be compiled outside a 29002 function or a loop (e.g. "return" or "break"). 29003 29004- bpo-23094: Fixed readline with frames in Python implementation of pickle. 29005 29006- bpo-23268: Fixed bugs in the comparison of ipaddress classes. 29007 29008- bpo-21408: Removed incorrect implementations of __ne__() which didn't 29009 returned NotImplemented if __eq__() returned NotImplemented. The default 29010 __ne__() now works correctly. 29011 29012- bpo-19996: :class:`email.feedparser.FeedParser` now handles (malformed) 29013 headers with no key rather than assuming the body has started. 29014 29015- bpo-20188: Support Application-Layer Protocol Negotiation (ALPN) in the 29016 ssl module. 29017 29018- bpo-23133: Pickling of ipaddress objects now produces more compact and 29019 portable representation. 29020 29021- bpo-23248: Update ssl error codes from latest OpenSSL git master. 29022 29023- bpo-23266: Much faster implementation of ipaddress.collapse_addresses() 29024 when there are many non-consecutive addresses. 29025 29026- bpo-23098: 64-bit dev_t is now supported in the os module. 29027 29028- bpo-21817: When an exception is raised in a task submitted to a 29029 ProcessPoolExecutor, the remote traceback is now displayed in the parent 29030 process. Patch by Claudiu Popa. 29031 29032- bpo-15955: Add an option to limit output size when decompressing LZMA 29033 data. Patch by Nikolaus Rath and Martin Panter. 29034 29035- bpo-23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" 29036 as they are written in the standard. 29037 29038- bpo-23063: In the distutils' check command, fix parsing of reST with code 29039 or code-block directives. 29040 29041- bpo-23209: selectors.BaseSelector.get_key() now raises a RuntimeError if 29042 the selector is closed. And selectors.BaseSelector.close() now clears its 29043 internal reference to the selector mapping to break a reference cycle. 29044 Initial patch written by Martin Richard. (See also: bpo-23225) 29045 29046- bpo-17911: Provide a way to seed the linecache for a PEP-302 module 29047 without actually loading the code. 29048 29049- bpo-17911: Provide a new object API for traceback, including the ability 29050 to not lookup lines at all until the traceback is actually rendered, 29051 without any trace of the original objects being kept alive. 29052 29053- bpo-19777: Provide a home() classmethod on Path objects. Contributed by 29054 Victor Salgado and Mayank Tripathi. 29055 29056- bpo-23206: Make ``json.dumps(..., ensure_ascii=False)`` as fast as the 29057 default case of ``ensure_ascii=True``. Patch by Naoki Inada. 29058 29059- bpo-23185: Add math.inf and math.nan constants. 29060 29061- bpo-23186: Add ssl.SSLObject.shared_ciphers() and 29062 ssl.SSLSocket.shared_ciphers() to fetch the client's list ciphers sent at 29063 handshake. 29064 29065- bpo-23143: Remove compatibility with OpenSSLs older than 0.9.8. 29066 29067- bpo-23132: Improve performance and introspection support of comparison 29068 methods created by functool.total_ordering. 29069 29070- bpo-19776: Add an expanduser() method on Path objects. 29071 29072- bpo-23112: Fix SimpleHTTPServer to correctly carry the query string and 29073 fragment when it redirects to add a trailing slash. 29074 29075- bpo-21793: Added http.HTTPStatus enums (i.e. HTTPStatus.OK, 29076 HTTPStatus.NOT_FOUND). Patch by Demian Brecht. 29077 29078- bpo-23093: In the io, module allow more operations to work on detached 29079 streams. 29080 29081- bpo-23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol 29082 version. 29083 29084- bpo-22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(), 29085 instead of reading /dev/urandom, to get pseudo-random bytes. 29086 29087- bpo-19104: pprint now produces evaluable output for wrapped strings. 29088 29089- bpo-23071: Added missing names to codecs.__all__. Patch by Martin Panter. 29090 29091- bpo-22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX 29092 opcode if possible. 29093 29094- bpo-15513: Added a __sizeof__ implementation for pickle classes. 29095 29096- bpo-19858: pickletools.optimize() now aware of the MEMOIZE opcode, can 29097 produce more compact result and no longer produces invalid output if input 29098 data contains MEMOIZE opcodes together with PUT or BINPUT opcodes. 29099 29100- bpo-22095: Fixed HTTPConnection.set_tunnel with default port. The port 29101 value in the host header was set to "None". Patch by Demian Brecht. 29102 29103- bpo-23016: A warning no longer produces an AttributeError when the program 29104 is run with pythonw.exe. 29105 29106- bpo-21775: shutil.copytree(): fix crash when copying to VFAT. An exception 29107 handler assumed that OSError objects always have a 'winerror' attribute. 29108 That is not the case, so the exception handler itself raised 29109 AttributeError when run on Linux (and, presumably, any other non-Windows 29110 OS). Patch by Greg Ward. 29111 29112- bpo-1218234: Fix inspect.getsource() to load updated source of reloaded 29113 module. Initial patch by Berker Peksag. 29114 29115- bpo-21740: Support wrapped callables in doctest. Patch by Claudiu Popa. 29116 29117- bpo-23009: Make sure selectors.EpollSelector.select() works when no FD is 29118 registered. 29119 29120- bpo-22959: In the constructor of http.client.HTTPSConnection, prefer the 29121 context's check_hostname attribute over the *check_hostname* parameter. 29122 29123- bpo-22696: Add function :func:`sys.is_finalizing` to know about 29124 interpreter shutdown. 29125 29126- bpo-16043: Add a default limit for the amount of data 29127 xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753. 29128 29129- bpo-14099: ZipFile.open() no longer reopen the underlying file. Objects 29130 returned by ZipFile.open() can now operate independently of the ZipFile 29131 even if the ZipFile was created by passing in a file-like object as the 29132 first argument to the constructor. 29133 29134- bpo-22966: Fix __pycache__ pyc file name clobber when pyc_compile is asked 29135 to compile a source file containing multiple dots in the source file name. 29136 29137- bpo-21971: Update turtledemo doc and add module to the index. 29138 29139- bpo-21032: Fixed socket leak if HTTPConnection.getresponse() fails. 29140 Original patch by Martin Panter. 29141 29142- bpo-22407: Deprecated the use of re.LOCALE flag with str patterns or 29143 re.ASCII. It was newer worked. 29144 29145- bpo-22902: The "ip" command is now used on Linux to determine MAC address 29146 in uuid.getnode(). Pach by Bruno Cauet. 29147 29148- bpo-22960: Add a context argument to xmlrpclib.ServerProxy constructor. 29149 29150- bpo-22389: Add contextlib.redirect_stderr(). 29151 29152- bpo-21356: Make ssl.RAND_egd() optional to support LibreSSL. The 29153 availability of the function is checked during the compilation. Patch 29154 written by Bernard Spil. 29155 29156- bpo-22915: SAX parser now supports files opened with file descriptor or 29157 bytes path. 29158 29159- bpo-22609: Constructors and update methods of mapping classes in the 29160 collections module now accept the self keyword argument. 29161 29162- bpo-22940: Add readline.append_history_file. 29163 29164- bpo-19676: Added the "namereplace" error handler. 29165 29166- bpo-22788: Add *context* parameter to logging.handlers.HTTPHandler. 29167 29168- bpo-22921: Allow SSLContext to take the *hostname* parameter even if 29169 OpenSSL doesn't support SNI. 29170 29171- bpo-22894: TestCase.subTest() would cause the test suite to be stopped 29172 when in failfast mode, even in the absence of failures. 29173 29174- bpo-22796: HTTP cookie parsing is now stricter, in order to protect 29175 against potential injection attacks. 29176 29177- bpo-22370: Windows detection in pathlib is now more robust. 29178 29179- bpo-22841: Reject coroutines in asyncio add_signal_handler(). Patch by 29180 Ludovic.Gasc. 29181 29182- bpo-19494: Added urllib.request.HTTPBasicPriorAuthHandler. Patch by Matej 29183 Cepl. 29184 29185- bpo-22578: Added attributes to the re.error class. 29186 29187- bpo-22849: Fix possible double free in the io.TextIOWrapper constructor. 29188 29189- bpo-12728: Different Unicode characters having the same uppercase but 29190 different lowercase are now matched in case-insensitive regular 29191 expressions. 29192 29193- bpo-22821: Fixed fcntl() with integer argument on 64-bit big-endian 29194 platforms. 29195 29196- bpo-21650: Add an `--sort-keys` option to json.tool CLI. 29197 29198- bpo-22824: Updated reprlib output format for sets to use set literals. 29199 Patch contributed by Berker Peksag. 29200 29201- bpo-22824: Updated reprlib output format for arrays to display empty 29202 arrays without an unnecessary empty list. Suggested by Serhiy Storchaka. 29203 29204- bpo-22406: Fixed the uu_codec codec incorrectly ported to 3.x. Based on 29205 patch by Martin Panter. 29206 29207- bpo-17293: uuid.getnode() now determines MAC address on AIX using netstat. 29208 Based on patch by Aivars Kalvāns. 29209 29210- bpo-22769: Fixed ttk.Treeview.tag_has() when called without arguments. 29211 29212- bpo-22417: Verify certificates by default in httplib (PEP 476). 29213 29214- bpo-22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2 29215 and above. Patch by Tim Graham. 29216 29217- bpo-22776: Brought excluded code into the scope of a try block in 29218 SysLogHandler.emit(). 29219 29220- bpo-22665: Add missing get_terminal_size and SameFileError to 29221 shutil.__all__. 29222 29223- bpo-6623: Remove deprecated Netrc class in the ftplib module. Patch by 29224 Matt Chaput. 29225 29226- bpo-17381: Fixed handling of case-insensitive ranges in regular 29227 expressions. 29228 29229- bpo-22410: Module level functions in the re module now cache compiled 29230 locale-dependent regular expressions taking into account the locale. 29231 29232- bpo-22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.) now 29233 return False when the underlying stat call raises NotADirectoryError. 29234 29235- bpo-8876: distutils now falls back to copying files when hard linking 29236 doesn't work. This allows use with special filesystems such as VirtualBox 29237 shared folders. 29238 29239- bpo-22217: Implemented reprs of classes in the zipfile module. 29240 29241- bpo-22457: Honour load_tests in the start_dir of discovery. 29242 29243- bpo-18216: gettext now raises an error when a .mo file has an unsupported 29244 major version number. Patch by Aaron Hill. 29245 29246- bpo-13918: Provide a locale.delocalize() function which can remove 29247 locale-specific number formatting from a string representing a number, 29248 without then converting it to a specific type. Patch by Cédric Krier. 29249 29250- bpo-22676: Make the pickling of global objects which don't have a 29251 __module__ attribute less slow. 29252 29253- bpo-18853: Fixed ResourceWarning in shlex.__nain__. 29254 29255- bpo-9351: Defaults set with set_defaults on an argparse subparser are no 29256 longer ignored when also set on the parent parser. 29257 29258- bpo-7559: unittest test loading ImportErrors are reported as import errors 29259 with their import exception rather than as attribute errors after the 29260 import has already failed. 29261 29262- bpo-19746: Make it possible to examine the errors from unittest discovery 29263 without executing the test suite. The new `errors` attribute on TestLoader 29264 exposes these non-fatal errors encountered during discovery. 29265 29266- bpo-21991: Make email.headerregistry's header 'params' attributes be 29267 read-only (MappingProxyType). Previously the dictionary was modifiable 29268 but a new one was created on each access of the attribute. 29269 29270- bpo-22638: SSLv3 is now disabled throughout the standard library. It can 29271 still be enabled by instantiating a SSLContext manually. 29272 29273- bpo-22641: In asyncio, the default SSL context for client connections is 29274 now created using ssl.create_default_context(), for stronger security. 29275 29276- bpo-17401: Include closefd in io.FileIO repr. 29277 29278- bpo-21338: Add silent mode for compileall. quiet parameters of 29279 compile_{dir, file, path} functions now have a multilevel value. Also, -q 29280 option of the CLI now have a multilevel value. Patch by Thomas Kluyver. 29281 29282- bpo-20152: Convert the array and cmath modules to Argument Clinic. 29283 29284- bpo-18643: Add socket.socketpair() on Windows. 29285 29286- bpo-22435: Fix a file descriptor leak when socketserver bind fails. 29287 29288- bpo-13096: Fixed segfault in CTypes POINTER handling of large values. 29289 29290- bpo-11694: Raise ConversionError in xdrlib as documented. Patch by Filip 29291 Gruszczyński and Claudiu Popa. 29292 29293- bpo-19380: Optimized parsing of regular expressions. 29294 29295- bpo-1519638: Now unmatched groups are replaced with empty strings in 29296 re.sub() and re.subn(). 29297 29298- bpo-18615: sndhdr.what/whathdr now return a namedtuple. 29299 29300- bpo-22462: Fix pyexpat's creation of a dummy frame to make it appear in 29301 exception tracebacks. 29302 29303- bpo-21965: Add support for in-memory SSL to the ssl module. Patch by 29304 Geert Jansen. 29305 29306- bpo-21173: Fix len() on a WeakKeyDictionary when .clear() was called with 29307 an iterator alive. 29308 29309- bpo-11866: Eliminated race condition in the computation of names for new 29310 threads. 29311 29312- bpo-21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is 29313 mutated while iterating. Patch by Olivier Grisel. 29314 29315- bpo-11271: concurrent.futures.Executor.map() now takes a *chunksize* 29316 argument to allow batching of tasks in child processes and improve 29317 performance of ProcessPoolExecutor. Patch by Dan O'Reilly. 29318 29319- bpo-21883: os.path.join() and os.path.relpath() now raise a TypeError with 29320 more helpful error message for unsupported or mismatched types of 29321 arguments. 29322 29323- bpo-22219: The zipfile module CLI now adds entries for directories 29324 (including empty directories) in ZIP file. 29325 29326- bpo-22449: In the ssl.SSLContext.load_default_certs, consult the 29327 environmental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows. 29328 29329- bpo-22508: The email.__version__ variable has been removed; the email code 29330 is no longer shipped separately from the stdlib, and __version__ hasn't 29331 been updated in several releases. 29332 29333- bpo-20076: Added non derived UTF-8 aliases to locale aliases table. 29334 29335- bpo-20079: Added locales supported in glibc 2.18 to locale alias table. 29336 29337- bpo-20218: Added convenience methods read_text/write_text and read_bytes/ 29338 write_bytes to pathlib.Path objects. 29339 29340- bpo-22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor 29341 os.posix_fallocate() because their prototypes in system headers are wrong. 29342 29343- bpo-22517: When an io.BufferedRWPair object is deallocated, clear its 29344 weakrefs. 29345 29346- bpo-22437: Number of capturing groups in regular expression is no longer 29347 limited by 100. 29348 29349- bpo-17442: InteractiveInterpreter now displays the full chained traceback 29350 in its showtraceback method, to match the built in interactive 29351 interpreter. 29352 29353- bpo-23392: Added tests for marshal C API that works with FILE*. 29354 29355- bpo-10510: distutils register and upload methods now use HTML standards 29356 compliant CRLF line endings. 29357 29358- bpo-9850: Fixed macpath.join() for empty first component. Patch by Oleg 29359 Oshmyan. 29360 29361- bpo-5309: distutils' build and build_ext commands now accept a ``-j`` 29362 option to enable parallel building of extension modules. 29363 29364- bpo-22448: Improve canceled timer handles cleanup to prevent unbound 29365 memory usage. Patch by Joshua Moore-Oliva. 29366 29367- bpo-22427: TemporaryDirectory no longer attempts to clean up twice when 29368 used in the with statement in generator. 29369 29370- bpo-22362: Forbidden ambiguous octal escapes out of range 0-0o377 in 29371 regular expressions. 29372 29373- bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS 29374 directory attributes. 29375 29376- bpo-21866: ZipFile.close() no longer writes ZIP64 central directory 29377 records if allowZip64 is false. 29378 29379- bpo-22278: Fix urljoin problem with relative urls, a regression observed 29380 after changes to issue22118 were submitted. 29381 29382- bpo-22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re 29383 module. Removed trailing spaces in debugging output. 29384 29385- bpo-22423: Unhandled exception in thread no longer causes unhandled 29386 AttributeError when sys.stderr is None. 29387 29388- bpo-21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line 29389 buffering, rather than block buffering. Patch by Akira Li. 29390 29391- bpo-21091: Fix API bug: email.message.EmailMessage.is_attachment is now a 29392 method. 29393 29394- bpo-21079: Fix email.message.EmailMessage.is_attachment to return the 29395 correct result when the header has parameters as well as a value. 29396 29397- bpo-22247: Add NNTPError to nntplib.__all__. 29398 29399- bpo-22366: urllib.request.urlopen will accept a context object 29400 (SSLContext) as an argument which will then be used for HTTPS connection. 29401 Patch by Alex Gaynor. 29402 29403- bpo-4180: The warnings registries are now reset when the filters are 29404 modified. 29405 29406- bpo-22419: Limit the length of incoming HTTP request in wsgiref server to 29407 65536 bytes and send a 414 error code for higher lengths. Patch 29408 contributed by Devin Cook. 29409 29410- Lax cookie parsing in http.cookies could be a security issue when combined 29411 with non-standard cookie handling in some web browsers. Reported by 29412 Sergey Bobrov. 29413 29414- bpo-20537: logging methods now accept an exception instance as well as a 29415 Boolean value or exception tuple. Thanks to Yury Selivanov for the patch. 29416 29417- bpo-22384: An exception in Tkinter callback no longer crashes the program 29418 when it is run with pythonw.exe. 29419 29420- bpo-22168: Prevent turtle AttributeError with non-default Canvas on OS X. 29421 29422- bpo-21147: sqlite3 now raises an exception if the request contains a null 29423 character instead of truncating it. Based on patch by Victor Stinner. 29424 29425- bpo-13968: The glob module now supports recursive search in subdirectories 29426 using the ``**`` pattern. 29427 29428- bpo-21951: Fixed a crash in Tkinter on AIX when called Tcl command with 29429 empty string or tuple argument. 29430 29431- bpo-21951: Tkinter now most likely raises MemoryError instead of crash if 29432 the memory allocation fails. 29433 29434- bpo-22338: Fix a crash in the json module on memory allocation failure. 29435 29436- bpo-12410: imaplib.IMAP4 now supports the context management protocol. 29437 Original patch by Tarek Ziadé. 29438 29439- bpo-21270: We now override tuple methods in mock.call objects so that they 29440 can be used as normal call attributes. 29441 29442- bpo-16662: load_tests() is now unconditionally run when it is present in a 29443 package's __init__.py. TestLoader.loadTestsFromModule() still accepts 29444 use_load_tests, but it is deprecated and ignored. A new keyword-only 29445 attribute `pattern` is added and documented. Patch given by Robert 29446 Collins, tweaked by Barry Warsaw. 29447 29448- bpo-22226: First letter no longer is stripped from the "status" key in the 29449 result of Treeview.heading(). 29450 29451- bpo-19524: Fixed resource leak in the HTTP connection when an invalid 29452 response is received. Patch by Martin Panter. 29453 29454- bpo-20421: Add a .version() method to SSL sockets exposing the actual 29455 protocol version in use. 29456 29457- bpo-19546: configparser exceptions no longer expose implementation 29458 details. Chained KeyErrors are removed, which leads to cleaner tracebacks. 29459 Patch by Claudiu Popa. 29460 29461- bpo-22051: turtledemo no longer reloads examples to re-run them. 29462 Initialization of variables and gui setup should be done in main(), which 29463 is called each time a demo is run, but not on import. 29464 29465- bpo-21933: Turtledemo users can change the code font size with a menu 29466 selection or control(command) '-' or '+' or control-mousewheel. Original 29467 patch by Lita Cho. 29468 29469- bpo-21597: The separator between the turtledemo text pane and the drawing 29470 canvas can now be grabbed and dragged with a mouse. The code text pane 29471 can be widened to easily view or copy the full width of the text. The 29472 canvas can be widened on small screens. Original patches by Jan Kanis and 29473 Lita Cho. 29474 29475- bpo-18132: Turtledemo buttons no longer disappear when the window is 29476 shrunk. Original patches by Jan Kanis and Lita Cho. 29477 29478- bpo-22043: time.monotonic() is now always available. 29479 ``threading.Lock.acquire()``, ``threading.RLock.acquire()`` and socket 29480 operations now use a monotonic clock, instead of the system clock, when a 29481 timeout is used. 29482 29483- bpo-21527: Add a default number of workers to ThreadPoolExecutor equal to 29484 5 times the number of CPUs. Patch by Claudiu Popa. 29485 29486- bpo-22216: smtplib now resets its state more completely after a quit. The 29487 most obvious consequence of the previous behavior was a STARTTLS failure 29488 during a connect/starttls/quit/connect/starttls sequence. 29489 29490- bpo-22098: ctypes' BigEndianStructure and LittleEndianStructure now define 29491 an empty __slots__ so that subclasses don't always get an instance dict. 29492 Patch by Claudiu Popa. 29493 29494- bpo-22185: Fix an occasional RuntimeError in threading.Condition.wait() 29495 caused by mutation of the waiters queue without holding the lock. Patch 29496 by Doug Zongker. 29497 29498- bpo-22287: On UNIX, _PyTime_gettimeofday() now uses 29499 clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now 29500 depends on the librt library on Solaris and on Linux (only with glibc 29501 older than 2.17). 29502 29503- bpo-22182: Use e.args to unpack exceptions correctly in 29504 distutils.file_util.move_file. Patch by Claudiu Popa. 29505 29506- The webbrowser module now uses subprocess's start_new_session=True rather 29507 than a potentially risky preexec_fn=os.setsid call. 29508 29509- bpo-22042: signal.set_wakeup_fd(fd) now raises an exception if the file 29510 descriptor is in blocking mode. 29511 29512- bpo-16808: inspect.stack() now returns a named tuple instead of a tuple. 29513 Patch by Daniel Shahaf. 29514 29515- bpo-22236: Fixed Tkinter images copying operations in NoDefaultRoot mode. 29516 29517- bpo-2527: Add a *globals* argument to timeit functions, in order to 29518 override the globals namespace in which the timed code is executed. Patch 29519 by Ben Roberts. 29520 29521- bpo-22118: Switch urllib.parse to use RFC 3986 semantics for the 29522 resolution of relative URLs, rather than RFCs 1808 and 2396. Patch by 29523 Demian Brecht. 29524 29525- bpo-21549: Added the "members" parameter to TarFile.list(). 29526 29527- bpo-19628: Allow compileall recursion depth to be specified with a -r 29528 option. 29529 29530- bpo-15696: Add a __sizeof__ implementation for mmap objects on Windows. 29531 29532- bpo-22068: Avoided reference loops with Variables and Fonts in Tkinter. 29533 29534- bpo-22165: SimpleHTTPRequestHandler now supports undecodable file names. 29535 29536- bpo-15381: Optimized line reading in io.BytesIO. 29537 29538- bpo-8797: Raise HTTPError on failed Basic Authentication immediately. 29539 Initial patch by Sam Bull. 29540 29541- bpo-20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() in 29542 the mailbox module. 29543 29544- bpo-21448: Changed FeedParser feed() to avoid O(N\ :sup:`2`) behavior when 29545 parsing long line. Original patch by Raymond Hettinger. 29546 29547- bpo-22184: The functools LRU Cache decorator factory now gives an earlier 29548 and clearer error message when the user forgets the required parameters. 29549 29550- bpo-17923: glob() patterns ending with a slash no longer match non-dirs on 29551 AIX. Based on patch by Delhallt. 29552 29553- bpo-21725: Added support for RFC 6531 (SMTPUTF8) in smtpd. 29554 29555- bpo-22176: Update the ctypes module's libffi to v3.1. This release adds 29556 support for the Linux AArch64 and POWERPC ELF ABIv2 little endian 29557 architectures. 29558 29559- bpo-5411: Added support for the "xztar" format in the shutil module. 29560 29561- bpo-21121: Don't force 3rd party C extensions to be built with 29562 -Werror=declaration-after-statement. 29563 29564- bpo-21975: Fixed crash when using uninitialized sqlite3.Row (in particular 29565 when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in 29566 the __new__() method. 29567 29568- bpo-20170: Convert posixmodule to use Argument Clinic. 29569 29570- bpo-21539: Add an *exists_ok* argument to `Pathlib.mkdir()` to mimic 29571 `mkdir -p` and `os.makedirs()` functionality. When true, ignore 29572 FileExistsErrors. Patch by Berker Peksag. 29573 29574- bpo-22127: Bypass IDNA for pure-ASCII host names in the socket module (in 29575 particular for numeric IPs). 29576 29577- bpo-21047: set the default value for the *convert_charrefs* argument of 29578 HTMLParser to True. Patch by Berker Peksag. 29579 29580- Add an __all__ to html.entities. 29581 29582- bpo-15114: the strict mode and argument of HTMLParser, HTMLParser.error, 29583 and the HTMLParserError exception have been removed. 29584 29585- bpo-22085: Dropped support of Tk 8.3 in Tkinter. 29586 29587- bpo-21580: Now Tkinter correctly handles bytes arguments passed to Tk. In 29588 particular this allows initializing images from binary data. 29589 29590- bpo-22003: When initialized from a bytes object, io.BytesIO() now defers 29591 making a copy until it is mutated, improving performance and memory use on 29592 some use cases. Patch by David Wilson. 29593 29594- bpo-22018: On Windows, signal.set_wakeup_fd() now also supports sockets. A 29595 side effect is that Python depends to the WinSock library. 29596 29597- bpo-22054: Add os.get_blocking() and os.set_blocking() functions to get 29598 and set the blocking mode of a file descriptor (False if the O_NONBLOCK 29599 flag is set, True otherwise). These functions are not available on 29600 Windows. 29601 29602- bpo-17172: Make turtledemo start as active on OS X even when run with 29603 subprocess. Patch by Lita Cho. 29604 29605- bpo-21704: Fix build error for _multiprocessing when semaphores are not 29606 available. Patch by Arfrever Frehtes Taifersar Arahesis. 29607 29608- bpo-20173: Convert sha1, sha256, sha512 and md5 to ArgumentClinic. Patch 29609 by Vajrasky Kok. 29610 29611- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError 29612 on closed socket. repr(socket.socket) already works fine. 29613 29614- bpo-22033: Reprs of most Python implemented classes now contain actual 29615 class name instead of hardcoded one. 29616 29617- bpo-21947: The dis module can now disassemble generator-iterator objects 29618 based on their gi_code attribute. Patch by Clement Rouault. 29619 29620- bpo-16133: The asynchat.async_chat.handle_read() method now ignores 29621 BlockingIOError exceptions. 29622 29623- bpo-22044: Fixed premature DECREF in call_tzinfo_method. Patch by Tom 29624 Flanagan. 29625 29626- bpo-19884: readline: Disable the meta modifier key if stdout is not a 29627 terminal to not write the ANSI sequence ``"\033[1034h"`` into stdout. This 29628 sequence is used on some terminal (ex: TERM=xterm-256color") to enable 29629 support of 8 bit characters. 29630 29631- bpo-4350: Removed a number of out-of-dated and non-working for a long time 29632 Tkinter methods. 29633 29634- bpo-6167: Scrollbar.activate() now returns the name of active element if 29635 the argument is not specified. Scrollbar.set() now always accepts only 2 29636 arguments. 29637 29638- bpo-15275: Clean up and speed up the ntpath module. 29639 29640- bpo-21888: plistlib's load() and loads() now work if the fmt parameter is 29641 specified. 29642 29643- bpo-22032: __qualname__ instead of __name__ is now always used to format 29644 fully qualified class names of Python implemented classes. 29645 29646- bpo-22031: Reprs now always use hexadecimal format with the "0x" prefix 29647 when contain an id in form " at 0x...". 29648 29649- bpo-22018: signal.set_wakeup_fd() now raises an OSError instead of a 29650 ValueError on ``fstat()`` failure. 29651 29652- bpo-21044: tarfile.open() now handles fileobj with an integer 'name' 29653 attribute. Based on patch by Antoine Pietri. 29654 29655- bpo-21966: Respect -q command-line option when code module is ran. 29656 29657- bpo-19076: Don't pass the redundant 'file' argument to self.error(). 29658 29659- bpo-16382: Improve exception message of warnings.warn() for bad category. 29660 Initial patch by Phil Elson. 29661 29662- bpo-21932: os.read() now uses a :c:func:`Py_ssize_t` type instead of 29663 :c:type:`int` for the size to support reading more than 2 GB at once. On 29664 Windows, the size is truncated to INT_MAX. As any call to os.read(), the 29665 OS may read less bytes than the number of requested bytes. 29666 29667- bpo-21942: Fixed source file viewing in pydoc's server mode on Windows. 29668 29669- bpo-11259: asynchat.async_chat().set_terminator() now raises a ValueError 29670 if the number of received bytes is negative. 29671 29672- bpo-12523: asynchat.async_chat.push() now raises a TypeError if it doesn't 29673 get a bytes string 29674 29675- bpo-21707: Add missing kwonlyargcount argument to 29676 ModuleFinder.replace_paths_in_code(). 29677 29678- bpo-20639: calling Path.with_suffix('') allows removing the suffix again. 29679 Patch by July Tikhonov. 29680 29681- bpo-21714: Disallow the construction of invalid paths using 29682 Path.with_name(). Original patch by Antony Lee. 29683 29684- bpo-15014: Added 'auth' method to smtplib to make implementing auth 29685 mechanisms simpler, and used it internally in the login method. 29686 29687- bpo-21151: Fixed a segfault in the winreg module when ``None`` is passed 29688 as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman. 29689 29690- bpo-21090: io.FileIO.readall() does not ignore I/O errors anymore. Before, 29691 it ignored I/O errors if at least the first C call read() succeed. 29692 29693- bpo-5800: headers parameter of wsgiref.headers.Headers is now optional. 29694 Initial patch by Pablo Torres Navarrete and SilentGhost. 29695 29696- bpo-21781: ssl.RAND_add() now supports strings longer than 2 GB. 29697 29698- bpo-21679: Prevent extraneous fstat() calls during open(). Patch by 29699 Bohuslav Kabrda. 29700 29701- bpo-21863: cProfile now displays the module name of C extension functions, 29702 in addition to their own name. 29703 29704- bpo-11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper 29705 object is destroyed. The destructor now closes the file if needed. The 29706 close() method can now be called twice: the second call does nothing. 29707 29708- bpo-21858: Better handling of Python exceptions in the sqlite3 module. 29709 29710- bpo-21476: Make sure the email.parser.BytesParser TextIOWrapper is 29711 discarded after parsing, so the input file isn't unexpectedly closed. 29712 29713- bpo-20295: imghdr now recognizes OpenEXR format images. 29714 29715- bpo-21729: Used the "with" statement in the dbm.dumb module to ensure 29716 files closing. Patch by Claudiu Popa. 29717 29718- bpo-21491: socketserver: Fix a race condition in child processes reaping. 29719 29720- bpo-21719: Added the ``st_file_attributes`` field to os.stat_result on 29721 Windows. 29722 29723- bpo-21832: Require named tuple inputs to be exact strings. 29724 29725- bpo-21722: The distutils "upload" command now exits with a non-zero return 29726 code when uploading fails. Patch by Martin Dengler. 29727 29728- bpo-21723: asyncio.Queue: support any type of number (ex: float) for the 29729 maximum size. Patch written by Vajrasky Kok. 29730 29731- bpo-21711: support for "site-python" directories has now been removed from 29732 the site module (it was deprecated in 3.4). 29733 29734- bpo-17552: new socket.sendfile() method allowing a file to be sent over a 29735 socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo 29736 Rodola'. 29737 29738- bpo-18039: dbm.dump.open() now always creates a new database when the flag 29739 has the value 'n'. Patch by Claudiu Popa. 29740 29741- bpo-21326: Add a new is_closed() method to asyncio.BaseEventLoop. 29742 run_forever() and run_until_complete() methods of asyncio.BaseEventLoop 29743 now raise an exception if the event loop was closed. 29744 29745- bpo-21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths 29746 before checking for a CGI script at that path. 29747 29748- bpo-21310: Fixed possible resource leak in failed open(). 29749 29750- bpo-21256: Printout of keyword args should be in deterministic order in a 29751 mock function call. This will help to write better doctests. 29752 29753- bpo-21677: Fixed chaining nonnormalized exceptions in io close() methods. 29754 29755- bpo-11709: Fix the pydoc.help function to not fail when sys.stdin is not a 29756 valid file. 29757 29758- bpo-21515: tempfile.TemporaryFile now uses os.O_TMPFILE flag is available. 29759 29760- bpo-13223: Fix pydoc.writedoc so that the HTML documentation for methods 29761 that use 'self' in the example code is generated correctly. 29762 29763- bpo-21463: In urllib.request, fix pruning of the FTP cache. 29764 29765- bpo-21618: The subprocess module could fail to close open fds that were 29766 inherited by the calling process and already higher than POSIX resource 29767 limits would otherwise allow. On systems with a functioning /proc/self/fd 29768 or /dev/fd interface the max is now ignored and all fds are closed. 29769 29770- bpo-20383: Introduce importlib.util.module_from_spec() as the preferred 29771 way to create a new module. 29772 29773- bpo-21552: Fixed possible integer overflow of too long string lengths in 29774 the tkinter module on 64-bit platforms. 29775 29776- bpo-14315: The zipfile module now ignores extra fields in the central 29777 directory that are too short to be parsed instead of letting a 29778 struct.unpack error bubble up as this "bad data" appears in many real 29779 world zip files in the wild and is ignored by other zip tools. 29780 29781- bpo-13742: Added "key" and "reverse" parameters to heapq.merge(). (First 29782 draft of patch contributed by Simon Sapin.) 29783 29784- bpo-21402: tkinter.ttk now works when default root window is not set. 29785 29786- bpo-3015: _tkinter.create() now creates tkapp object with wantobject=1 by 29787 default. 29788 29789- bpo-10203: sqlite3.Row now truly supports sequence protocol. In 29790 particular it supports reverse() and negative indices. Original patch by 29791 Claudiu Popa. 29792 29793- bpo-18807: If copying (no symlinks) specified for a venv, then the python 29794 interpreter aliases (python, python3) are now created by copying rather 29795 than symlinking. 29796 29797- bpo-20197: Added support for the WebP image type in the imghdr module. 29798 Patch by Fabrice Aneche and Claudiu Popa. 29799 29800- bpo-21513: Speedup some properties of IP addresses (IPv4Address, 29801 IPv6Address) such as .is_private or .is_multicast. 29802 29803- bpo-21137: Improve the repr for threading.Lock() and its variants by 29804 showing the "locked" or "unlocked" status. Patch by Berker Peksag. 29805 29806- bpo-21538: The plistlib module now supports loading of binary plist files 29807 when reference or offset size is not a power of two. 29808 29809- bpo-21455: Add a default backlog to socket.listen(). 29810 29811- bpo-21525: Most Tkinter methods which accepted tuples now accept lists 29812 too. 29813 29814- bpo-22166: With the assistance of a new internal _codecs._forget_codec 29815 helping function, test_codecs now clears the encoding caches to avoid the 29816 appearance of a reference leak 29817 29818- bpo-22236: Tkinter tests now don't reuse default root window. New root 29819 window is created for every test class. 29820 29821- bpo-10744: Fix :pep:`3118` format strings on ctypes objects with a 29822 nontrivial shape. 29823 29824- bpo-20826: Optimize ipaddress.collapse_addresses(). 29825 29826- bpo-21487: Optimize ipaddress.summarize_address_range() and 29827 ipaddress.{IPv4Network,IPv6Network}.subnets(). 29828 29829- bpo-21486: Optimize parsing of netmasks in ipaddress.IPv4Network and 29830 ipaddress.IPv6Network. 29831 29832- bpo-13916: Disallowed the surrogatepass error handler for non UTF-\* 29833 encodings. 29834 29835- bpo-20998: Fixed re.fullmatch() of repeated single character pattern with 29836 ignore case. Original patch by Matthew Barnett. 29837 29838- bpo-21075: fileinput.FileInput now reads bytes from standard stream if 29839 binary mode is specified. Patch by Sam Kimbrel. 29840 29841- bpo-19775: Add a samefile() method to pathlib Path objects. Initial patch 29842 by Vajrasky Kok. 29843 29844- bpo-21226: Set up modules properly in PyImport_ExecCodeModuleObject (and 29845 friends). 29846 29847- bpo-21398: Fix a unicode error in the pydoc pager when the documentation 29848 contains characters not encodable to the stdout encoding. 29849 29850- bpo-16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an 29851 (address, netmask) tuple argument, so as to easily construct network 29852 objects from existing addresses. 29853 29854- bpo-21156: importlib.abc.InspectLoader.source_to_code() is now a 29855 staticmethod. 29856 29857- bpo-21424: Simplified and optimized heaqp.nlargest() and nmsmallest() to 29858 make fewer tuple comparisons. 29859 29860- bpo-21396: Fix TextIOWrapper(..., write_through=True) to not force a 29861 flush() on the underlying binary stream. Patch by akira. 29862 29863- bpo-18314: Unlink now removes junctions on Windows. Patch by Kim Gräsman 29864 29865- bpo-21088: Bugfix for curses.window.addch() regression in 3.4.0. In 29866 porting to Argument Clinic, the first two arguments were reversed. 29867 29868- bpo-21407: _decimal: The module now supports function signatures. 29869 29870- bpo-10650: Remove the non-standard 'watchexp' parameter from the 29871 Decimal.quantize() method in the Python version. It had never been 29872 present in the C version. 29873 29874- bpo-21469: Reduced the risk of false positives in robotparser by checking 29875 to make sure that robots.txt has been read or does not exist prior to 29876 returning True in can_fetch(). 29877 29878- bpo-19414: Have the OrderedDict mark deleted links as unusable. This gives 29879 an early failure if the link is deleted during iteration. 29880 29881- bpo-21421: Add __slots__ to the MappingViews ABC. Patch by Josh Rosenberg. 29882 29883- bpo-21101: Eliminate double hashing in the C speed-up code for 29884 collections.Counter(). 29885 29886- bpo-21321: itertools.islice() now releases the reference to the source 29887 iterator when the slice is exhausted. Patch by Anton Afanasyev. 29888 29889- bpo-21057: TextIOWrapper now allows the underlying binary stream's read() 29890 or read1() method to return an arbitrary bytes-like object (such as a 29891 memoryview). Patch by Nikolaus Rath. 29892 29893- bpo-20951: SSLSocket.send() now raises either SSLWantReadError or 29894 SSLWantWriteError on a non-blocking socket if the operation would block. 29895 Previously, it would return 0. Patch by Nikolaus Rath. 29896 29897- bpo-13248: removed previously deprecated asyncore.dispatcher __getattr__ 29898 cheap inheritance hack. 29899 29900- bpo-9815: assertRaises now tries to clear references to local variables in 29901 the exception's traceback. 29902 29903- bpo-19940: ssl.cert_time_to_seconds() now interprets the given time string 29904 in the UTC timezone (as specified in RFC 5280), not the local timezone. 29905 29906- bpo-13204: Calling sys.flags.__new__ would crash the interpreter, now it 29907 raises a TypeError. 29908 29909- bpo-19385: Make operations on a closed dbm.dumb database always raise the 29910 same exception. 29911 29912- bpo-21207: Detect when the os.urandom cached fd has been closed or 29913 replaced, and open it anew. 29914 29915- bpo-21291: subprocess's Popen.wait() is now thread safe so that multiple 29916 threads may be calling wait() or poll() on a Popen instance at the same 29917 time without losing the Popen.returncode value. 29918 29919- bpo-21127: Path objects can now be instantiated from str subclass 29920 instances (such as ``numpy.str_``). 29921 29922- bpo-15002: urllib.response object to use _TemporaryFileWrapper (and 29923 _TemporaryFileCloser) facility. Provides a better way to handle file 29924 descriptor close. Patch contributed by Christian Theune. 29925 29926- bpo-12220: mindom now raises a custom ValueError indicating it doesn't 29927 support spaces in URIs instead of letting a 'split' ValueError bubble up. 29928 29929- bpo-21068: The ssl.PROTOCOL* constants are now enum members. 29930 29931- bpo-21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd. 29932 29933- bpo-21262: New method assert_not_called for Mock. It raises AssertionError 29934 if the mock has been called. 29935 29936- bpo-21238: New keyword argument `unsafe` to Mock. It raises 29937 `AttributeError` incase of an attribute startswith assert or assret. 29938 29939- bpo-20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not 29940 PROTOCOL_SSLv3, for maximum compatibility. 29941 29942- bpo-21239: patch.stopall() didn't work deterministically when the same 29943 name was patched more than once. 29944 29945- bpo-21203: Updated fileConfig and dictConfig to remove inconsistencies. 29946 Thanks to Jure Koren for the patch. 29947 29948- bpo-21222: Passing name keyword argument to mock.create_autospec now 29949 works. 29950 29951- bpo-21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX. 29952 29953- bpo-17498: Some SMTP servers disconnect after certain errors, violating 29954 strict RFC conformance. Instead of losing the error code when we issue 29955 the subsequent RSET, smtplib now returns the error code and defers raising 29956 the SMTPServerDisconnected error until the next command is issued. 29957 29958- bpo-17826: setting an iterable side_effect on a mock function created by 29959 create_autospec now works. Patch by Kushal Das. 29960 29961- bpo-7776: Fix ``Host:`` header and reconnection when using 29962 http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath. 29963 29964- bpo-20968: unittest.mock.MagicMock now supports division. Patch by 29965 Johannes Baiter. 29966 29967- bpo-21529: Fix arbitrary memory access in JSONDecoder.raw_decode with a 29968 negative second parameter. Bug reported by Guido Vranken. (See also: 29969 CVE-2014-4616) 29970 29971- bpo-21169: getpass now handles non-ascii characters that the input stream 29972 encoding cannot encode by re-encoding using the replace error handler. 29973 29974- bpo-21171: Fixed undocumented filter API of the rot13 codec. Patch by 29975 Berker Peksag. 29976 29977- bpo-20539: Improved math.factorial error message for large positive inputs 29978 and changed exception type (OverflowError -> ValueError) for large 29979 negative inputs. 29980 29981- bpo-21172: isinstance check relaxed from dict to collections.Mapping. 29982 29983- bpo-21155: asyncio.EventLoop.create_unix_server() now raises a ValueError 29984 if path and sock are specified at the same time. 29985 29986- bpo-21136: Avoid unnecessary normalization of Fractions resulting from 29987 power and other operations. Patch by Raymond Hettinger. 29988 29989- bpo-17621: Introduce importlib.util.LazyLoader. 29990 29991- bpo-21076: signal module constants were turned into enums. Patch by 29992 Giampaolo Rodola'. 29993 29994- bpo-20636: Improved the repr of Tkinter widgets. 29995 29996- bpo-19505: The items, keys, and values views of OrderedDict now support 29997 reverse iteration using reversed(). 29998 29999- bpo-21149: Improved thread-safety in logging cleanup during interpreter 30000 shutdown. Thanks to Devin Jeanpierre for the patch. 30001 30002- bpo-21058: Fix a leak of file descriptor in 30003 :func:`tempfile.NamedTemporaryFile`, close the file descriptor if 30004 :func:`io.open` fails 30005 30006- bpo-21200: Return None from pkgutil.get_loader() when __spec__ is missing. 30007 30008- bpo-21013: Enhance ssl.create_default_context() when used for server side 30009 sockets to provide better security by default. 30010 30011- bpo-20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a 30012 TypeError if the second argument is not a string or compiled regex. 30013 30014- bpo-20633: Replace relative import by absolute import. 30015 30016- bpo-20980: Stop wrapping exception when using ThreadPool. 30017 30018- bpo-21082: In os.makedirs, do not set the process-wide umask. Note this 30019 changes behavior of makedirs when exist_ok=True. 30020 30021- bpo-20990: Fix issues found by pyflakes for multiprocessing. 30022 30023- bpo-21015: SSL contexts will now automatically select an elliptic curve 30024 for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise default to 30025 "prime256v1". 30026 30027- bpo-21000: Improve the command-line interface of json.tool. 30028 30029- bpo-20995: Enhance default ciphers used by the ssl module to enable better 30030 security and prioritize perfect forward secrecy. 30031 30032- bpo-20884: Don't assume that __file__ is defined on importlib.__init__. 30033 30034- bpo-21499: Ignore __builtins__ in several test_importlib.test_api tests. 30035 30036- bpo-20627: xmlrpc.client.ServerProxy is now a context manager. 30037 30038- bpo-19165: The formatter module now raises DeprecationWarning instead of 30039 PendingDeprecationWarning. 30040 30041- bpo-13936: Remove the ability of datetime.time instances to be considered 30042 false in boolean contexts. 30043 30044- bpo-18931: selectors module now supports /dev/poll on Solaris. Patch by 30045 Giampaolo Rodola'. 30046 30047- bpo-19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale), 30048 :py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the 30049 ``surrogateescape`` error handler, instead of the ``strict`` error 30050 handler. 30051 30052- bpo-20574: Implement incremental decoder for cp65001 code (Windows code 30053 page 65001, Microsoft UTF-8). 30054 30055- bpo-20879: Delay the initialization of encoding and decoding tables for 30056 base32, ascii85 and base85 codecs in the base64 module, and delay the 30057 initialization of the unquote_to_bytes() table of the urllib.parse module, 30058 to not waste memory if these modules are not used. 30059 30060- bpo-19157: Include the broadcast address in the usuable hosts for IPv6 in 30061 ipaddress. 30062 30063- bpo-11599: When an external command (e.g. compiler) fails, distutils now 30064 prints out the whole command line (instead of just the command name) if 30065 the environment variable DISTUTILS_DEBUG is set. 30066 30067- bpo-4931: distutils should not produce unhelpful "error: None" messages 30068 anymore. distutils.util.grok_environment_error is kept but doc-deprecated. 30069 30070- bpo-20875: Prevent possible gzip "'read' is not defined" NameError. Patch 30071 by Claudiu Popa. 30072 30073- bpo-11558: ``email.message.Message.attach`` now returns a more useful 30074 error message if ``attach`` is called on a message for which 30075 ``is_multipart`` is False. 30076 30077- bpo-20283: RE pattern methods now accept the string keyword parameters as 30078 documented. The pattern and source keyword parameters are left as 30079 deprecated aliases. 30080 30081- bpo-20778: Fix modulefinder to work with bytecode-only modules. 30082 30083- bpo-20791: copy.copy() now doesn't make a copy when the input is a bytes 30084 object. Initial patch by Peter Otten. 30085 30086- bpo-19748: On AIX, time.mktime() now raises an OverflowError for year 30087 outsize range [1902; 2037]. 30088 30089- bpo-19573: inspect.signature: Use enum for parameter kind constants. 30090 30091- bpo-20726: inspect.signature: Make Signature and Parameter picklable. 30092 30093- bpo-17373: Add inspect.Signature.from_callable method. 30094 30095- bpo-20378: Improve repr of inspect.Signature and inspect.Parameter. 30096 30097- bpo-20816: Fix inspect.getcallargs() to raise correct TypeError for 30098 missing keyword-only arguments. Patch by Jeremiah Lowin. 30099 30100- bpo-20817: Fix inspect.getcallargs() to fail correctly if more than 3 30101 arguments are missing. Patch by Jeremiah Lowin. 30102 30103- bpo-6676: Ensure a meaningful exception is raised when attempting to parse 30104 more than one XML document per pyexpat xmlparser instance. (Original 30105 patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with suggested 30106 wording by David Gutteridge) 30107 30108- bpo-21117: Fix inspect.signature to better support functools.partial. Due 30109 to the specifics of functools.partial implementation, 30110 positional-or-keyword arguments passed as keyword arguments become 30111 keyword-only. 30112 30113- bpo-20334: inspect.Signature and inspect.Parameter are now hashable. 30114 Thanks to Antony Lee for bug reports and suggestions. 30115 30116- bpo-15916: doctest.DocTestSuite returns an empty unittest.TestSuite 30117 instead of raising ValueError if it finds no tests 30118 30119- bpo-21209: Fix asyncio.tasks.CoroWrapper to workaround a bug in yield-from 30120 implementation in CPythons prior to 3.4.1. 30121 30122- asyncio: Add gi_{frame,running,code} properties to CoroWrapper (upstream 30123 issue #163). 30124 30125- bpo-21311: Avoid exception in _osx_support with non-standard compiler 30126 configurations. Patch by John Szakmeister. 30127 30128- bpo-11571: Ensure that the turtle window becomes the topmost window when 30129 launched on OS X. 30130 30131- bpo-21801: Validate that __signature__ is None or an instance of 30132 Signature. 30133 30134- bpo-21923: Prevent AttributeError in 30135 distutils.sysconfig.customize_compiler due to possible uninitialized 30136 _config_vars. 30137 30138- bpo-21323: Fix http.server to again handle scripts in CGI subdirectories, 30139 broken by the fix for security issue #19435. Patch by Zach Byrne. 30140 30141- bpo-22733: Fix ffi_prep_args not zero-extending argument values correctly 30142 on 64-bit Windows. 30143 30144- bpo-23302: Default to TCP_NODELAY=1 upon establishing an HTTPConnection. 30145 Removed use of hard-coded MSS as it's an optimization that's no longer 30146 needed with Nagle disabled. 30147 30148IDLE 30149---- 30150 30151- bpo-20577: Configuration of the max line length for the FormatParagraph 30152 extension has been moved from the General tab of the Idle preferences 30153 dialog to the FormatParagraph tab of the Config Extensions dialog. Patch 30154 by Tal Einat. 30155 30156- bpo-16893: Update Idle doc chapter to match current Idle and add new 30157 information. 30158 30159- bpo-3068: Add Idle extension configuration dialog to Options menu. Changes 30160 are written to HOME/.idlerc/config-extensions.cfg. Original patch by Tal 30161 Einat. 30162 30163- bpo-16233: A module browser (File : Class Browser, Alt+C) requires an 30164 editor window with a filename. When Class Browser is requested otherwise, 30165 from a shell, output window, or 'Untitled' editor, Idle no longer displays 30166 an error box. It now pops up an Open Module box (Alt+M). If a valid name 30167 is entered and a module is opened, a corresponding browser is also opened. 30168 30169- bpo-4832: Save As to type Python files automatically adds .py to the name 30170 you enter (even if your system does not display it). Some systems 30171 automatically add .txt when type is Text files. 30172 30173- bpo-21986: Code objects are not normally pickled by the pickle module. To 30174 match this, they are no longer pickled when running under Idle. 30175 30176- bpo-17390: Adjust Editor window title; remove 'Python', move version to 30177 end. 30178 30179- bpo-14105: Idle debugger breakpoints no longer disappear when inserting or 30180 deleting lines. 30181 30182- bpo-17172: Turtledemo can now be run from Idle. Currently, the entry is on 30183 the Help menu, but it may move to Run. Patch by Ramchandra Apt and Lita 30184 Cho. 30185 30186- bpo-21765: Add support for non-ascii identifiers to HyperParser. 30187 30188- bpo-21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav 30189 Heblikar. 30190 30191- bpo-18592: Add unittest for SearchDialogBase. Patch by Phil Webster. 30192 30193- bpo-21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar. 30194 30195- bpo-21686: add unittest for HyperParser. Original patch by Saimadhav 30196 Heblikar. 30197 30198- bpo-12387: Add missing upper(lower)case versions of default Windows key 30199 bindings for Idle so Caps Lock does not disable them. Patch by Roger 30200 Serwy. 30201 30202- bpo-21695: Closing a Find-in-files output window while the search is still 30203 in progress no longer closes Idle. 30204 30205- bpo-18910: Add unittest for textView. Patch by Phil Webster. 30206 30207- bpo-18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar. 30208 30209- bpo-18409: Add unittest for AutoComplete. Patch by Phil Webster. 30210 30211- bpo-21477: htest.py - Improve framework, complete set of tests. Patches by 30212 Saimadhav Heblikar 30213 30214- bpo-18104: Add idlelib/idle_test/htest.py with a few sample tests to begin 30215 consolidating and improving human-validated tests of Idle. Change other 30216 files as needed to work with htest. Running the module as __main__ runs 30217 all tests. 30218 30219- bpo-21139: Change default paragraph width to 72, the :pep:`8` 30220 recommendation. 30221 30222- bpo-21284: Paragraph reformat test passes after user changes reformat 30223 width. 30224 30225- bpo-17654: Ensure IDLE menus are customized properly on OS X for 30226 non-framework builds and for all variants of Tk. 30227 30228- bpo-23180: Rename IDLE "Windows" menu item to "Window". Patch by Al 30229 Sweigart. 30230 30231Build 30232----- 30233 30234- bpo-15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the 30235 configure script. 30236 30237- bpo-22935: Allow the ssl module to be compiled if openssl doesn't support 30238 SSL 3. 30239 30240- bpo-22592: Drop support of the Borland C compiler to build Python. The 30241 distutils module still supports it to build extensions. 30242 30243- bpo-22591: Drop support of MS-DOS, especially of the DJGPP compiler 30244 (MS-DOS port of GCC). 30245 30246- bpo-16537: Check whether self.extensions is empty in setup.py. Patch by 30247 Jonathan Hosmer. 30248 30249- bpo-22359: Remove incorrect uses of recursive make. Patch by Jonas 30250 Wagner. 30251 30252- bpo-21958: Define HAVE_ROUND when building with Visual Studio 2013 and 30253 above. Patch by Zachary Turner. 30254 30255- bpo-18093: the programs that embed the CPython runtime are now in a 30256 separate "Programs" directory, rather than being kept in the Modules 30257 directory. 30258 30259- bpo-15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/ 30260 now display special message when and only when there are failures. 30261 30262- bpo-21141: The Windows build process no longer attempts to find Perl, 30263 instead relying on OpenSSL source being configured and ready to build. 30264 The ``PCbuild\build_ssl.py`` script has been re-written and re-named to 30265 ``PCbuild\prepare_ssl.py``, and takes care of configuring OpenSSL source 30266 for both 32 and 64 bit platforms. OpenSSL sources obtained from 30267 svn.python.org will always be pre-configured and ready to build. 30268 30269- bpo-21037: Add a build option to enable AddressSanitizer support. 30270 30271- bpo-19962: The Windows build process now creates "python.bat" in the root 30272 of the source tree, which passes all arguments through to the most 30273 recently built interpreter. 30274 30275- bpo-21285: Refactor and fix curses configure check to always search in a 30276 ncursesw directory. 30277 30278- bpo-15234: For BerkeleyDB and Sqlite, only add the found library and 30279 include directories if they aren't already being searched. This avoids an 30280 explicit runtime library dependency. 30281 30282- bpo-17861: Tools/scripts/generate_opcode_h.py automatically regenerates 30283 Include/opcode.h from Lib/opcode.py if the latter gets any change. 30284 30285- bpo-20644: OS X installer build support for documentation build changes in 30286 3.4.1: assume externally supplied sphinx-build is available in /usr/bin. 30287 30288- bpo-20022: Eliminate use of deprecated bundlebuilder in OS X builds. 30289 30290- bpo-15968: Incorporated Tcl, Tk, and Tix builds into the Windows build 30291 solution. 30292 30293- bpo-17095: Fix Modules/Setup *shared* support. 30294 30295- bpo-21811: Anticipated fixes to support OS X versions > 10.9. 30296 30297- bpo-21166: Prevent possible segfaults and other random failures of python 30298 --generate-posix-vars in pybuilddir.txt build target. 30299 30300- bpo-18096: Fix library order returned by python-config. 30301 30302- bpo-17219: Add library build dir for Python extension cross-builds. 30303 30304- bpo-22919: Windows build updated to support VC 14.0 (Visual Studio 2015), 30305 which will be used for the official release. 30306 30307- bpo-21236: Build _msi.pyd with cabinet.lib instead of fci.lib 30308 30309- bpo-17128: Use private version of OpenSSL for OS X 10.5+ installer. 30310 30311C API 30312----- 30313 30314- bpo-14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo(), 30315 bytearray_getbuffer(), bytesiobuf_getbuffer() and array_buffer_getbuf(). 30316 All functions now raise BufferError in that case. 30317 30318- bpo-22445: PyBuffer_IsContiguous() now implements precise contiguity 30319 tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation 30320 flag. Previously the function reported false negatives for corner cases. 30321 30322- bpo-22079: PyType_Ready() now checks that statically allocated type has no 30323 dynamically allocated bases. 30324 30325- bpo-22453: Removed non-documented macro PyObject_REPR(). 30326 30327- bpo-18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, 30328 rename ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document 30329 these functions. 30330 30331- bpo-21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(), 30332 PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) is now using 30333 ``calloc()`` instead of ``malloc()`` for large objects which is faster and 30334 use less memory. 30335 30336- bpo-20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to 30337 match what importlib does; this affects _frozen_importlib as well as any 30338 module loaded using imp.init_frozen(). 30339 30340Documentation 30341------------- 30342 30343- bpo-19548: Update the codecs module documentation to better cover the 30344 distinction between text encodings and other codecs, together with other 30345 clarifications. Patch by Martin Panter. 30346 30347- bpo-22394: Doc/Makefile now supports ``make venv PYTHON=../python`` to 30348 create a venv for generating the documentation, e.g., ``make html 30349 PYTHON=venv/bin/python3``. 30350 30351- bpo-21514: The documentation of the json module now refers to new JSON RFC 30352 7159 instead of obsoleted RFC 4627. 30353 30354- bpo-21777: The binary sequence methods on bytes and bytearray are now 30355 documented explicitly, rather than assuming users will be able to derive 30356 the expected behaviour from the behaviour of the corresponding str 30357 methods. 30358 30359- bpo-6916: undocument deprecated asynchat.fifo class. 30360 30361- bpo-17386: Expanded functionality of the ``Doc/make.bat`` script to make 30362 it much more comparable to ``Doc/Makefile``. 30363 30364- bpo-21312: Update the thread_foobar.h template file to include newer 30365 threading APIs. Patch by Jack McCracken. 30366 30367- bpo-21043: Remove the recommendation for specific CA organizations and to 30368 mention the ability to load the OS certificates. 30369 30370- bpo-20765: Add missing documentation for PurePath.with_name() and 30371 PurePath.with_suffix(). 30372 30373- bpo-19407: New package installation and distribution guides based on the 30374 Python Packaging Authority tools. Existing guides have been retained as 30375 legacy links from the distutils docs, as they still contain some required 30376 reference material for tool developers that isn't recorded anywhere else. 30377 30378- bpo-19697: Document cases where __main__.__spec__ is None. 30379 30380Tests 30381----- 30382 30383- bpo-18982: Add tests for CLI of the calendar module. 30384 30385- bpo-19548: Added some additional checks to test_codecs to ensure that 30386 statements in the updated documentation remain accurate. Patch by Martin 30387 Panter. 30388 30389- bpo-22838: All test_re tests now work with unittest test discovery. 30390 30391- bpo-22173: Update lib2to3 tests to use unittest test discovery. 30392 30393- bpo-16000: Convert test_curses to use unittest. 30394 30395- bpo-21456: Skip two tests in test_urllib2net.py if _ssl module not 30396 present. Patch by Remi Pointel. 30397 30398- bpo-20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de 30399 Gaye. 30400 30401- bpo-22060: test_ctypes has been somewhat cleaned up and simplified; it now 30402 uses unittest test discovery to find its tests. 30403 30404- bpo-22104: regrtest.py no longer holds a reference to the suite of tests 30405 loaded from test modules that don't define test_main(). 30406 30407- bpo-22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch. 30408 30409- bpo-22002: Added ``load_package_tests`` function to test.support and used 30410 it to implement/augment test discovery in test_asyncio, test_email, 30411 test_importlib, test_json, and test_tools. 30412 30413- bpo-21976: Fix test_ssl to accept LibreSSL version strings. Thanks to 30414 William Orr. 30415 30416- bpo-21918: Converted test_tools from a module to a package containing 30417 separate test files for each tested script. 30418 30419- bpo-9554: Use modern unittest features in test_argparse. Initial patch by 30420 Denver Coneybeare and Radu Voicilas. 30421 30422- bpo-20155: Changed HTTP method names in failing tests in test_httpservers 30423 so that packet filtering software (specifically Windows Base Filtering 30424 Engine) does not interfere with the transaction semantics expected by the 30425 tests. 30426 30427- bpo-19493: Refactored the ctypes test package to skip tests explicitly 30428 rather than silently. 30429 30430- bpo-18492: All resources are now allowed when tests are not run by 30431 regrtest.py. 30432 30433- bpo-21634: Fix pystone micro-benchmark: use floor division instead of true 30434 division to benchmark integers instead of floating point numbers. Set 30435 pystone version to 1.2. Patch written by Lennart Regebro. 30436 30437- bpo-21605: Added tests for Tkinter images. 30438 30439- bpo-21493: Added test for ntpath.expanduser(). Original patch by Claudiu 30440 Popa. 30441 30442- bpo-19925: Added tests for the spwd module. Original patch by Vajrasky 30443 Kok. 30444 30445- bpo-21522: Added Tkinter tests for Listbox.itemconfigure(), 30446 PanedWindow.paneconfigure(), and Menu.entryconfigure(). 30447 30448- bpo-17756: Fix test_code test when run from the installed location. 30449 30450- bpo-17752: Fix distutils tests when run from the installed location. 30451 30452- bpo-18604: Consolidated checks for GUI availability. All platforms now at 30453 least check whether Tk can be instantiated when the GUI resource is 30454 requested. 30455 30456- bpo-21275: Fix a socket test on KFreeBSD. 30457 30458- bpo-21223: Pass test_site/test_startup_imports when some of the extensions 30459 are built as builtins. 30460 30461- bpo-20635: Added tests for Tk geometry managers. 30462 30463- Add test case for freeze. 30464 30465- bpo-20743: Fix a reference leak in test_tcl. 30466 30467- bpo-21097: Move test_namespace_pkgs into test_importlib. 30468 30469- bpo-21503: Use test_both() consistently in test_importlib. 30470 30471- bpo-20939: Avoid various network test failures due to new redirect of 30472 http://www.python.org/ to https://www.python.org: use 30473 http://www.example.com instead. 30474 30475- bpo-20668: asyncio tests no longer rely on tests.txt file. (Patch by 30476 Vajrasky Kok) 30477 30478- bpo-21093: Prevent failures of ctypes test_macholib on OS X if a copy of 30479 libz exists in $HOME/lib or /usr/local/lib. 30480 30481- bpo-22770: Prevent some Tk segfaults on OS X when running gui tests. 30482 30483- bpo-23211: Workaround test_logging failure on some OS X 10.6 systems. 30484 30485- bpo-23345: Prevent test_ssl failures with large OpenSSL patch level values 30486 (like 0.9.8zc). 30487 30488Tools/Demos 30489----------- 30490 30491- bpo-22314: pydoc now works when the LINES environment variable is set. 30492 30493- bpo-22615: Argument Clinic now supports the "type" argument for the int 30494 converter. This permits using the int converter with enums and typedefs. 30495 30496- bpo-20076: The makelocalealias.py script no longer ignores UTF-8 mapping. 30497 30498- bpo-20079: The makelocalealias.py script now can parse the SUPPORTED file 30499 from glibc sources and supports command line options for source paths. 30500 30501- bpo-22201: Command-line interface of the zipfile module now correctly 30502 extracts ZIP files with directory entries. Patch by Ryan Wilson. 30503 30504- bpo-22120: For functions using an unsigned integer return converter, 30505 Argument Clinic now generates a cast to that type for the comparison to -1 30506 in the generated code. (This suppresses a compilation warning.) 30507 30508- bpo-18974: Tools/scripts/diff.py now uses argparse instead of optparse. 30509 30510- bpo-21906: Make Tools/scripts/md5sum.py work in Python 3. Patch by Zachary 30511 Ware. 30512 30513- bpo-21629: Fix Argument Clinic's "--converters" feature. 30514 30515- Add support for ``yield from`` to 2to3. 30516 30517- Add support for the :pep:`465` matrix multiplication operator to 2to3. 30518 30519- bpo-16047: Fix module exception list and __file__ handling in freeze. 30520 Patch by Meador Inge. 30521 30522- bpo-11824: Consider ABI tags in freeze. Patch by Meador Inge. 30523 30524- bpo-20535: PYTHONWARNING no longer affects the run_tests.py script. Patch 30525 by Arfrever Frehtes Taifersar Arahesis. 30526 30527Windows 30528------- 30529 30530- bpo-23260: Update Windows installer 30531 30532- The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible 30533 result of this change is the addition of new native file dialogs when 30534 running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more 30535 information. Also, this version of Tcl/Tk includes support for Windows 30536 10. 30537 30538- bpo-17896: The Windows build scripts now expect external library sources 30539 to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``. 30540 30541- bpo-17717: The Windows build scripts now use a copy of NASM pulled from 30542 svn.python.org to build OpenSSL. 30543 30544- bpo-21907: Improved the batch scripts provided for building Python. 30545 30546- bpo-22644: The bundled version of OpenSSL has been updated to 1.0.1j. 30547 30548- bpo-10747: Use versioned labels in the Windows start menu. Patch by Olive 30549 Kilburn. 30550 30551- bpo-22980: .pyd files with a version and platform tag (for example, 30552 ".cp35-win32.pyd") will now be loaded in preference to those without tags. 30553 30554 30555**(For information about older versions, consult the HISTORY file.)** 30556