1+++++++++++ 2Python News 3+++++++++++ 4 5What's New in Python 3.9.2 final? 6================================= 7 8*Release date: 2021-02-19* 9 10Windows 11------- 12 13- bpo-43155: :c:func:`PyCMethod_New` is now present in ``python3.lib``. 14 15 16What's New in Python 3.9.2 release candidate 1? 17=============================================== 18 19*Release date: 2021-02-16* 20 21Security 22-------- 23 24- bpo-42967: Fix web cache poisoning vulnerability by defaulting the query 25 args separator to ``&``, and allowing the user to choose a custom 26 separator. 27 28- bpo-42938: Avoid static buffers when computing the repr of 29 :class:`ctypes.c_double` and :class:`ctypes.c_longdouble` values. 30 31Core and Builtins 32----------------- 33 34- bpo-42819: :mod:`readline`: Explicitly disable bracketed paste in the 35 interactive interpreter, even if it's set in the inputrc, is enabled by 36 default (eg GNU Readline 8.1), or a user calls 37 ``readline.read_init_file()``. The Python REPL has not implemented 38 bracketed paste support. Also, bracketed mode writes the ``"\x1b[?2004h"`` 39 escape sequence into stdout which causes test failures in applications 40 that don't support it. It can still be explicitly enabled by calling 41 ``readline.parse_and_bind("set enable-bracketed-paste on")``. Patch by 42 Dustin Rodrigues. 43 44- bpo-42806: Fix the column offsets for f-strings :mod:`ast` nodes 45 surrounded by parentheses and for nodes that spawn multiple lines. Patch 46 by Pablo Galindo. 47 48- bpo-40631: Fix regression where a single parenthesized starred expression 49 was a valid assignment target. 50 51- bpo-32381: Fix encoding name when running a ``.pyc`` file on Windows: 52 :c:func:`PyRun_SimpleFileExFlags()` now uses the correct encoding to 53 decode the filename. 54 55- bpo-42536: Several built-in and standard library types now ensure that 56 their internal result tuples are always tracked by the :term:`garbage 57 collector <garbage collection>`: 58 59 - :meth:`collections.OrderedDict.items() <collections.OrderedDict>` 60 61 - :meth:`dict.items` 62 63 - :func:`enumerate` 64 65 - :func:`functools.reduce` 66 67 - :func:`itertools.combinations` 68 69 - :func:`itertools.combinations_with_replacement` 70 71 - :func:`itertools.permutations` 72 73 - :func:`itertools.product` 74 75 - :func:`itertools.zip_longest` 76 77 - :func:`zip` 78 79 Previously, they could have become untracked by a prior garbage 80 collection. Patch by Brandt Bucher. 81 82- bpo-42195: The ``__args__`` of the parameterized generics for 83 :data:`typing.Callable` and :class:`collections.abc.Callable` are now 84 consistent. The ``__args__`` for :class:`collections.abc.Callable` are 85 now flattened while :data:`typing.Callable`'s have not changed. To allow 86 this change, :class:`types.GenericAlias` can now be subclassed and 87 ``collections.abc.Callable``'s ``__class_getitem__`` will now return a 88 subclass of ``types.GenericAlias``. Tests for typing were also updated to 89 not subclass things like ``Callable[..., T]`` as that is not a valid base 90 class. Finally, both types no longer validate their ``argtypes``, in 91 ``Callable[[argtypes], resulttype]`` to prepare for :pep:`612`. Patch by 92 Ken Jin. 93 94Library 95------- 96 97- bpo-43102: The namedtuple __new__ method had its __builtins__ set to None 98 instead of an actual dictionary. This created problems for introspection 99 tools. 100 101- bpo-43108: Fixed a reference leak in the :mod:`curses` module. Patch by 102 Pablo Galindo 103 104- bpo-42944: Fix ``random.Random.sample`` when ``counts`` argument is not 105 ``None``. 106 107- bpo-42931: Add :func:`randbytes` to ``random.__all__``. 108 109- bpo-42780: Fix os.set_inheritable() for O_PATH file descriptors on Linux. 110 111- bpo-42851: remove __init_subclass__ support for Enum members 112 113- bpo-41748: Fix HTMLParser parsing rules for element attributes containing 114 commas with spaces. Patch by Karl Dubost. 115 116- bpo-42759: Fixed equality comparison of :class:`tkinter.Variable` and 117 :class:`tkinter.font.Font`. Objects which belong to different Tcl 118 interpreters are now always different, even if they have the same name. 119 120- bpo-42756: Configure LMTP Unix-domain socket to use socket global default 121 timeout when a timeout is not explicitly provided. 122 123- bpo-23328: Allow / character in username, password fields on _PROXY 124 envars. 125 126- bpo-42655: :mod:`subprocess` *extra_groups* is now correctly passed into 127 setgroups() system call. 128 129- bpo-42727: ``EnumMeta.__prepare__`` now accepts ``**kwds`` to properly 130 support ``__init_subclass__`` 131 132- bpo-42681: Fixed range checks for color and pair numbers in :mod:`curses`. 133 134- bpo-37961: Fix crash in :func:`tracemalloc.Traceback.__repr__` (regressed 135 in Python 3.9). 136 137- bpo-42630: :mod:`tkinter` functions and constructors which need a default 138 root window raise now :exc:`RuntimeError` with descriptive message instead 139 of obscure :exc:`AttributeError` or :exc:`NameError` if it is not created 140 yet or cannot be created automatically. 141 142- bpo-42644: `logging.disable` will now validate the types and value of its 143 parameter. It also now accepts strings representing the levels (as does 144 `loging.setLevel`) instead of only the numerical values. 145 146- bpo-36541: Fixed lib2to3.pgen2 to be able to parse PEP-570 positional only 147 argument syntax. 148 149- bpo-42517: Enum: private names will raise a DeprecationWarning; in 3.10 150 they will become normal attributes 151 152- bpo-42678: `Enum`: call `__init_subclass__` after members have been added 153 154- bpo-42532: Remove unexpected call of ``__bool__`` when passing a 155 ``spec_arg`` argument to a Mock. 156 157- bpo-42388: Fix subprocess.check_output(..., input=None) behavior when 158 text=True to be consistent with that of the documentation and 159 universal_newlines=True. 160 161- bpo-34463: Fixed discrepancy between :mod:`traceback` and the interpreter 162 in formatting of SyntaxError with lineno not set (:mod:`traceback` was 163 changed to match interpreter). 164 165- bpo-42375: subprocess module update for DragonFlyBSD support. 166 167- bpo-42384: Make pdb populate sys.path[0] exactly the same as regular 168 python execution. 169 170- bpo-42383: Fix pdb: previously pdb would fail to restart the debugging 171 target if it was specified using a relative path and the current directory 172 changed. 173 174- bpo-42318: Fixed support of non-BMP characters in :mod:`tkinter` on macOS. 175 176- bpo-42163: Restore compatibility for ``uname_result`` around deepcopy and 177 _replace. 178 179- bpo-39825: Windows: Change ``sysconfig.get_config_var('EXT_SUFFIX')`` to 180 the expected full ``platform_tag.extension`` format. Previously it was 181 hard-coded to ``.pyd``, now it is compatible with ``distutils.sysconfig`` 182 and will result in something like ``.cp38-win_amd64.pyd``. This brings 183 windows into conformance with the other platforms. 184 185- bpo-42059: :class:`typing.TypedDict` types created using the alternative 186 call-style syntax now correctly respect the ``total`` keyword argument 187 when setting their ``__required_keys__`` and ``__optional_keys__`` class 188 attributes. 189 190- bpo-39101: Fixed tests using IsolatedAsyncioTestCase from hanging on 191 BaseExceptions. 192 193- bpo-42005: Fix CLI of :mod:`cProfile` and :mod:`profile` to catch 194 :exc:`BrokenPipeError`. 195 196- bpo-41907: fix `format()` behavior for `IntFlag` 197 198- bpo-41889: Enum: fix regression involving inheriting a multiply-inherited 199 enum 200 201- bpo-41891: Ensure asyncio.wait_for waits for task completion 202 203- bpo-41604: Don't decrement the reference count of the previous user_ptr 204 when set_panel_userptr fails. 205 206- bpo-40219: Lowered :class:`tkinter.ttk.LabeledScale` dummy widget to 207 prevent hiding part of the content label. 208 209- bpo-40084: Fix ``Enum.__dir__``: dir(Enum.member) now includes attributes 210 as well as methods. 211 212- bpo-39068: Fix initialization race condition in :func:`a85encode` and 213 :func:`b85encode` in :mod:`base64`. Patch by Brandon Stansbury. 214 215- bpo-33289: Correct call to :mod:`tkinter.colorchooser` to return RGB 216 triplet of ints instead of floats. Patch by Cheryl Sabella. 217 218Documentation 219------------- 220 221- bpo-40304: Fix doc for type(name, bases, dict). Patch by Boris 222 Verkhovskiy and Éric Araujo. 223 224- bpo-42811: Updated importlib.utils.resolve_name() doc to use 225 __spec__.parent instead of __package__. (Thanks Yair Frid.) 226 227- bpo-17140: Add documentation for the 228 :class:`multiprocessing.pool.ThreadPool` class. 229 230Tests 231----- 232 233- bpo-42794: Update test_nntplib to use offical group name of news.aioe.org 234 for testing. Patch by Dong-hee Na. 235 236- bpo-40810: In :mod:`sqlite3`, fix ``CheckTraceCallbackContent`` for SQLite 237 pre 3.7.15. 238 239Build 240----- 241 242- bpo-43174: Windows build now uses ``/utf-8`` compiler option. 243 244- bpo-42692: Fix __builtin_available check on older compilers. Patch by 245 Joshua Root. 246 247- bpo-42604: Now all platforms use a value for the "EXT_SUFFIX" build 248 variable derived from SOABI (for instance in freeBSD, "EXT_SUFFIX" is now 249 ".cpython-310d.so" instead of ".so"). Previosuly only Linux, Mac and 250 VxWorks were using a value for "EXT_SUFFIX" that included "SOABI". 251 252- bpo-42598: Fix implicit function declarations in configure which could 253 have resulted in incorrect configuration checks. Patch contributed by 254 Joshua Root. 255 256- bpo-29076: Add fish shell support to macOS installer. 257 258Windows 259------- 260 261- bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i 262 263- bpo-42584: Upgrade Windows installer to use SQLite 3.34.0. 264 265macOS 266----- 267 268- bpo-42504: Ensure that the value of 269 sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') is always a string, 270 even in when the value is parsable as an integer. 271 272- bpo-42361: Update macOS installer build to use Tcl/Tk 8.6.11 (rc2, 273 expected to be final release). 274 275- bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i. 276 277- bpo-42584: Update macOS installer to use SQLite 3.34.0. 278 279IDLE 280---- 281 282- bpo-43008: Make IDLE invoke :func:`sys.excepthook` in normal, 2-process 283 mode. Patch by Ken Hilton. 284 285- bpo-33065: Fix problem debugging user classes with __repr__ method. 286 287- bpo-23544: Disable Debug=>Stack Viewer when user code is running or 288 Debugger is active, to prevent hang or crash. Patch by Zackery Spytz. 289 290- bpo-32631: Finish zzdummy example extension module: make menu entries 291 work; add docstrings and tests with 100% coverage. 292 293Tools/Demos 294----------- 295 296- bpo-42726: Fixed Python 3 compatibility issue with gdb/libpython.py 297 handling of attribute dictionaries. 298 299- bpo-42613: Fix ``freeze.py`` tool to use the prope config and library 300 directories. Patch by Victor Stinner. 301 302C API 303----- 304 305- bpo-43030: Fixed a compiler warning in :c:func:`Py_UNICODE_ISSPACE()` on 306 platforms with signed ``wchar_t``. 307 308- bpo-42591: Export the :c:func:`Py_FrozenMain` function: fix a Python 3.9.0 309 regression. Python 3.9 uses ``-fvisibility=hidden`` and the function was 310 not exported explicitly and so not exported. 311 312- bpo-40052: Fix an alignment build warning/error in function 313 ``PyVectorcall_Function()``. Patch by Andreas Schneider, Antoine Pitrou 314 and Petr Viktorin. 315 316 317What's New in Python 3.9.1 final? 318================================= 319 320*Release date: 2020-12-07* 321 322Core and Builtins 323----------------- 324 325- bpo-42576: ``types.GenericAlias`` will now raise a ``TypeError`` when 326 attempting to initialize with a keyword argument. Previously, this would 327 cause the interpreter to crash if the interpreter was compiled with debug 328 symbols. This does not affect interpreters compiled for release. Patch by 329 Ken Jin. 330 331Library 332------- 333 334- bpo-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed. 335 Replace the special purpose getallmatchingheaders with generic get_all 336 method and add relevant tests. 337 338 Original Patch by Martin Panter. Modified by Senthil Kumaran. 339 340- bpo-17735: :func:`inspect.findsource` now raises :exc:`OSError` instead of 341 :exc:`IndexError` when :attr:`co_lineno` of a code object is greater than 342 the file length. This can happen, for example, when a file is edited after 343 it was imported. PR by Irit Katriel. 344 345- bpo-42116: Fix handling of trailing comments by :func:`inspect.getsource`. 346 347- bpo-42487: ChainMap.__iter__ no longer calls __getitem__ on underlying 348 maps 349 350- bpo-42482: :class:`~traceback.TracebackException` no longer holds a 351 reference to the exception's traceback object. Consequently, instances of 352 TracebackException for equivalent but non-equal exceptions now compare as 353 equal. 354 355- bpo-42406: We fixed an issue in `pickle.whichmodule` in which importing 356 `multiprocessing` could change the how pickle identifies which module an 357 object belongs to, potentially breaking the unpickling of those objects. 358 359- bpo-34215: Clarify the error message for 360 :exc:`asyncio.IncompleteReadError` when ``expected`` is ``None``. 361 362- bpo-12800: Extracting a symlink from a tarball should succeed and 363 overwrite the symlink if it already exists. The fix is to remove the 364 existing file or symlink before extraction. Based on patch by Chris AtLee, 365 Jeffrey Kintscher, and Senthil Kumaran. 366 367Tests 368----- 369 370- bpo-41473: Reenable test_gdb on gdb 9.2 and newer: 371 https://bugzilla.redhat.com/show_bug.cgi?id=1866884 bug is fixed in gdb 372 10.1. 373 374- bpo-42553: Fix ``test_asyncio.test_call_later()`` race condition: don't 375 measure asyncio performance in the ``call_later()`` unit test. The test 376 failed randomly on the CI. 377 378macOS 379----- 380 381- bpo-41116: If no explicit macOS SDK was specified, setup.py should check 382 for Tcl and TK frameworks in /Library/Frameworks; the previous commit 383 inadvertently broke that test. 384 385- bpo-42504: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11 386 387IDLE 388---- 389 390- bpo-42508: Keep IDLE running on macOS. Remove obsolete workaround that 391 prevented running files with shortcuts when using new universal2 392 installers built on macOS 11. 393 394 395What's New in Python 3.9.1 release candidate 1? 396=============================================== 397 398*Release date: 2020-11-24* 399 400Security 401-------- 402 403- bpo-42103: Prevented potential DoS attack via CPU and RAM exhaustion when 404 processing malformed Apple Property List files in binary format. 405 406- bpo-42051: The :mod:`plistlib` module no longer accepts entity 407 declarations in XML plist files to avoid XML vulnerabilities. This should 408 not affect users as entity declarations are not used in regular plist 409 files. 410 411- bpo-40791: Add ``volatile`` to the accumulator variable in 412 ``hmac.compare_digest``, making constant-time-defeating optimizations less 413 likely. 414 415Core and Builtins 416----------------- 417 418- bpo-41686: On Windows, the ``SIGINT`` event, ``_PyOS_SigintEvent()``, is 419 now created even if Python is configured to not install signal handlers 420 (if :c:member:`PyConfig.install_signal_handlers` equals to 0, or 421 ``Py_InitializeEx(0)``). 422 423- bpo-42381: Allow assignment expressions in set literals and set 424 comprehensions as per PEP 572. Patch by Pablo Galindo. 425 426- bpo-42374: Fix a regression introduced by the new parser, where an 427 unparenthesized walrus operator was not allowed within generator 428 expressions. 429 430- bpo-42296: On Windows, fix a regression in signal handling which prevented 431 to interrupt a program using CTRL+C. The signal handler can be run in a 432 thread different than the Python thread, in which case the test deciding 433 if the thread can handle signals is wrong. 434 435- bpo-42332: :class:`types.GenericAlias` objects can now be the targets of 436 weakrefs. 437 438- bpo-42218: Fixed a bug in the PEG parser that was causing crashes in debug 439 mode. Now errors are checked in left-recursive rules to avoid cases where 440 such errors do not get handled in time and appear as long-distance crashes 441 in other places. 442 443- bpo-42214: Fixed a possible crash in the PEG parser when checking for the 444 '!=' token in the ``barry_as_flufl`` rule. Patch by Pablo Galindo. 445 446- bpo-42143: Fix handling of errors during creation of ``PyFunctionObject``, 447 which resulted in operations on uninitialized memory. Patch by Yonatan 448 Goldschmidt. 449 450- bpo-41659: Fix a bug in the parser, where a curly brace following a 451 `primary` didn't fail immediately. This led to invalid expressions like `a 452 {b}` to throw a :exc:`SyntaxError` with a wrong offset, or invalid 453 expressions ending with a curly brace like `a {` to not fail immediately 454 in the REPL. 455 456- bpo-42150: Fix possible buffer overflow in the new parser when checking 457 for continuation lines. Patch by Pablo Galindo. 458 459- bpo-42123: Run the parser two times. On the first run, disable all the 460 rules that only generate better error messages to gain performance. If 461 there's a parse failure, run the parser a second time with those enabled. 462 463- bpo-42057: Fix peephole optimizer misoptimize conditional jump + 464 JUMP_IF_NOT_EXC_MATCH pair. 465 466- bpo-41984: The garbage collector now tracks all user-defined classes. 467 Patch by Brandt Bucher. 468 469- bpo-41993: Fixed potential issues with removing not completely initialized 470 module from ``sys.modules`` when import fails. 471 472- bpo-41979: Star-unpacking is now allowed for with item's targets in the 473 PEG parser. 474 475- bpo-41909: Fixed stack overflow in :func:`issubclass` and 476 :func:`isinstance` when getting the ``__bases__`` attribute leads to 477 infinite recursion. 478 479- bpo-41894: When loading a native module and a load failure occurs, prevent 480 a possible UnicodeDecodeError when not running in a UTF-8 locale by 481 decoding the load error message using the current locale's encoding. 482 483- bpo-39934: Correctly count control blocks in 'except' in compiler. Ensures 484 that a syntax error, rather a fatal error, occurs for deeply nested, named 485 exception handlers. 486 487Library 488------- 489 490- bpo-42328: Fixed :meth:`tkinter.ttk.Style.map`. The function accepts now 491 the representation of the default state as empty sequence (as returned by 492 ``Style.map()``). The structure of the result is now the same on all 493 platform and does not depend on the value of ``wantobjects``. 494 495- bpo-42345: Fix various issues with ``typing.Literal`` parameter handling 496 (flatten, deduplicate, use type to cache key). Patch provided by Yurii 497 Karabas. 498 499- bpo-42350: Fix the :class:`threading.Thread` class at fork: do nothing if 500 the thread is already stopped (ex: fork called at Python exit). 501 Previously, an error was logged in the child process. 502 503- bpo-42014: The ``onerror`` callback from ``shutil.rmtree`` now receives 504 correct function when ``os.open`` fails. 505 506- bpo-42237: Fix `os.sendfile()` on illumos. 507 508- bpo-42249: Fixed writing binary Plist files larger than 4 GiB. 509 510- bpo-35455: On Solaris, :func:`~time.thread_time` is now implemented with 511 ``gethrvtime()`` because ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` is not 512 always available. Patch by Jakub Kulik. 513 514- bpo-42233: The :func:`repr` of :mod:`typing` types containing 515 :ref:`Generic Alias Types <types-genericalias>` previously did not show 516 the parameterized types in the ``GenericAlias``. They have now been 517 changed to do so. 518 519- bpo-41754: webbrowser: Ignore *NotADirectoryError* when calling 520 ``xdg-settings``. 521 522- bpo-29566: ``binhex.binhex()`` consisently writes macOS 9 line endings. 523 524- bpo-42183: Fix a stack overflow error for asyncio Task or Future repr(). 525 526 The overflow occurs under some circumstances when a Task or Future 527 recursively returns itself. 528 529- bpo-42146: Fix memory leak in :func:`subprocess.Popen` in case an uid 530 (gid) specified in `user` (`group`, `extra_groups`) overflows `uid_t` 531 (`gid_t`). 532 533- bpo-42140: Improve asyncio.wait function to create the futures set just 534 one time. 535 536- bpo-42103: :exc:`~plistlib.InvalidFileException` and :exc:`RecursionError` 537 are now the only errors caused by loading malformed binary Plist file 538 (previously ValueError and TypeError could be raised in some specific 539 cases). 540 541- bpo-41052: Pickling heap types implemented in C with protocols 0 and 1 542 raises now an error instead of producing incorrect data. 543 544- bpo-41491: plistlib: fix parsing XML plists with hexadecimal integer 545 values 546 547- bpo-42065: Fix an incorrectly formatted error from 548 :meth:`_codecs.charmap_decode` when called with a mapped value outside the 549 range of valid Unicode code points. PR by Max Bernstein. 550 551- bpo-41966: Fix pickling pure Python :class:`datetime.time` subclasses. 552 Patch by Dean Inwood. 553 554- bpo-41976: Fixed a bug that was causing :func:`ctypes.util.find_library` 555 to return ``None`` when triying to locate a library in an environment when 556 gcc>=9 is available and ``ldconfig`` is not. Patch by Pablo Galindo 557 558- bpo-41900: C14N 2.0 serialisation in xml.etree.ElementTree failed for 559 unprefixed attributes when a default namespace was defined. 560 561- bpo-41840: Fix a bug in the :mod:`symtable` module that was causing 562 module-scope global variables to not be reported as both local and global. 563 Patch by Pablo Galindo. 564 565- bpo-41831: ``str()`` for the ``type`` attribute of the ``tkinter.Event`` 566 object always returns now the numeric code returned by Tk instead of the 567 name of the event type. 568 569- bpo-41817: fix `tkinter.EventType` Enum so all members are strings, and 570 none are tuples 571 572- bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch 573 contributed by Peter David McCormick. 574 575- bpo-41316: Fix the :mod:`tarfile` module to write only basename of TAR 576 file to GZIP compression header. 577 578- bpo-16396: Allow ``ctypes.wintypes`` to be imported on non-Windows 579 systems. 580 581- bpo-40592: :func:`shutil.which` now ignores empty entries in 582 :envvar:`PATHEXT` instead of treating them as a match. 583 584- bpo-40550: Fix time-of-check/time-of-action issue in 585 subprocess.Popen.send_signal. 586 587- bpo-40492: Fix ``--outfile`` for :mod:`cProfile` / :mod:`profile` not 588 writing the output file in the original directory when the program being 589 profiled changes the working directory. PR by Anthony Sottile. 590 591- bpo-40105: ZipFile truncates files to avoid corruption when a shorter 592 comment is provided in append ("a") mode. Patch by Jan Mazur. 593 594- bpo-27321: Fixed KeyError exception when flattening an email to a string 595 attempts to replace a non-existent Content-Transfer-Encoding header. 596 597Documentation 598------------- 599 600- bpo-42153: Fix the URL for the IMAP protocol documents. 601 602- bpo-42061: Document __format__ functionality for IP addresses. 603 604- bpo-41910: Document the default implementation of `object.__eq__`. 605 606- bpo-42010: Clarify that subscription expressions are also valid for 607 certain :term:`classes <class>` and :term:`types <type>` in the standard 608 library, and for user-defined classes and types if the classmethod 609 :meth:`__class_getitem__` is provided. 610 611- bpo-41805: Documented :ref:`generic alias type <types-genericalias>` and 612 :data:`types.GenericAlias`. Also added an entry in glossary for 613 :term:`generic types <generic type>`. 614 615- bpo-41774: In Programming FAQ "Sequences (Tuples/Lists)" section, add "How 616 do you remove multiple items from a list". 617 618- bpo-35293: Fix RemovedInSphinx40Warning when building the documentation. 619 Patch by Dong-hee Na. 620 621- bpo-41726: Update the refcounts info of ``PyType_FromModuleAndSpec``. 622 623- bpo-39693: Fix tarfile's extractfile documentation 624 625- bpo-39416: Document some restrictions on the default string 626 representations of numeric classes. 627 628Tests 629----- 630 631- bpo-40754: Include ``_testinternalcapi`` module in Windows installer for 632 test suite 633 634- bpo-41739: Fix test_logging.test_race_between_set_target_and_flush(): the 635 test now waits until all threads complete to avoid leaking running 636 threads. 637 638- bpo-41970: Avoid a test failure in ``test_lib2to3`` if the module has 639 already imported at the time the test executes. Patch by Pablo Galindo. 640 641- bpo-41944: Tests for CJK codecs no longer call ``eval()`` on content 642 received via HTTP. 643 644- bpo-41939: Fix test_site.test_license_exists_at_url(): call 645 ``urllib.request.urlcleanup()`` to reset the global 646 ``urllib.request._opener``. Patch by Victor Stinner. 647 648- bpo-41561: test_ssl: skip test_min_max_version_mismatch when TLS 1.0 is 649 not available 650 651- bpo-41602: Add tests for SIGINT handling in the runpy module. 652 653- bpo-41306: Fixed a failure in ``test_tk.test_widgets.ScaleTest`` happening 654 when executing the test with Tk 8.6.10. 655 656Build 657----- 658 659- bpo-42398: Fix a race condition in "make regen-all" when make -jN option 660 is used to run jobs in parallel. The clinic.py script now only use atomic 661 write to write files. Moveover, generated files are now left unchanged if 662 the content does not change, to not change the file modification time. 663 664- bpo-41617: Fix building ``pycore_bitutils.h`` internal header on old clang 665 version without ``__builtin_bswap16()`` (ex: Xcode 4.6.3 on Mac OS X 666 10.7). Patch by Joshua Root and Victor Stinner. 667 668- bpo-38249: Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable() 669 if only the compiler is able to use it. Patch by Dong-hee Na. 670 671- bpo-40998: Addressed three compiler warnings found by undefined behavior 672 sanitizer (ubsan). 673 674Windows 675------- 676 677- bpo-42120: Remove macro definition of ``copysign`` (to ``_copysign``) in 678 headers. 679 680- bpo-38439: Updates the icons for IDLE in the Windows Store package. 681 682- bpo-41744: Fixes automatic import of props file when using the Nuget 683 package. 684 685- bpo-41557: Update Windows installer to use SQLite 3.33.0. 686 687- bpo-38324: Avoid Unicode errors when accessing certain locale data on 688 Windows. 689 690macOS 691----- 692 693- bpo-41116: Ensure distutils.unixxcompiler.find_library_file can find 694 system provided libraries on macOS 11. 695 696- bpo-41100: Add support for macOS 11 and Apple Silicon systems. 697 698 It is now possible to build "Universal 2" binaries using 699 "--enable-universalsdk --with-universal-archs=universal2". 700 701 Binaries build on later macOS versions can be deployed back to older 702 versions (tested up to macOS 10.9), when using the correct deployment 703 target. This is tested using Xcode 11 and later. 704 705- bpo-38443: The ``--enable-universalsdk`` and ``--with-universal-archs`` 706 options for the configure script now check that the specified 707 architectures can be used. 708 709- bpo-41471: Ignore invalid prefix lengths in system proxy excludes. 710 711- bpo-41557: Update macOS installer to use SQLite 3.33.0. 712 713IDLE 714---- 715 716- bpo-42426: Fix reporting offset of the RE error in searchengine. 717 718- bpo-42415: Get docstrings for IDLE calltips more often by using 719 inspect.getdoc. 720 721- bpo-33987: Mostly finish using ttk widgets, mainly for editor, settings, 722 and searches. Some patches by Mark Roseman. 723 724- bpo-41775: Use 'IDLE Shell' as shell title 725 726- bpo-35764: Rewrite the Calltips doc section. 727 728- bpo-40181: In calltips, stop reminding that '/' marks the end of 729 positional-only arguments. 730 731- bpo-40511: Typing opening and closing parentheses inside the parentheses 732 of a function call will no longer cause unnecessary "flashing" off and on 733 of an existing open call-tip, e.g. when typed in a string literal. 734 735- bpo-38439: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created 736 by Andrew Clover. Remove the low-color gif variations from the .ico file. 737 738C API 739----- 740 741- bpo-42015: Fix potential crash in deallocating method objects when 742 dynamically allocated `PyMethodDef`'s lifetime is managed through the 743 ``self`` argument of a `PyCFunction`. 744 745- bpo-41986: :c:data:`Py_FileSystemDefaultEncodeErrors` and 746 :c:data:`Py_UTF8Mode` are available again in limited API. 747 748 749What's New in Python 3.9.0 final? 750================================= 751 752*Release date: 2020-10-04* 753 754Library 755------- 756 757- bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch 758 contributed by Peter David McCormick. 759 760- bpo-41662: No longer override exceptions raised in ``__len__()`` of a 761 sequence of parameters in :mod:`sqlite3` with 762 :exc:`~sqlite3.ProgrammingError`. 763 764- bpo-41662: Fixed crash when mutate list of parameters during iteration in 765 :mod:`sqlite3`. 766 767- bpo-39728: fix default `_missing_` so a duplicate `ValueError` is not set 768 as the `__context__` of the original `ValueError` 769 770Tests 771----- 772 773- bpo-41602: Add tests for SIGINT handling in the runpy module. 774 775Build 776----- 777 778- bpo-38249: Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable() 779 if only the compiler is able to use it. Patch by Dong-hee Na. 780 781 782What's New in Python 3.9.0 release candidate 2? 783=============================================== 784 785*Release date: 2020-09-16* 786 787Core and Builtins 788----------------- 789 790- bpo-41780: Fix :meth:`__dir__` of :class:`types.GenericAlias`. Patch by 791 Batuhan Taskaya. 792 793- bpo-41690: Fix a possible stack overflow in the parser when parsing 794 functions and classes with a huge ammount of arguments. Patch by Pablo 795 Galindo. 796 797- bpo-41681: Fixes the wrong error description in the error raised by using 798 2 `,` in format string in f-string and :meth:`str.format`. 799 800- bpo-41654: Fix a crash that occurred when destroying subclasses of 801 :class:`MemoryError`. Patch by Pablo Galindo. 802 803- bpo-41631: The ``_ast`` module uses again a global state. Using a module 804 state per module instance is causing subtle practical problems. For 805 example, the Mercurial project replaces the ``__import__()`` function to 806 implement lazy import, whereas Python expected that ``import _ast`` always 807 return a fully initialized ``_ast`` module. 808 809- bpo-41533: Free the stack allocated in ``va_build_stack`` if 810 ``do_mkstack`` fails and the stack is not a ``small_stack``. 811 812- bpo-41531: Fix a bug that was dropping keys when compiling dict literals 813 with more than 0xFFFF elements. Patch by Pablo Galindo. 814 815- bpo-41525: The output of ``python --help`` contains now only ASCII 816 characters. 817 818- bpo-29590: Make the stack trace correct after calling 819 :meth:`generator.throw` on a generator that has yielded from a ``yield 820 from``. 821 822Library 823------- 824 825- bpo-41517: fix bug allowing Enums to be extended via multiple inheritance 826 827- bpo-39587: use the correct mix-in data type when constructing Enums 828 829- bpo-41789: Honor `object` overrides in `Enum` class creation 830 (specifically, `__str__`, `__repr__`, `__format__`, and `__reduce_ex__`). 831 832- bpo-39651: Fix a race condition in the ``call_soon_threadsafe()`` method 833 of ``asyncio.ProactorEventLoop``: do nothing if the self-pipe socket has 834 been closed. 835 836- bpo-41720: Fixed :meth:`turtle.Vec2D.__rmul__` for arguments which are not 837 int or float. 838 839- bpo-41696: Fix handling of debug mode in :func:`asyncio.run`. This allows 840 setting ``PYTHONASYNCIODEBUG`` or ``-X dev`` to enable asyncio debug mode 841 when using :func:`asyncio.run`. 842 843- bpo-41687: Fix implementation of sendfile to be compatible with Solaris. 844 845- bpo-39010: Restarting a ``ProactorEventLoop`` on Windows no longer logs 846 spurious ``ConnectionResetErrors``. 847 848- bpo-41609: The pdb whatis command correctly reports instance methods as 849 'Method' rather than 'Function'. 850 851- bpo-32751: When cancelling the task due to a timeout, 852 :meth:`asyncio.wait_for` will now wait until the cancellation is complete 853 also in the case when *timeout* is <= 0, like it does with positive 854 timeouts. 855 856- bpo-37658: :meth:`asyncio.wait_for` now properly handles races between 857 cancellation of itself and the completion of the wrapped awaitable. 858 859- bpo-40782: Change the method asyncio.AbstractEventLoop.run_in_executor to 860 not be a coroutine. 861 862- bpo-41520: Fix :mod:`codeop` regression that prevented turning compile 863 warnings into errors. 864 865- bpo-41503: Fixed a race between setTarget and flush in 866 logging.handlers.MemoryHandler. 867 868- bpo-41344: Prevent creating :class:`shared_memory.SharedMemory` objects 869 with :code:`size=0`. 870 871- bpo-41025: Fixed an issue preventing the C implementation of 872 :class:`zoneinfo.ZoneInfo` from being subclassed. 873 874- bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than 875 OSError when peer closes connection during TLS negotiation 876 877- bpo-33660: Fix pathlib.PosixPath to resolve a relative path located on the 878 root directory properly. 879 880Documentation 881------------- 882 883- bpo-37149: Change Shipman tkinter doc link from archive.org to TkDocs. 884 (The doc has been removed from the NMT server.) The new link responds 885 much faster and includes a short explanatory note. 886 887- bpo-41624: Fix the signature of :class:`typing.Coroutine`. 888 889- bpo-40204: Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable 890 ``c_warn_on_allowed_pre_v3`` option to make the documentation compatible 891 with Sphinx 2 and Sphinx 3. 892 893- bpo-40979: Refactored typing.rst, arranging more than 70 classes, 894 functions, and decorators into new sub-sections. 895 896- bpo-39883: Make code, examples, and recipes in the Python documentation be 897 licensed under the more permissive BSD0 license in addition to the 898 existing Python 2.0 license. 899 900Tests 901----- 902 903- bpo-41731: Make test_cmd_line_script pass with option '-vv'. 904 905Build 906----- 907 908- bpo-41617: Fix ``pycore_byteswap.h`` header file to support old clang 909 versions: ``__builtin_bswap16()`` is not available in LLVM clang 3.0. 910 911Windows 912------- 913 914- bpo-41526: Fixed layout of final page of the installer by removing the 915 special thanks to Mark Hammond (with his permission). 916 917C API 918----- 919 920- bpo-41524: Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented 921 pointers beyond the end of a string. 922 923 924What's New in Python 3.9.0 release candidate 1? 925=============================================== 926 927*Release date: 2020-08-11* 928 929Core and Builtins 930----------------- 931 932- bpo-38156: Handle interrupts that come after EOF correctly in 933 ``PyOS_StdioReadline``. 934 935Library 936------- 937 938- bpo-41497: Fix potential UnicodeDecodeError in dis module. 939 940- bpo-41490: Update :mod:`ensurepip` to install pip 20.2.1 and setuptools 941 49.2.1. 942 943- bpo-41467: On Windows, fix asyncio ``recv_into()`` return value when the 944 socket/pipe is closed (:exc:`BrokenPipeError`): return ``0`` rather than 945 an empty byte string (``b''``). 946 947- bpo-41425: Make tkinter doc example runnable. 948 949- bpo-41384: Raise TclError instead of TypeError when an unknown option is 950 passed to tkinter.OptionMenu. 951 952- bpo-38731: Fix :exc:`NameError` in command-line interface of 953 :mod:`py_compile`. 954 955- bpo-41317: Use add_done_callback() in asyncio.loop.sock_accept() to 956 unsubscribe reader early on cancellation. 957 958- bpo-41364: Reduce import overhead of :mod:`uuid`. 959 960- bpo-41341: Recursive evaluation of `typing.ForwardRef` in 961 `get_type_hints`. 962 963- bpo-41182: selector: use DefaultSelector based upon implementation 964 965- bpo-40726: Handle cases where the ``end_lineno`` is ``None`` on 966 :func:`ast.increment_lineno`. 967 968Documentation 969------------- 970 971- bpo-41045: Add documentation for debug feature of f-strings. 972 973- bpo-41314: Changed the release when ``from __future__ import annotations`` 974 becomes the default from ``4.0`` to ``3.10`` (following a change in PEP 975 563). 976 977Windows 978------- 979 980- bpo-41492: Fixes the description that appears in UAC prompts. 981 982- bpo-40948: Improve post-install message to direct people to the "py" 983 command. 984 985- bpo-41412: The installer will now fail to install on Windows 7 and Windows 986 8. Further, the UCRT dependency is now always downloaded on demand. 987 988- bpo-40741: Update Windows release to include SQLite 3.32.3. 989 990IDLE 991---- 992 993- bpo-41468: Improve IDLE run crash error message (which users should never 994 see). 995 996- bpo-41373: Save files loaded with no line ending, as when blank, or 997 different line endings, by setting its line ending to the system default. 998 Fix regression in 3.8.4 and 3.9.0b4. 999 1000 1001What's New in Python 3.9.0 beta 5? 1002================================== 1003 1004*Release date: 2020-07-20* 1005 1006Security 1007-------- 1008 1009- bpo-41304: Fixes `python3x._pth` being ignored on Windows, caused by the 1010 fix for :issue:`29778` (CVE-2020-15801). 1011 1012- bpo-41162: Audit hooks are now cleared later during finalization to avoid 1013 missing events. 1014 1015- bpo-29778: Ensure :file:`python3.dll` is loaded from correct locations 1016 when Python is embedded (CVE-2020-15523). 1017 1018- bpo-39603: Prevent http header injection by rejecting control characters 1019 in http.client.putrequest(...). 1020 1021Core and Builtins 1022----------------- 1023 1024- bpo-41295: Resolve a regression in CPython 3.8.4 where defining 1025 "__setattr__" in a multi-inheritance setup and calling up the hierarchy 1026 chain could fail if builtins/extension types were involved in the base 1027 types. 1028 1029- bpo-41247: Always cache the running loop holder when running 1030 ``asyncio.set_running_loop``. 1031 1032- bpo-41252: Fix incorrect refcounting in _ssl.c's 1033 ``_servername_callback()``. 1034 1035- bpo-41215: Use non-NULL default values in the PEG parser keyword list to 1036 overcome a bug that was preventing Python from being properly compiled 1037 when using the XLC compiler. Patch by Pablo Galindo. 1038 1039- bpo-41218: Python 3.8.3 had a regression where compiling with 1040 ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension 1041 with CO_COROUTINE. Now only list comprehension making use of async/await 1042 will tagged as so. 1043 1044- bpo-41175: Guard against a NULL pointer dereference within bytearrayobject 1045 triggered by the ``bytearray() + bytearray()`` operation. 1046 1047- bpo-39960: The "hackcheck" that prevents sneaking around a type's 1048 __setattr__() by calling the superclass method was rewritten to allow C 1049 implemented heap types. 1050 1051Library 1052------- 1053 1054- bpo-41288: Unpickling invalid NEWOBJ_EX opcode with the C implementation 1055 raises now UnpicklingError instead of crashing. 1056 1057- bpo-39017: Avoid infinite loop when reading specially crafted TAR files 1058 using the tarfile module (CVE-2019-20907). 1059 1060- bpo-41235: Fix the error handling in 1061 :meth:`ssl.SSLContext.load_dh_params`. 1062 1063- bpo-41207: In distutils.spawn, restore expectation that DistutilsExecError 1064 is raised when the command is not found. 1065 1066- bpo-39168: Remove the ``__new__`` method of :class:`typing.Generic`. 1067 1068- bpo-41194: Fix a crash in the ``_ast`` module: it can no longer be loaded 1069 more than once. It now uses a global state rather than a module state. 1070 1071- bpo-39384: Fixed email.contentmanager to allow set_content() to set a null 1072 string. 1073 1074Documentation 1075------------- 1076 1077- bpo-37703: Updated Documentation to comprehensively elaborate on the 1078 behaviour of gather.cancel() 1079 1080macOS 1081----- 1082 1083- bpo-40741: Update macOS installer to use SQLite 3.32.3. 1084 1085IDLE 1086---- 1087 1088- bpo-41300: Save files with non-ascii chars. Fix regression released in 1089 3.9.0b4 and 3.8.4. 1090 1091- bpo-37765: Add keywords to module name completion list. Rewrite 1092 Completions section of IDLE doc. 1093 1094C API 1095----- 1096 1097- bpo-40170: Revert :c:func:`PyType_HasFeature` change: it reads again 1098 directly the :c:member:`PyTypeObject.tp_flags` member when the limited C 1099 API is not used, rather than always calling :c:func:`PyType_GetFlags` 1100 which hides implementation details. 1101 1102 1103What's New in Python 3.9.0 beta 4? 1104================================== 1105 1106*Release date: 2020-07-02* 1107 1108Security 1109-------- 1110 1111- bpo-41004: The __hash__() methods of ipaddress.IPv4Interface and 1112 ipaddress.IPv6Interface incorrectly generated constant hash values of 32 1113 and 128 respectively. This resulted in always causing hash collisions. The 1114 fix uses hash() to generate hash values for the tuple of (address, mask 1115 length, network address). 1116 1117Core and Builtins 1118----------------- 1119 1120- bpo-41094: Fix decoding errors with audit when open files with non-ASCII 1121 names on non-UTF-8 locale. 1122 1123- bpo-41084: Prefix the error message with 'f-string: ', when parsing an 1124 f-string expression which throws a :exc:`SyntaxError`. 1125 1126- bpo-41076: Pre-feed the parser with the location of the f-string 1127 expression, not the f-string itself, which allows us to skip the shifting 1128 of the AST node locations after the parsing is completed. 1129 1130- bpo-40939: Deprecate :c:func:`PyNode_Compile`. 1131 1132- bpo-41056: Fixes a reference to deallocated stack space during startup 1133 when constructing sys.path involving a relative symlink when code was 1134 supplied via -c. (discovered via Coverity) 1135 1136- bpo-41061: Fix incorrect expressions and asserts in hashtable code and 1137 tests. 1138 1139- bpo-41052: Opt out serialization/deserialization for _random.Random 1140 1141- bpo-40939: Deprecate :c:func:`PyParser_SimpleParseStringFlags`, 1142 :c:func:`PyParser_SimpleParseStringFlagsFilename` and 1143 :c:func:`PyParser_SimpleParseFileFlags`. 1144 1145- bpo-35975: Stefan Behnel reported that cf_feature_version is used even 1146 when PyCF_ONLY_AST is not set. This is against the intention and against 1147 the documented behavior, so it's been fixed. 1148 1149- bpo-40985: Fix a bug that caused the :exc:`SyntaxError` text to be empty 1150 when a file ends with a line ending in a line continuation character (i.e. 1151 backslash). The error text should contain the text of the last line. 1152 1153- bpo-40958: Fix a possible buffer overflow in the PEG parser when gathering 1154 information for emitting syntax errors. Patch by Pablo Galindo. 1155 1156- bpo-40957: Fix refleak in _Py_fopen_obj() when PySys_Audit() fails 1157 1158- bpo-40947: The Python :ref:`Path Configuration <init-path-config>` now 1159 takes :c:member:`PyConfig.platlibdir` in account. 1160 1161- bpo-40847: Fix a bug where a line with only a line continuation character 1162 is not considered a blank line at tokenizer level. In such cases, more 1163 than a single `NEWLINE` token was emitted. The old parser was working 1164 around the issue, but the new parser threw a :exc:`SyntaxError` for valid 1165 input due to this. For example, an empty line following a line 1166 continuation character was interpreted as a :exc:`SyntaxError`. 1167 1168- bpo-40824: Unexpected errors in calling the ``__iter__`` method are no 1169 longer masked by ``TypeError`` in the :keyword:`in` operator and functions 1170 :func:`~operator.contains`, :func:`~operator.indexOf` and 1171 :func:`~operator.countOf` of the :mod:`operator` module. 1172 1173- bpo-19569: Add the private macros ``_Py_COMP_DIAG_PUSH``, 1174 ``_Py_COMP_DIAG_IGNORE_DEPR_DECLS``, and ``_Py_COMP_DIAG_POP``. 1175 1176Library 1177------- 1178 1179- bpo-41193: The ``write_history()`` atexit function of the readline 1180 completer now ignores any :exc:`OSError` to ignore error if the filesystem 1181 is read-only, instead of only ignoring :exc:`FileNotFoundError` and 1182 :exc:`PermissionError`. 1183 1184- bpo-41161: The decimal module now requires libmpdec-2.5.0. Users of 1185 --with-system-libmpdec should update their system library. 1186 1187- bpo-40874: The decimal module now requires libmpdec-2.5.0. 1188 1189- bpo-41138: Fixed the :mod:`trace` module CLI for Python source files with 1190 non-UTF-8 encoding. 1191 1192- bpo-31938: Fix default-value signatures of several functions in the 1193 :mod:`select` module - by Anthony Sottile. 1194 1195- bpo-41068: Fixed reading files with non-ASCII names from ZIP archive 1196 directly after writing them. 1197 1198- bpo-41058: :func:`pdb.find_function` now correctly determines the source 1199 file encoding. 1200 1201- bpo-41056: Fix a NULL pointer dereference within the ssl module during a 1202 MemoryError in the keylog callback. (discovered by Coverity) 1203 1204- bpo-41056: Fixed an instance where a MemoryError within the zoneinfo 1205 module might not be reported or not reported at its source. (found by 1206 Coverity) 1207 1208- bpo-41048: :func:`mimetypes.read_mime_types` function reads the rule file 1209 using UTF-8 encoding, not the locale encoding. Patch by Srinivas Reddy 1210 Thatiparthy. 1211 1212- bpo-41043: Fixed the use of :func:`~glob.glob` in the stdlib: literal part 1213 of the path is now always correctly escaped. 1214 1215- bpo-40448: :mod:`ensurepip` now disables the use of `pip` cache when 1216 installing the bundled versions of `pip` and `setuptools`. Patch by 1217 Krzysztof Konopko. 1218 1219- bpo-40967: Removed :meth:`asyncio.Task.current_task` and 1220 :meth:`asyncio.Task.all_tasks`. Patch contributed by Rémi Lapeyre. 1221 1222- bpo-40955: Fix a minor memory leak in :mod:`subprocess` module when 1223 extra_groups was specified. 1224 1225- bpo-40855: The standard deviation and variance functions in the statistics 1226 module were ignoring their mu and xbar arguments. 1227 1228- bpo-40924: Removed support for loaders implementing .files and supplying 1229 TraversableResources. 1230 1231- bpo-40939: Use the new PEG parser when generating the stdlib 1232 :mod:`keyword` module. 1233 1234- bpo-40834: Fix truncate when sending str object 1235 with_xxsubinterpreters.channel_send. 1236 1237- bpo-26407: Unexpected errors in calling the ``__iter__`` method are no 1238 longer masked by ``TypeError`` in :func:`csv.reader`, 1239 :func:`csv.writer.writerow` and :meth:`csv.writer.writerows`. 1240 1241- bpo-38488: Update ensurepip to install pip 20.1.1 and setuptools 47.1.0. 1242 1243- bpo-36543: Restored the deprecated :mod:`xml.etree.cElementTree` module. 1244 1245- bpo-34226: Fix `cgi.parse_multipart` without content_length. Patch by 1246 Roger Duran 1247 1248Tests 1249----- 1250 1251- bpo-41085: Fix integer overflow in the :meth:`array.array.index` method on 1252 64-bit Windows for index larger than ``2**31``. 1253 1254- bpo-41069: :data:`test.support.TESTFN` and the current directory for tests 1255 when run via ``test.regrtest`` contain now non-ascii characters if 1256 possible. 1257 1258- bpo-38377: On Linux, skip tests using multiprocessing if the current user 1259 cannot create a file in ``/dev/shm/`` directory. Add the 1260 :func:`~test.support.skip_if_broken_multiprocessing_synchronize` function 1261 to the :mod:`test.support` module. 1262 1263- bpo-41009: Fix use of ``support.require_{linux|mac|freebsd}_version()`` 1264 decorators as class decorator. 1265 1266- bpo-41003: Fix ``test_copyreg`` when ``numpy`` is installed: 1267 ``test.pickletester`` now saves/restores warnings filters when importing 1268 ``numpy``, to ignore filters installed by ``numpy``. 1269 1270- bpo-40964: Disable remote :mod:`imaplib` tests, host cyrus.andrew.cmu.edu 1271 is blocking incoming connections. 1272 1273- bpo-40927: Fix test_binhex when run twice: it now uses 1274 import_fresh_module() to ensure that it raises DeprecationWarning each 1275 time. 1276 1277- bpo-34401: Make test_gdb properly run on HP-UX. Patch by Michael Osipov. 1278 1279Build 1280----- 1281 1282- bpo-40204: Pin Sphinx version to 2.3.1 in ``Doc/Makefile``. 1283 1284Windows 1285------- 1286 1287- bpo-41074: Fixed support of non-ASCII names in functions 1288 :func:`msilib.OpenDatabase` and :func:`msilib.init_database` and non-ASCII 1289 SQL in method :meth:`msilib.Database.OpenView`. 1290 1291- bpo-40164: Updates Windows OpenSSL to 1.1.1g 1292 1293- bpo-37556: Extend py.exe help to mention overrides via venv, shebang, 1294 environmental variables & ini files. 1295 1296macOS 1297----- 1298 1299- bpo-39580: Avoid opening Finder window if running installer from the 1300 command line. Patch contributed by Rick Heil. 1301 1302- bpo-41100: Fix configure error when building on macOS 11. Note that the 1303 current Python release was released shortly after the first developer 1304 preview of macOS 11 (Big Sur); there are other known issues with building 1305 and running on the developer preview. Big Sur is expected to be fully 1306 supported in a future bugfix release of Python 3.8.x and with 3.9.0. 1307 1308- bpo-41005: fixed an XDG settings issue not allowing macos to open browser 1309 in webbrowser.py 1310 1311IDLE 1312---- 1313 1314- bpo-41152: The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is 1315 now always UTF-8. 1316 1317- bpo-41144: Make Open Module open a special module such as os.path. 1318 1319C API 1320----- 1321 1322- bpo-36346: Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, 1323 ``PyUnicode_WSTR_LENGTH``, ``PyUnicode_FromUnicode``, 1324 ``PyUnicode_AsUnicode``, ``_PyUnicode_AsUnicode``, and 1325 ``PyUnicode_AsUnicodeAndSize`` as deprecated in C. Remove 1326 ``Py_UNICODE_MATCH`` which was deprecated and broken since Python 3.3. 1327 1328- bpo-36020: On Windows, ``#include "pyerrors.h"`` no longer defines 1329 ``snprintf`` and ``vsnprintf`` macros. 1330 1331- bpo-40703: The PyType_FromSpec*() functions no longer overwrite the type's 1332 "__module__" attribute if it is set via "Py_tp_members" or "Py_tp_getset". 1333 1334 1335What's New in Python 3.9.0 beta 3? 1336================================== 1337 1338*Release date: 2020-06-09* 1339 1340Library 1341------- 1342 1343- bpo-40924: `importlib.resources`: Reverted ``TraversableResources`` 1344 implementations from the built-in loaders (SourceFileLoader and 1345 ZipImporter) as it was an incompatible change introduced in 3.9.0 beta 2 1346 causing through a chain of events for root TLS certificates to be missing. 1347 1348Build 1349----- 1350 1351- bpo-40684: ``make install`` now uses the ``PLATLIBDIR`` variable for the 1352 destination ``lib-dynload/`` directory when ``./configure 1353 --with-platlibdir`` is used. 1354 1355 1356What's New in Python 3.9.0 beta 2? 1357================================== 1358 1359*Release date: 2020-06-08* 1360 1361Core and Builtins 1362----------------- 1363 1364- bpo-40904: Fix possible segfault in the new PEG parser when parsing 1365 f-string containing yield statements with no value (:code:`f"{yield}"`). 1366 Patch by Pablo Galindo 1367 1368- bpo-40903: Fixed a possible segfault in the new PEG parser when producing 1369 error messages for invalid assignments of the form :code:`p=p=`. Patch by 1370 Pablo Galindo 1371 1372- bpo-40880: Fix invalid memory read in the new parser when checking 1373 newlines in string literals. Patch by Pablo Galindo. 1374 1375- bpo-40883: Fix memory leak in when parsing f-strings in the new parser. 1376 Patch by Pablo Galindo 1377 1378- bpo-40870: Raise :exc:`ValueError` when validating custom AST's where the 1379 constants ``True``, ``False`` and ``None`` are used within a 1380 :class:`ast.Name` node. 1381 1382- bpo-40854: Allow overriding :data:`sys.platlibdir` via a new 1383 :envvar:`PYTHONPLATLIBDIR` environment variable. 1384 1385- bpo-40826: Fix GIL usage in :c:func:`PyOS_Readline`: lock the GIL to set 1386 an exception and pass the Python thread state when checking if there is a 1387 pending signal. 1388 1389- bpo-40780: Fix a corner case where g-style string formatting of a float 1390 failed to remove trailing zeros. 1391 1392- bpo-38964: When there's a :exc:`SyntaxError` in the expression part of an 1393 fstring, the filename attribute of the :exc:`SyntaxError` gets correctly 1394 set to the name of the file the fstring resides in. 1395 1396- bpo-40750: Support the "-d" debug flag in the new PEG parser. Patch by 1397 Pablo Galindo 1398 1399- bpo-40217: Instances of types created with 1400 :c:func:`PyType_FromSpecWithBases` will no longer automatically visit 1401 their class object when traversing references in the garbage collector. 1402 The user is expected to manually visit the object's class. Patch by Pablo 1403 Galindo. 1404 1405- bpo-40696: Fix a hang that can arise after :meth:`generator.throw` due to 1406 a cycle in the exception context chain. 1407 1408Library 1409------- 1410 1411- bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. 1412 1413- bpo-40807: Stop codeop._maybe_compile, used by code.InteractiveInterpreter 1414 (and IDLE). from from emitting each warning three times. 1415 1416- bpo-39791: Built-in loaders (SourceFileLoader and ZipImporter) now supply 1417 ``TraversableResources`` implementations for ``ResourceReader``, and the 1418 fallback function has been removed. 1419 1420- bpo-17005: The topological sort functionality that was introduced 1421 initially in the :mod:`functools` module has been moved to a new 1422 :mod:`graphlib` module to better accommodate the new tools and keep the 1423 original scope of the :mod:`functools` module. Patch by Pablo Galindo 1424 1425- bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time 1426 to avoid errors on some compilers. 1427 1428- bpo-40767: :mod:`webbrowser` now properly finds the default browser in 1429 pure Wayland systems by checking the WAYLAND_DISPLAY environment variable. 1430 Patch contributed by Jérémy Attali. 1431 1432- bpo-40791: :func:`hashlib.compare_digest` uses OpenSSL's 1433 ``CRYPTO_memcmp()`` function when OpenSSL is available. 1434 1435- bpo-40795: :mod:`ctypes` module: If ctypes fails to convert the result of 1436 a callback or if a ctypes callback function raises an exception, 1437 sys.unraisablehook is now called with an exception set. Previously, the 1438 error was logged into stderr by :c:func:`PyErr_Print`. 1439 1440- bpo-30008: Fix :mod:`ssl` code to be compatible with OpenSSL 1.1.x builds 1441 that use ``no-deprecated`` and ``--api=1.1.0``. 1442 1443- bpo-30064: Fix asyncio ``loop.sock_*`` race condition issue 1444 1445- bpo-40759: Deprecate the :mod:`symbol` module. 1446 1447- bpo-40737: Fix possible reference leak for :mod:`sqlite3` initialization. 1448 1449- bpo-40698: :mod:`distutils` upload creates SHA2-256 and Blake2b-256 1450 digests. MD5 digests is skipped if platform blocks MD5. 1451 1452- bpo-40695: :mod:`hashlib` no longer falls back to builtin hash 1453 implementations when OpenSSL provides a hash digest and the algorithm is 1454 blocked by security policy. 1455 1456- bpo-9216: func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP 1457 constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle 1458 strict security policy better. 1459 1460- bpo-40614: :func:`ast.parse` will not parse self documenting expressions 1461 in f-strings when passed ``feature_version`` is less than ``(3, 8)``. 1462 1463- bpo-40671: Prepare ``_hashlib`` for :pep:`489` and use 1464 :c:func:`PyModule_AddType`. 1465 1466- bpo-32309: Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is 1467 mainly used for running IO-bound functions in a separate thread to avoid 1468 blocking the event loop, and essentially works as a high-level version of 1469 :meth:`~asyncio.loop.run_in_executor` that can directly take keyword 1470 arguments. 1471 1472- bpo-40630: Added :func:`tracemalloc.reset_peak` to set the peak size of 1473 traced memory blocks to the current size, to measure the peak of specific 1474 pieces of code. 1475 1476- bpo-13097: ``ctypes`` now raises an ``ArgumentError`` when a callback is 1477 invoked with more than 1024 arguments. 1478 1479- bpo-23082: Updated the error message and docs of PurePath.relative_to() to 1480 better reflect the function behaviour. 1481 1482- bpo-39244: Fixed :class:`multiprocessing.context.get_all_start_methods` to 1483 properly return the default method first on macOS. 1484 1485- bpo-39040: Fix parsing of invalid mime headers parameters by collapsing 1486 whitespace between encoded words in a bare-quote-string. 1487 1488- bpo-35714: :exc:`struct.error` is now raised if there is a null character 1489 in a :mod:`struct` format string. 1490 1491- bpo-36290: AST nodes are now raising :exc:`TypeError` on conflicting 1492 keyword arguments. Patch contributed by Rémi Lapeyre. 1493 1494Tests 1495----- 1496 1497- bpo-17258: Skip some :mod:`multiprocessing` tests when MD5 hash digest is 1498 blocked. 1499 1500Build 1501----- 1502 1503- bpo-40514: Remove ``--with-experimental-isolated-subinterpreters`` 1504 configure option in Python 3.9: the experiment continues in the master 1505 branch, but it's no longer needed in 3.9. 1506 1507- bpo-40683: Fixed an issue where the :mod:`zoneinfo` module and its tests 1508 were not included when Python is installed with ``make``. 1509 1510Windows 1511------- 1512 1513- bpo-39631: Changes the registered MIME type for ``.py`` files on Windows 1514 to ``text/x-python`` instead of ``text/plain``. 1515 1516- bpo-40677: Manually define IO_REPARSE_TAG_APPEXECLINK in case some old 1517 Windows SDK doesn't have it. 1518 1519macOS 1520----- 1521 1522- bpo-40741: Update macOS installer to use SQLite 3.32.2. 1523 1524IDLE 1525---- 1526 1527- bpo-39885: Make context menu Cut and Copy work again when right-clicking 1528 within a selection. 1529 1530- bpo-40723: Make test_idle pass when run after import. 1531 1532C API 1533----- 1534 1535- bpo-40910: Export explicitly the :c:func:`Py_GetArgcArgv` function to the 1536 C API and document the function. Previously, it was exported implicitly 1537 which no longer works since Python is built with ``-fvisibility=hidden``. 1538 1539- bpo-40724: Allow defining buffer slots in type specs. 1540 1541- bpo-40826: :c:func:`PyOS_InterruptOccurred` now fails with a fatal error 1542 if it is called with the GIL released. 1543 1544 1545What's New in Python 3.9.0 beta 1? 1546================================== 1547 1548*Release date: 2020-05-19* 1549 1550Security 1551-------- 1552 1553- bpo-40501: :mod:`uuid` no longer uses :mod:`ctypes` to load 1554 :file:`libuuid` or :file:`rpcrt4.dll` at runtime. 1555 1556Core and Builtins 1557----------------- 1558 1559- bpo-40663: Correctly generate annotations where parentheses are omitted 1560 but required (e.g: ``Type[(str, int, *other))]``. 1561 1562- bpo-40596: Fixed :meth:`str.isidentifier` for non-canonicalized strings 1563 containing non-BMP characters on Windows. 1564 1565- bpo-40593: Improved syntax errors for invalid characters in source code. 1566 1567- bpo-40585: Fixed a bug when using :func:`codeop.compile_command` that was 1568 causing exceptions to be swallowed with the new parser. Patch by Pablo 1569 Galindo 1570 1571- bpo-40566: Apply :pep:`573` to :mod:`abc`. 1572 1573- bpo-40502: Initialize ``n->n_col_offset``. (Patch by Joannah Nanjekye) 1574 1575- bpo-40527: Fix command line argument parsing: no longer write errors 1576 multiple times into stderr. 1577 1578- bpo-1635741: Port :mod:`errno` to multiphase initialization (:pep:`489`). 1579 1580- bpo-40523: Add pass-throughs for :func:`hash` and :func:`reversed` to 1581 :class:`weakref.proxy` objects. Patch by Pablo Galindo. 1582 1583- bpo-1635741: Port :mod:`syslog` to multiphase initialization (:pep:`489`). 1584 1585- bpo-40246: Reporting a specialised error message for invalid string 1586 prefixes, which was introduced in :issue:`40246`, is being reverted due to 1587 backwards compatibility concerns for strings that immediately follow a 1588 reserved keyword without whitespace between them. Constructs like 1589 `bg="#d00" if clear else"#fca"` were failing to parse, which is not an 1590 acceptable breakage on such short notice. 1591 1592- bpo-40417: Fix imp module deprecation warning when PyImport_ReloadModule 1593 is called. Patch by Robert Rouhani. 1594 1595- bpo-40408: Fixed support of nested type variables in GenericAlias (e.g. 1596 ``list[list[T]]``). 1597 1598- bpo-1635741: Port _stat module to multiphase initialization (:pep:`489`). 1599 1600- bpo-29587: Enable implicit exception chaining when calling 1601 :meth:`generator.throw`. 1602 1603- bpo-40328: Add tools for generating mappings headers for CJKCodecs. 1604 1605- bpo-40228: Setting frame.f_lineno is now robust w.r.t. changes in the 1606 source-to-bytecode compiler 1607 1608- bpo-38880: Added the ability to list interpreters associated with channel 1609 ends in the internal subinterpreters module. 1610 1611- bpo-37986: Improve performance of :c:func:`PyLong_FromDouble` for values 1612 that fit into :c:type:`long`. 1613 1614Library 1615------- 1616 1617- bpo-40662: Fixed :func:`ast.get_source_segment` for ast nodes that have 1618 incomplete location information. Patch by Irit Katriel. 1619 1620- bpo-40665: Convert :mod:`bisect` to use Argument Clinic. 1621 1622- bpo-40536: Added the :func:`~zoneinfo.available_timezones` function to the 1623 :mod:`zoneinfo` module. Patch by Paul Ganssle. 1624 1625- bpo-40645: The :class:`hmac.HMAC` exposes internal implementation details. 1626 The attributes ``digest_cons``, ``inner``, and ``outer`` are deprecated 1627 and will be removed in the future. 1628 1629- bpo-40645: The internal module ``_hashlib`` wraps and exposes OpenSSL's 1630 HMAC API. The new code will be used in Python 3.10 after the internal 1631 implementation details of the pure Python HMAC module are no longer part 1632 of the public API. 1633 1634- bpo-40637: Builtin hash modules can now be disabled or selectively enabled 1635 with ``configure --with-builtin-hashlib-hashes=sha3,blake1`` or 1636 ``--without-builtin-hashlib-hashes``. 1637 1638- bpo-37630: The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF 1639 from OpenSSL when available. 1640 1641- bpo-40479: The :mod:`hashlib` now compiles with OpenSSL 3.0.0-alpha2. 1642 1643- bpo-40257: Revert changes to :func:`inspect.getdoc`. 1644 1645- bpo-40607: When cancelling a task due to timeout, :meth:`asyncio.wait_for` 1646 will now propagate the exception if an error happens during cancellation. 1647 Patch by Roman Skurikhin. 1648 1649- bpo-40612: Fix edge cases in SyntaxError formatting. If the offset is <= 1650 0, no caret is printed. If the offset is > line length, the caret is 1651 printed pointing just after the last character. 1652 1653- bpo-40597: If text content lines are longer than policy.max_line_length, 1654 always use a content-encoding to make sure they are wrapped. 1655 1656- bpo-40571: Added functools.cache() as a simpler, more discoverable way to 1657 access the unbounded cache variant of lru_cache(maxsize=None). 1658 1659- bpo-40503: :pep:`615`, the :mod:`zoneinfo` module. Adds support for the 1660 IANA time zone database. 1661 1662- bpo-40397: Removed attributes ``__args__`` and ``__parameters__`` from 1663 special generic aliases like ``typing.List`` (not subscripted). 1664 1665- bpo-40549: Convert posixmodule.c ("posix" or "nt" module) to the 1666 multiphase initialization (PEP 489). 1667 1668- bpo-31033: Add a ``msg`` argument to :meth:`Future.cancel` and 1669 :meth:`Task.cancel`. 1670 1671- bpo-40541: Added an optional *counts* parameter to random.sample(). 1672 1673- bpo-40515: The :mod:`ssl` and :mod:`hashlib` modules now actively check 1674 that OpenSSL is build with thread support. Python 3.7.0 made thread 1675 support mandatory and no longer works safely with a no-thread builds. 1676 1677- bpo-31033: When a :class:`asyncio.Task` is cancelled, the exception 1678 traceback now chains all the way back to where the task was first 1679 interrupted. 1680 1681- bpo-40504: :func:`functools.lru_cache` objects can now be the targets of 1682 weakrefs. 1683 1684- bpo-40559: Fix possible memory leak in the C implementation of 1685 :class:`asyncio.Task`. 1686 1687- bpo-40480: ``fnmatch.fnmatch()`` could take exponential time in the 1688 presence of multiple ``*`` pattern characters. This was repaired by 1689 generating more elaborate regular expressions to avoid futile 1690 backtracking. 1691 1692- bpo-40495: :mod:`compileall` is now able to use hardlinks to prevent 1693 duplicates in a case when ``.pyc`` files for different optimization levels 1694 have the same content. 1695 1696- bpo-40457: The ssl module now support OpenSSL builds without TLS 1.0 and 1697 1.1 methods. 1698 1699- bpo-40355: Improve error reporting in :func:`ast.literal_eval` in the 1700 presence of malformed :class:`ast.Dict` nodes instead of silently ignoring 1701 any non-conforming elements. Patch by Curtis Bucher. 1702 1703- bpo-40465: Deprecated the optional *random* argument to 1704 *random.shuffle()*. 1705 1706- bpo-40459: :func:`platform.win32_ver` now produces correct *ptype* strings 1707 instead of empty strings. 1708 1709- bpo-39435: The first argument of :func:`pickle.loads` is now 1710 positional-only. 1711 1712- bpo-39305: Update :mod:`nntplib` to merge :class:`nntplib.NNTP` and 1713 :class:`nntplib._NNTPBase`. Patch by Dong-hee Na. 1714 1715- bpo-32494: Update :mod:`dbm.gnu` to use gdbm_count if possible when 1716 calling :func:`len`. Patch by Dong-hee Na. 1717 1718- bpo-40453: Add ``isolated=True`` keyword-only parameter to 1719 ``_xxsubinterpreters.create()``. An isolated subinterpreter cannot spawn 1720 threads, spawn a child process or call ``os.fork()``. 1721 1722- bpo-40286: Remove ``_random.Random.randbytes()``: the C implementation of 1723 ``randbytes()``. Implement the method in Python to ease subclassing: 1724 ``randbytes()`` now directly reuses ``getrandbits()``. 1725 1726- bpo-40394: Added default arguments to 1727 :meth:`difflib.SequenceMatcher.find_longest_match()`. 1728 1729- bpo-39995: Fix a race condition in concurrent.futures._ThreadWakeup: 1730 access to _ThreadWakeup is now protected with the shutdown lock. 1731 1732- bpo-30966: ``Process.shutdown(wait=True)`` of :mod:`concurrent.futures` 1733 now closes explicitly the result queue. 1734 1735- bpo-30966: Add a new :meth:`~multiprocessing.SimpleQueue.close` method to 1736 the :class:`~multiprocessing.SimpleQueue` class to explicitly close the 1737 queue. 1738 1739- bpo-39966: Revert bpo-25597. :class:`unittest.mock.MagicMock` with wraps' 1740 set uses default return values for magic methods. 1741 1742- bpo-39791: Added ``files()`` function to importlib.resources with support 1743 for subdirectories in package data, matching backport in 1744 importlib_resources 1.5. 1745 1746- bpo-40375: :meth:`imaplib.IMAP4.unselect` is added. Patch by Dong-hee Na. 1747 1748- bpo-40389: ``repr()`` now returns ``typing.Optional[T]`` when called for 1749 ``typing.Union`` of two types, one of which is ``NoneType``. 1750 1751- bpo-40291: Add support for CAN_J1939 sockets (available on Linux 5.4+) 1752 1753- bpo-40273: :class:`types.MappingProxyType` is now reversible. 1754 1755- bpo-39075: The repr for :class:`types.SimpleNamespace` is now insertion 1756 ordered rather than alphabetical. 1757 1758- bpo-40192: On AIX, :func:`~time.thread_time` is now implemented with 1759 ``thread_cputime()`` which has nanosecond resolution, rather than 1760 ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` which has a resolution of 10 1761 ms. Patch by Batuhan Taskaya. 1762 1763- bpo-40025: Raise TypeError when _generate_next_value_ is defined after 1764 members. Patch by Ethan Onstott. 1765 1766- bpo-39058: In the argparse module, the repr for Namespace() and other 1767 argument holders now displayed in the order attributes were added. 1768 Formerly, it displayed in alphabetical order even though argument order is 1769 preserved the user visible parts of the module. 1770 1771- bpo-24416: The ``isocalendar()`` methods of :class:`datetime.date` and 1772 :class:`datetime.datetime` now return a :term:`named tuple` instead of a 1773 :class:`tuple`. 1774 1775Documentation 1776------------- 1777 1778- bpo-34790: Add version of removal for explicit passing of coros to 1779 `asyncio.wait()`'s documentation 1780 1781- bpo-40561: Provide docstrings for webbrowser open functions. 1782 1783- bpo-40499: Mention that :func:`asyncio.wait` requires a non-empty set of 1784 awaitables. 1785 1786- bpo-39705: Tutorial example for sorted() in the Loop Techniques section is 1787 given a better explanation. Also a new example is included to explain 1788 sorted()'s basic behavior. 1789 1790- bpo-39435: Fix an incorrect signature for :func:`pickle.loads` in the docs 1791 1792Tests 1793----- 1794 1795- bpo-40055: distutils.tests now saves/restores warnings filters to leave 1796 them unchanged. Importing tests imports docutils which imports 1797 pkg_resources which adds a warnings filter. 1798 1799- bpo-40436: test_gdb and test.pythoninfo now check gdb command exit code. 1800 1801Build 1802----- 1803 1804- bpo-40653: Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling 1805 issue. 1806 1807- bpo-40514: Add ``--with-experimental-isolated-subinterpreters`` build 1808 option to ``configure``: better isolate subinterpreters, experimental 1809 build mode. 1810 1811Windows 1812------- 1813 1814- bpo-40650: Include winsock2.h in pytime.c for timeval. 1815 1816- bpo-40458: Increase reserved stack space to prevent overflow crash on 1817 Windows. 1818 1819- bpo-39148: Add IPv6 support to :mod:`asyncio` datagram endpoints in 1820 ProactorEventLoop. Change the raised exception for unknown address 1821 families to ValueError as it's not coming from Windows API. 1822 1823macOS 1824----- 1825 1826- bpo-34956: When building Python on macOS from source, ``_tkinter`` now 1827 links with non-system Tcl and Tk frameworks if they are installed in 1828 ``/Library/Frameworks``, as had been the case on older releases of macOS. 1829 If a macOS SDK is explicitly configured, by using 1830 ``--enable-universalsdk=`` or ``-isysroot``, only the SDK itself is 1831 searched. The default behavior can still be overridden with 1832 ``--with-tcltk-includes`` and ``--with-tcltk-libs``. 1833 1834- bpo-35569: Expose RFC 3542 IPv6 socket options. 1835 1836Tools/Demos 1837----------- 1838 1839- bpo-40479: Update multissltest helper to test with latest OpenSSL 1.0.2, 1840 1.1.0, 1.1.1, and 3.0.0-alpha. 1841 1842- bpo-40431: Fix a syntax typo in ``turtledemo`` that now raises a 1843 ``SyntaxError``. 1844 1845- bpo-40163: Fix multissltest tool. OpenSSL has changed download URL for old 1846 releases. The multissltest tool now tries to download from current and old 1847 download URLs. 1848 1849C API 1850----- 1851 1852- bpo-39465: Remove the ``_PyUnicode_ClearStaticStrings()`` function from 1853 the C API. 1854 1855- bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks now 1856 that we allow subtypes of PyCFunction, as well as PyCMethod_CheckExact() 1857 and PyCMethod_Check() for the new PyCMethod subtype. 1858 1859- bpo-40545: Declare ``_PyErr_GetTopmostException()`` with ``PyAPI_FUNC()`` 1860 to properly export the function in the C API. The function remains private 1861 (``_Py``) prefix. 1862 1863- bpo-40412: Nullify inittab_copy during finalization, preventing future 1864 interpreter initializations in an embedded situation from crashing. Patch 1865 by Gregory Szorc. 1866 1867- bpo-40429: The :c:func:`PyThreadState_GetFrame` function now returns a 1868 strong reference to the frame. 1869 1870- bpo-40428: Remove the following functions from the C API. Call 1871 :c:func:`PyGC_Collect` explicitly to free all free lists. 1872 1873 * ``PyAsyncGen_ClearFreeLists()`` 1874 * ``PyContext_ClearFreeList()`` 1875 * ``PyDict_ClearFreeList()`` 1876 * ``PyFloat_ClearFreeList()`` 1877 * ``PyFrame_ClearFreeList()`` 1878 * ``PyList_ClearFreeList()`` 1879 * ``PySet_ClearFreeList()`` 1880 * ``PyTuple_ClearFreeList()`` 1881 1882- bpo-40421: New :c:func:`PyFrame_GetBack` function: get the frame next 1883 outer frame. 1884 1885- bpo-40421: New :c:func:`PyFrame_GetCode` function: return a borrowed 1886 reference to the frame code. 1887 1888- bpo-40217: Ensure that instances of types created with 1889 :c:func:`PyType_FromSpecWithBases` will visit its class object when 1890 traversing references in the garbage collector (implemented as an 1891 extension of the provided :c:member:`~PyTypeObject.tp_traverse`). Patch by 1892 Pablo Galindo. 1893 1894- bpo-38787: Module C state is now accessible from C-defined heap type 1895 methods (:pep:`573`). Patch by Marcel Plch and Petr Viktorin. 1896 1897 1898What's New in Python 3.9.0 alpha 6? 1899=================================== 1900 1901*Release date: 2020-04-27* 1902 1903Security 1904-------- 1905 1906- bpo-40121: Fixes audit events raised on creating a new socket. 1907 1908- bpo-39073: Disallow CR or LF in email.headerregistry.Address arguments to 1909 guard against header injection attacks. 1910 1911- bpo-39503: CVE-2020-8492: The 1912 :class:`~urllib.request.AbstractBasicAuthHandler` class of the 1913 :mod:`urllib.request` module uses an inefficient regular expression which 1914 can be exploited by an attacker to cause a denial of service. Fix the 1915 regex to prevent the catastrophic backtracking. Vulnerability reported by 1916 Ben Caller and Matt Schwager. 1917 1918Core and Builtins 1919----------------- 1920 1921- bpo-40313: Improve the performance of bytes.hex(). 1922 1923- bpo-40334: Switch to a new parser, based on PEG. For more details see PEP 1924 617. To temporarily switch back to the old parser, use ``-X oldparser`` or 1925 ``PYTHONOLDPARSER=1``. In Python 3.10 we will remove the old parser 1926 completely, including the ``parser`` module (already deprecated) and 1927 anything that depends on it. 1928 1929- bpo-40267: Fix the tokenizer to display the correct error message, when 1930 there is a SyntaxError on the last input character and no newline follows. 1931 It used to be `unexpected EOF while parsing`, while it should be `invalid 1932 syntax`. 1933 1934- bpo-39522: Correctly unparse explicit ``u`` prefix for strings when 1935 postponed evaluation for annotations activated. Patch by Batuhan Taskaya. 1936 1937- bpo-40246: Report a specialized error message, `invalid string prefix`, 1938 when the tokenizer encounters a string with an invalid prefix. 1939 1940- bpo-40082: Fix the signal handler: it now always uses the main 1941 interpreter, rather than trying to get the current Python thread state. 1942 1943- bpo-37388: str.encode() and str.decode() no longer check the encoding and 1944 errors in development mode or in debug mode during Python finalization. 1945 The codecs machinery can no longer work on very late calls to str.encode() 1946 and str.decode(). 1947 1948- bpo-40077: Fix possible refleaks in :mod:`_json`, memo of PyScannerObject 1949 should be traversed. 1950 1951- bpo-37207: Speed up calls to ``dict()`` by using the :pep:`590` 1952 ``vectorcall`` calling convention. 1953 1954- bpo-40141: Add column and line information to ``ast.keyword`` nodes. Patch 1955 by Pablo Galindo. 1956 1957- bpo-1635741: Port :mod:`resource` to multiphase initialization 1958 (:pep:`489`). 1959 1960- bpo-1635741: Port :mod:`math` to multiphase initialization (:pep:`489`). 1961 1962- bpo-1635741: Port _uuid module to multiphase initialization (:pep:`489`). 1963 1964- bpo-40077: Convert json module to use :c:func:`PyType_FromSpec`. 1965 1966- bpo-40067: Improve the error message for multiple star expressions in an 1967 assignment. Patch by Furkan Onder 1968 1969- bpo-1635741: Port _functools module to multiphase initialization (PEP 1970 489). Patch by Paulo Henrique Silva. 1971 1972- bpo-1635741: Port operator module to multiphase initialization (PEP 489). 1973 Patch by Paulo Henrique Silva. 1974 1975- bpo-20526: Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is 1976 a borrowed reference, not a strong reference: ``PyThreadState_Clear()`` 1977 must not call ``Py_CLEAR(tstate->frame)``. 1978 1979- bpo-1635741: Port time module to multiphase initialization (:pep:`489`). 1980 Patch by Paulo Henrique Silva. 1981 1982- bpo-1635741: Port _weakref extension module to multiphase initialization 1983 (:pep:`489`). 1984 1985- bpo-40020: Fix a leak and subsequent crash in parsetok.c caused by realloc 1986 misuse on a rare codepath. 1987 1988- bpo-39939: Added str.removeprefix and str.removesuffix methods and 1989 corresponding bytes, bytearray, and collections.UserString methods to 1990 remove affixes from a string if present. See :pep:`616` for a full 1991 description. Patch by Dennis Sweeney. 1992 1993- bpo-39481: Implement PEP 585. This supports list[int], tuple[str, ...] 1994 etc. 1995 1996- bpo-32894: Support unparsing of infinity numbers in postponed annotations. 1997 Patch by Batuhan Taşkaya. 1998 1999- bpo-37207: Speed up calls to ``list()`` by using the :pep:`590` 2000 ``vectorcall`` calling convention. Patch by Mark Shannon. 2001 2002Library 2003------- 2004 2005- bpo-40398: :func:`typing.get_args` now always returns an empty tuple for 2006 special generic aliases. 2007 2008- bpo-40396: Functions :func:`typing.get_origin`, :func:`typing.get_args` 2009 and :func:`typing.get_type_hints` support now generic aliases like 2010 ``list[int]``. 2011 2012- bpo-38061: Optimize the :mod:`subprocess` module on FreeBSD using 2013 ``closefrom()``. A single ``close(fd)`` syscall is cheap, but when 2014 ``sysconf(_SC_OPEN_MAX)`` is high, the loop calling ``close(fd)`` on each 2015 file descriptor can take several milliseconds. 2016 2017 The workaround on FreeBSD to improve performance was to load and mount the 2018 fdescfs kernel module, but this is not enabled by default. 2019 2020 Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans 2021 (kevans) and Kubilay Kocak (koobs): 2022 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 2023 2024- bpo-38061: On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls 2025 ``closefrom(fd_low)`` if *fd_high* is greater than or equal to 2026 ``sysconf(_SC_OPEN_MAX)``. 2027 2028 Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans 2029 (kevans) and Kubilay Kocak (koobs): 2030 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 2031 2032- bpo-40360: The :mod:`lib2to3` module is pending deprecation due to 2033 :pep:`617`. 2034 2035- bpo-40138: Fix the Windows implementation of :func:`os.waitpid` for exit 2036 code larger than ``INT_MAX >> 8``. The exit status is now interpreted as 2037 an unsigned number. 2038 2039- bpo-39942: Set "__main__" as the default module name when "__name__" is 2040 missing in :class:`typing.TypeVar`. Patch by Weipeng Hong. 2041 2042- bpo-40275: The :mod:`logging` package is now imported lazily in 2043 :mod:`unittest` only when the :meth:`~unittest.TestCase.assertLogs` 2044 assertion is used. 2045 2046- bpo-40275: The :mod:`asyncio` package is now imported lazily in 2047 :mod:`unittest` only when the :class:`~unittest.IsolatedAsyncioTestCase` 2048 class is used. 2049 2050- bpo-40330: In :meth:`ShareableList.__setitem__`, check the size of a new 2051 string item after encoding it to utf-8, not before. 2052 2053- bpo-40148: Added :meth:`pathlib.Path.with_stem()` to create a new Path 2054 with the stem replaced. 2055 2056- bpo-40325: Deprecated support for set objects in random.sample(). 2057 2058- bpo-40257: Improved help for the :mod:`typing` module. Docstrings are now 2059 shown for all special forms and special generic aliases (like ``Union`` 2060 and ``List``). Using ``help()`` with generic alias like ``List[int]`` will 2061 show the help for the correspondent concrete type (``list`` in this case). 2062 2063- bpo-40257: func:`inspect.getdoc` no longer returns docstring inherited 2064 from the type of the object or from parent class if it is a class if it is 2065 not defined in the object itself. In :mod:`pydoc` the documentation string 2066 is now shown not only for class, function, method etc, but for any object 2067 that has its own ``__doc__`` attribute. 2068 2069- bpo-40287: Fixed ``SpooledTemporaryFile.seek()`` to return the position. 2070 2071- bpo-40290: Added zscore() to statistics.NormalDist(). 2072 2073- bpo-40282: Allow ``random.getrandbits(0)`` to succeed and to return 0. 2074 2075- bpo-40286: Add :func:`random.randbytes` function and 2076 :meth:`random.Random.randbytes` method to generate random bytes. 2077 2078- bpo-40277: :func:`collections.namedtuple` now provides a human-readable 2079 repr for its field accessors. 2080 2081- bpo-40270: The included copy of sqlite3 on Windows is now compiled with 2082 the json extension. This allows the use of functions such as 2083 ``json_object``. 2084 2085- bpo-29255: Wait in `KqueueSelector.select` when no fds are registered 2086 2087- bpo-40260: Ensure :mod:`modulefinder` uses :func:`io.open_code` and 2088 respects coding comments. 2089 2090- bpo-40234: Allow again to spawn daemon threads in subinterpreters (revert 2091 change which denied them). 2092 2093- bpo-39207: Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are 2094 now spawned on demand, only when there are no available idle workers to 2095 reuse. This optimizes startup overhead and reduces the amount of lost CPU 2096 time to idle workers. Patch by Kyle Stanley. 2097 2098- bpo-40091: Fix a hang at fork in the logging module: the new private 2099 _at_fork_reinit() method is now used to reinitialize locks at fork in the 2100 child process. 2101 2102- bpo-40149: Implement traverse and clear slots in _abc._abc_data type. 2103 2104- bpo-40208: Remove deprecated :meth:`symtable.SymbolTable.has_exec`. 2105 2106- bpo-40196: Fix a bug in the :mod:`symtable` module that was causing 2107 incorrectly report global variables as local. Patch by Pablo Galindo. 2108 2109- bpo-40190: Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`. 2110 2111- bpo-40182: Removed the ``_field_types`` attribute of the 2112 :class:`typing.NamedTuple` class. 2113 2114- bpo-36517: Multiple inheritance with :class:`typing.NamedTuple` now raises 2115 an error instead of silently ignoring other types. 2116 2117- bpo-40126: Fixed reverting multiple patches in unittest.mock. Patcher's 2118 ``__exit__()`` is now never called if its ``__enter__()`` is failed. 2119 Returning true from ``__exit__()`` silences now the exception. 2120 2121- bpo-40094: CGIHTTPRequestHandler of http.server now logs the CGI script 2122 exit code, rather than the CGI script exit status of os.waitpid(). For 2123 example, if the script is killed by signal 11, it now logs: "CGI script 2124 exit code -11." 2125 2126- bpo-40108: Improve the error message when triying to import a module using 2127 :mod:`runpy` and incorrently use the ".py" extension at the end of the 2128 module name. Patch by Pablo Galindo. 2129 2130- bpo-40094: Add :func:`os.waitstatus_to_exitcode` function: convert a wait 2131 status to an exit code. 2132 2133- bpo-40089: Fix threading._after_fork(): if fork was not called by a thread 2134 spawned by threading.Thread, threading._after_fork() now creates a 2135 _MainThread instance for _main_thread, instead of a _DummyThread instance. 2136 2137- bpo-40089: Add a private ``_at_fork_reinit()`` method to 2138 :class:`_thread.Lock`, :class:`_thread.RLock`, :class:`threading.RLock` 2139 and :class:`threading.Condition` classes: reinitialize the lock at fork in 2140 the child process, reset the lock to the unlocked state. Rename also the 2141 private ``_reset_internal_locks()`` method of :class:`threading.Event` to 2142 ``_at_fork_reinit()``. 2143 2144- bpo-25780: Expose :data:`~socket.CAN_RAW_JOIN_FILTERS` in the 2145 :mod:`socket` module. 2146 2147- bpo-39503: :class:`~urllib.request.AbstractBasicAuthHandler` of 2148 :mod:`urllib.request` now parses all WWW-Authenticate HTTP headers and 2149 accepts multiple challenges per header: use the realm of the first Basic 2150 challenge. 2151 2152- bpo-39812: Removed daemon threads from :mod:`concurrent.futures` by adding 2153 an internal `threading._register_atexit()`, which calls registered 2154 functions prior to joining all non-daemon threads. This allows for 2155 compatibility with subinterpreters, which don't support daemon threads. 2156 2157- bpo-40050: Fix ``importlib._bootstrap_external``: avoid creating a new 2158 ``winreg`` builtin module if it's already available in 2159 :data:`sys.modules`, and remove redundant imports. 2160 2161- bpo-40014: Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails 2162 because the group list is too small, retry with a larger group list. On 2163 failure, the glibc implementation of ``getgrouplist()`` sets ``ngroups`` 2164 to the total number of groups. For other implementations, double the group 2165 list size. 2166 2167- bpo-40017: Add :data:`time.CLOCK_TAI` constant if the operating system 2168 support it. 2169 2170- bpo-40016: In re docstring, clarify the relationship between inline and 2171 argument compile flags. 2172 2173- bpo-39953: Update internal table of OpenSSL error codes in the ``ssl`` 2174 module. 2175 2176- bpo-36144: Added :pep:`584` operators to 2177 :class:`weakref.WeakValueDictionary`. 2178 2179- bpo-36144: Added :pep:`584` operators to 2180 :class:`weakref.WeakKeyDictionary`. 2181 2182- bpo-38891: Fix linear runtime behaviour of the `__getitem__` and 2183 `__setitem__` methods in 2184 :class:`multiprocessing.shared_memory.ShareableList`. This avoids 2185 quadratic performance when iterating a `ShareableList`. Patch by Thomas 2186 Krennwallner. 2187 2188- bpo-39682: Remove undocumented support for *closing* a `pathlib.Path` 2189 object via its context manager. The context manager magic methods remain, 2190 but they are now a no-op, making `Path` objects immutable. 2191 2192- bpo-36144: Added :pep:`584` operators (``|`` and ``|=``) to 2193 :class:`collections.ChainMap`. 2194 2195- bpo-39011: Normalization of line endings in ElementTree attributes was 2196 removed, as line endings which were replaced by entity numbers should be 2197 preserved in original form. 2198 2199- bpo-38410: Properly handle :func:`sys.audit` failures in 2200 :func:`sys.set_asyncgen_hooks`. 2201 2202- bpo-36541: lib2to3 now recognizes named assignment expressions (the walrus 2203 operator, ``:=``) 2204 2205- bpo-35967: In platform, delay the invocation of 'uname -p' until the 2206 processor attribute is requested. 2207 2208- bpo-35113: :meth:`inspect.getsource` now returns correct source code for 2209 inner class with same name as module level class. Decorators are also 2210 returned as part of source of the class. Patch by Karthikeyan 2211 Singaravelan. 2212 2213- bpo-33262: Deprecate passing None as an argument for 2214 :func:`shlex.split()`'s ``s`` parameter. Patch by Zackery Spytz. 2215 2216- bpo-31758: Prevent crashes when using an uninitialized 2217 ``_elementtree.XMLParser`` object. Patch by Oren Milman. 2218 2219Documentation 2220------------- 2221 2222- bpo-27635: The pickle documentation incorrectly claimed that ``__new__`` 2223 isn't called by default when unpickling. 2224 2225- bpo-39879: Updated :ref:`datamodel` docs to include :func:`dict` insertion 2226 order preservation. Patch by Furkan Onder and Samy Lahfa. 2227 2228- bpo-38387: Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. 2229 2230- bpo-13743: Some methods within xml.dom.minidom.Element class are now 2231 better documented. 2232 2233Tests 2234----- 2235 2236- bpo-31904: Set expected default encoding in test_c_locale_coercion.py for 2237 VxWorks RTOS. 2238 2239- bpo-40162: Update Travis CI configuration to OpenSSL 1.1.1f. 2240 2241- bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines. 2242 2243- bpo-40094: Add :func:`test.support.wait_process` function. 2244 2245- bpo-40003: ``test.bisect_cmd`` now copies Python command line options like 2246 ``-O`` or ``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used 2247 with ``-w``/``--verbose2`` option. 2248 2249- bpo-39380: Add the encoding in :class:`ftplib.FTP` and 2250 :class:`ftplib.FTP_TLS` to the constructor as keyword-only and change the 2251 default from ``latin-1`` to ``utf-8`` to follow :rfc:`2640`. 2252 2253- bpo-39793: Use the same domain when testing ``make_msgid``. Patch by 2254 Batuhan Taskaya. 2255 2256- bpo-1812: Fix newline handling in doctest.testfile when loading from a 2257 package whose loader has a get_data method. Patch by Peter Donis. 2258 2259Build 2260----- 2261 2262- bpo-38360: Support single-argument form of macOS -isysroot flag. 2263 2264- bpo-40158: Fix CPython MSBuild Properties in NuGet Package 2265 (build/native/python.props) 2266 2267- bpo-38527: Fix configure check on Solaris for "float word ordering": 2268 sometimes, the correct "grep" command was not being used. Patch by Arnon 2269 Yaari. 2270 2271Windows 2272------- 2273 2274- bpo-40164: Updates Windows to OpenSSL 1.1.1f 2275 2276- bpo-8901: Ignore the Windows registry when the ``-E`` option is used. 2277 2278macOS 2279----- 2280 2281- bpo-38329: python.org macOS installers now update the Current version 2282 symlink of /Library/Frameworks/Python.framework/Versions for 3.9 installs. 2283 Previously, Current was only updated for Python 2.x installs. This should 2284 make it easier to embed Python 3 into other macOS applications. 2285 2286- bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. 2287 2288IDLE 2289---- 2290 2291- bpo-38439: Add a 256×256 pixel IDLE icon to support more modern 2292 environments. Created by Andrew Clover. Delete the unused macOS idle.icns 2293 icon file. 2294 2295- bpo-38689: IDLE will no longer freeze when inspect.signature fails when 2296 fetching a calltip. 2297 2298Tools/Demos 2299----------- 2300 2301- bpo-40385: Removed the checkpyc.py tool. Please see compileall without 2302 force mode as a potential alternative. 2303 2304- bpo-40179: Fixed translation of ``#elif`` in Argument Clinic. 2305 2306- bpo-40094: Fix ``which.py`` script exit code: it now uses 2307 :func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status 2308 into an exit code. 2309 2310C API 2311----- 2312 2313- bpo-40241: Move the :c:type:`PyGC_Head` structure to the internal C API. 2314 2315- bpo-40170: Convert :c:func:`PyObject_IS_GC` macro to a function to hide 2316 implementation details. 2317 2318- bpo-40241: Add the functions :c:func:`PyObject_GC_IsTracked` and 2319 :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if 2320 Python objects are being currently tracked or have been already finalized 2321 by the garbage collector respectively. Patch by Pablo Galindo. 2322 2323- bpo-40170: The :c:func:`PyObject_NEW` macro becomes an alias to the 2324 :c:func:`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro 2325 becomes an alias to the :c:func:`PyObject_NewVar` macro, to hide 2326 implementation details. They no longer access directly the 2327 :c:member:`PyTypeObject.tp_basicsize` member. 2328 2329- bpo-40170: :c:func:`PyType_HasFeature` now always calls 2330 :c:func:`PyType_GetFlags` to hide implementation details. Previously, it 2331 accessed directly the :c:member:`PyTypeObject.tp_flags` member when the 2332 limited C API was not used. 2333 2334- bpo-40170: Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a 2335 function to hide implementation details: the macro accessed directly to 2336 the :c:member:`PyTypeObject.tp_weaklistoffset` member. 2337 2338- bpo-40170: Convert :c:func:`PyObject_CheckBuffer` macro to a function to 2339 hide implementation details: the macro accessed directly the 2340 :c:member:`PyTypeObject.tp_as_buffer` member. 2341 2342- bpo-40170: Always declare :c:func:`PyIndex_Check` as an opaque function to 2343 hide implementation details: remove ``PyIndex_Check()`` macro. The macro 2344 accessed directly the :c:member:`PyTypeObject.tp_as_number` member. 2345 2346- bpo-39947: Add :c:func:`PyThreadState_GetID` function: get the unique 2347 identifier of a Python thread state. 2348 2349 2350What's New in Python 3.9.0 alpha 5? 2351=================================== 2352 2353*Release date: 2020-03-23* 2354 2355Security 2356-------- 2357 2358- bpo-38576: Disallow control characters in hostnames in http.client, 2359 addressing CVE-2019-18348. Such potentially malicious header injection 2360 URLs now cause a InvalidURL to be raised. 2361 2362Core and Builtins 2363----------------- 2364 2365- bpo-40010: Optimize pending calls in multithreaded applications. If a 2366 thread different than the main thread schedules a pending call 2367 (:c:func:`Py_AddPendingCall`), the bytecode evaluation loop is no longer 2368 interrupted at each bytecode instruction to check for pending calls which 2369 cannot be executed. Only the main thread can execute pending calls. 2370 2371 Previously, the bytecode evaluation loop was interrupted at each 2372 instruction until the main thread executes pending calls. 2373 2374- bpo-1635741: Port _weakref extension module to multiphase initialization 2375 (:pep:`489`). 2376 2377- bpo-1635741: Port _collections module to multiphase initialization 2378 (:pep:`489`). 2379 2380- bpo-40010: Optimize signal handling in multithreaded applications. If a 2381 thread different than the main thread gets a signal, the bytecode 2382 evaluation loop is no longer interrupted at each bytecode instruction to 2383 check for pending signals which cannot be handled. Only the main thread of 2384 the main interpreter can handle signals. 2385 2386 Previously, the bytecode evaluation loop was interrupted at each 2387 instruction until the main thread handles signals. 2388 2389- bpo-39984: If :c:func:`Py_AddPendingCall` is called in a subinterpreter, 2390 the function is now scheduled to be called from the subinterpreter, rather 2391 than being called from the main interpreter. Each subinterpreter now has 2392 its own list of scheduled calls. 2393 2394- bpo-1635741: Port _heapq module to multiphase initialization. 2395 2396- bpo-1635741: Port itertools module to multiphase initialization 2397 (:pep:`489`). 2398 2399- bpo-37207: Speed up calls to ``frozenset()`` by using the :pep:`590` 2400 ``vectorcall`` calling convention. Patch by Dong-hee Na. 2401 2402- bpo-39984: subinterpreters: Move 2403 ``_PyRuntimeState.ceval.tracing_possible`` to 2404 ``PyInterpreterState.ceval.tracing_possible``: each interpreter now has 2405 its own variable. 2406 2407- bpo-37207: Speed up calls to ``set()`` by using the :pep:`590` 2408 ``vectorcall`` calling convention. Patch by Dong-hee Na. 2409 2410- bpo-1635741: Port _statistics module to multiphase initialization 2411 (:pep:`489`). 2412 2413- bpo-39968: Use inline function to replace extension modules' 2414 get_module_state macros. 2415 2416- bpo-39965: Correctly raise ``SyntaxError`` if *await* is used inside 2417 non-async functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the 2418 asyncio REPL). Patch by Pablo Galindo. 2419 2420- bpo-39562: Allow executing asynchronous comprehensions on the top level 2421 when the ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan 2422 Taskaya. 2423 2424- bpo-37207: Speed up calls to ``tuple()`` by using the :pep:`590` 2425 ``vectorcall`` calling convention. Patch by Dong-hee Na. 2426 2427- bpo-38373: Chaged list overallocation strategy. It no longer overallocates 2428 if the new size is closer to overalocated size than to the old size and 2429 adds padding. 2430 2431- bpo-39926: Update Unicode database to Unicode version 13.0.0. 2432 2433- bpo-19466: Clear the frames of daemon threads earlier during the Python 2434 shutdown to call objects destructors. So "unclosed file" resource warnings 2435 are now emitted for daemon threads in a more reliable way. 2436 2437- bpo-38894: Fix a bug that was causing incomplete results when calling 2438 ``pathlib.Path.glob`` in the presence of symlinks that point to files 2439 where the user does not have read access. Patch by Pablo Galindo and Matt 2440 Wozniski. 2441 2442- bpo-39877: Fix :c:func:`PyEval_RestoreThread` random crash at exit with 2443 daemon threads. It now accesses the ``_PyRuntime`` variable directly 2444 instead of using ``tstate->interp->runtime``, since ``tstate`` can be a 2445 dangling pointer after :c:func:`Py_Finalize` has been called. Moreover, 2446 the daemon thread now exits before trying to take the GIL. 2447 2448- bpo-39871: Fix a possible :exc:`SystemError` in 2449 ``math.{atan2,copysign,remainder}()`` when the first argument cannot be 2450 converted to a :class:`float`. Patch by Zackery Spytz. 2451 2452- bpo-39776: Fix race condition where threads created by PyGILState_Ensure() 2453 could get a duplicate id. 2454 2455 This affects consumers of tstate->id like the contextvar caching 2456 machinery, which could return invalid cached objects under heavy thread 2457 load (observed in embedded scenarios). 2458 2459- bpo-39778: Fixed a crash due to incorrect handling of weak references in 2460 ``collections.OrderedDict`` classes. Patch by Pablo Galindo. 2461 2462- bpo-1635741: Port audioop extension module to multiphase initialization 2463 (:pep:`489`). 2464 2465- bpo-39702: Relax :term:`decorator` grammar restrictions to allow any valid 2466 expression (:pep:`614`). 2467 2468- bpo-38091: Tweak import deadlock detection code to not deadlock itself. 2469 2470- bpo-1635741: Port _locale extension module to multiphase initialization 2471 (:pep:`489`). 2472 2473- bpo-39087: Optimize :c:func:`PyUnicode_AsUTF8` and 2474 :c:func:`PyUnicode_AsUTF8AndSize` slightly when they need to create 2475 internal UTF-8 cache. 2476 2477- bpo-39520: Fix unparsing of ext slices with no items (``foo[:,]``). Patch 2478 by Batuhan Taskaya. 2479 2480- bpo-39220: Do not optimize annotations if 'from __future__ import 2481 annotations' is used. Patch by Pablo Galindo. 2482 2483- bpo-35712: Using :data:`NotImplemented` in a boolean context has been 2484 deprecated. Patch contributed by Josh Rosenberg. 2485 2486- bpo-22490: Don't leak environment variable ``__PYVENV_LAUNCHER__`` into 2487 the interpreter session on macOS. 2488 2489Library 2490------- 2491 2492- bpo-39830: Add :class:`zipfile.Path` to ``__all__`` in the :mod:`zipfile` 2493 module. 2494 2495- bpo-40000: Improved error messages for validation of ``ast.Constant`` 2496 nodes. Patch by Batuhan Taskaya. 2497 2498- bpo-39999: ``__module__`` of the AST node classes is now set to "ast" 2499 instead of "_ast". Added docstrings for dummy AST node classes and 2500 deprecated attributes. 2501 2502- bpo-39991: :func:`uuid.getnode` now skips IPv6 addresses with the same 2503 string length than a MAC address (17 characters): only use MAC addresses. 2504 2505- bpo-39988: Deprecated ``ast.AugLoad`` and ``ast.AugStore`` node classes 2506 because they are no longer used. 2507 2508- bpo-39656: Ensure ``bin/python3.#`` is always present in virtual 2509 environments on POSIX platforms - by Anthony Sottile. 2510 2511- bpo-39969: Deprecated ``ast.Param`` node class because it's no longer 2512 used. Patch by Batuhan Taskaya. 2513 2514- bpo-39360: Ensure all workers exit when finalizing a 2515 :class:`multiprocessing.Pool` implicitly via the module finalization 2516 handlers of multiprocessing. This fixes a deadlock situation that can be 2517 experienced when the Pool is not properly finalized via the context 2518 manager or a call to ``multiprocessing.Pool.terminate``. Patch by Batuhan 2519 Taskaya and Pablo Galindo. 2520 2521- bpo-35370: sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() 2522 now properly report :c:func:`PySys_Audit` error if "sys.setprofile" or 2523 "sys.settrace" audit event is denied. 2524 2525- bpo-39936: AIX: Fix _aix_support module when the subprocess is not 2526 available, when building Python from scratch. It now uses new private 2527 _bootsubprocess module, rather than having two implementations depending 2528 if subprocess is available or not. So _aix_support.aix_platform() result 2529 is now the same if subprocess is available or not. 2530 2531- bpo-36144: :class:`collections.OrderedDict` now implements ``|`` and 2532 ``|=`` (:pep:`584`). 2533 2534- bpo-39652: The column name found in ``sqlite3.Cursor.description`` is now 2535 truncated on the first '[' only if the PARSE_COLNAMES option is set. 2536 2537- bpo-39915: Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call 2538 objects in the order of awaited arguments instead of using 2539 :attr:`unittest.mock.Mock.call_args` which has the last value of the call. 2540 Patch by Karthikeyan Singaravelan. 2541 2542- bpo-36144: Updated :data:`os.environ` and :data:`os.environb` to support 2543 :pep:`584`'s merge (``|``) and update (``|=``) operators. 2544 2545- bpo-38662: The ``ensurepip`` module now invokes ``pip`` via the ``runpy`` 2546 module. Hence it is no longer tightly coupled with the internal API of the 2547 bundled ``pip`` version, allowing easier updates to a newer ``pip`` 2548 version both internally and for distributors. 2549 2550- bpo-38075: Fix the :meth:`random.Random.seed` method when a :class:`bool` 2551 is passed as the seed. 2552 2553- bpo-39916: More reliable use of ``os.scandir()`` in ``Path.glob()``. It no 2554 longer emits a ResourceWarning when interrupted. 2555 2556- bpo-39850: :mod:`multiprocessing` now supports abstract socket addresses 2557 (if abstract sockets are supported in the running platform). When creating 2558 arbitrary addresses (like when default-constructing 2559 :class:`multiprocessing.connection.Listener` objects) abstract sockets are 2560 preferred to avoid the case when the temporary-file-generated address is 2561 too large for an AF_UNIX socket address. Patch by Pablo Galindo. 2562 2563- bpo-36287: :func:`ast.dump()` no longer outputs optional fields and 2564 attributes with default values. The default values for optional fields and 2565 attributes of AST nodes are now set as class attributes (e.g. 2566 ``Constant.kind`` is set to ``None``). 2567 2568- bpo-39889: Fixed :func:`ast.unparse` for extended slices containing a 2569 single element (e.g. ``a[i:j,]``). Remove redundant tuples when index with 2570 a tuple (e.g. ``a[i, j]``). 2571 2572- bpo-39828: Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by 2573 Dong-hee Na. 2574 2575- bpo-13487: Avoid a possible *"RuntimeError: dictionary changed size during 2576 iteration"* from :func:`inspect.getmodule` when it tried to loop through 2577 :attr:`sys.modules`. 2578 2579- bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode". 2580 The "U" mode of open() is kept in Python 3.9 to ease transition from 2581 Python 2.7, but will be removed in Python 3.10. 2582 2583- bpo-28577: The hosts method on 32-bit prefix length IPv4Networks and 2584 128-bit prefix IPv6Networks now returns a list containing the single 2585 Address instead of an empty list. 2586 2587- bpo-39826: Add getConnection method to logging HTTPHandler to enable 2588 custom connections. 2589 2590- bpo-39763: Reimplement :func:`distutils.spawn.spawn` function with the 2591 :mod:`subprocess` module. 2592 2593- bpo-39794: Add --without-decimal-contextvar build option. This enables a 2594 thread-local rather than a coroutine local context. 2595 2596- bpo-36144: :class:`collections.defaultdict` now implements ``|`` 2597 (:pep:`584`). 2598 2599- bpo-39517: Fix runpy.run_path() when using pathlike objects 2600 2601- bpo-39775: Change ``inspect.Signature.parameters`` back to 2602 ``collections.OrderedDict``. This was changed to ``dict`` in Python 2603 3.9.0a4. 2604 2605- bpo-39678: Refactor queue_manager in 2606 :class:`concurrent.futures.ProcessPoolExecutor` to make it easier to 2607 maintain. 2608 2609- bpo-39764: Fix AttributeError when calling get_stack on a PyAsyncGenObject 2610 Task 2611 2612- bpo-39769: The :func:`compileall.compile_dir` function's *ddir* parameter 2613 and the compileall command line flag `-d` no longer write the wrong 2614 pathname to the generated pyc file for submodules beneath the root of the 2615 directory tree being compiled. This fixes a regression introduced with 2616 Python 3.5. 2617 2618- bpo-36144: :class:`types.MappingProxyType` objects now support the merge 2619 (``|``) operator from :pep:`584`. 2620 2621- bpo-38691: The :mod:`importlib` module now ignores the 2622 :envvar:`PYTHONCASEOK` environment variable when the :option:`-E` or 2623 :option:`-I` command line options are being used. 2624 2625- bpo-39719: Remove :meth:`tempfile.SpooledTemporaryFile.softspace` as files 2626 no longer have the ``softspace`` attribute in Python 3. Patch by Shantanu. 2627 2628- bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct 2629 performance degradation as found in zipp 3.0. 2630 2631- bpo-39638: Keep ASDL signatures in the docstrings for ``AST`` nodes. Patch 2632 by Batuhan Taskaya 2633 2634- bpo-39639: Deprecated ``ast.Suite`` node class because it's no longer 2635 used. Patch by Batuhan Taskaya. 2636 2637- bpo-39609: Add thread_name_prefix to default asyncio executor 2638 2639- bpo-39548: Fix handling of header in 2640 :class:`urllib.request.AbstractDigestAuthHandler` when the optional 2641 ``qop`` parameter is not present. 2642 2643- bpo-39509: HTTP status codes ``103 EARLY_HINTS`` and ``425 TOO_EARLY`` are 2644 added to :class:`http.HTTPStatus`. Patch by Dong-hee Na. 2645 2646- bpo-39507: Adding HTTP status 418 "I'm a Teapot" to HTTPStatus in http 2647 library. Patch by Ross Rhodes. 2648 2649- bpo-39495: Remove default value from *attrs* parameter of 2650 :meth:`xml.etree.ElementTree.TreeBuilder.start` for consistency between 2651 Python and C implementations. 2652 2653- bpo-38971: Open issue in the BPO indicated a desire to make the 2654 implementation of codecs.open() at parity with io.open(), which implements 2655 a try/except to assure file stream gets closed before an exception is 2656 raised. 2657 2658- bpo-38641: Added starred expressions support to ``return`` and ``yield`` 2659 statements for ``lib2to3``. Patch by Vlad Emelianov. 2660 2661- bpo-37534: When using minidom module to generate XML documents the ability 2662 to add Standalone Document Declaration is added. All the changes are made 2663 to generate a document in compliance with Extensible Markup Language (XML) 2664 1.0 (Fifth Edition) W3C Recommendation (available here: 2665 https://www.w3.org/TR/xml/#sec-prolog-dtd). 2666 2667- bpo-34788: Add support for scoped IPv6 addresses to :mod:`ipaddress`. 2668 Patch by Oleksandr Pavliuk. 2669 2670- bpo-34822: Simplified AST for subscription. Simple indices are now 2671 represented by their value, extended slices are represented as tuples. 2672 :mod:`ast` classes ``Index`` and ``ExtSlice`` are considered deprecated 2673 and will be removed in future Python versions. In the meantime, 2674 ``Index(value)`` now returns a ``value`` itself, ``ExtSlice(slices)`` 2675 returns ``Tuple(slices, Load())``. 2676 2677Documentation 2678------------- 2679 2680- bpo-39868: Updated the Language Reference for :pep:`572`. 2681 2682- bpo-13790: Change 'string' to 'specification' in format doc. 2683 2684- bpo-17422: The language reference no longer restricts default class 2685 namespaces to dicts only. 2686 2687- bpo-39530: Fix misleading documentation about mixed-type numeric 2688 comparisons. 2689 2690- bpo-39718: Update :mod:`token` documentation to reflect additions in 2691 Python 3.8 2692 2693- bpo-39677: Changed operand name of **MAKE_FUNCTION** from *argc* to 2694 *flags* for module :mod:`dis` 2695 2696Tests 2697----- 2698 2699- bpo-40019: test_gdb now skips tests if it detects that gdb failed to read 2700 debug information because the Python binary is optimized. 2701 2702- bpo-27807: ``test_site.test_startup_imports()`` is now skipped if a path 2703 of :data:`sys.path` contains a ``.pth`` file. 2704 2705- bpo-26067: Do not fail test_shutil test_chown test when uid or gid of user 2706 cannot be resolved to a name. 2707 2708- bpo-39855: test_subprocess.test_user() now skips the test on an user name 2709 if the user name doesn't exist. For example, skip the test if the user 2710 "nobody" doesn't exist on Linux. 2711 2712Build 2713----- 2714 2715- bpo-39761: Fix build with DTrace but without additional DFLAGS. 2716 2717- bpo-39763: setup.py now uses a basic implementation of the 2718 :mod:`subprocess` module if the :mod:`subprocess` module is not available: 2719 before required C extension modules are built. 2720 2721- bpo-1294959: Add ``--with-platlibdir`` option to the configure script: 2722 name of the platform-specific library directory, stored in the new 2723 :attr:`sys.platlibdir` attribute. It is used to build the path of 2724 platform-specific extension modules and the path of the standard library. 2725 It is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is 2726 equal to ``"lib64"`` on 64-bit platforms. Patch by Jan Matějek, Matěj 2727 Cepl, Charalampos Stratakis and Victor Stinner. 2728 2729Windows 2730------- 2731 2732- bpo-39930: Ensures the required :file:`vcruntime140.dll` is included in 2733 install packages. 2734 2735- bpo-39847: Avoid hang when computer is hibernated whilst waiting for a 2736 mutex (for lock-related objects from :mod:`threading`) around 49-day 2737 uptime. 2738 2739- bpo-38597: :mod:`distutils` will no longer statically link 2740 :file:`vcruntime140.dll` when a redistributable version is unavailable. 2741 All future releases of CPython will include a copy of this DLL to ensure 2742 distributed extensions can continue to load. 2743 2744- bpo-38380: Update Windows builds to use SQLite 3.31.1 2745 2746- bpo-39789: Update Windows release build machines to Visual Studio 2019 2747 (MSVC 14.2). 2748 2749- bpo-34803: Package for nuget.org now includes repository reference and 2750 bundled icon image. 2751 2752macOS 2753----- 2754 2755- bpo-38380: Update macOS builds to use SQLite 3.31.1 2756 2757IDLE 2758---- 2759 2760- bpo-27115: For 'Go to Line', use a Query box subclass with IDLE standard 2761 behavior and improved error checking. 2762 2763- bpo-39885: Since clicking to get an IDLE context menu moves the cursor, 2764 any text selection should be and now is cleared. 2765 2766- bpo-39852: Edit "Go to line" now clears any selection, preventing 2767 accidental deletion. It also updates Ln and Col on the status bar. 2768 2769- bpo-39781: Selecting code context lines no longer causes a jump. 2770 2771Tools/Demos 2772----------- 2773 2774- bpo-36184: Port python-gdb.py to FreeBSD. python-gdb.py now checks for 2775 "take_gil" function name to check if a frame tries to acquire the GIL, 2776 instead of checking for "pthread_cond_timedwait" which is specific to 2777 Linux and can be a different condition than the GIL. 2778 2779- bpo-38080: Added support to fix ``getproxies`` in the 2780 :mod:`lib2to3.fixes.fix_urllib` module. Patch by José Roberto Meza 2781 Cabrera. 2782 2783C API 2784----- 2785 2786- bpo-40024: Add :c:func:`PyModule_AddType` helper function: add a type to a 2787 module. Patch by Dong-hee Na. 2788 2789- bpo-39946: Remove ``_PyRuntime.getframe`` hook and remove 2790 ``_PyThreadState_GetFrame`` macro which was an alias to 2791 ``_PyRuntime.getframe``. They were only exposed by the internal C API. 2792 Remove also ``PyThreadFrameGetter`` type. 2793 2794- bpo-39947: Add :c:func:`PyThreadState_GetFrame` function: get the current 2795 frame of a Python thread state. 2796 2797- bpo-37207: Add _PyArg_NoKwnames helper function. Patch by Dong-hee Na. 2798 2799- bpo-39947: Add :c:func:`PyThreadState_GetInterpreter`: get the interpreter 2800 of a Python thread state. 2801 2802- bpo-39947: Add :c:func:`PyInterpreterState_Get` function to the limited C 2803 API. 2804 2805- bpo-35370: If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile` 2806 or :c:func:`PyEval_SetTrace`, log the error as an unraisable exception. 2807 2808- bpo-39947: Move the static inline function flavor of 2809 Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() to the internal C API: 2810 they access PyThreadState attributes. The limited C API provides regular 2811 functions which hide implementation details. 2812 2813- bpo-39947: Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer 2814 access PyThreadState attributes, but call new private _PyTrash_begin() and 2815 _PyTrash_end() functions which hide implementation details. 2816 2817- bpo-39884: :c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now 2818 include the method name in the SystemError "bad call flags" error message 2819 to ease debug. 2820 2821- bpo-39877: Deprecated :c:func:`PyEval_InitThreads` and 2822 :c:func:`PyEval_ThreadsInitialized`. Calling :c:func:`PyEval_InitThreads` 2823 now does nothing. 2824 2825- bpo-38249: :c:macro:`Py_UNREACHABLE` is now implemented with 2826 ``__builtin_unreachable()`` and analogs in release mode. 2827 2828- bpo-38643: :c:func:`PyNumber_ToBase` now raises a :exc:`SystemError` 2829 instead of crashing when called with invalid base. 2830 2831- bpo-39882: The :c:func:`Py_FatalError` function is replaced with a macro 2832 which logs automatically the name of the current function, unless the 2833 ``Py_LIMITED_API`` macro is defined. 2834 2835- bpo-39824: Extension modules: :c:member:`~PyModuleDef.m_traverse`, 2836 :c:member:`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` 2837 functions of :c:type:`PyModuleDef` are no longer called if the module 2838 state was requested but is not allocated yet. This is the case immediately 2839 after the module is created and before the module is executed 2840 (:c:data:`Py_mod_exec` function). More precisely, these functions are not 2841 called if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module 2842 state (as returned by :c:func:`PyModule_GetState`) is ``NULL``. 2843 2844 Extension modules without module state (``m_size <= 0``) are not affected. 2845 2846- bpo-38913: Fixed segfault in ``Py_BuildValue()`` called with a format 2847 containing "#" and undefined PY_SSIZE_T_CLEAN whwn an exception is set. 2848 2849- bpo-38500: Add a private API to get and set the frame evaluation function: 2850 add :c:func:`_PyInterpreterState_GetEvalFrameFunc` and 2851 :c:func:`_PyInterpreterState_SetEvalFrameFunc` C functions. The 2852 :c:type:`_PyFrameEvalFunction` function type now takes a *tstate* 2853 parameter. 2854 2855 2856What's New in Python 3.9.0 alpha 4? 2857=================================== 2858 2859*Release date: 2020-02-25* 2860 2861Security 2862-------- 2863 2864- bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, 2865 `resource`, `shutil`, `signal` and `syslog`. 2866 2867- bpo-39401: Avoid unsafe DLL load at startup on Windows 7 and earlier. 2868 2869- bpo-39184: Add audit events to command execution functions in os and pty 2870 modules. 2871 2872Core and Builtins 2873----------------- 2874 2875- bpo-39382: Fix a use-after-free in the single inheritance path of 2876 ``issubclass()``, when the ``__bases__`` of an object has a single 2877 reference, and so does its first item. Patch by Yonatan Goldschmidt. 2878 2879- bpo-39573: Update clinic tool to use :c:func:`Py_IS_TYPE`. Patch by 2880 Dong-hee Na. 2881 2882- bpo-39619: Enable use of :func:`os.chroot` on HP-UX systems. 2883 2884- bpo-39573: Add :c:func:`Py_IS_TYPE` static inline function to check 2885 whether the object *o* type is *type*. 2886 2887- bpo-39606: Fix regression caused by fix for bpo-39386, that prevented 2888 calling ``aclose`` on an async generator that had already been closed or 2889 exhausted. 2890 2891- bpo-39579: Change the ending column offset of `Attribute` nodes 2892 constructed in `ast_for_dotted_name` to point at the end of the current 2893 node and not at the end of the last `NAME` node. 2894 2895- bpo-1635741: Port _crypt extension module to multiphase initialization 2896 (:pep:`489`). 2897 2898- bpo-1635741: Port _contextvars extension module to multiphase 2899 initialization (:pep:`489`). 2900 2901- bpo-39510: Fix segfault in ``readinto()`` method on closed BufferedReader. 2902 2903- bpo-39502: Fix :func:`time.localtime` on 64-bit AIX to support years 2904 before 1902 and after 2038. Patch by M Felt. 2905 2906- bpo-39492: Fix a reference cycle in the C Pickler that was preventing the 2907 garbage collection of deleted, pickled objects. 2908 2909- bpo-39453: Fixed a possible crash in :meth:`list.__contains__` when a list 2910 is changed during comparing items. Patch by Dong-hee Na. 2911 2912- bpo-39434: :term:`floor division` of float operation now has a better 2913 performance. Also the message of :exc:`ZeroDivisionError` for this 2914 operation is updated. Patch by Dong-hee Na. 2915 2916- bpo-1635741: Port _codecs extension module to multiphase initialization 2917 (:pep:`489`). 2918 2919- bpo-1635741: Port _bz2 extension module to multiphase initialization 2920 (:pep:`489`). 2921 2922- bpo-1635741: Port _abc extension module to multiphase initialization 2923 (:pep:`489`). 2924 2925- bpo-39320: Replace two complex bytecodes for building dicts with two 2926 simpler ones. The new bytecodes ``DICT_MERGE`` and ``DICT_UPDATE`` have 2927 been added The old bytecodes ``BUILD_MAP_UNPACK`` and 2928 ``BUILD_MAP_UNPACK_WITH_CALL`` have been removed. 2929 2930- bpo-39219: Syntax errors raised in the tokenizer now always set correct 2931 "text" and "offset" attributes. 2932 2933- bpo-36051: Drop the GIL during large ``bytes.join`` operations. Patch by 2934 Bruce Merry. 2935 2936- bpo-38960: Fix DTrace build issues on FreeBSD. Patch by David Carlier. 2937 2938- bpo-37207: Speed up calls to ``range()`` by about 30%, by using the PEP 2939 590 ``vectorcall`` calling convention. Patch by Mark Shannon. 2940 2941- bpo-36144: :class:`dict` (and :class:`collections.UserDict`) objects now 2942 support PEP 584's merge (``|``) and update (``|=``) operators. Patch by 2943 Brandt Bucher. 2944 2945- bpo-32856: Optimized the idiom for assignment a temporary variable in 2946 comprehensions. Now ``for y in [expr]`` in comprehensions is as fast as a 2947 simple assignment ``y = expr``. 2948 2949Library 2950------- 2951 2952- bpo-30566: Fix :exc:`IndexError` when trying to decode an invalid string 2953 with punycode codec. 2954 2955- bpo-39649: Remove obsolete check for `__args__` in 2956 bdb.Bdb.format_stack_entry. 2957 2958- bpo-39648: Expanded :func:`math.gcd` and :func:`math.lcm` to handle 2959 multiple arguments. 2960 2961- bpo-39681: Fix a regression where the C pickle module wouldn't allow 2962 unpickling from a file-like object that doesn't expose a readinto() 2963 method. 2964 2965- bpo-35950: Raise :exc:`io.UnsupportedOperation` in 2966 :meth:`io.BufferedReader.truncate` when it is called on a read-only 2967 :class:`io.BufferedReader` instance. 2968 2969- bpo-39479: Add :func:`math.lcm` function: least common multiple. 2970 2971- bpo-39674: Revert "Do not expose abstract collection classes in the 2972 collections module" change (bpo-25988). Aliases to ABC like 2973 collections.Mapping are kept in Python 3.9 to ease transition from Python 2974 2.7, but will be removed in Python 3.10. 2975 2976- bpo-39104: Fix hanging ProcessPoolExcutor on ``shutdown(wait=False)`` when 2977 a task has failed pickling. 2978 2979- bpo-39627: Fixed TypedDict totality check for inherited keys. 2980 2981- bpo-39474: Fixed starting position of AST for expressions like ``(a)(b)``, 2982 ``(a)[b]`` and ``(a).b``. 2983 2984- bpo-21016: The :mod:`pydoc` and :mod:`trace` modules now use the 2985 :mod:`sysconfig` module to get the path to the Python standard library, to 2986 support uncommon installation path like ``/usr/lib64/python3.9/`` on 2987 Fedora. Patch by Jan Matějek. 2988 2989- bpo-39590: Collections.deque now holds strong references during 2990 deque.__contains__ and deque.count, fixing crashes. 2991 2992- bpo-39586: The distutils ``bdist_msi`` command is deprecated in Python 2993 3.9, use ``bdist_wheel`` (wheel packages) instead. 2994 2995- bpo-39595: Improved performance of zipfile.Path for files with a large 2996 number of entries. Also improved performance and fixed minor issue as 2997 published with `importlib_metadata 1.5 2998 <https://importlib-metadata.readthedocs.io/en/latest/changelog%20(links).html#v1-5-0>`_. 2999 3000- bpo-39350: Fix regression in :class:`fractions.Fraction` if the numerator 3001 and/or the denominator is an :class:`int` subclass. The :func:`math.gcd` 3002 function is now used to normalize the *numerator* and *denominator*. 3003 :func:`math.gcd` always return a :class:`int` type. Previously, the GCD 3004 type depended on *numerator* and *denominator*. 3005 3006- bpo-39567: Added audit for :func:`os.walk`, :func:`os.fwalk`, 3007 :meth:`pathlib.Path.glob` and :meth:`pathlib.Path.rglob`. 3008 3009- bpo-39559: Remove unused, undocumented argument ``getters`` from 3010 :func:`uuid.getnode` 3011 3012- bpo-38149: :func:`sys.audit` is now called only once per call of 3013 :func:`glob.glob` and :func:`glob.iglob`. 3014 3015- bpo-39546: Fix a regression in :class:`~argparse.ArgumentParser` where 3016 ``allow_abbrev=False`` was ignored for long options that used a prefix 3017 character other than "-". 3018 3019- bpo-39450: Striped whitespace from docstring before returning it from 3020 :func:`unittest.case.shortDescription`. 3021 3022- bpo-12915: A new function ``resolve_name`` has been added to the 3023 ``pkgutil`` module. This resolves a string of the form ``'a.b.c.d'`` or 3024 ``'a.b:c.d'`` to an object. In the example, ``a.b`` is a package/module 3025 and ``c.d`` is an object within that package/module reached via recursive 3026 attribute access. 3027 3028- bpo-39353: The :func:`binascii.crc_hqx` function is no longer deprecated. 3029 3030- bpo-39493: Mark ``typing.IO.closed`` as a property 3031 3032- bpo-39491: Add :data:`typing.Annotated` and ``include_extras`` parameter 3033 to :func:`typing.get_type_hints` as part of :pep:`593`. Patch by Till 3034 Varoquaux, documentation by Till Varoquaux and Konstantin Kashin. 3035 3036- bpo-39485: Fix a bug in :func:`unittest.mock.create_autospec` that would 3037 complain about the wrong number of arguments for custom descriptors 3038 defined in an extension module returning functions. 3039 3040- bpo-38932: Mock fully resets child objects on reset_mock(). Patch by 3041 Vegard Stikbakke 3042 3043- bpo-39082: Allow AsyncMock to correctly patch static/class methods 3044 3045- bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit\_..." symbol 3046 names in distutils to make it export the correct init symbol also on 3047 Windows. 3048 3049- bpo-18819: Omit ``devmajor`` and ``devminor`` fields for non-device files 3050 in :mod:`tarfile` archives, enabling bit-for-bit compatibility with GNU 3051 ``tar(1)``. 3052 3053- bpo-39349: Added a new *cancel_futures* parameter to 3054 :meth:`concurrent.futures.Executor.shutdown` that cancels all pending 3055 futures which have not started running, instead of waiting for them to 3056 complete before shutting down the executor. 3057 3058- bpo-39274: ``bool(fraction.Fraction)`` now returns a boolean even if 3059 (numerator != 0) does not return a boolean (ex: numpy number). 3060 3061- bpo-34793: Remove support for ``with (await asyncio.lock):`` and ``with 3062 (yield from asyncio.lock):``. The same is correct for 3063 ``asyncio.Condition`` and ``asyncio.Semaphore``. 3064 3065- bpo-25597: Ensure, if ``wraps`` is supplied to 3066 :class:`unittest.mock.MagicMock`, it is used to calculate return values 3067 for the magic methods instead of using the default return values. Patch by 3068 Karthikeyan Singaravelan. 3069 3070- bpo-36350: `inspect.Signature.parameters` and 3071 `inspect.BoundArguments.arguments` are now dicts instead of OrderedDicts. 3072 Patch contributed by Rémi Lapeyre. 3073 3074- bpo-35727: Fix sys.exit() and sys.exit(None) exit code propagation when 3075 used in multiprocessing.Process. 3076 3077- bpo-32173: * Add `lazycache` function to `__all__`. * Use `dict.clear` to 3078 clear the cache. * Refactoring `getline` function and `checkcache` 3079 function. 3080 3081Documentation 3082------------- 3083 3084- bpo-17422: The language reference now specifies restrictions on class 3085 namespaces. Adapted from a patch by Ethan Furman. 3086 3087- bpo-39572: Updated documentation of ``total`` flag of TypeDict. 3088 3089- bpo-39654: In pyclbr doc, update 'class' to 'module' where appropriate and 3090 add readmodule comment. Patch by Hakan Çelik. 3091 3092- bpo-39153: Clarify refcounting semantics for the following functions: - 3093 PyObject_SetItem - PyMapping_SetItemString - PyDict_SetItem - 3094 PyDict_SetItemString 3095 3096- bpo-39392: Explain that when filling with turtle, overlap regions may be 3097 left unfilled. 3098 3099- bpo-39369: Update mmap readline method description. The fact that the 3100 readline method does update the file position should not be ignored since 3101 this might give the impression for the programmer that it doesn't update 3102 it. 3103 3104- bpo-9056: Include subsection in TOC for PDF version of docs. 3105 3106Tests 3107----- 3108 3109- bpo-38325: Skip tests on non-BMP characters of test_winconsoleio. 3110 3111- bpo-39502: Skip test_zipfile.test_add_file_after_2107() if 3112 :func:`time.localtime` fails with :exc:`OverflowError`. It is the case on 3113 AIX 6.1 for example. 3114 3115Build 3116----- 3117 3118- bpo-39489: Remove ``COUNT_ALLOCS`` special build. 3119 3120Windows 3121------- 3122 3123- bpo-39553: Delete unused code related to SxS manifests. 3124 3125- bpo-39439: Honor the Python path when a virtualenv is active on Windows. 3126 3127- bpo-39393: Improve the error message when attempting to load a DLL with 3128 unresolved dependencies. 3129 3130- bpo-38883: :meth:`~pathlib.Path.home()` and 3131 :meth:`~pathlib.Path.expanduser()` on Windows now prefer 3132 :envvar:`USERPROFILE` and no longer use :envvar:`HOME`, which is not 3133 normally set for regular user accounts. This makes them again behave like 3134 :func:`os.path.expanduser`, which was changed to ignore :envvar:`HOME` in 3135 3.8, see :issue:`36264`. 3136 3137- bpo-39185: The build.bat script has additional options for very-quiet 3138 output (-q) and very-verbose output (-vv) 3139 3140IDLE 3141---- 3142 3143- bpo-39663: Add tests for pyparse find_good_parse_start(). 3144 3145- bpo-39600: In the font configuration window, remove duplicated font names. 3146 3147- bpo-30780: Add remaining configdialog tests for buttons and highlights and 3148 keys tabs. 3149 3150- bpo-39388: IDLE Settings Cancel button now cancels pending changes 3151 3152- bpo-38792: Close an IDLE shell calltip if a :exc:`KeyboardInterrupt` or 3153 shell restart occurs. Patch by Zackery Spytz. 3154 3155C API 3156----- 3157 3158- bpo-35081: Move the ``bytes_methods.h`` header file to the internal C API 3159 as ``pycore_bytes_methods.h``: it only contains private symbols (prefixed 3160 by ``_Py``), except of the ``PyDoc_STRVAR_shared()`` macro. 3161 3162- bpo-35081: Move the ``dtoa.h`` header file to the internal C API as 3163 ``pycore_dtoa.h``: it only contains private functions (prefixed by 3164 ``_Py``). The :mod:`math` and :mod:`cmath` modules must now be compiled 3165 with the ``Py_BUILD_CORE`` macro defined. 3166 3167- bpo-39573: Add :c:func:`Py_SET_SIZE` function to set the size of an 3168 object. 3169 3170- bpo-39500: :c:func:`PyUnicode_IsIdentifier` does not call 3171 :c:func:`Py_FatalError` anymore if the string is not ready. 3172 3173- bpo-39573: Add :c:func:`Py_SET_TYPE` function to set the type of an 3174 object. 3175 3176- bpo-39573: Add a :c:func:`Py_SET_REFCNT` function to set the reference 3177 counter of an object. 3178 3179- bpo-39542: Convert :c:func:`PyType_HasFeature`, :c:func:`PyType_Check` and 3180 :c:func:`PyType_CheckExact` macros to static inline functions. 3181 3182- bpo-39542: In the limited C API, ``PyObject_INIT()`` and 3183 ``PyObject_INIT_VAR()`` are now defined as aliases to 3184 :c:func:`PyObject_Init` and :c:func:`PyObject_InitVar` to make their 3185 implementation opaque. It avoids to leak implementation details in the 3186 limited C API. Exclude the following functions from the limited C API: 3187 ``_Py_NewReference()``, ``_Py_ForgetReference()``, 3188 ``_PyTraceMalloc_NewReference()`` and ``_Py_GetRefTotal()``. 3189 3190- bpo-39542: Exclude trashcan mechanism from the limited C API: it requires 3191 access to PyTypeObject and PyThreadState structure fields, whereas these 3192 structures are opaque in the limited C API. 3193 3194- bpo-39511: The :c:func:`PyThreadState_Clear` function now calls the 3195 :c:member:`PyThreadState.on_delete` callback. Previously, that happened in 3196 :c:func:`PyThreadState_Delete`. 3197 3198- bpo-38076: Fix to clear the interpreter state only after clearing module 3199 globals to guarantee module state access from C Extensions during runtime 3200 destruction 3201 3202- bpo-39245: The Vectorcall API (PEP 590) was made public, adding the 3203 functions ``PyObject_Vectorcall``, ``PyObject_VectorcallMethod``, 3204 ``PyVectorcall_Function``, ``PyObject_CallOneArg``, 3205 ``PyObject_CallMethodNoArgs``, ``PyObject_CallMethodOneArg``, 3206 ``PyObject_FastCallDict``, and the flag ``Py_TPFLAGS_HAVE_VECTORCALL``. 3207 3208 3209What's New in Python 3.9.0 alpha 3? 3210=================================== 3211 3212*Release date: 2020-01-24* 3213 3214Core and Builtins 3215----------------- 3216 3217- bpo-39427: Document all possibilities for the ``-X`` options in the 3218 command line help section. Patch by Pablo Galindo. 3219 3220- bpo-39421: Fix possible crashes when operating with the functions in the 3221 :mod:`heapq` module and custom comparison operators. 3222 3223- bpo-39386: Prevent double awaiting of async iterator. 3224 3225- bpo-17005: Add :class:`functools.TopologicalSorter` to the 3226 :mod:`functools` module to offers functionality to perform topological 3227 sorting of graphs. Patch by Pablo Galindo, Tim Peters and Larry Hastings. 3228 3229- bpo-39320: Replace four complex bytecodes for building sequences with 3230 three simpler ones. 3231 3232 The following four bytecodes have been removed: 3233 3234 * BUILD_LIST_UNPACK 3235 * BUILD_TUPLE_UNPACK 3236 * BUILD_SET_UNPACK 3237 * BUILD_TUPLE_UNPACK_WITH_CALL 3238 3239 The following three bytecodes have been added: 3240 3241 * LIST_TO_TUPLE 3242 * LIST_EXTEND 3243 * SET_UPDATE 3244 3245- bpo-39336: Import loaders which publish immutable module objects can now 3246 publish immutable packages in addition to individual modules. 3247 3248- bpo-39322: Added a new function :func:`gc.is_finalized` to check if an 3249 object has been finalized by the garbage collector. Patch by Pablo 3250 Galindo. 3251 3252- bpo-39048: Improve the displayed error message when incorrect types are 3253 passed to ``async with`` statements by looking up the :meth:`__aenter__` 3254 special method before the :meth:`__aexit__` special method when entering 3255 an asynchronous context manager. Patch by Géry Ogam. 3256 3257- bpo-39235: Fix AST end location for lone generator expression in function 3258 call, e.g. f(i for i in a). 3259 3260- bpo-39209: Correctly handle multi-line tokens in interactive mode. Patch 3261 by Pablo Galindo. 3262 3263- bpo-1635741: Port _json extension module to multiphase initialization 3264 (:pep:`489`). 3265 3266- bpo-39216: Fix constant folding optimization for positional only arguments 3267 - by Anthony Sottile. 3268 3269- bpo-39215: Fix ``SystemError`` when nested function has annotation on 3270 positional-only argument - by Anthony Sottile. 3271 3272- bpo-39200: Correct the error message when calling the :func:`min` or 3273 :func:`max` with no arguments. Patch by Dong-hee Na. 3274 3275- bpo-39200: Correct the error message when trying to construct 3276 :class:`range` objects with no arguments. Patch by Pablo Galindo. 3277 3278- bpo-39166: Fix incorrect line execution reporting in trace functions when 3279 tracing the last iteration of asynchronous for loops. Patch by Pablo 3280 Galindo. 3281 3282- bpo-39114: Fix incorrent line execution reporting in trace functions when 3283 tracing exception handlers with name binding. Patch by Pablo Galindo. 3284 3285- bpo-39156: Split the COMPARE_OP bytecode instruction into four distinct 3286 instructions. 3287 3288 * COMPARE_OP for rich comparisons 3289 * IS_OP for 'is' and 'is not' tests 3290 * CONTAINS_OP for 'in' and 'is not' tests 3291 * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements. 3292 3293 This improves the clarity of the interpreter and should provide a modest 3294 speedup. 3295 3296- bpo-38588: Fix possible crashes in dict and list when calling 3297 :c:func:`PyObject_RichCompareBool`. 3298 3299- bpo-13601: By default, ``sys.stderr`` is line-buffered now, even if 3300 ``stderr`` is redirected to a file. You can still make ``sys.stderr`` 3301 unbuffered by passing the :option:`-u` command-line option or setting the 3302 :envvar:`PYTHONUNBUFFERED` environment variable. 3303 3304 (Contributed by Jendrik Seipp in bpo-13601.) 3305 3306- bpo-38610: Fix possible crashes in several list methods by holding strong 3307 references to list elements when calling 3308 :c:func:`PyObject_RichCompareBool`. 3309 3310- bpo-32021: Include brotli .br encoding in mimetypes encodings_map 3311 3312Library 3313------- 3314 3315- bpo-39430: Fixed race condition in lazy imports in :mod:`tarfile`. 3316 3317- bpo-39413: The :func:`os.unsetenv` function is now also available on 3318 Windows. 3319 3320- bpo-39390: Fixed a regression with the `ignore` callback of 3321 :func:`shutil.copytree`. The argument types are now str and List[str] 3322 again. 3323 3324- bpo-39395: The :func:`os.putenv` and :func:`os.unsetenv` functions are now 3325 always available. 3326 3327- bpo-39406: If ``setenv()`` C function is available, :func:`os.putenv` is 3328 now implemented with ``setenv()`` instead of ``putenv()``, so Python 3329 doesn't have to handle the environment variable memory. 3330 3331- bpo-39396: Fix ``math.nextafter(-0.0, +0.0)`` on AIX 7.1. 3332 3333- bpo-29435: Allow :func:`tarfile.is_tarfile` to be used with file and 3334 file-like objects, like :func:`zipfile.is_zipfile`. Patch by William 3335 Woodruff. 3336 3337- bpo-39377: Removed ``encoding`` option from :func:`json.loads`. It has 3338 been deprecated since Python 3.1. 3339 3340- bpo-39389: Write accurate compression level metadata in :mod:`gzip` 3341 archives, rather than always signaling maximum compression. 3342 3343- bpo-39366: The previously deprecated ``xpath()`` and ``xgtitle()`` methods 3344 of :class:`nntplib.NNTP` have been removed. 3345 3346- bpo-39357: Remove the *buffering* parameter of :class:`bz2.BZ2File`. Since 3347 Python 3.0, it was ignored and using it was emitting 3348 :exc:`DeprecationWarning`. Pass an open file object, to control how the 3349 file is opened. The *compresslevel* parameter becomes keyword-only. 3350 3351- bpo-39353: Deprecate binhex4 and hexbin4 standards. Deprecate the 3352 :mod:`binhex` module and the following :mod:`binascii` functions: 3353 :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`, 3354 :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`, 3355 :func:`~binascii.crc_hqx`. 3356 3357- bpo-39351: Remove ``base64.encodestring()`` and ``base64.decodestring()``, 3358 aliases deprecated since Python 3.1: use :func:`base64.encodebytes` and 3359 :func:`base64.decodebytes` instead. 3360 3361- bpo-39350: Remove ``fractions.gcd()`` function, deprecated since Python 3362 3.5 (:issue:`22486`): use :func:`math.gcd` instead. 3363 3364- bpo-39329: :class:`~smtplib.LMTP` constructor now has an optional 3365 *timeout* parameter. Patch by Dong-hee Na. 3366 3367- bpo-39313: Add a new ``exec_function`` option (*--exec-function* in the 3368 CLI) to ``RefactoringTool`` for making ``exec`` a function. Patch by 3369 Batuhan Taskaya. 3370 3371- bpo-39259: :class:`~ftplib.FTP_TLS` and :class:`~ftplib.FTP_TLS` now raise 3372 a :class:`ValueError` if the given timeout for their constructor is zero 3373 to prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 3374 3375- bpo-39259: :class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise 3376 a :class:`ValueError` if the given timeout for their constructor is zero 3377 to prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 3378 3379- bpo-39310: Add :func:`math.ulp`: return the value of the least significant 3380 bit of a float. 3381 3382- bpo-39297: Improved performance of importlib.metadata distribution 3383 discovery and resilients to inaccessible sys.path entries 3384 (importlib_metadata v1.4.0). 3385 3386- bpo-39259: :class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise 3387 a :class:`ValueError` if the given timeout for their constructor is zero 3388 to prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 3389 3390- bpo-38901: When you specify prompt='.' or equivalently python -m venv 3391 --prompt . ... the basename of the current directory is used to set the 3392 created venv's prompt when it's activated. 3393 3394- bpo-39288: Add :func:`math.nextafter`: return the next floating-point 3395 value after *x* towards *y*. 3396 3397- bpo-39259: :class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a 3398 :class:`ValueError` if the given timeout for their constructor is zero to 3399 prevent the creation of a non-blocking socket. Patch by Dong-hee Na. 3400 3401- bpo-39242: Updated the Gmane domain from news.gmane.org to news.gmane.io 3402 which is used for examples of :class:`~nntplib.NNTP` news reader server 3403 and nntplib tests. 3404 3405- bpo-35292: Proxy the `SimpleHTTPRequestHandler.guess_type` to 3406 `mimetypes.guess_type` so the `mimetypes.init` is called lazily to avoid 3407 unnecessary costs when :mod:`http.server` module is imported. 3408 3409- bpo-39239: The :meth:`select.epoll.unregister` method no longer ignores 3410 the :data:`~errno.EBADF` error. 3411 3412- bpo-38907: In http.server script, restore binding to IPv4 on Windows. 3413 3414- bpo-39152: Fix ttk.Scale.configure([name]) to return configuration tuple 3415 for name or all options. Giovanni Lombardo contributed part of the patch. 3416 3417- bpo-39198: If an exception were to be thrown in `Logger.isEnabledFor` 3418 (say, by asyncio timeouts or stopit) , the `logging` global lock may not 3419 be released appropriately, resulting in deadlock. This change wraps that 3420 block of code with `try...finally` to ensure the lock is released. 3421 3422- bpo-39191: Perform a check for running loop before starting a new task in 3423 ``loop.run_until_complete()`` to fail fast; it prevents the side effect of 3424 new task spawning before exception raising. 3425 3426- bpo-38871: Correctly parenthesize filter-based statements that contain 3427 lambda expressions in mod:`lib2to3`. Patch by Dong-hee Na. 3428 3429- bpo-39142: A change was made to logging.config.dictConfig to avoid 3430 converting instances of named tuples to ConvertingTuple. It's assumed that 3431 named tuples are too specialised to be treated like ordinary tuples; if a 3432 user of named tuples requires ConvertingTuple functionality, they will 3433 have to implement that themselves in their named tuple class. 3434 3435- bpo-39158: ast.literal_eval() now supports empty sets. 3436 3437- bpo-39129: Fix import path for ``asyncio.TimeoutError`` 3438 3439- bpo-39057: :func:`urllib.request.proxy_bypass_environment` now ignores 3440 leading dots and no longer ignores a trailing newline. 3441 3442- bpo-39056: Fixed handling invalid warning category in the -W option. No 3443 longer import the re module if it is not needed. 3444 3445- bpo-39055: :func:`base64.b64decode` with ``validate=True`` raises now a 3446 binascii.Error if the input ends with a single ``\n``. 3447 3448- bpo-21600: Fix :func:`mock.patch.stopall` to stop active patches that were 3449 created with :func:`mock.patch.dict`. 3450 3451- bpo-39019: Implement dummy ``__class_getitem__`` for 3452 :class:`tempfile.SpooledTemporaryFile`. 3453 3454- bpo-39019: Implement dummy ``__class_getitem__`` for ``subprocess.Popen``, 3455 ``subprocess.CompletedProcess`` 3456 3457- bpo-38914: Adjusted the wording of the warning issued by distutils' 3458 ``check`` command when the ``author`` and ``maintainer`` fields are 3459 supplied but no corresponding e-mail field (``author_email`` or 3460 ``maintainer_email``) is found. The wording now reflects the fact that 3461 these fields are suggested, but not required. Patch by Juergen Gmach. 3462 3463- bpo-38878: Fixed __subclasshook__ of :class:`os.PathLike` to return a 3464 correct result upon inheritence. Patch by Bar Harel. 3465 3466- bpo-38615: :class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now 3467 have an optional *timeout* parameter for their constructors. Also, the 3468 :meth:`~imaplib.IMAP4.open` method now has an optional *timeout* parameter 3469 with this change. The overridden methods of :class:`~imaplib.IMAP4_SSL` 3470 and :class:`~imaplib.IMAP4_stream` were applied to this change. Patch by 3471 Dong-hee Na. 3472 3473- bpo-35182: Fixed :func:`Popen.communicate` subsequent call crash when the 3474 child process has already closed any piped standard stream, but still 3475 continues to be running. Patch by Andriy Maletsky. 3476 3477- bpo-38630: On Unix, :meth:`subprocess.Popen.send_signal` now polls the 3478 process status. Polling reduces the risk of sending a signal to the wrong 3479 process if the process completed, the :attr:`subprocess.Popen.returncode` 3480 attribute is still ``None``, and the pid has been reassigned (recycled) to 3481 a new different process. 3482 3483- bpo-38536: Removes trailing space in formatted currency with 3484 `international=True` and a locale with symbol following value. E.g. 3485 `locale.currency(12.34, international=True)` returned `'12,34 EUR '` 3486 instead of `'12,34 EUR'`. 3487 3488- bpo-38473: Use signature from inner mock for autospecced methods attached 3489 with :func:`unittest.mock.attach_mock`. Patch by Karthikeyan Singaravelan. 3490 3491- bpo-38361: Fixed an issue where ``ident`` could include a leading path 3492 separator when :func:`syslog.openlog` was called without arguments. 3493 3494- bpo-38293: Add :func:`copy.copy` and :func:`copy.deepcopy` support to 3495 :func:`property` objects. 3496 3497- bpo-37958: Added the pstats.Stats.get_profile_dict() method to return the 3498 profile data as a StatsProfile instance. 3499 3500- bpo-28367: Termios magic constants for the following baud rates: - 3501 B500000 - B576000 - B921600 - B1000000 - B1152000 - B1500000 - 3502 B2000000 - B2500000 - B3000000 - B3500000 - B4000000 Patch by 3503 Andrey Smirnov 3504 3505Documentation 3506------------- 3507 3508- bpo-39381: Mention in docs that :func:`asyncio.get_event_loop` implicitly 3509 creates new event loop only if called from the main thread. 3510 3511- bpo-38918: Add an entry for ``__module__`` in the "function" & "method" 3512 sections of the `inspect docs types and members table 3513 <https://docs.python.org/3/library/inspect.html#types-and-members>`_ 3514 3515- bpo-3530: In the :mod:`ast` module documentation, fix a misleading 3516 ``NodeTransformer`` example and add advice on when to use the 3517 ``fix_missing_locations`` function. 3518 3519Build 3520----- 3521 3522- bpo-39395: On non-Windows platforms, the :c:func:`setenv` and 3523 :c:func:`unsetenv` functions are now required to build Python. 3524 3525- bpo-39160: Updated the documentation in `./configure --help` to show 3526 default values, reference documentation where required and add additional 3527 explanation where needed. 3528 3529- bpo-39144: The ctags and etags build targets both include Modules/_ctypes 3530 and Python standard library source files. 3531 3532IDLE 3533---- 3534 3535- bpo-39050: Make IDLE Settings dialog Help button work again. 3536 3537- bpo-34118: Tag memoryview, range, and tuple as classes, the same as list, 3538 etcetera, in the library manual built-in functions list. 3539 3540- bpo-32989: Add tests for editor newline_and_indent_event method. Remove 3541 dead code from pyparse find_good_parse_start method. 3542 3543C API 3544----- 3545 3546- bpo-39372: Clean header files of interfaces defined but with no 3547 implementation. The public API symbols being removed are: 3548 ``_PyBytes_InsertThousandsGroupingLocale``, 3549 ``_PyBytes_InsertThousandsGrouping``, ``_Py_InitializeFromArgs``, 3550 ``_Py_InitializeFromWideArgs``, ``_PyFloat_Repr``, ``_PyFloat_Digits``, 3551 ``_PyFloat_DigitsInit``, ``PyFrame_ExtendStack``, 3552 ``_PyAIterWrapper_Type``, ``PyNullImporter_Type``, ``PyCmpWrapper_Type``, 3553 ``PySortWrapper_Type``, ``PyNoArgsFunction``. 3554 3555- bpo-39164: Add a private ``_PyErr_GetExcInfo()`` function to retrieve 3556 exception information of the specified Python thread state. 3557 3558 3559What's New in Python 3.9.0 alpha 2? 3560=================================== 3561 3562*Release date: 2019-12-18* 3563 3564Security 3565-------- 3566 3567- bpo-38945: Newline characters have been escaped when performing uu 3568 encoding to prevent them from overflowing into to content section of the 3569 encoded file. This prevents malicious or accidental modification of data 3570 during the decoding process. 3571 3572- bpo-37228: Due to significant security concerns, the *reuse_address* 3573 parameter of :meth:`asyncio.loop.create_datagram_endpoint` is no longer 3574 supported. This is because of the behavior of ``SO_REUSEADDR`` in UDP. For 3575 more details, see the documentation for 3576 ``loop.create_datagram_endpoint()``. (Contributed by Kyle Stanley, Antoine 3577 Pitrou, and Yury Selivanov in :issue:`37228`.) 3578 3579- bpo-38804: Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by 3580 Ben Caller. 3581 3582Core and Builtins 3583----------------- 3584 3585- bpo-39028: Slightly improve the speed of keyword argument parsing with 3586 many kwargs by strengthening the assumption that kwargs are interned 3587 strings. 3588 3589- bpo-39080: Fix the value of *end_col_offset* for Starred Expression AST 3590 nodes when they are among the elements in the *args* attribute of Call AST 3591 nodes. 3592 3593- bpo-39031: When parsing an "elif" node, lineno and col_offset of the node 3594 now point to the "elif" keyword and not to its condition, making it 3595 consistent with the "if" node. Patch by Lysandros Nikolaou. 3596 3597- bpo-20443: In Python 3.9.0a1, sys.argv[0] was made an absolute path if a 3598 filename was specified on the command line. Revert this change, since most 3599 users expect sys.argv to be unmodified. 3600 3601- bpo-39008: :c:func:`PySys_Audit` now requires ``Py_ssize_t`` to be used 3602 for size arguments in the format string, regardless of whether 3603 ``PY_SSIZE_T_CLEAN`` was defined at include time. 3604 3605- bpo-38673: In REPL mode, don't switch to PS2 if the line starts with 3606 comment or whitespace. Based on work by Batuhan Taşkaya. 3607 3608- bpo-38922: Calling ``replace`` on a code object now raises the 3609 ``code.__new__`` audit event. 3610 3611- bpo-38920: Add audit hooks for when :func:`sys.excepthook` and 3612 :func:`sys.unraisablehook` are invoked. 3613 3614- bpo-38892: Improve documentation for audit events table and functions. 3615 3616- bpo-38852: Set the thread stack size to 8 Mb for debug builds on android 3617 platforms. 3618 3619- bpo-38858: Each Python subinterpreter now has its own "small integer 3620 singletons": numbers in [-5; 257] range. It is no longer possible to 3621 change the number of small integers at build time by overriding 3622 ``NSMALLNEGINTS`` and ``NSMALLPOSINTS`` macros: macros should now be 3623 modified manually in ``pycore_pystate.h`` header file. 3624 3625- bpo-36854: The garbage collector state becomes per interpreter 3626 (``PyInterpreterState.gc``), rather than being global 3627 (``_PyRuntimeState.gc``). 3628 3629- bpo-38835: The ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` 3630 macros are empty: they have been doing nothing for the last year, so stop 3631 using them. 3632 3633- bpo-38328: Sped up the creation time of constant :class:`list` and 3634 :class:`set` displays. Patch by Brandt Bucher. 3635 3636- bpo-38707: ``MainThread.native_id`` is now correctly reset in child 3637 processes spawned using :class:`multiprocessing.Process`, instead of 3638 retaining the parent's value. 3639 3640- bpo-38629: Added ``__floor__`` and ``__ceil__`` methods to float object. 3641 Patch by Batuhan Taşkaya. 3642 3643- bpo-27145: int + int and int - int operators can now return small integer 3644 singletons. Patch by hongweipeng. 3645 3646- bpo-38021: Provide a platform tag for AIX that is sufficient for PEP425 3647 binary distribution identification. Patch by Michael Felt. 3648 3649- bpo-35409: Ignore GeneratorExit exceptions when throwing an exception into 3650 the aclose coroutine of an asynchronous generator. 3651 3652- bpo-33387: Removed WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, 3653 END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Replaced with RERAISE 3654 and WITH_EXCEPT_START bytecodes. The compiler now generates different code 3655 for exceptional and non-exceptional branches for 'with' and 'try-except' 3656 statements. For 'try-finally' statements the 'finally' block is replicated 3657 for each exit from the 'try' body. 3658 3659Library 3660------- 3661 3662- bpo-39033: Fix :exc:`NameError` in :mod:`zipimport`. Patch by Karthikeyan 3663 Singaravelan. 3664 3665- bpo-39022: Update importlib.metadata to include improvements from 3666 importlib_metadata 1.3 including better serialization of EntryPoints and 3667 improved documentation for custom finders. 3668 3669- bpo-39006: Fix asyncio when the ssl module is missing: only check for 3670 ssl.SSLSocket instance if the ssl module is available. 3671 3672- bpo-38708: Fix a potential IndexError in email parser when parsing an 3673 empty msg-id. 3674 3675- bpo-38698: Add a new ``InvalidMessageID`` token to email parser to 3676 represent invalid Message-ID headers. Also, add defects when there is 3677 remaining value after parsing the header. 3678 3679- bpo-38994: Implement ``__class_getitem__`` for ``os.PathLike``, 3680 ``pathlib.Path``. 3681 3682- bpo-38979: Return class from ``ContextVar.__class_getitem__`` to simplify 3683 subclassing. 3684 3685- bpo-38978: Implement ``__class_getitem__`` on asyncio objects (Future, 3686 Task, Queue). Patch by Batuhan Taskaya. 3687 3688- bpo-38916: :class:`array.array`: Remove ``tostring()`` and 3689 ``fromstring()`` methods. They were aliases to ``tobytes()`` and 3690 ``frombytes()``, deprecated since Python 3.2. 3691 3692- bpo-38986: Make repr of C accelerated TaskWakeupMethWrapper the same as of 3693 pure Python version. 3694 3695- bpo-38982: Fix asyncio ``PidfdChildWatcher``: handle ``waitpid()`` error. 3696 If ``waitpid()`` is called elsewhere, ``waitpid()`` call fails with 3697 :exc:`ChildProcessError`: use return code 255 in this case, and log a 3698 warning. It ensures that the pidfd file descriptor is closed if this error 3699 occurs. 3700 3701- bpo-38529: Drop too noisy asyncio warning about deletion of a stream 3702 without explicit ``.close()`` call. 3703 3704- bpo-27413: Added ability to pass through ``ensure_ascii`` options to 3705 json.dumps in the ``json.tool`` command-line interface. 3706 3707- bpo-38634: The :mod:`readline` module now detects if Python is linked to 3708 libedit at runtime on all platforms. Previously, the check was only done 3709 on macOS. 3710 3711- bpo-33684: Fix ``json.tool`` failed to read a JSON file with non-ASCII 3712 characters when locale encoding is not UTF-8. 3713 3714- bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id. 3715 3716 parse_message_id() was improperly using a token defined inside an 3717 exception handler, which was raising `UnboundLocalError` on parsing an 3718 invalid value. Patch by Claudiu Popa. 3719 3720- bpo-38927: Use ``python -m pip`` instead of ``pip`` to upgrade 3721 dependencies in venv. 3722 3723- bpo-26730: Fix ``SpooledTemporaryFile.rollover()`` might corrupt the file 3724 when it is in text mode. Patch by Serhiy Storchaka. 3725 3726- bpo-38881: random.choices() now raises a ValueError when all the weights 3727 are zero. 3728 3729- bpo-38876: Raise pickle.UnpicklingError when loading an item from memo for 3730 invalid input. 3731 3732 The previous code was raising a `KeyError` for both the Python and C 3733 implementation. This was caused by the specified index of an invalid input 3734 which did not exist in the memo structure, where the pickle stores what 3735 objects it has seen. The malformed input would have caused either a 3736 `BINGET` or `LONG_BINGET` load from the memo, leading to a `KeyError` as 3737 the determined index was bogus. Patch by Claudiu Popa 3738 3739- bpo-38688: Calling func:`shutil.copytree` to copy a directory tree from 3740 one directory to another subdirectory resulted in an endless loop and a 3741 RecursionError. A fix was added to consume an iterator and create the list 3742 of the entries to be copied, avoiding the recursion for newly created 3743 directories. Patch by Bruno P. Kinoshita. 3744 3745- bpo-38863: Improve :func:`is_cgi` function in :mod:`http.server`, which 3746 enables processing the case that cgi directory is a child of another 3747 directory other than root. 3748 3749- bpo-37838: :meth:`typing.get_type_hints` properly handles functions 3750 decorated with :meth:`functools.wraps`. 3751 3752- bpo-38870: Expose :func:`ast.unparse` as a function of the :mod:`ast` 3753 module that can be used to unparse an :class:`ast.AST` object and produce 3754 a string with code that would produce an equivalent :class:`ast.AST` 3755 object when parsed. Patch by Pablo Galindo and Batuhan Taskaya. 3756 3757- bpo-38859: AsyncMock now returns StopAsyncIteration on the exhaustion of a 3758 side_effects iterable. Since PEP-479 its Impossible to raise a 3759 StopIteration exception from a coroutine. 3760 3761- bpo-38857: AsyncMock fix for return values that are awaitable types. This 3762 also covers side_effect iterable values that happened to be awaitable, and 3763 wraps callables that return an awaitable type. Before these awaitables 3764 were being awaited instead of being returned as is. 3765 3766- bpo-38834: :class:`typing.TypedDict` subclasses now track which keys are 3767 optional using the ``__required_keys__`` and ``__optional_keys__`` 3768 attributes, to enable runtime validation by downstream projects. Patch by 3769 Zac Hatfield-Dodds. 3770 3771- bpo-38821: Fix unhandled exceptions in :mod:`argparse` when 3772 internationalizing error messages for arguments with ``nargs`` set to 3773 special (non-integer) values. Patch by Federico Bond. 3774 3775- bpo-38820: Make Python compatible with OpenSSL 3.0.0. 3776 :func:`ssl.SSLSocket.getpeercert` no longer returns IPv6 addresses with a 3777 trailing new line. 3778 3779- bpo-38811: Fix an unhandled exception in :mod:`pathlib` when 3780 :meth:`os.link` is missing. Patch by Toke Høiland-Jørgensen. 3781 3782- bpo-38686: Added support for multiple ``qop`` values in 3783 :class:`urllib.request.AbstractDigestAuthHandler`. 3784 3785- bpo-38712: Add the Linux-specific :func:`signal.pidfd_send_signal` 3786 function, which allows sending a signal to a process identified by a file 3787 descriptor rather than a pid. 3788 3789- bpo-38348: Add ``-i`` and ``--indent`` (indentation level), and 3790 ``--no-type-comments`` (type comments) command line options to ast parsing 3791 tool. 3792 3793- bpo-37523: Change :class:`zipfile.ZipExtFile` to raise ``ValueError`` when 3794 trying to access the underlying file object after it has been closed. This 3795 new behavior is consistent with how accessing closed files is handled in 3796 other parts of Python. 3797 3798- bpo-38045: Improve the performance of :func:`enum._decompose` in 3799 :mod:`enum`. Patch by hongweipeng. 3800 3801- bpo-36820: Break cycle generated when saving an exception in socket.py, 3802 codeop.py and dyld.py as they keep alive not only the exception but user 3803 objects through the ``__traceback__`` attribute. Patch by Mario Corchero. 3804 3805- bpo-36406: Handle namespace packages in :mod:`doctest`. Patch by 3806 Karthikeyan Singaravelan. 3807 3808- bpo-34776: Fix dataclasses to support forward references in type 3809 annotations 3810 3811- bpo-20928: ElementTree supports recursive XInclude processing. Patch by 3812 Stefan Behnel. 3813 3814- bpo-29636: Add whitespace options for formatting JSON with the 3815 ``json.tool`` CLI. The following mutually exclusive options are now 3816 supported: ``--indent`` for setting the indent level in spaces; ``--tab`` 3817 for indenting with tabs; ``--no-indent`` for suppressing newlines; and 3818 ``--compact`` for suppressing all whitespace. The default behavior remains 3819 the same as ``--indent=4``. 3820 3821Documentation 3822------------- 3823 3824- bpo-38928: Correct when venv's ``upgrade_dependencies()`` and 3825 ``--upgrade-deps`` are added. 3826 3827- bpo-38899: Update documentation to state that to activate virtual 3828 environments under fish one should use `source`, not `.` as documented at 3829 https://fishshell.com/docs/current/commands.html#source. 3830 3831- bpo-22377: Improves documentation of the values that 3832 :meth:`datetime.datetime.strptime` accepts for ``%Z``. Patch by Karl 3833 Dubost. 3834 3835Tests 3836----- 3837 3838- bpo-38546: Fix test_ressources_gced_in_workers() of 3839 test_concurrent_futures: explicitly stop the manager to prevent leaking a 3840 child process running in the background after the test completes. 3841 3842- bpo-38546: Multiprocessing and concurrent.futures tests now stop the 3843 resource tracker process when tests complete. 3844 3845- bpo-38614: Replace hardcoded timeout constants in tests with new 3846 :mod:`test.support` constants: :data:`~test.support.LOOPBACK_TIMEOUT`, 3847 :data:`~test.support.INTERNET_TIMEOUT`, 3848 :data:`~test.support.SHORT_TIMEOUT` and 3849 :data:`~test.support.LONG_TIMEOUT`. It becomes easier to adjust these four 3850 timeout constants for all tests at once, rather than having to adjust 3851 every single test file. 3852 3853- bpo-38547: Fix test_pty: if the process is the session leader, closing the 3854 master file descriptor raises a SIGHUP signal: simply ignore SIGHUP when 3855 running the tests. 3856 3857- bpo-38992: Fix a test for :func:`math.fsum` that was failing due to 3858 constant folding. 3859 3860- bpo-38991: :mod:`test.support`: 3861 :func:`~test.support.run_python_until_end`, 3862 :func:`~test.support.assert_python_ok` and 3863 :func:`~test.support.assert_python_failure` functions no longer strip 3864 whitespaces from stderr. Remove ``test.support.strip_python_stderr()`` 3865 function. 3866 3867- bpo-38965: Fix test_faulthandler on GCC 10. Use the "volatile" keyword in 3868 ``faulthandler._stack_overflow()`` to prevent tail call optimization on 3869 any compiler, rather than relying on compiler specific pragma. 3870 3871- bpo-38875: test_capi: trashcan tests now require the test "cpu" resource. 3872 3873- bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix 3874 on platforms lacking a functional bind() for named unix domain sockets. 3875 3876- bpo-38692: Skip the test_posix.test_pidfd_open() test if 3877 ``os.pidfd_open()`` fails with a :exc:`PermissionError`. This situation 3878 can happen in a Linux sandbox using a syscall whitelist which doesn't 3879 allow the ``pidfd_open()`` syscall yet. 3880 3881- bpo-38839: Fix some unused functions in tests. Patch by Adam Johnson. 3882 3883- bpo-38669: Raise :exc:`TypeError` when passing target as a string with 3884 :meth:`unittest.mock.patch.object`. 3885 3886- bpo-37957: test.regrtest now can receive a list of test patterns to ignore 3887 (using the -i/--ignore argument) or a file with a list of patterns to 3888 ignore (using the --ignore-file argument). Patch by Pablo Galindo. 3889 3890Build 3891----- 3892 3893- bpo-37404: :mod:`asyncio` now raises :exc:`TyperError` when calling 3894 incompatible methods with an :class:`ssl.SSLSocket` socket. Patch by Ido 3895 Michael. 3896 3897- bpo-36500: Added an optional "regen" project to the Visual Studio solution 3898 that will regenerate all grammar, tokens, and opcodes. 3899 3900Windows 3901------- 3902 3903- bpo-39007: Add auditing events to functions in :mod:`winreg`. 3904 3905- bpo-33125: Add support for building and releasing Windows ARM64 packages. 3906 3907macOS 3908----- 3909 3910- bpo-37931: Fixed a crash on OSX dynamic builds that occurred when 3911 re-initializing the posix module after a Py_Finalize if the environment 3912 had changed since the previous `import posix`. Patch by Benoît Hudson. 3913 3914IDLE 3915---- 3916 3917- bpo-38944: Escape key now closes IDLE completion windows. Patch by Johnny 3918 Najera. 3919 3920- bpo-38943: Fix IDLE autocomplete windows not always appearing on some 3921 systems. Patch by Johnny Najera. 3922 3923- bpo-38862: 'Strip Trailing Whitespace' on the Format menu removes extra 3924 newlines at the end of non-shell files. 3925 3926- bpo-38636: Fix IDLE Format menu tab toggle and file indent width. These 3927 functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in 3928 3.7.5 and 3.8.0. 3929 3930C API 3931----- 3932 3933- bpo-38896: Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free 3934 list has been removed in Python 3.3. 3935 3936- bpo-37340: Remove ``PyMethod_ClearFreeList()`` and 3937 ``PyCFunction_ClearFreeList()`` functions: the free lists of bound method 3938 objects have been removed. 3939 3940- bpo-38835: Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` 3941 macros of ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API). 3942 3943 3944What's New in Python 3.9.0 alpha 1? 3945=================================== 3946 3947*Release date: 2019-11-19* 3948 3949Security 3950-------- 3951 3952- bpo-38722: :mod:`runpy` now uses :meth:`io.open_code` to open code files. 3953 Patch by Jason Killen. 3954 3955- bpo-38622: Add additional audit events for the :mod:`ctypes` module. 3956 3957- bpo-38418: Fixes audit event for :func:`os.system` to be named 3958 ``os.system``. 3959 3960- bpo-38243: Escape the server title of 3961 :class:`xmlrpc.server.DocXMLRPCServer` when rendering the document page as 3962 HTML. (Contributed by Dong-hee Na in :issue:`38243`.) 3963 3964- bpo-38174: Update vendorized expat library version to 2.2.8, which 3965 resolves CVE-2019-15903. 3966 3967- bpo-37764: Fixes email._header_value_parser.get_unstructured going into an 3968 infinite loop for a specific case in which the email header does not have 3969 trailing whitespace, and the case in which it contains an invalid encoded 3970 word. Patch by Ashwin Ramaswami. 3971 3972- bpo-37461: Fix an infinite loop when parsing specially crafted email 3973 headers. Patch by Abhilash Raj. 3974 3975- bpo-37363: Adds audit events for the range of supported run commands (see 3976 :ref:`using-on-general`). 3977 3978- bpo-37463: ssl.match_hostname() no longer accepts IPv4 addresses with 3979 additional text after the address and only quad-dotted notation without 3980 trailing whitespaces. Some inet_aton() implementations ignore whitespace 3981 and all data after whitespace, e.g. '127.0.0.1 whatever'. 3982 3983- bpo-37363: Adds audit events for :mod:`ensurepip`, :mod:`ftplib`, 3984 :mod:`glob`, :mod:`imaplib`, :mod:`nntplib`, :mod:`pdb`, :mod:`poplib`, 3985 :mod:`shutil`, :mod:`smtplib`, :mod:`sqlite3`, :mod:`subprocess`, 3986 :mod:`telnetlib`, :mod:`tempfile` and :mod:`webbrowser`, as well as 3987 :func:`os.listdir`, :func:`os.scandir` and :func:`breakpoint`. 3988 3989- bpo-37364: :func:`io.open_code` is now used when reading :file:`.pth` 3990 files. 3991 3992- bpo-34631: Updated OpenSSL to 1.1.1c in Windows installer 3993 3994- bpo-34155: Fix parsing of invalid email addresses with more than one ``@`` 3995 (e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email 3996 address. Patch by maxking & jpic. 3997 3998Core and Builtins 3999----------------- 4000 4001- bpo-38631: Replace ``Py_FatalError()`` call with a regular 4002 :exc:`RuntimeError` exception in :meth:`float.__getformat__`. 4003 4004- bpo-38639: Optimized :func:`math.floor()`, :func:`math.ceil()` and 4005 :func:`math.trunc()` for floats. 4006 4007- bpo-38640: Fixed a bug in the compiler that was causing to raise in the 4008 presence of break statements and continue statements inside always false 4009 while loops. Patch by Pablo Galindo. 4010 4011- bpo-38613: Optimized some set operations (e.g. ``|``, ``^``, and ``-``) of 4012 ``dict_keys``. ``d.keys() | other`` was slower than ``set(d) | other`` but 4013 they are almost same performance for now. 4014 4015- bpo-28029: ``"".replace("", s, n)`` now returns ``s`` instead of an empty 4016 string for all non-zero ``n``. There are similar changes for 4017 :class:`bytes` and :class:`bytearray` objects. 4018 4019- bpo-38535: Fixed line numbers and column offsets for AST nodes for calls 4020 without arguments in decorators. 4021 4022- bpo-38525: Fix a segmentation fault when using reverse iterators of empty 4023 ``dict`` objects. Patch by Dong-hee Na and Inada Naoki. 4024 4025- bpo-38465: :class:`bytearray`, :class:`~array.array` and 4026 :class:`~mmap.mmap` objects allow now to export more than 2**31 buffers at 4027 a time. 4028 4029- bpo-38469: Fixed a bug where the scope of named expressions was not being 4030 resolved correctly in the presence of the *global* keyword. Patch by Pablo 4031 Galindo. 4032 4033- bpo-38437: Activate the ``GC_DEBUG`` macro for debug builds of the 4034 interpreter (when ``Py_DEBUG`` is set). Patch by Pablo Galindo. 4035 4036- bpo-38379: When the garbage collector makes a collection in which some 4037 objects resurrect (they are reachable from outside the isolated cycles 4038 after the finalizers have been executed), do not block the collection of 4039 all objects that are still unreachable. Patch by Pablo Galindo and Tim 4040 Peters. 4041 4042- bpo-38379: When cyclic garbage collection (gc) runs finalizers that 4043 resurrect unreachable objects, the current gc run ends, without collecting 4044 any cyclic trash. However, the statistics reported by ``collect()`` and 4045 ``get_stats()`` claimed that all cyclic trash found was collected, and 4046 that the resurrected objects were collected. Changed the stats to report 4047 that none were collected. 4048 4049- bpo-38392: In debug mode, :c:func:`PyObject_GC_Track` now calls 4050 ``tp_traverse()`` of the object type to ensure that the object is valid: 4051 test that objects visited by ``tp_traverse()`` are valid. 4052 4053- bpo-38210: Remove unecessary intersection and update set operation in 4054 dictview with empty set. (Contributed by Dong-hee Na in :issue:`38210`.) 4055 4056- bpo-38402: Check the error from the system's underlying ``crypt`` or 4057 ``crypt_r``. 4058 4059- bpo-37474: On FreeBSD, Python no longer calls ``fedisableexcept()`` at 4060 startup to control the floating point control mode. The call became 4061 useless since FreeBSD 6: it became the default mode. 4062 4063- bpo-38006: Fix a bug due to the interaction of weakrefs and the cyclic 4064 garbage collector. We must clear any weakrefs in garbage in order to 4065 prevent their callbacks from executing and causing a crash. 4066 4067- bpo-38317: Fix warnings options priority: ``PyConfig.warnoptions`` has the 4068 highest priority, as stated in the :pep:`587`. 4069 4070- bpo-38310: Predict ``BUILD_MAP_UNPACK_WITH_CALL`` -> ``CALL_FUNCTION_EX`` 4071 opcode pairs in the main interpreter loop. Patch by Brandt Bucher. 4072 4073- bpo-36871: Improve error handling for the assert_has_calls and 4074 assert_has_awaits methods of mocks. Fixed a bug where any errors 4075 encountered while binding the expected calls to the mock's spec were 4076 silently swallowed, leading to misleading error output. 4077 4078- bpo-11410: Better control over symbol visibility is provided through use 4079 of the visibility attributes available in gcc >= 4.0, provided in a 4080 uniform way across POSIX and Windows. The POSIX build files have been 4081 updated to compile with -fvisibility=hidden, minimising exported symbols. 4082 4083- bpo-38219: Optimized the :class:`dict` constructor and the 4084 :meth:`~dict.update` method for the case when the argument is a dict. 4085 4086- bpo-38236: Python now dumps path configuration if it fails to import the 4087 Python codecs of the filesystem and stdio encodings. 4088 4089- bpo-38013: Allow to call ``async_generator_athrow().throw(...)`` even for 4090 non-started async generator helper. It fixes annoying warning at the end 4091 of :func:`asyncio.run` call. 4092 4093- bpo-38124: Fix an off-by-one error in PyState_AddModule that could cause 4094 out-of-bounds memory access. 4095 4096- bpo-38116: The select module is now PEP-384 compliant and no longer has 4097 static state 4098 4099- bpo-38113: ast module updated to PEP-384 and all statics removed 4100 4101- bpo-38076: The struct module is now PEP-384 compatible 4102 4103- bpo-38075: The random module is now PEP-384 compatible 4104 4105- bpo-38074: zlib module made PEP-384 compatible 4106 4107- bpo-38073: Make pwd extension module PEP-384 compatible 4108 4109- bpo-38072: grp module made PEP-384 compatible 4110 4111- bpo-38069: Make _posixsubprocess PEP-384 compatible 4112 4113- bpo-38071: Make termios extension module PEP-384 compatible 4114 4115- bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. 4116 4117- bpo-36946: Fix possible signed integer overflow when handling slices. 4118 Patch by hongweipeng. 4119 4120- bpo-37994: Fixed silencing arbitrary errors if an attribute lookup fails 4121 in several sites. Only AttributeError should be silenced. 4122 4123- bpo-8425: Optimize set difference_update for the case when the other set 4124 is much larger than the base set. (Suggested by Evgeny Kapun with code 4125 contributed by Michele Orrù). 4126 4127- bpo-37966: The implementation of :func:`~unicodedata.is_normalized` has 4128 been greatly sped up on strings that aren't normalized, by implementing 4129 the full normalization-quick-check algorithm from the Unicode standard. 4130 4131- bpo-37947: Adjust correctly the recursion level in the symtable generation 4132 for named expressions. Patch by Pablo Galindo. 4133 4134- bpo-37812: The ``CHECK_SMALL_INT`` macro used inside 4135 :file:`Object/longobject.c` has been replaced with an explicit ``return`` 4136 at each call site. 4137 4138- bpo-37751: Fix :func:`codecs.lookup` to normalize the encoding name the 4139 same way than :func:`encodings.normalize_encoding`, except that 4140 :func:`codecs.lookup` also converts the name to lower case. 4141 4142- bpo-37830: Fixed compilation of :keyword:`break` and :keyword:`continue` 4143 in the :keyword:`finally` block when the corresponding :keyword:`try` 4144 block contains :keyword:`return` with a non-constant value. 4145 4146- bpo-20490: Improve import error message for partially initialized module 4147 on circular ``from`` imports - by Anthony Sottile. 4148 4149- bpo-37840: Fix handling of negative indices in 4150 :c:member:`~PySequenceMethods.sq_item` of :class:`bytearray`. Patch by 4151 Sergey Fedoseev. 4152 4153- bpo-37802: Slightly improve performance of 4154 :c:func:`PyLong_FromUnsignedLong`, :c:func:`PyLong_FromUnsignedLongLong` 4155 and :c:func:`PyLong_FromSize_t`. Patch by Sergey Fedoseev. 4156 4157- bpo-37409: Ensure explicit relative imports from interactive sessions and 4158 scripts (having no parent package) always raise ImportError, rather than 4159 treating the current module as the package. Patch by Ben Lewis. 4160 4161- bpo-32912: Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead 4162 of :exc:`DeprecationWarning` for invalid escape sequences in string and 4163 bytes literals. 4164 4165- bpo-37757: :pep:`572`: As described in the PEP, assignment expressions now 4166 raise :exc:`SyntaxError` when their interaction with comprehension scoping 4167 results in an ambiguous target scope. 4168 4169 The ``TargetScopeError`` subclass originally proposed by the PEP has been 4170 removed in favour of just raising regular syntax errors for the disallowed 4171 cases. 4172 4173- bpo-36279: Fix potential use of uninitialized memory in :func:`os.wait3`. 4174 4175- bpo-36311: Decoding bytes objects larger than 2GiB is faster and no longer 4176 fails when a multibyte characters spans a chunk boundary. 4177 4178- bpo-34880: The :keyword:`assert` statement now works properly if the 4179 :exc:`AssertionError` exception is being shadowed. Patch by Zackery Spytz. 4180 4181- bpo-37340: Removed object cache (``free_list``) for bound method objects. 4182 Temporary bound method objects are less used than before thanks to the 4183 ``LOAD_METHOD`` opcode and the ``_PyObject_VectorcallMethod`` C API. 4184 4185- bpo-37648: Fixed minor inconsistency in :meth:`list.__contains__`, 4186 :meth:`tuple.__contains__` and a few other places. The collection's item 4187 is now always at the left and the needle is on the right of ``==``. 4188 4189- bpo-37444: Update differing exception between :meth:`builtins.__import__` 4190 and :meth:`importlib.__import__`. 4191 4192- bpo-37619: When adding a wrapper descriptor from one class to a different 4193 class (for example, setting ``__add__ = str.__add__`` on an ``int`` 4194 subclass), an exception is correctly raised when the operator is called. 4195 4196- bpo-37593: Swap the positions of the *posonlyargs* and *args* parameters 4197 in the constructor of :class:`ast.parameters` nodes. 4198 4199- bpo-37543: Optimized pymalloc for non PGO build. 4200 4201- bpo-37537: Compute allocated pymalloc blocks inside 4202 _Py_GetAllocatedBlocks(). This slows down _Py_GetAllocatedBlocks() but 4203 gives a small speedup to _PyObject_Malloc() and _PyObject_Free(). 4204 4205- bpo-37467: Fix :func:`sys.excepthook` and :c:func:`PyErr_Display` if a 4206 filename is a bytes string. For example, for a SyntaxError exception where 4207 the filename attribute is a bytes string. 4208 4209- bpo-37433: Fix ``SyntaxError`` indicator printing too many spaces for 4210 multi-line strings - by Anthony Sottile. 4211 4212- bpo-37417: :meth:`bytearray.extend` now correctly handles errors that 4213 arise during iteration. Patch by Brandt Bucher. 4214 4215- bpo-37414: The undocumented ``sys.callstats()`` function has been removed. 4216 Since Python 3.7, it was deprecated and always returned ``None``. It 4217 required a special build option ``CALL_PROFILE`` which was already removed 4218 in Python 3.7. 4219 4220- bpo-37392: Remove ``sys.getcheckinterval()`` and 4221 ``sys.setcheckinterval()`` functions. They were deprecated since Python 4222 3.2. Use :func:`sys.getswitchinterval` and :func:`sys.setswitchinterval` 4223 instead. Remove also ``check_interval`` field of the 4224 ``PyInterpreterState`` structure. 4225 4226- bpo-37388: In development mode and in debug build, *encoding* and *errors* 4227 arguments are now checked on string encoding and decoding operations. 4228 Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`. 4229 4230 By default, for best performances, the *errors* argument is only checked 4231 at the first encoding/decoding error, and the *encoding* argument is 4232 sometimes ignored for empty strings. 4233 4234- bpo-37348: Optimized decoding short ASCII string with UTF-8 and ascii 4235 codecs. ``b"foo".decode()`` is about 15% faster. Patch by Inada Naoki. 4236 4237- bpo-24214: Improved support of the surrogatepass error handler in the 4238 UTF-8 and UTF-16 incremental decoders. 4239 4240- bpo-37330: :func:`open`, :func:`io.open`, :func:`codecs.open` and 4241 :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal 4242 newline") in the file mode. This flag was deprecated since Python 3.3. 4243 4244- bpo-35224: Reverse evaluation order of key: value in dict comprehensions 4245 as proposed in PEP 572. I.e. in ``{k: v for ...}``, ``k`` will be 4246 evaluated before ``v``. 4247 4248- bpo-37316: Fix the :c:func:`PySys_Audit` call in :class:`mmap.mmap`. 4249 4250- bpo-37300: Remove an unnecssary Py_XINCREF in classobject.c. 4251 4252- bpo-37269: Fix a bug in the peephole optimizer that was not treating 4253 correctly constant conditions with binary operators. Patch by Pablo 4254 Galindo. 4255 4256- bpo-20443: Python now gets the absolute path of the script filename 4257 specified on the command line (ex: "python3 script.py"): the __file__ 4258 attribute of the __main__ module and sys.path[0] become an absolute path, 4259 rather than a relative path. 4260 4261- bpo-37257: Python's small object allocator (``obmalloc.c``) now allows (no 4262 more than) one empty arena to remain available for immediate reuse, 4263 without returning it to the OS. This prevents thrashing in simple loops 4264 where an arena could be created and destroyed anew on each iteration. 4265 4266- bpo-37231: The dispatching of type slots to special methods (for example 4267 calling ``__mul__`` when doing ``x * y``) has been made faster. 4268 4269- bpo-36974: Implemented separate vectorcall functions for every calling 4270 convention of builtin functions and methods. This improves performance for 4271 calls. 4272 4273- bpo-37213: Handle correctly negative line offsets in the peephole 4274 optimizer. Patch by Pablo Galindo. 4275 4276- bpo-37219: Remove erroneous optimization for empty set differences. 4277 4278- bpo-15913: Implement :c:func:`PyBuffer_SizeFromFormat()` function 4279 (previously documented but not implemented): call :func:`struct.calcsize`. 4280 Patch by Joannah Nanjekye. 4281 4282- bpo-36922: Slot functions optimize any callable with 4283 ``Py_TPFLAGS_METHOD_DESCRIPTOR`` instead of only instances of 4284 ``function``. 4285 4286- bpo-36974: The slot ``tp_vectorcall_offset`` is inherited unconditionally 4287 to support ``super().__call__()`` when the base class uses vectorcall. 4288 4289- bpo-37160: :func:`threading.get_native_id` now also supports NetBSD. 4290 4291- bpo-37077: Add :func:`threading.get_native_id` support for AIX. Patch by 4292 M. Felt 4293 4294- bpo-36781: :func:`sum` has been optimized for boolean values. 4295 4296- bpo-34556: Add ``--upgrade-deps`` to venv module. Patch by Cooper Ry Lees 4297 4298- bpo-20523: ``pdb.Pdb`` supports ~/.pdbrc in Windows 7. Patch by Tim Hopper 4299 and Dan Lidral-Porter. 4300 4301- bpo-35551: Updated encodings: - Removed the "tis260" encoding, which was 4302 an alias for the nonexistent "tactis" codec. - Added "mac_centeuro" as an 4303 alias for the mac_latin2 encoding. 4304 4305- bpo-19072: The :class:`classmethod` decorator can now wrap other 4306 descriptors such as property objects. Adapted from a patch written by 4307 Graham Dumpleton. 4308 4309- bpo-27575: Improve speed of dictview intersection by directly using set 4310 intersection logic. Patch by David Su. 4311 4312- bpo-30773: Prohibit parallel running of aclose() / asend() / athrow(). Fix 4313 ag_running to reflect the actual running status of the AG. 4314 4315Library 4316------- 4317 4318- bpo-36589: The :func:`curses.update_lines_cols` function now returns 4319 ``None`` instead of ``1`` on success. 4320 4321- bpo-38807: Update :exc:`TypeError` messages for :meth:`os.path.join` to 4322 include :class:`os.PathLike` objects as acceptable input types. 4323 4324- bpo-38724: Add a repr for ``subprocess.Popen`` objects. Patch by Andrey 4325 Doroschenko. 4326 4327- bpo-38786: pydoc now recognizes and parses HTTPS URLs. Patch by python273. 4328 4329- bpo-38785: Prevent asyncio from crashing if parent ``__init__`` is not 4330 called from a constructor of object derived from ``asyncio.Future``. 4331 4332- bpo-38723: :mod:`pdb` now uses :meth:`io.open_code` to trigger auditing 4333 events. 4334 4335- bpo-27805: Allow opening pipes and other non-seekable files in append mode 4336 with :func:`open`. 4337 4338- bpo-38438: Simplify the :mod:`argparse` usage message for ``nargs="*"``. 4339 4340- bpo-38761: WeakSet is now registered as a collections.abc.MutableSet. 4341 4342- bpo-38716: logging: change RotatingHandler namer and rotator to 4343 class-level attributes. This stops __init__ from setting them to None in 4344 the case where a subclass defines them with eponymous methods. 4345 4346- bpo-38713: Add :data:`os.P_PIDFD` constant, which may be passed to 4347 :func:`os.waitid` to wait on a Linux process file descriptor. 4348 4349- bpo-38692: Add :class:`asyncio.PidfdChildWatcher`, a Linux-specific child 4350 watcher implementation that polls process file descriptors. 4351 4352- bpo-38692: Expose the Linux ``pidfd_open`` syscall as 4353 :func:`os.pidfd_open`. 4354 4355- bpo-38602: Added constants :data:`~fcntl.F_OFD_GETLK`, 4356 :data:`~fcntl.F_OFD_SETLK` and :data:`~fcntl.F_OFD_SETLKW` to the 4357 :mod:`fcntl` module. Patch by Dong-hee Na. 4358 4359- bpo-38334: Fixed seeking backward on an encrypted 4360 :class:`zipfile.ZipExtFile`. 4361 4362- bpo-38312: Add :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, 4363 :func:`curses.get_tabsize`, and :func:`curses.set_tabsize` functions - by 4364 Anthony Sottile. 4365 4366- bpo-38586: Now :func:`~logging.config.fileConfig` correcty sets the .name 4367 of handlers loaded. 4368 4369- bpo-38565: Add new cache_parameters() method for functools.lru_cache() to 4370 better support pickling. 4371 4372- bpo-34679: asynci.ProactorEventLoop.close() now only calls 4373 signal.set_wakeup_fd() in the main thread. 4374 4375- bpo-31202: The case the result of :func:`pathlib.WindowsPath.glob` matches 4376 now the case of the pattern for literal parts. 4377 4378- bpo-36321: Remove misspelled attribute. The 3.8 changelog noted that this 4379 would be removed in 3.9. 4380 4381- bpo-38521: Fixed erroneous equality comparison in statistics.NormalDist(). 4382 4383- bpo-38493: Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for 4384 :attr:`si_code`. Patch by Dong-hee Na. 4385 4386- bpo-38478: Fixed a bug in :meth:`inspect.signature.bind` that was causing 4387 it to fail when handling a keyword argument with same name as 4388 positional-only parameter. Patch by Pablo Galindo. 4389 4390- bpo-33604: Fixed `hmac.new` and `hmac.HMAC` to raise TypeError instead of 4391 ValueError when the digestmod parameter, now required in 3.8, is omitted. 4392 Also clarified the hmac module documentation and docstrings. 4393 4394- bpo-38378: Parameters *out* and *in* of :func:`os.sendfile` was renamed to 4395 *out_fd* and *in_fd*. 4396 4397- bpo-38417: Added support for setting the umask in the child process to the 4398 subprocess module on POSIX systems. 4399 4400- bpo-38449: Revert GH-15522, which introduces a regression in 4401 :meth:`mimetypes.guess_type` due to improper handling of filenames as 4402 urls. 4403 4404- bpo-38431: Fix ``__repr__`` method for :class:`dataclasses.InitVar` to 4405 support typing objects, patch by Samuel Colvin. 4406 4407- bpo-38109: Add missing :data:`stat.S_IFDOOR`, :data:`stat.S_IFPORT`, 4408 :data:`stat.S_IFWHT`, :func:`stat.S_ISDOOR`, :func:`stat.S_ISPORT`, and 4409 :func:`stat.S_ISWHT` values to the Python implementation of :mod:`stat`. 4410 4411- bpo-38422: Clarify docstrings of pathlib suffix(es) 4412 4413- bpo-38405: Nested subclasses of :class:`typing.NamedTuple` are now 4414 pickleable. 4415 4416- bpo-38332: Prevent :exc:`KeyError` thrown by :func:`_encoded_words.decode` 4417 when given an encoded-word with invalid content-type encoding from 4418 propagating all the way to :func:`email.message.get`. 4419 4420- bpo-38371: Deprecated the ``split()`` method in 4421 :class:`_tkinter.TkappType` in favour of the ``splitlist()`` method which 4422 has more consistent and predicable behavior. 4423 4424- bpo-38341: Add :exc:`smtplib.SMTPNotSupportedError` to the :mod:`smtplib` 4425 exported names. 4426 4427- bpo-38319: sendfile() used in socket and shutil modules was raising 4428 OverflowError for files >= 2GiB on 32-bit architectures. (patch by 4429 Giampaolo Rodola) 4430 4431- bpo-38242: Revert the new asyncio Streams API 4432 4433- bpo-13153: OS native encoding is now used for converting between Python 4434 strings and Tcl objects. This allows to display, copy and paste to 4435 clipboard emoji and other non-BMP characters. Converting strings from Tcl 4436 to Python and back now never fails (except MemoryError). 4437 4438- bpo-38019: Correctly handle pause/resume reading of closed asyncio unix 4439 pipe. 4440 4441- bpo-38163: Child mocks will now detect their type as either synchronous or 4442 asynchronous, asynchronous child mocks will be AsyncMocks and synchronous 4443 child mocks will be either MagicMock or Mock (depending on their parent 4444 type). 4445 4446- bpo-38161: Removes _AwaitEvent from AsyncMock. 4447 4448- bpo-38216: Allow the rare code that wants to send invalid http requests 4449 from the `http.client` library a way to do so. The fixes for bpo-30458 4450 led to breakage for some projects that were relying on this ability to 4451 test their own behavior in the face of bad requests. 4452 4453- bpo-28286: Deprecate opening :class:`~gzip.GzipFile` for writing 4454 implicitly. Always specify the *mode* argument for writing. 4455 4456- bpo-38108: Any synchronous magic methods on an AsyncMock now return a 4457 MagicMock. Any asynchronous magic methods on a MagicMock now return an 4458 AsyncMock. 4459 4460- bpo-38265: Update the *length* parameter of :func:`os.pread` to accept 4461 :c:type:`Py_ssize_t` instead of :c:type:`int`. 4462 4463- bpo-38112: :mod:`compileall` has a higher default recursion limit and new 4464 command-line arguments for path manipulation, symlinks handling, and 4465 multiple optimization levels. 4466 4467- bpo-38248: asyncio: Fix inconsistent immediate Task cancellation 4468 4469- bpo-38237: The arguments for the builtin pow function are more 4470 descriptive. They can now also be passed in as keywords. 4471 4472- bpo-34002: Improve efficiency in parts of email package by changing 4473 while-pop to a for loop, using isdisjoint instead of set intersections. 4474 4475- bpo-38191: Constructors of :class:`~typing.NamedTuple` and 4476 :class:`~typing.TypedDict` types now accept arbitrary keyword argument 4477 names, including "cls", "self", "typename", "_typename", "fields" and 4478 "_fields". 4479 4480- bpo-38155: Add ``__all__`` to :mod:`datetime`. Patch by Tahia Khan. 4481 4482- bpo-38185: Fixed case-insensitive string comparison in 4483 :class:`sqlite3.Row` indexing. 4484 4485- bpo-38136: Changes AsyncMock call count and await count to be two 4486 different counters. Now await count only counts when a coroutine has been 4487 awaited, not when it has been called, and vice-versa. Update the 4488 documentation around this. 4489 4490- bpo-37828: Fix default mock name in 4491 :meth:`unittest.mock.Mock.assert_called` exceptions. Patch by Abraham 4492 Toriz Cruz. 4493 4494- bpo-38175: Fix a memory leak in comparison of :class:`sqlite3.Row` 4495 objects. 4496 4497- bpo-33936: _hashlib no longer calls obsolete OpenSSL initialization 4498 function with OpenSSL 1.1.0+. 4499 4500- bpo-34706: Preserve subclassing in inspect.Signature.from_callable. 4501 4502- bpo-38153: Names of hashing algorithms frome OpenSSL are now normalized to 4503 follow Python's naming conventions. For example OpenSSL uses sha3-512 4504 instead of sha3_512 or blake2b512 instead of blake2b. 4505 4506- bpo-38115: Fix a bug in dis.findlinestarts() where it would return invalid 4507 bytecode offsets. Document that a code object's co_lnotab can contain 4508 invalid bytecode offsets. 4509 4510- bpo-38148: Add slots to :mod:`asyncio` transport classes, which can reduce 4511 memory usage. 4512 4513- bpo-38142: The _hashlib OpenSSL wrapper extension module is now PEP-384 4514 compliant. 4515 4516- bpo-9216: hashlib constructors now support usedforsecurity flag to signal 4517 that a hashing algorithm is not used in a security context. 4518 4519- bpo-36991: Fixes a potential incorrect AttributeError exception escaping 4520 ZipFile.extract() in some unsupported input error situations. 4521 4522- bpo-38134: Remove obsolete copy of PBKDF2_HMAC_fast. All supported OpenSSL 4523 versions contain a fast implementation. 4524 4525- bpo-38132: The OpenSSL hashlib wrapper uses a simpler implementation. 4526 Several Macros and pointless caches are gone. The hash name now comes from 4527 OpenSSL's EVP. The algorithm name stays the same, except it is now always 4528 lower case. 4529 4530- bpo-38008: Fix parent class check in protocols to correctly identify the 4531 module that provides a builtin protocol, instead of assuming they all come 4532 from the :mod:`collections.abc` module 4533 4534- bpo-34037: For :mod:`asyncio`, add a new coroutine 4535 :meth:`loop.shutdown_default_executor`. The new coroutine provides an API 4536 to schedule an executor shutdown that waits on the threadpool to finish 4537 closing. Also, :func:`asyncio.run` has been updated to utilize the new 4538 coroutine. Patch by Kyle Stanley. 4539 4540- bpo-37405: Fixed regression bug for socket.getsockname() for non-CAN_ISOTP 4541 AF_CAN address family sockets by returning a 1-tuple instead of string. 4542 4543- bpo-38121: Update parameter names on functions in importlib.metadata 4544 matching the changes in the 0.22 release of importlib_metadata. 4545 4546- bpo-38110: The os.closewalk() implementation now uses the libc fdwalk() 4547 API on platforms where it is available. 4548 4549- bpo-38093: Fixes AsyncMock so it doesn't crash when used with 4550 AsyncContextManagers or AsyncIterators. 4551 4552- bpo-37488: Add warning to :meth:`datetime.utctimetuple`, 4553 :meth:`datetime.utcnow` and :meth:`datetime.utcfromtimestamp` . 4554 4555- bpo-35640: Allow passing a :term:`path-like object` as ``directory`` 4556 argument to the :class:`http.server.SimpleHTTPRequestHandler` class. Patch 4557 by Géry Ogam. 4558 4559- bpo-38086: Update importlib.metadata with changes from `importlib_metadata 4560 0.21 4561 <https://gitlab.com/python-devs/importlib_metadata/blob/0.21/importlib_metadata/docs/changelog.rst>`_. 4562 4563- bpo-37251: Remove `__code__` check in AsyncMock that incorrectly evaluated 4564 function specs as async objects but failed to evaluate classes with 4565 `__await__` but no `__code__` attribute defined as async objects. 4566 4567- bpo-38037: Fix reference counters in the :mod:`signal` module. 4568 4569- bpo-38066: Hide internal asyncio.Stream methods: feed_eof(), feed_data(), 4570 set_exception() and set_transport(). 4571 4572- bpo-38059: inspect.py now uses sys.exit() instead of exit() 4573 4574- bpo-38049: Added command-line interface for the :mod:`ast` module. 4575 4576- bpo-37953: In :mod:`typing`, improved the ``__hash__`` and ``__eq__`` 4577 methods for :class:`ForwardReferences`. 4578 4579- bpo-38026: Fixed :func:`inspect.getattr_static` used ``isinstance`` while 4580 it should avoid dynamic lookup. 4581 4582- bpo-35923: Update :class:`importlib.machinery.BuiltinImporter` to use 4583 ``loader._ORIGIN`` instead of a hardcoded value. Patch by Dong-hee Na. 4584 4585- bpo-38010: In ``importlib.metadata`` sync with ``importlib_metadata`` 4586 0.20, clarifying behavior of ``files()`` and fixing issue where only one 4587 requirement was returned for ``requires()`` on ``dist-info`` packages. 4588 4589- bpo-38006: weakref.WeakValueDictionary defines a local remove() function 4590 used as callback for weak references. This function was created with a 4591 closure. Modify the implementation to avoid the closure. 4592 4593- bpo-37995: Added the *indent* option to :func:`ast.dump` which allows it 4594 to produce a multiline indented output. 4595 4596- bpo-34410: Fixed a crash in the :func:`tee` iterator when re-enter it. 4597 RuntimeError is now raised in this case. 4598 4599- bpo-37140: Fix a ctypes regression of Python 3.8. When a ctypes.Structure 4600 is passed by copy to a function, ctypes internals created a temporary 4601 object which had the side effect of calling the structure finalizer 4602 (__del__) twice. The Python semantics requires a finalizer to be called 4603 exactly once. Fix ctypes internals to no longer call the finalizer twice. 4604 4605- bpo-37587: ``_json.scanstring`` is now up to 3x faster when there are many 4606 backslash escaped characters in the JSON string. 4607 4608- bpo-37834: Prevent shutil.rmtree exception when built on non-Windows 4609 system without fd system call support, like older versions of macOS. 4610 4611- bpo-10978: Semaphores and BoundedSemaphores can now release more than one 4612 waiting thread at a time. 4613 4614- bpo-37972: Subscripts to the `unittest.mock.call` objects now receive the 4615 same chaining mechanism as any other custom attributes, so that the 4616 following usage no longer raises a `TypeError`: 4617 4618 call().foo().__getitem__('bar') 4619 4620 Patch by blhsing 4621 4622- bpo-37965: Fix C compiler warning caused by 4623 distutils.ccompiler.CCompiler.has_function. 4624 4625- bpo-37964: Add ``F_GETPATH`` command to :mod:`fcntl`. 4626 4627- bpo-37960: ``repr()`` of buffered and text streams now silences only 4628 expected exceptions when get the value of "name" and "mode" attributes. 4629 4630- bpo-37961: Add a ``total_nframe`` field to the traces collected by the 4631 tracemalloc module. This field indicates the original number of frames 4632 before it was truncated. 4633 4634- bpo-37951: Most features of the subprocess module now work again in 4635 subinterpreters. Only *preexec_fn* is restricted in subinterpreters. 4636 4637- bpo-36205: Fix the rusage implementation of time.process_time() to 4638 correctly report the sum of the system and user CPU time. 4639 4640- bpo-37950: Fix :func:`ast.dump` when call with incompletely initialized 4641 node. 4642 4643- bpo-34679: Restores instantiation of Windows IOCP event loops from the 4644 non-main thread. 4645 4646- bpo-36917: Add default implementation of the 4647 :meth:`ast.NodeVisitor.visit_Constant` method which emits a deprecation 4648 warning and calls corresponding methody ``visit_Num()``, ``visit_Str()``, 4649 etc. 4650 4651- bpo-37798: Update test_statistics.py to verify that the statistics module 4652 works well for both C and Python implementations. Patch by Dong-hee Na 4653 4654- bpo-26589: Added a new status code to the http module: 451 4655 UNAVAILABLE_FOR_LEGAL_REASONS 4656 4657- bpo-37915: Fix a segmentation fault that appeared when comparing instances 4658 of ``datetime.timezone`` and ``datetime.tzinfo`` objects. Patch by Pablo 4659 Galindo. 4660 4661- bpo-32554: Deprecate having random.seed() call hash on arbitrary types. 4662 4663- bpo-9938: Add optional keyword argument ``exit_on_error`` for 4664 :class:`ArgumentParser`. 4665 4666- bpo-37851: The :mod:`faulthandler` module no longer allocates its 4667 alternative stack at Python startup. Now the stack is only allocated at 4668 the first faulthandler usage. 4669 4670- bpo-32793: Fix a duplicated debug message when 4671 :meth:`smtplib.SMTP.connect` is called. 4672 4673- bpo-37885: venv: Don't generate unset variable warning on deactivate. 4674 4675- bpo-37868: Fix dataclasses.is_dataclass when given an instance that never 4676 raises AttributeError in __getattr__. That is, an object that returns 4677 something for __dataclass_fields__ even if it's not a dataclass. 4678 4679- bpo-37811: Fix ``socket`` module's ``socket.connect(address)`` function 4680 being unable to establish connection in case of interrupted system call. 4681 The problem was observed on all OSes which ``poll(2)`` system call can 4682 take only non-negative integers and -1 as a timeout value. 4683 4684- bpo-37863: Optimizations for Fraction.__hash__ suggested by Tim Peters. 4685 4686- bpo-21131: Fix ``faulthandler.register(chain=True)`` stack. faulthandler 4687 now allocates a dedicated stack of ``SIGSTKSZ*2`` bytes, instead of just 4688 ``SIGSTKSZ`` bytes. Calling the previous signal handler in faulthandler 4689 signal handler uses more than ``SIGSTKSZ`` bytes of stack memory on some 4690 platforms. 4691 4692- bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() Patch by 4693 Dong-hee Na 4694 4695- bpo-37804: Remove the deprecated method `threading.Thread.isAlive()`. 4696 Patch by Dong-hee Na. 4697 4698- bpo-37819: Add Fraction.as_integer_ratio() to match the corresponding 4699 methods in bool, int, float, and decimal. 4700 4701- bpo-14465: Add an xml.etree.ElementTree.indent() function for 4702 pretty-printing XML trees. Contributed by Stefan Behnel. 4703 4704- bpo-37810: Fix :mod:`difflib` ``?`` hint in diff output when dealing with 4705 tabs. Patch by Anthony Sottile. 4706 4707- bpo-37772: In ``zipfile.Path``, when adding implicit dirs, ensure that 4708 ancestral directories are added and that duplicates are excluded. 4709 4710- bpo-18578: Renamed and documented `test.bytecode_helper` as 4711 `test.support.bytecode_helper`. Patch by Joannah Nanjekye. 4712 4713- bpo-37785: Fix xgettext warnings in :mod:`argparse`. 4714 4715- bpo-34488: :meth:`writelines` method of :class:`io.BytesIO` is now 4716 slightly faster when many small lines are passed. Patch by Sergey 4717 Fedoseev. 4718 4719- bpo-37449: `ensurepip` now uses `importlib.resources.read_binary()` to 4720 read data instead of `pkgutil.get_data()`. Patch by Joannah Nanjekye. 4721 4722- bpo-28292: Mark calendar.py helper functions as being private. The 4723 follows PEP 8 guidance to maintain the style conventions in the module and 4724 it addresses a known case of user confusion. 4725 4726- bpo-18049: Add definition of THREAD_STACK_SIZE for AIX in 4727 Python/thread_pthread.h The default thread stacksize caused crashes with 4728 the default recursion limit Patch by M Felt 4729 4730- bpo-37742: The logging.getLogger() API now returns the root logger when 4731 passed the name 'root', whereas previously it returned a non-root logger 4732 named 'root'. This could affect cases where user code explicitly wants a 4733 non-root logger named 'root', or instantiates a logger using 4734 logging.getLogger(__name__) in some top-level module called 'root.py'. 4735 4736- bpo-37738: Fix the implementation of curses ``addch(str, color_pair)``: 4737 pass the color pair to ``setcchar()``, instead of always passing 0 as the 4738 color pair. 4739 4740- bpo-37723: Fix performance regression on regular expression parsing with 4741 huge character sets. Patch by Yann Vaginay. 4742 4743- bpo-35943: The function :c:func:`PyImport_GetModule` now ensures any 4744 module it returns is fully initialized. Patch by Joannah Nanjekye. 4745 4746- bpo-32178: Fix IndexError in :mod:`email` package when trying to parse 4747 invalid address fields starting with ``:``. 4748 4749- bpo-37268: The :mod:`parser` module is deprecated and will be removed in 4750 future versions of Python. 4751 4752- bpo-11953: Completing WSA* error codes in :mod:`socket`. 4753 4754- bpo-37685: Fixed comparisons of :class:`datetime.timedelta` and 4755 :class:`datetime.timezone`. 4756 4757- bpo-37697: Syncronize ``importlib.metadata`` with `importlib_metadata 0.19 4758 <https://gitlab.com/python-devs/importlib_metadata/-/milestones/20>`_, 4759 improving handling of EGG-INFO files and fixing a crash when entry point 4760 names contained colons. 4761 4762- bpo-37695: Correct :func:`curses.unget_wch` error message. Patch by 4763 Anthony Sottile. 4764 4765- bpo-37689: Add :meth:`is_relative_to` in :class:`PurePath` to determine 4766 whether or not one path is relative to another. 4767 4768- bpo-29553: Fixed :meth:`argparse.ArgumentParser.format_usage` for mutually 4769 exclusive groups. Patch by Andrew Nester. 4770 4771- bpo-37691: Let math.dist() accept coordinates as sequences (or iterables) 4772 rather than just tuples. 4773 4774- bpo-37685: Fixed ``__eq__``, ``__lt__`` etc implementations in some 4775 classes. They now return :data:`NotImplemented` for unsupported type of 4776 the other operand. This allows the other operand to play role (for example 4777 the equality comparison with :data:`~unittest.mock.ANY` will return 4778 ``True``). 4779 4780- bpo-37354: Make Activate.ps1 Powershell script static to allow for signing 4781 it. 4782 4783- bpo-37664: Update wheels bundled with ensurepip (pip 19.2.3 and setuptools 4784 41.2.0) 4785 4786- bpo-37663: Bring consistency to venv shell activation scripts by always 4787 using __VENV_PROMPT__. 4788 4789- bpo-37642: Allowed the pure Python implementation of 4790 :class:`datetime.timezone` to represent sub-minute offsets close to 4791 minimum and maximum boundaries, specifically in the ranges (23:59, 24:00) 4792 and (-23:59, 24:00). Patch by Ngalim Siregar 4793 4794- bpo-36161: In :mod:`posix`, use ``ttyname_r`` instead of ``ttyname`` for 4795 thread safety. 4796 4797- bpo-36324: Make internal attributes for statistics.NormalDist() private. 4798 4799- bpo-37555: Fix `NonCallableMock._call_matcher` returning tuple instead of 4800 `_Call` object when `self._spec_signature` exists. Patch by Elizabeth 4801 Uselton 4802 4803- bpo-29446: Make `from tkinter import *` import only the expected objects. 4804 4805- bpo-16970: Adding a value error when an invalid value in passed to nargs 4806 Patch by Robert Leenders 4807 4808- bpo-34443: Exceptions from :mod:`enum` now use the ``__qualname`` of the 4809 enum class in the exception message instead of the ``__name__``. 4810 4811- bpo-37491: Fix ``IndexError`` when parsing email headers with unexpectedly 4812 ending bare-quoted string value. Patch by Abhilash Raj. 4813 4814- bpo-37587: Make json.loads faster for long strings. (Patch by Marco 4815 Paolini) 4816 4817- bpo-18378: Recognize "UTF-8" as a valid value for LC_CTYPE in 4818 locale._parse_localename. 4819 4820- bpo-37579: Return :exc:`NotImplemented` in Python implementation of 4821 ``__eq__`` for :class:`~datetime.timedelta` and :class:`~datetime.time` 4822 when the other object being compared is not of the same type to match C 4823 implementation. Patch by Karthikeyan Singaravelan. 4824 4825- bpo-21478: Record calls to parent when autospecced object is attached to a 4826 mock using :func:`unittest.mock.attach_mock`. Patch by Karthikeyan 4827 Singaravelan. 4828 4829- bpo-37531: "python3 -m test -jN --timeout=TIMEOUT" now kills a worker 4830 process if it runs longer than *TIMEOUT* seconds. 4831 4832- bpo-37482: Fix serialization of display name in originator or destination 4833 address fields with both encoded words and special chars. 4834 4835- bpo-36993: Improve error reporting for corrupt zip files with bad zip64 4836 extra data. Patch by Daniel Hillier. 4837 4838- bpo-37502: pickle.loads() no longer raises TypeError when the buffers 4839 argument is set to None 4840 4841- bpo-37520: Correct behavior for zipfile.Path.parent when the path object 4842 identifies a subdirectory. 4843 4844- bpo-18374: Fix the ``.col_offset`` attribute of nested :class:`ast.BinOp` 4845 instances which had a too large value in some situations. 4846 4847- bpo-37424: Fixes a possible hang when using a timeout on 4848 `subprocess.run()` while capturing output. If the child process spawned 4849 its own children or otherwise connected its stdout or stderr handles with 4850 another process, we could hang after the timeout was reached and our child 4851 was killed when attempting to read final output from the pipes. 4852 4853- bpo-37421: Fix :func:`multiprocessing.util.get_temp_dir` finalizer: clear 4854 also the 'tempdir' configuration of the current process, so next call to 4855 ``get_temp_dir()`` will create a new temporary directory, rather than 4856 reusing the removed temporary directory. 4857 4858- bpo-37481: The distutils ``bdist_wininst`` command is deprecated in Python 4859 3.8, use ``bdist_wheel`` (wheel packages) instead. 4860 4861- bpo-37479: When `Enum.__str__` is overridden in a derived class, the 4862 override will be used by `Enum.__format__` regardless of whether mixin 4863 classes are present. 4864 4865- bpo-37440: http.client now enables TLS 1.3 post-handshake authentication 4866 for default context or if a cert_file is passed to HTTPSConnection. 4867 4868- bpo-37437: Update vendorized expat version to 2.2.7. 4869 4870- bpo-37428: SSLContext.post_handshake_auth = True no longer sets 4871 SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the 4872 option is documented as ignored for clients, OpenSSL implicitly enables 4873 cert chain validation when the flag is set. 4874 4875- bpo-37420: :func:`os.sched_setaffinity` now correctly handles errors that 4876 arise during iteration over its ``mask`` argument. Patch by Brandt Bucher. 4877 4878- bpo-37412: The :func:`os.getcwdb` function now uses the UTF-8 encoding on 4879 Windows, rather than the ANSI code page: see :pep:`529` for the rationale. 4880 The function is no longer deprecated on Windows. 4881 4882- bpo-37406: The sqlite3 module now raises TypeError, rather than 4883 ValueError, if operation argument type is not str: execute(), 4884 executemany() and calling a connection. 4885 4886- bpo-29412: Fix IndexError in parsing a header value ending unexpectedly. 4887 Patch by Abhilash Raj. 4888 4889- bpo-36546: The *dist* argument for statistics.quantiles() is now 4890 positional only. The current name doesn't reflect that the argument can be 4891 either a dataset or a distribution. Marking the parameter as positional 4892 avoids confusion and makes it possible to change the name later. 4893 4894- bpo-37394: Fix a bug that was causing the :mod:`queue` module to fail if 4895 the accelerator module was not available. Patch by Pablo Galindo. 4896 4897- bpo-37376: :mod:`pprint` now has support for 4898 :class:`types.SimpleNamespace`. Patch by Carl Bordum Hansen. 4899 4900- bpo-26967: An :class:`~argparse.ArgumentParser` with 4901 ``allow_abbrev=False`` no longer disables grouping of short flags, such as 4902 ``-vv``, but only disables abbreviation of long flags as documented. Patch 4903 by Zac Hatfield-Dodds. 4904 4905- bpo-37212: :func:`unittest.mock.call` now preserves the order of keyword 4906 arguments in repr output. Patch by Karthikeyan Singaravelan. 4907 4908- bpo-37372: Fix error unpickling datetime.time objects from Python 2 with 4909 seconds>=24. Patch by Justin Blanchard. 4910 4911- bpo-37345: Add formal support for UDPLITE sockets. Support was present 4912 before, but it is now easier to detect support with ``hasattr(socket, 4913 'IPPROTO_UDPLITE')`` and there are constants defined for each of the 4914 values needed: :py:obj:`socket.IPPROTO_UDPLITE`, 4915 :py:obj:`UDPLITE_SEND_CSCOV`, and :py:obj:`UDPLITE_RECV_CSCOV`. Patch by 4916 Gabe Appleton. 4917 4918- bpo-37358: Optimized ``functools.partial`` by using vectorcall. 4919 4920- bpo-37347: :meth:`sqlite3.Connection.create_aggregate`, 4921 :meth:`sqlite3.Connection.create_function`, 4922 :meth:`sqlite3.Connection.set_authorizer`, 4923 :meth:`sqlite3.Connection.set_progress_handler` 4924 :meth:`sqlite3.Connection.set_trace_callback` methods lead to segfaults if 4925 some of these methods are called twice with an equal object but not the 4926 same. Now callbacks are stored more carefully. Patch by Aleksandr Balezin. 4927 4928- bpo-37163: The *obj* argument of :func:`dataclasses.replace` is 4929 positional-only now. 4930 4931- bpo-37085: Add the optional Linux SocketCAN Broadcast Manager constants, 4932 used as flags to configure the BCM behaviour, in the socket module. Patch 4933 by Karl Ding. 4934 4935- bpo-37328: ``HTMLParser.unescape`` is removed. It was undocumented and 4936 deprecated since Python 3.4. 4937 4938- bpo-37305: Add .webmanifest -> application/manifest+json to list of 4939 recognized file types and content type headers 4940 4941- bpo-37320: ``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` 4942 alias to ``sunau.open()``, and ``wave.openfp()`` alias to ``wave.open()`` 4943 have been removed. They were deprecated since Python 3.7. 4944 4945- bpo-37315: Deprecated accepting floats with integral value (like ``5.0``) 4946 in :func:`math.factorial`. 4947 4948- bpo-37312: ``_dummy_thread`` and ``dummy_threading`` modules have been 4949 removed. These modules were deprecated since Python 3.7 which requires 4950 threading support. 4951 4952- bpo-33972: Email with single part but content-type set to ``multipart/*`` 4953 doesn't raise AttributeError anymore. 4954 4955- bpo-37280: Use threadpool for reading from file for sendfile fallback 4956 mode. 4957 4958- bpo-37279: Fix asyncio sendfile support when sendfile sends extra data in 4959 fallback mode. 4960 4961- bpo-19865: :func:`ctypes.create_unicode_buffer()` now also supports 4962 non-BMP characters on platforms with 16-bit :c:type:`wchar_t` (for 4963 example, Windows and AIX). 4964 4965- bpo-37266: In a subinterpreter, spawning a daemon thread now raises an 4966 exception. Daemon threads were never supported in subinterpreters. 4967 Previously, the subinterpreter finalization crashed with a Pyton fatal 4968 error if a daemon thread was still running. 4969 4970- bpo-37210: Allow pure Python implementation of :mod:`pickle` to work even 4971 when the C :mod:`_pickle` module is unavailable. 4972 4973- bpo-21872: Fix :mod:`lzma`: module decompresses data incompletely. When 4974 decompressing a FORMAT_ALONE format file, and it doesn't have the end 4975 marker, sometimes the last one to dozens bytes can't be output. Patch by 4976 Ma Lin. 4977 4978- bpo-35922: Fix :meth:`RobotFileParser.crawl_delay` and 4979 :meth:`RobotFileParser.request_rate` to return ``None`` rather than raise 4980 :exc:`AttributeError` when no relevant rule is defined in the robots.txt 4981 file. Patch by Rémi Lapeyre. 4982 4983- bpo-35766: Change the format of feature_version to be a (major, minor) 4984 tuple. 4985 4986- bpo-36607: Eliminate :exc:`RuntimeError` raised by 4987 :func:`asyncio.all_tasks()` if internal tasks weak set is changed by 4988 another thread during iteration. 4989 4990- bpo-18748: :class:`_pyio.IOBase` destructor now does nothing if getting 4991 the ``closed`` attribute fails to better mimick :class:`_io.IOBase` 4992 finalizer. 4993 4994- bpo-36402: Fix a race condition at Python shutdown when waiting for 4995 threads. Wait until the Python thread state of all non-daemon threads get 4996 deleted (join all non-daemon threads), rather than just wait until 4997 non-daemon Python threads complete. 4998 4999- bpo-37206: Default values which cannot be represented as Python objects no 5000 longer improperly represented as ``None`` in function signatures. 5001 5002- bpo-37111: Added ``encoding`` and ``errors`` keyword parameters to 5003 ``logging.basicConfig``. 5004 5005- bpo-12144: Ensure cookies with ``expires`` attribute are handled in 5006 :meth:`CookieJar.make_cookies`. 5007 5008- bpo-34886: Fix an unintended ValueError from :func:`subprocess.run` when 5009 checking for conflicting `input` and `stdin` or `capture_output` and 5010 `stdout` or `stderr` args when they were explicitly provided but with 5011 `None` values within a passed in `**kwargs` dict rather than as passed 5012 directly by name. Patch contributed by Rémi Lapeyre. 5013 5014- bpo-37173: The exception message for ``inspect.getfile()`` now correctly 5015 reports the passed class rather than the builtins module. 5016 5017- bpo-37178: Give math.perm() a one argument form that means the same as 5018 math.factorial(). 5019 5020- bpo-37178: For math.perm(n, k), let k default to n, giving the same result 5021 as factorial. 5022 5023- bpo-37165: Converted _collections._count_elements to use the Argument 5024 Clinic. 5025 5026- bpo-34767: Do not always create a :class:`collections.deque` in 5027 :class:`asyncio.Lock`. 5028 5029- bpo-37158: Speed-up statistics.fmean() by switching from a function to a 5030 generator. 5031 5032- bpo-34282: Remove ``Enum._convert`` method, deprecated in 3.8. 5033 5034- bpo-37150: `argparse._ActionsContainer.add_argument` now throws error, if 5035 someone accidentally pass FileType class object instead of instance of 5036 FileType as `type` argument 5037 5038- bpo-28724: The socket module now has the :func:`socket.send_fds` and 5039 :func:`socket.recv.fds` methods. Contributed by Joannah Nanjekye, Shinya 5040 Okano and Victor Stinner. 5041 5042- bpo-35621: Support running asyncio subprocesses when execution event loop 5043 in a thread on UNIX. 5044 5045- bpo-36520: Lengthy email headers with UTF-8 characters are now properly 5046 encoded when they are folded. Patch by Jeffrey Kintscher. 5047 5048- bpo-30835: Fixed a bug in email parsing where a message with invalid bytes 5049 in content-transfer-encoding of a multipart message can cause an 5050 AttributeError. Patch by Andrew Donnellan. 5051 5052- bpo-31163: pathlib.Path instance's rename and replace methods now return 5053 the new Path instance. 5054 5055- bpo-25068: :class:`urllib.request.ProxyHandler` now lowercases the keys of 5056 the passed dictionary. 5057 5058- bpo-26185: Fix :func:`repr` on empty :class:`ZipInfo` object. Patch by 5059 Mickaël Schoentgen. 5060 5061- bpo-21315: Email headers containing RFC2047 encoded words are parsed 5062 despite the missing whitespace, and a defect registered. Also missing 5063 trailing whitespace after encoded words is now registered as a defect. 5064 5065- bpo-31904: Port test_datetime to VxWorks: skip zoneinfo tests on VxWorks 5066 5067- bpo-35805: Add parser for Message-ID header and add it to default 5068 HeaderRegistry. This should prevent folding of Message-ID using RFC 2048 5069 encoded words. 5070 5071- bpo-36871: Ensure method signature is used instead of constructor 5072 signature of a class while asserting mock object against method calls. 5073 Patch by Karthikeyan Singaravelan. 5074 5075- bpo-35070: posix.getgrouplist() now works correctly when the user belongs 5076 to NGROUPS_MAX supplemental groups. Patch by Jeffrey Kintscher. 5077 5078- bpo-31783: Fix race condition in ThreadPoolExecutor when worker threads 5079 are created during interpreter shutdown. 5080 5081- bpo-36582: Fix ``UserString.encode()`` to correctly return ``bytes`` 5082 rather than a ``UserString`` instance. 5083 5084- bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of 5085 copy.copy(). 5086 5087 Patch by Gordon P. Hemsley 5088 5089- bpo-36564: Fix infinite loop in email header folding logic that would be 5090 triggered when an email policy's max_line_length is not long enough to 5091 include the required markup and any values in the message. Patch by Paul 5092 Ganssle 5093 5094- bpo-36543: Removed methods Element.getchildren(), Element.getiterator() 5095 and ElementTree.getiterator() and the xml.etree.cElementTree module. 5096 5097- bpo-36409: Remove the old plistlib API deprecated in Python 3.4 5098 5099- bpo-36302: distutils sorts source file lists so that Extension .so files 5100 build more reproducibly by default 5101 5102- bpo-36250: Ignore ``ValueError`` from ``signal`` with ``interaction`` in 5103 non-main thread. 5104 5105- bpo-36046: Added ``user``, ``group`` and ``extra_groups`` parameters to 5106 the subprocess.Popen constructor. Patch by Patrick McLean. 5107 5108- bpo-32627: Fix compile error when ``_uuid`` headers conflicting included. 5109 5110- bpo-35800: Deprecate ``smtpd.MailmanProxy`` ready for future removal. 5111 5112- bpo-35168: :attr:`shlex.shlex.punctuation_chars` is now a read-only 5113 property. 5114 5115- bpo-8538: Add support for boolean actions like ``--foo`` and ``--no-foo`` 5116 to argparse. Patch contributed by Rémi Lapeyre. 5117 5118- bpo-20504: Fixes a bug in :mod:`cgi` module when a multipart/form-data 5119 request has no `Content-Length` header. 5120 5121- bpo-25988: The abstract base classes in :mod:`collections.abc` no longer 5122 are exposed in the regular :mod:`collections` module. 5123 5124- bpo-11122: Distutils won't check for rpmbuild in specified paths only. 5125 5126- bpo-34775: Division handling of PurePath now returns NotImplemented 5127 instead of raising a TypeError when passed something other than an 5128 instance of str or PurePath. Patch by Roger Aiudi. 5129 5130- bpo-34749: :func:`binascii.a2b_base64` is now up to 2 times faster. Patch 5131 by Sergey Fedoseev. 5132 5133- bpo-34519: Add additional aliases for HP Roman 8. Patch by Michael Osipov. 5134 5135- bpo-28009: Fix uuid.getnode() on platforms with '.' as MAC Addr delimiter 5136 as well fix for MAC Addr format that omits a leading 0 in MAC Addr values. 5137 Currently, AIX is the only know platform with these settings. Patch by 5138 Michael Felt. 5139 5140- bpo-30618: Add :meth:`~pathlib.Path.readlink`. Patch by Girts Folkmanis. 5141 5142- bpo-32498: Made :func:`urllib.parse.unquote()` accept bytes in addition to 5143 strings. Patch by Stein Karlsen. 5144 5145- bpo-33348: lib2to3 now recognizes expressions after ``*`` and `**` like in 5146 ``f(*[] or [])``. 5147 5148- bpo-32689: Update :func:`shutil.move` function to allow for Path objects 5149 to be used as source argument. Patch by Emily Morehouse and Maxwell 5150 "5.13b" McKinnon. 5151 5152- bpo-32820: Added __format__ to IPv4 and IPv6 classes. Always outputs a 5153 fully zero- padded string. Supports b/x/n modifiers (bin/hex/native 5154 format). Native format for IPv4 is bin, native format for IPv6 is hex. 5155 Also supports '#' and '_' modifiers. 5156 5157- bpo-27657: Fix urllib.parse.urlparse() with numeric paths. A string like 5158 "path:80" is no longer parsed as a path but as a scheme ("path") and a 5159 path ("80"). 5160 5161- bpo-4963: Fixed non-deterministic behavior related to mimetypes extension 5162 mapping and module reinitialization. 5163 5164Documentation 5165------------- 5166 5167- bpo-21767: Explicitly mention abc support in functools.singledispatch 5168 5169- bpo-38816: Provides more details about the interaction between 5170 :c:func:`fork` and CPython's runtime, focusing just on the C-API. This 5171 includes cautions about where :c:func:`fork` should and shouldn't be 5172 called. 5173 5174- bpo-38351: Modernize :mod:`email` examples from %-formatting to f-strings. 5175 5176- bpo-38778: Document the fact that :exc:`RuntimeError` is raised if 5177 :meth:`os.fork` is called in a subinterpreter. 5178 5179- bpo-38592: Add Brazilian Portuguese to the language switcher at Python 5180 Documentation website. 5181 5182- bpo-38294: Add list of no-longer-escaped chars to re.escape documentation 5183 5184- bpo-38053: Modernized the plistlib documentation 5185 5186- bpo-26868: Fix example usage of :c:func:`PyModule_AddObject` to properly 5187 handle errors. 5188 5189- bpo-36797: Fix a dead link in the distutils API Reference. 5190 5191- bpo-37977: Warn more strongly and clearly about pickle insecurity 5192 5193- bpo-37979: Added a link to dateutil.parser.isoparse in the 5194 datetime.fromisoformat documentation. Patch by Paul Ganssle 5195 5196- bpo-12707: Deprecate info(), geturl(), getcode() methods in favor of the 5197 headers, url, and status properties, respectively, for HTTPResponse and 5198 addinfourl. Also deprecate the code attribute of addinfourl in favor of 5199 the status attribute. Patch by Ashwin Ramaswami 5200 5201- bpo-37937: Mention ``frame.f_trace`` in :func:`sys.settrace` docs. 5202 5203- bpo-37878: Make :c:func:`PyThreadState_DeleteCurrent` Internal. 5204 5205- bpo-37759: Beginning edits to Whatsnew 3.8 5206 5207- bpo-37726: Stop recommending getopt in the tutorial for command line 5208 argument parsing and promote argparse. 5209 5210- bpo-32910: Remove implementation-specific behaviour of how venv's 5211 Deactivate works. 5212 5213- bpo-37256: Fix wording of arguments for :class:`Request` in 5214 :mod:`urllib.request` 5215 5216- bpo-37284: Add a brief note to indicate that any new 5217 ``sys.implementation`` required attributes must go through the PEP 5218 process. 5219 5220- bpo-30088: Documented that :class:`mailbox.Maildir` constructor doesn't 5221 attempt to verify the maildir folder layout correctness. Patch by 5222 Sviatoslav Sydorenko. 5223 5224- bpo-37521: Fix `importlib` examples to insert any newly created modules 5225 via importlib.util.module_from_spec() immediately into sys.modules instead 5226 of after calling loader.exec_module(). 5227 5228 Thanks to Benjamin Mintz for finding the bug. 5229 5230- bpo-37456: Slash ('/') is now part of syntax. 5231 5232- bpo-37487: Fix PyList_GetItem index description to include 0. 5233 5234- bpo-37149: Replace the dead link to the Tkinter 8.5 reference by John 5235 Shipman, New Mexico Tech, with a link to the archive.org copy. 5236 5237- bpo-37478: Added possible exceptions to the description of os.chdir(). 5238 5239- bpo-34903: Documented that in :meth:`datetime.datetime.strptime()`, the 5240 leading zero in some two-digit formats is optional. Patch by Mike Gleen. 5241 5242- bpo-36260: Add decompression pitfalls to zipfile module documentation. 5243 5244- bpo-37004: In the documentation for difflib, a note was added explicitly 5245 warning that the results of SequenceMatcher's ratio method may depend on 5246 the order of the input strings. 5247 5248- bpo-36960: Restructured the :mod:`datetime` docs in the interest of making 5249 them more user-friendly and improving readability. Patch by Brad Solomon. 5250 5251- bpo-36487: Make C-API docs clear about what the "main" interpreter is. 5252 5253- bpo-23460: The documentation for decimal string formatting using the `:g` 5254 specifier has been updated to reflect the correct exponential notation 5255 cutoff point. Original patch contributed by Tuomas Suutari. 5256 5257- bpo-35803: Document and test that ``tempfile`` functions may accept a 5258 :term:`path-like object` for the ``dir`` argument. Patch by Anthony 5259 Sottile. 5260 5261- bpo-33944: Added a note about the intended use of code in .pth files. 5262 5263- bpo-34293: Fix the Doc/Makefile regarding PAPER environment variable and 5264 PDF builds 5265 5266- bpo-25237: Add documentation for tkinter modules 5267 5268Tests 5269----- 5270 5271- bpo-38614: Fix test_communicate() of test_asyncio.test_subprocess: use 5272 ``support.LONG_TIMEOUT`` (5 minutes), instead of just 1 minute. 5273 5274- bpo-38614: Add timeout constants to :mod:`test.support`: 5275 :data:`~test.support.LOOPBACK_TIMEOUT`, 5276 :data:`~test.support.INTERNET_TIMEOUT`, 5277 :data:`~test.support.SHORT_TIMEOUT` and 5278 :data:`~test.support.LONG_TIMEOUT`. 5279 5280- bpo-38502: test.regrtest now uses process groups in the multiprocessing 5281 mode (-jN command line option) if process groups are available: if 5282 :func:`os.setsid` and :func:`os.killpg` functions are available. 5283 5284- bpo-35998: Fix a race condition in test_asyncio.test_start_tls_server_1(). 5285 Previously, there was a race condition between the test main() function 5286 which replaces the protocol and the test ServerProto protocol which sends 5287 ANSWER once it gets HELLO. Now, only the test main() function is 5288 responsible to send data, ServerProto no longer sends data. 5289 5290- bpo-38470: Fix ``test_compileall.test_compile_dir_maxlevels()`` on Windows 5291 without long path support: only create 3 subdirectories instead of between 5292 20 and 100 subdirectories. 5293 5294- bpo-37531: On timeout, regrtest no longer attempts to call 5295 ``popen.communicate()`` again: it can hang until all child processes using 5296 stdout and stderr pipes completes. Kill the worker process and ignores its 5297 output. Change also the faulthandler timeout of the main process from 1 5298 minute to 5 minutes, for Python slowest buildbots. 5299 5300- bpo-38239: Fix test_gdb for Link Time Optimization (LTO) builds. 5301 5302- bpo-38275: test_ssl now handles disabled TLS/SSL versions better. 5303 OpenSSL's crypto policy and run-time settings are recognized and tests for 5304 disabled versions are skipped. Tests also accept more TLS minimum_versions 5305 for platforms that override OpenSSL's default with strict settings. 5306 5307- bpo-38271: The private keys for test_ssl were encrypted with 3DES in 5308 traditional PKCS#5 format. 3DES and the digest algorithm of PKCS#5 are 5309 blocked by some strict crypto policies. Use PKCS#8 format with AES256 5310 encryption instead. 5311 5312- bpo-38270: test.support now has a helper function to check for 5313 availibility of a hash digest function. Several tests are refactored avoid 5314 MD5 and use SHA256 instead. Other tests are marked to use MD5 and skipped 5315 when MD5 is disabled. 5316 5317- bpo-37123: Multiprocessing test test_mymanager() now also expects 5318 -SIGTERM, not only exitcode 0. BaseManager._finalize_manager() sends 5319 SIGTERM to the manager process if it takes longer than 1 second to stop, 5320 which happens on slow buildbots. 5321 5322- bpo-38212: Multiprocessing tests: increase 5323 test_queue_feeder_donot_stop_onexc() timeout from 1 to 60 seconds. 5324 5325- bpo-38117: Test with OpenSSL 1.1.1d 5326 5327- bpo-38018: Increase code coverage for multiprocessing.shared_memory. 5328 5329- bpo-37805: Add tests for json.dump(..., skipkeys=True). Patch by Dong-hee 5330 Na. 5331 5332- bpo-37531: Enhance regrtest multiprocess timeout: write a message when 5333 killing a worker process, catch popen.kill() and popen.wait() exceptions, 5334 put a timeout on the second call to popen.communicate(). 5335 5336- bpo-37876: Add tests for ROT-13 codec. 5337 5338- bpo-36833: Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of 5339 the :mod:`datetime` module. Patch by Joannah Nanjekye. 5340 5341- bpo-37558: Fix test_shared_memory_cleaned_after_process_termination name 5342 handling 5343 5344- bpo-37526: Add :func:`test.support.catch_threading_exception`: context 5345 manager catching :class:`threading.Thread` exception using 5346 :func:`threading.excepthook`. 5347 5348- bpo-37421: test_concurrent_futures now explicitly stops the ForkServer 5349 instance if it's running. 5350 5351- bpo-37421: multiprocessing tests now stop the ForkServer instance if it's 5352 running: close the "alive" file descriptor to ask the server to stop and 5353 then remove its UNIX address. 5354 5355- bpo-37421: test_distutils.test_build_ext() is now able to remove the 5356 temporary directory on Windows: don't import the newly built C extension 5357 ("xx") in the current process, but test it in a separated process. 5358 5359- bpo-37421: test_concurrent_futures now cleans up multiprocessing to remove 5360 immediately temporary directories created by 5361 multiprocessing.util.get_temp_dir(). 5362 5363- bpo-37421: test_winconsoleio doesn't leak a temporary file anymore: use 5364 tempfile.TemporaryFile() to remove it when the test completes. 5365 5366- bpo-37421: multiprocessing tests now explicitly call ``_run_finalizers()`` 5367 to immediately remove temporary directories created by tests. 5368 5369- bpo-37421: urllib.request tests now call 5370 :func:`~urllib.request.urlcleanup` to remove temporary files created by 5371 ``urlretrieve()`` tests and to clear the ``_opener`` global variable set 5372 by ``urlopen()`` and functions calling indirectly ``urlopen()``. 5373 5374- bpo-37472: Remove ``Lib/test/outstanding_bugs.py``. 5375 5376- bpo-37199: Fix test failures when IPv6 is unavailable or disabled. 5377 5378- bpo-19696: Replace deprecated method "random.choose" with "random.choice" 5379 in "test_pkg_import.py". 5380 5381- bpo-37335: Remove no longer necessary code from c locale coercion tests 5382 5383- bpo-37421: Fix test_shutil to no longer leak temporary files. 5384 5385- bpo-37411: Fix test_wsgiref.testEnviron() to no longer depend on the 5386 environment variables (don't fail if "X" variable is set). 5387 5388- bpo-37400: Fix test_os.test_chown(): use os.getgroups() rather than 5389 grp.getgrall() to get groups. Rename also the test to test_chown_gid(). 5390 5391- bpo-37359: Add --cleanup option to python3 -m test to remove 5392 ``test_python_*`` directories of previous failed jobs. Add "make 5393 cleantest" to run ``python3 -m test --cleanup``. 5394 5395- bpo-37362: test_gdb no longer fails if it gets an "unexpected" message on 5396 stderr: it now ignores stderr. The purpose of test_gdb is to test that 5397 python-gdb.py commands work as expected, not to test gdb. 5398 5399- bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() 5400 5401- bpo-37278: Fix test_asyncio ProactorLoopCtrlC: join the thread to prevent 5402 leaking a running thread and leaking a reference. 5403 5404- bpo-37261: Fix :func:`test.support.catch_unraisable_exception`: its 5405 __exit__() method now ignores unraisable exception raised when clearing 5406 its ``unraisable`` attribute. 5407 5408- bpo-37069: regrtest now uses :func:`sys.unraisablehook` to mark a test as 5409 "environment altered" (ENV_CHANGED) if it emits an "unraisable exception". 5410 Moreover, regrtest logs a warning in this case. 5411 5412 Use ``python3 -m test --fail-env-changed`` to catch unraisable exceptions 5413 in tests. 5414 5415- bpo-37252: Fix assertions in ``test_close`` and 5416 ``test_events_mask_overflow`` devpoll tests. 5417 5418- bpo-37169: Rewrite ``_PyObject_IsFreed()`` unit tests. 5419 5420- bpo-37153: ``test_venv.test_multiprocessing()`` now explicitly calls 5421 ``pool.terminate()`` to wait until the pool completes. 5422 5423- bpo-34001: Make test_ssl pass with LibreSSL. LibreSSL handles minimum and 5424 maximum TLS version differently than OpenSSL. 5425 5426- bpo-36919: Make ``test_source_encoding.test_issue2301`` implementation 5427 independent. The test will work now for both CPython and IronPython. 5428 5429- bpo-30202: Update ``test.test_importlib.test_abc`` to test 5430 ``find_spec()``. 5431 5432- bpo-28009: Modify the test_uuid logic to test when a program is available 5433 AND can be used to obtain a MACADDR as basis for an UUID. Patch by M. Felt 5434 5435- bpo-34596: Fallback to a default reason when :func:`unittest.skip` is 5436 uncalled. Patch by Naitree Zhu. 5437 5438Build 5439----- 5440 5441- bpo-38809: On Windows, build scripts will now recognize and use python.exe 5442 from an active virtual env. 5443 5444- bpo-38684: Fix _hashlib build when Blake2 is disabled, but OpenSSL 5445 supports it. 5446 5447- bpo-38468: Misc/python-config.in now uses `getvar()` for all still 5448 existing `sysconfig.get_config_var()` calls. Patch by Joannah Nanjekye. 5449 5450- bpo-37415: Fix stdatomic.h header check for ICC compiler: the ICC 5451 implementation lacks atomic_uintptr_t type which is needed by Python. 5452 5453- bpo-38301: In Solaris family, we must be sure to use ``-D_REENTRANT``. 5454 Patch by Jesús Cea Avión. 5455 5456- bpo-36002: Locate ``llvm-profdata`` and ``llvm-ar`` binaries using 5457 ``AC_PATH_TOOL`` rather than ``AC_PATH_TARGET_TOOL``. 5458 5459- bpo-37936: The :file:`.gitignore` file systematically keeps "rooted", with 5460 a non-trailing slash, all the rules that are meant to apply to files in a 5461 specific place in the repo. Previously, when the intended file to ignore 5462 happened to be at the root of the repo, we'd most often accidentally also 5463 ignore files and directories with the same name anywhere in the tree. 5464 5465- bpo-37760: The :file:`Tools/unicode/makeunicodedata.py` script, which is 5466 used for converting information from the Unicode Character Database into 5467 generated code and data used by the methods of :class:`str` and by the 5468 :mod:`unicodedata` module, now handles each character's data as a 5469 ``dataclass`` with named attributes, rather than a length-18 list of 5470 different fields. 5471 5472- bpo-37936: The :file:`.gitignore` file no longer applies to any files that 5473 are in fact tracked in the Git repository. Patch by Greg Price. 5474 5475- bpo-37725: Change "clean" makefile target to also clean the program guided 5476 optimization (PGO) data. Previously you would have to use "make clean" 5477 and "make profile-removal", or "make clobber". 5478 5479- bpo-37707: Mark some individual tests to skip when --pgo is used. The 5480 tests marked increase the PGO task time significantly and likely don't 5481 help improve optimization of the final executable. 5482 5483- bpo-36044: Reduce the number of unit tests run for the PGO generation 5484 task. This speeds up the task by a factor of about 15x. Running the full 5485 unit test suite is slow. This change may result in a slightly less 5486 optimized build since not as many code branches will be executed. If you 5487 are willing to wait for the much slower build, the old behavior can be 5488 restored using './configure [..] PROFILE_TASK="-m test --pgo-extended"'. 5489 We make no guarantees as to which PGO task set produces a faster build. 5490 Users who care should run their own relevant benchmarks as results can 5491 depend on the environment, workload, and compiler tool chain. 5492 5493- bpo-37468: ``make install`` no longer installs ``wininst-*.exe`` files 5494 used by distutils bdist_wininst: bdist_wininst only works on Windows. 5495 5496- bpo-37189: Many ``PyRun_XXX()`` functions like :c:func:`PyRun_String` were 5497 no longer exported in ``libpython38.dll`` by mistake. Export them again to 5498 fix the ABI compatibility. 5499 5500- bpo-25361: Enables use of SSE2 instructions in Windows 32-bit build. 5501 5502- bpo-36210: Update optional extension module detection for AIX. ossaudiodev 5503 and spwd are not applicable for AIX, and are no longer reported as 5504 missing. 3rd-party packaging of ncurses (with ASIS support) conflicts with 5505 officially supported AIX curses library, so configure AIX to use 5506 libcurses.a. However, skip trying to build _curses_panel. 5507 5508 patch by M Felt 5509 5510Windows 5511------- 5512 5513- bpo-38589: Fixes HTML Help shortcut when Windows is not installed to C 5514 drive 5515 5516- bpo-38453: Ensure ntpath.realpath() correctly resolves relative paths. 5517 5518- bpo-38519: Restores the internal C headers that were missing from the 5519 nuget.org and Microsoft Store packages. 5520 5521- bpo-38492: Remove ``pythonw.exe`` dependency on the Microsoft C++ runtime. 5522 5523- bpo-38344: Fix error message in activate.bat 5524 5525- bpo-38359: Ensures ``pyw.exe`` launcher reads correct registry key. 5526 5527- bpo-38355: Fixes ``ntpath.realpath`` failing on ``sys.executable``. 5528 5529- bpo-38117: Update bundled OpenSSL to 1.1.1d 5530 5531- bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual 5532 environment. 5533 5534- bpo-38133: Allow py.exe launcher to locate installations from the 5535 Microsoft Store and improve display of active virtual environments. 5536 5537- bpo-38114: The ``pip.ini`` is no longer included in the Nuget package. 5538 5539- bpo-32592: Set Windows 8 as the minimum required version for API support 5540 5541- bpo-36634: :func:`os.cpu_count` now returns active processors rather than 5542 maximum processors. 5543 5544- bpo-36634: venv activate.bat now works when the existing variables contain 5545 double quote characters. 5546 5547- bpo-38081: Prevent error calling :func:`os.path.realpath` on ``'NUL'``. 5548 5549- bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath. 5550 5551- bpo-38088: Fixes distutils not finding vcruntime140.dll with only the v142 5552 toolset installed. 5553 5554- bpo-37283: Ensure command-line and unattend.xml setting override 5555 previously detected states in Windows installer. 5556 5557- bpo-38030: Fixes :func:`os.stat` failing for block devices on Windows 5558 5559- bpo-38020: Fixes potential crash when calling :func:`os.readlink` (or 5560 indirectly through :func:`~os.path.realpath`) on a file that is not a 5561 supported link. 5562 5563- bpo-37705: Improve the implementation of ``winerror_to_errno()``. 5564 5565- bpo-37549: :func:`os.dup` no longer fails for standard streams on Windows 5566 7. 5567 5568- bpo-1311: The ``nul`` file on Windows now returns True from 5569 :func:`~os.path.exists` and a valid result from :func:`os.stat` with 5570 ``S_IFCHR`` set. 5571 5572- bpo-9949: Enable support for following symlinks in :func:`os.realpath`. 5573 5574- bpo-37834: Treat all name surrogate reparse points on Windows in 5575 :func:`os.lstat` and other reparse points as regular files in 5576 :func:`os.stat`. 5577 5578- bpo-36266: Add the module name in the formatted error message when DLL 5579 load fail happens during module import in 5580 ``_PyImport_FindSharedFuncptrWindows()``. Patch by Srinivas Nyayapati. 5581 5582- bpo-25172: Trying to import the :mod:`crypt` module on Windows will result 5583 in an :exc:`ImportError` with a message explaining that the module isn't 5584 supported on Windows. On other platforms, if the underlying ``_crypt`` 5585 module is not available, the ImportError will include a message explaining 5586 the problem. 5587 5588- bpo-37778: Fixes the icons used for file associations to the Microsoft 5589 Store package. 5590 5591- bpo-37734: Fix use of registry values to launch Python from Microsoft 5592 Store app. 5593 5594- bpo-37702: Fix memory leak on Windows in creating an SSLContext object or 5595 running urllib.request.urlopen('https://...'). 5596 5597- bpo-37672: Switch Windows Store package's pip to use bundled 5598 :file:`pip.ini` instead of :envvar:`PIP_USER` variable. 5599 5600- bpo-10945: Officially drop support for creating bdist_wininst installers 5601 on non-Windows systems. 5602 5603- bpo-37445: Include the ``FORMAT_MESSAGE_IGNORE_INSERTS`` flag in 5604 ``FormatMessageW()`` calls. 5605 5606- bpo-37369: Fixes path for :data:`sys.executable` when running from the 5607 Microsoft Store. 5608 5609- bpo-37380: Don't collect unfinished processes with ``subprocess._active`` 5610 on Windows to cleanup later. Patch by Ruslan Kuprieiev. 5611 5612- bpo-37351: Removes libpython38.a from standard Windows distribution. 5613 5614- bpo-35360: Update Windows builds to use SQLite 3.28.0. 5615 5616- bpo-37267: On Windows, :func:`os.dup` no longer creates an inheritable fd 5617 when handling a character file. 5618 5619- bpo-36779: Ensure ``time.tzname`` is correct on Windows when the active 5620 code page is set to CP_UTF7 or CP_UTF8. 5621 5622- bpo-32587: Make :data:`winreg.REG_MULTI_SZ` support zero-length strings. 5623 5624- bpo-28269: Replace use of :c:func:`strcasecmp` for the system function 5625 :c:func:`_stricmp`. Patch by Minmin Gong. 5626 5627- bpo-36590: Add native Bluetooth RFCOMM support to socket module. 5628 5629macOS 5630----- 5631 5632- bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. 5633 5634- bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests 5635 optional 5636 5637- bpo-18049: Increase the default stack size of threads from 5MB to 16MB on 5638 macOS, to match the stack size of the main thread. This avoids crashes on 5639 deep recursion in threads. 5640 5641- bpo-34602: Avoid test suite failures on macOS by no longer calling 5642 resource.setrlimit to increase the process stack size limit at runtime. 5643 The runtime change is no longer needed since the interpreter is being 5644 built with a larger default stack size. 5645 5646- bpo-35360: Update macOS installer to use SQLite 3.28.0. 5647 5648- bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer. 5649 5650IDLE 5651---- 5652 5653- bpo-26353: Stop adding newline when saving an IDLE shell window. 5654 5655- bpo-4630: Add an option to toggle IDLE's cursor blink for shell, editor, 5656 and output windows. See Settings, General, Window Preferences, Cursor 5657 Blink. Patch by Zackery Spytz. 5658 5659- bpo-38598: Do not try to compile IDLE shell or output windows 5660 5661- bpo-36698: IDLE no longer fails when write non-encodable characters to 5662 stderr. It now escapes them with a backslash, as the regular Python 5663 interpreter. Added the ``errors`` field to the standard streams. 5664 5665- bpo-35379: When exiting IDLE, catch any AttributeError. One happens when 5666 EditorWindow.close is called twice. Printing a traceback, when IDLE is 5667 run from a terminal, is useless and annoying. 5668 5669- bpo-38183: To avoid problems, test_idle ignores the user config directory. 5670 It no longer tries to create or access .idlerc or any files within. Users 5671 must run IDLE to discover problems with saving settings. 5672 5673- bpo-38077: IDLE no longer adds 'argv' to the user namespace when 5674 initializing it. This bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4. 5675 5676- bpo-38041: Shell restart lines now fill the window width, always start 5677 with '=', and avoid wrapping unnecessarily. The line will still wrap if 5678 the included file name is long relative to the width. 5679 5680- bpo-35771: To avoid occasional spurious test_idle failures on slower 5681 machines, increase the ``hover_delay`` in test_tooltip. 5682 5683- bpo-37824: Properly handle user input warnings in IDLE shell. Cease 5684 turning SyntaxWarnings into SyntaxErrors. 5685 5686- bpo-37929: IDLE Settings dialog now closes properly when there is no shell 5687 window. 5688 5689- bpo-37902: Add mousewheel scrolling for IDLE module, path, and stack 5690 browsers. Patch by George Zhang. 5691 5692- bpo-37849: Fixed completions list appearing too high or low when shown 5693 above the current line. 5694 5695- bpo-36419: Refactor IDLE autocomplete and improve testing. 5696 5697- bpo-37748: Reorder the Run menu. Put the most common choice, Run Module, 5698 at the top. 5699 5700- bpo-37692: Improve highlight config sample with example shell interaction 5701 and better labels for shell elements. 5702 5703- bpo-37628: Settings dialog no longer expands with font size. 5704 5705- bpo-37627: Initialize the Customize Run dialog with the command line 5706 arguments most recently entered before. The user can optionally edit 5707 before submitting them. 5708 5709- bpo-33610: Fix code context not showing the correct context when first 5710 toggled on. 5711 5712- bpo-37530: Optimize code context to reduce unneeded background activity. 5713 Font and highlight changes now occur along with text changes instead of 5714 after a random delay. 5715 5716- bpo-27452: Cleanup ``config.py`` by inlining ``RemoveFile`` and 5717 simplifying the handling of ``file`` in ``CreateConfigHandlers``. 5718 5719- bpo-37325: Fix tab focus traversal order for help source and custom run 5720 dialogs. 5721 5722- bpo-37321: Both subprocess connection error messages now refer to the 5723 'Startup failure' section of the IDLE doc. 5724 5725- bpo-17535: Add optional line numbers for IDLE editor windows. Windows 5726 open without line numbers unless set otherwise in the General tab of the 5727 configuration dialog. 5728 5729- bpo-26806: To compensate for stack frames added by IDLE and avoid possible 5730 problems with low recursion limits, add 30 to limits in the user code 5731 execution process. Subtract 30 when reporting recursion limits to make 5732 this addition mostly transparent. 5733 5734- bpo-37177: Properly 'attach' search dialogs to their main window so that 5735 they behave like other dialogs and do not get hidden behind their main 5736 window. 5737 5738- bpo-37039: Adjust "Zoom Height" to individual screens by momentarily 5739 maximizing the window on first use with a particular screen. Changing 5740 screen settings may invalidate the saved height. While a window is 5741 maximized, "Zoom Height" has no effect. 5742 5743- bpo-35763: Make calltip reminder about '/' meaning positional-only less 5744 obtrusive by only adding it when there is room on the first line. 5745 5746- bpo-5680: Add 'Run... Customized' to the Run menu to run a module with 5747 customized settings. Any 'command line arguments' entered are added to 5748 sys.argv. One can suppress the normal Shell main module restart. 5749 5750- bpo-36390: Gather Format menu functions into format.py. Combine 5751 paragraph.py, rstrip.py, and format methods from editor.py. 5752 5753Tools/Demos 5754----------- 5755 5756- bpo-38118: Update Valgrind suppression file to ignore a false alarm in 5757 :c:func:`PyUnicode_Decode` when using GCC builtin strcmp(). 5758 5759- bpo-38347: pathfix.py: Assume all files that end on '.py' are Python 5760 scripts when working recursively. 5761 5762- bpo-37803: pdb's ``--help`` and ``--version`` long options now work. 5763 5764- bpo-37942: Improve ArgumentClinic converter for floats. 5765 5766- bpo-37704: Remove ``Tools/scripts/h2py.py``: use cffi to access a C API in 5767 Python. 5768 5769- bpo-37675: 2to3 now works when run from a zipped standard library. 5770 5771- bpo-37034: Argument Clinic now uses the argument name on errors with 5772 keyword-only argument instead of their position. Patch contributed by Rémi 5773 Lapeyre. 5774 5775- bpo-37064: Add option -k to pathscript.py script: preserve shebang flags. 5776 Add option -a to pathscript.py script: add flags. 5777 5778C API 5779----- 5780 5781- bpo-37633: Re-export some function compatibility wrappers for macros in 5782 ``pythonrun.h``. 5783 5784- bpo-38644: Provide :c:func:`Py_EnterRecursiveCall` and 5785 :c:func:`Py_LeaveRecursiveCall` as regular functions for the limited API. 5786 Previously, there were defined as macros, but these macros didn't work 5787 with the limited API which cannot access ``PyThreadState.recursion_depth`` 5788 field. Remove ``_Py_CheckRecursionLimit`` from the stable ABI. 5789 5790- bpo-38650: The global variable :c:data:`PyStructSequence_UnnamedField` is 5791 now a constant and refers to a constant string. 5792 5793- bpo-38540: Fixed possible leak in :c:func:`PyArg_Parse` and similar 5794 functions for format units ``"es#"`` and ``"et#"`` when the macro 5795 :c:macro:`PY_SSIZE_T_CLEAN` is not defined. 5796 5797- bpo-38395: Fix a crash in :class:`weakref.proxy` objects due to incorrect 5798 lifetime management when calling some associated methods that may delete 5799 the last reference to object being referenced by the proxy. Patch by Pablo 5800 Galindo. 5801 5802- bpo-36389: The ``_PyObject_CheckConsistency()`` function is now also 5803 available in release mode. For example, it can be used to debug a crash in 5804 the ``visit_decref()`` function of the GC. 5805 5806- bpo-38266: Revert the removal of PyThreadState_DeleteCurrent() with 5807 documentation. 5808 5809- bpo-38303: Update audioop extension module to use the stable ABI 5810 (PEP-384). Patch by Tyler Kieft. 5811 5812- bpo-38234: :c:func:`Py_SetPath` now sets :data:`sys.executable` to the 5813 program full path (:c:func:`Py_GetProgramFullPath`) rather than to the 5814 program name (:c:func:`Py_GetProgramName`). 5815 5816- bpo-38234: Python ignored arguments passed to :c:func:`Py_SetPath`, 5817 :c:func:`Py_SetPythonHome` and :c:func:`Py_SetProgramName`: fix Python 5818 initialization to use specified arguments. 5819 5820- bpo-38205: The :c:func:`Py_UNREACHABLE` macro now calls 5821 :c:func:`Py_FatalError`. 5822 5823- bpo-38140: Make dict and weakref offsets opaque for C heap types by 5824 passing the offsets through PyMemberDef 5825 5826- bpo-15088: The C function ``PyGen_NeedsFinalizing`` has been removed. It 5827 was not documented, tested or used anywhere within CPython after the 5828 implementation of :pep:`442`. Patch by Joannah Nanjekye. (Patch by Joannah 5829 Nanjekye) 5830 5831- bpo-36763: Options added by ``PySys_AddXOption()`` are now handled the 5832 same way than ``PyConfig.xoptions`` and command line ``-X`` options. 5833 5834- bpo-37926: Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``. 5835 5836- bpo-37879: Fix subtype_dealloc to suppress the type decref when the base 5837 type is a C heap type 5838 5839- bpo-37645: Add :c:func:`_PyObject_FunctionStr` to get a user-friendly 5840 string representation of a function-like object. Patch by Jeroen Demeyer. 5841 5842- bpo-29548: The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, 5843 ``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are 5844 deprecated. Use :c:func:`PyObject_Call` and its variants instead. 5845 5846- bpo-37151: ``PyCFunction_Call`` is now a deprecated alias of 5847 :c:func:`PyObject_Call`. 5848 5849- bpo-37540: The vectorcall protocol now requires that the caller passes 5850 only strings as keyword names. 5851 5852- bpo-37207: The vectorcall protocol is now enabled for ``type`` objects: 5853 set ``tp_vectorcall`` to a vectorcall function to be used instead of 5854 ``tp_new`` and ``tp_init`` when calling the class itself. 5855 5856- bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API. 5857 5858- bpo-37483: Add new function ``_PyObject_CallOneArg`` for calling an object 5859 with one positional argument. 5860 5861- bpo-36763: Add :func:`PyConfig_SetWideStringList` function. 5862 5863- bpo-37337: Add fast functions for calling methods: 5864 :c:func:`_PyObject_VectorcallMethod`, :c:func:`_PyObject_CallMethodNoArgs` 5865 and :c:func:`_PyObject_CallMethodOneArg`. 5866 5867- bpo-28805: The :const:`METH_FASTCALL` calling convention has been 5868 documented. 5869 5870- bpo-37221: The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to 5871 create code objects like :c:func:`PyCode_New`, but with an extra 5872 *posonlyargcount* parameter for indicating the number of positonal-only 5873 arguments. 5874 5875- bpo-37215: Fix dtrace issue introduce by bpo-36842 5876 5877- bpo-37194: Add a new public :c:func:`PyObject_CallNoArgs` function to the 5878 C API: call a callable Python object without any arguments. It is the most 5879 efficient way to call a callback without any argument. On x86-64, for 5880 example, ``PyObject_CallFunctionObjArgs(func, NULL)`` allocates 960 bytes 5881 on the stack per call, whereas ``PyObject_CallNoArgs(func)`` only 5882 allocates 624 bytes per call. 5883 5884- bpo-37170: Fix the cast on error in 5885 :c:func:`PyLong_AsUnsignedLongLongMask()`. 5886 5887- bpo-35381: Convert posixmodule.c statically allocated types 5888 ``DirEntryType`` and ``ScandirIteratorType`` to heap-allocated types. 5889 5890- bpo-34331: Use singular/plural noun in error message when instantiating an 5891 abstract class with non-overriden abstract method(s). 5892 5893 5894What's New in Python 3.8.0 beta 1? 5895================================== 5896 5897*Release date: 2019-06-04* 5898 5899Security 5900-------- 5901 5902- bpo-35907: CVE-2019-9948: Avoid file reading by disallowing 5903 ``local-file://`` and ``local_file://`` URL schemes in 5904 ``URLopener().open()`` and ``URLopener().retrieve()`` of 5905 :mod:`urllib.request`. 5906 5907- bpo-33529: Prevent fold function used in email header encoding from 5908 entering infinite loop when there are too many non-ASCII characters in a 5909 header. 5910 5911- bpo-33164: Updated blake2 implementation which uses secure memset 5912 implementation provided by platform. 5913 5914Core and Builtins 5915----------------- 5916 5917- bpo-35814: Allow unpacking in the right hand side of annotated 5918 assignments. In particular, ``t: Tuple[int, ...] = x, y, *z`` is now 5919 allowed. 5920 5921- bpo-37126: All structseq objects are now tracked by the garbage collector. 5922 Patch by Pablo Galindo. 5923 5924- bpo-37122: Make the *co_argcount* attribute of code objects represent the 5925 total number of positional arguments (including positional-only 5926 arguments). The value of *co_posonlyargcount* can be used to distinguish 5927 which arguments are positional only, and the difference (*co_argcount* - 5928 *co_posonlyargcount*) is the number of positional-or-keyword arguments. 5929 Patch by Pablo Galindo. 5930 5931- bpo-20092: Constructors of :class:`int`, :class:`float` and 5932 :class:`complex` will now use the :meth:`~object.__index__` special 5933 method, if available and the corresponding method :meth:`~object.__int__`, 5934 :meth:`~object.__float__` or :meth:`~object.__complex__` is not available. 5935 5936- bpo-37087: Add native thread ID (TID) support to OpenBSD. 5937 5938- bpo-26219: Implemented per opcode cache mechanism and ``LOAD_GLOBAL`` 5939 instruction use it. ``LOAD_GLOBAL`` is now about 40% faster. Contributed 5940 by Yury Selivanov, and Inada Naoki. 5941 5942- bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL. 5943 5944- bpo-37029: Freeing a great many small objects could take time quadratic in 5945 the number of arenas, due to using linear search to keep ``obmalloc.c``'s 5946 list of usable arenas sorted by order of number of free memory pools. 5947 This is accomplished without search now, leaving the worst-case time 5948 linear in the number of arenas. For programs where this quite visibly 5949 matters (typically with more than 100 thousand small objects alive 5950 simultaneously), this can greatly reduce the time needed to release their 5951 memory. 5952 5953- bpo-26423: Fix possible overflow in ``wrap_lenfunc()`` when ``sizeof(long) 5954 < sizeof(Py_ssize_t)`` (e.g., 64-bit Windows). 5955 5956- bpo-37050: Improve the AST for "debug" f-strings, which use '=' to print 5957 out the source of the expression being evaluated. Delete expr_text from 5958 the FormattedValue node, and instead use a Constant string node (possibly 5959 merged with adjacent constant expressions inside the f-string). 5960 5961- bpo-22385: The `bytes.hex`, `bytearray.hex`, and `memoryview.hex` methods 5962 as well as the `binascii.hexlify` and `b2a_hex` functions now have the 5963 ability to include an optional separator between hex bytes. This 5964 functionality was inspired by MicroPython's hexlify implementation. 5965 5966- bpo-26836: Add :func:`os.memfd_create`. 5967 5968- bpo-37032: Added new ``replace()`` method to the code type 5969 (:class:`types.CodeType`). 5970 5971- bpo-37007: Implement :func:`socket.if_nameindex()`, 5972 :func:`socket.if_nametoindex()`, and :func:`socket.if_indextoname()` on 5973 Windows. 5974 5975- bpo-36829: :c:func:`PyErr_WriteUnraisable` now creates a traceback object 5976 if there is no current traceback. Moreover, call 5977 :c:func:`PyErr_NormalizeException` and :c:func:`PyException_SetTraceback` 5978 to normalize the exception value. Ignore any error. 5979 5980- bpo-36878: Only accept text after `# type: ignore` if the first character 5981 is ASCII. This is to disallow things like `# type: ignoreé`. 5982 5983- bpo-36878: Store text appearing after a `# type: ignore` comment in the 5984 AST. For example a type ignore like `# type: ignore[E1000]` will have the 5985 string `"[E1000]"` stored in its AST node. 5986 5987- bpo-2180: Treat line continuation at EOF as a ``SyntaxError`` by Anthony 5988 Sottile. 5989 5990- bpo-36907: Fix a crash when calling a C function with a keyword dict 5991 (``f(**kwargs)``) and changing the dict ``kwargs`` while that function is 5992 running. 5993 5994- bpo-36946: Fix possible signed integer overflow when handling slices. 5995 5996- bpo-36826: Add NamedExpression kind support to ast_unparse.c 5997 5998- bpo-1875: A :exc:`SyntaxError` is now raised if a code blocks that will be 5999 optimized away (e.g. if conditions that are always false) contains syntax 6000 errors. Patch by Pablo Galindo. 6001 6002- bpo-36027: Allow computation of modular inverses via three-argument 6003 ``pow``: the second argument is now permitted to be negative in the case 6004 where the first and third arguments are relatively prime. 6005 6006- bpo-36861: Update the Unicode database to version 12.1.0. 6007 6008- bpo-28866: Avoid caching attributes of classes which type defines mro() to 6009 avoid a hard cache invalidation problem. 6010 6011- bpo-36851: The ``FrameType`` stack is now correctly cleaned up if the 6012 execution ends with a return and the stack is not empty. 6013 6014- bpo-34616: The ``compile()`` builtin functions now support the 6015 ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag, which allow to compile sources 6016 that contains top-level ``await``, ``async with`` or ``async for``. This 6017 is useful to evaluate async-code from with an already async functions; for 6018 example in a custom REPL. 6019 6020- bpo-36842: Implement PEP 578, adding sys.audit, io.open_code and related 6021 APIs. 6022 6023- bpo-27639: Correct return type for UserList slicing operations. Patch by 6024 Michael Blahay, Erick Cervantes, and vaultah 6025 6026- bpo-36737: Move PyRuntimeState.warnings into per-interpreter state (via 6027 "module state"). 6028 6029- bpo-36793: Removed ``__str__`` implementations from builtin types 6030 :class:`bool`, :class:`int`, :class:`float`, :class:`complex` and few 6031 classes from the standard library. They now inherit ``__str__()`` from 6032 :class:`object`. 6033 6034- bpo-36817: Add a ``=`` feature f-strings for debugging. This can precede 6035 ``!s``, ``!r``, or ``!a``. It produces the text of the expression, 6036 followed by an equal sign, followed by the repr of the value of the 6037 expression. So ``f'{3*9+15=}'`` would be equal to the string 6038 ``'3*9+15=42'``. If ``=`` is specified, the default conversion is set to 6039 ``!r``, unless a format spec is given, in which case the formatting 6040 behavior is unchanged, and __format__ will be used. 6041 6042- bpo-24048: Save the live exception during import.c's ``remove_module()``. 6043 6044- bpo-27987: pymalloc returns memory blocks aligned by 16 bytes, instead of 6045 8 bytes, on 64-bit platforms to conform x86-64 ABI. Recent compilers 6046 assume this alignment more often. Patch by Inada Naoki. 6047 6048- bpo-36601: A long-since-meaningless check for ``getpid() == main_pid`` was 6049 removed from Python's internal C signal handler. 6050 6051- bpo-36594: Fix incorrect use of ``%p`` in format strings. Patch by Zackery 6052 Spytz. 6053 6054- bpo-36045: builtins.help() now prefixes `async` for async functions 6055 6056- bpo-36084: Add native thread ID (TID) to threading.Thread objects 6057 (supported platforms: Windows, FreeBSD, Linux, macOS) 6058 6059- bpo-36035: Added fix for broken symlinks in combination with pathlib 6060 6061- bpo-35983: Added new trashcan macros to deal with a double deallocation 6062 that could occur when the `tp_dealloc` of a subclass calls the 6063 `tp_dealloc` of a base class and that base class uses the trashcan 6064 mechanism. Patch by Jeroen Demeyer. 6065 6066- bpo-20602: Do not clear :data:`sys.flags` and :data:`sys.float_info` 6067 during shutdown. Patch by Zackery Spytz. 6068 6069- bpo-26826: Expose :func:`copy_file_range` as a low level API in the 6070 :mod:`os` module. 6071 6072- bpo-32388: Remove cross-version binary compatibility requirement in 6073 tp_flags. 6074 6075- bpo-31862: Port binascii to PEP 489 multiphase initialization. Patch by 6076 Marcel Plch. 6077 6078Library 6079------- 6080 6081- bpo-37128: Added :func:`math.perm`. 6082 6083- bpo-37120: Add SSLContext.num_tickets to control the number of TLSv1.3 6084 session tickets. 6085 6086- bpo-12202: Fix the error handling in 6087 :meth:`msilib.SummaryInformation.GetProperty`. Patch by Zackery Spytz. 6088 6089- bpo-26835: The fcntl module now contains file sealing constants for 6090 sealing of memfds. 6091 6092- bpo-29262: Add ``get_origin()`` and ``get_args()`` introspection helpers 6093 to ``typing`` module. 6094 6095- bpo-12639: :meth:`msilib.Directory.start_component()` no longer fails if 6096 *keyfile* is not ``None``. 6097 6098- bpo-36999: Add the ``asyncio.Task.get_coro()`` method to publicly expose 6099 the tasks's coroutine object. 6100 6101- bpo-35246: Make :func:`asyncio.create_subprocess_exec` accept path-like 6102 arguments. 6103 6104- bpo-35279: Change default *max_workers* of ``ThreadPoolExecutor`` from 6105 ``cpu_count() * 5`` to ``min(32, cpu_count() + 4))``. Previous value was 6106 unreasonably large on many cores machines. 6107 6108- bpo-37076: :func:`_thread.start_new_thread` now logs uncaught exception 6109 raised by the function using :func:`sys.unraisablehook`, rather than 6110 :func:`sys.excepthook`, so the hook gets access to the function which 6111 raised the exception. 6112 6113- bpo-33725: On macOS, the :mod:`multiprocessing` module now uses *spawn* 6114 start method by default. 6115 6116- bpo-37054: Fix destructor :class:`_pyio.BytesIO` and 6117 :class:`_pyio.TextIOWrapper`: initialize their ``_buffer`` attribute as 6118 soon as possible (in the class body), because it's used by ``__del__()`` 6119 which calls ``close()``. 6120 6121- bpo-37058: PEP 544: Add ``Protocol`` and ``@runtime_checkable`` to the 6122 ``typing`` module. 6123 6124- bpo-36933: The functions ``sys.set_coroutine_wrapper`` and 6125 ``sys.get_coroutine_wrapper`` that were deprecated and marked for removal 6126 in 3.8 have been removed. 6127 6128- bpo-37047: Handle late binding and attribute access in 6129 :class:`unittest.mock.AsyncMock` setup for autospeccing. Document newly 6130 implemented async methods in :class:`unittest.mock.MagicMock`. 6131 6132- bpo-37049: PEP 589: Add ``TypedDict`` to the ``typing`` module. 6133 6134- bpo-37046: PEP 586: Add ``Literal`` to the ``typing`` module. 6135 6136- bpo-37045: PEP 591: Add ``Final`` qualifier and ``@final`` decorator to 6137 the ``typing`` module. 6138 6139- bpo-37035: Don't log OSError based exceptions if a fatal error has 6140 occurred in asyncio transport. Peer can generate almost any OSError, user 6141 cannot avoid these exceptions by fixing own code. Errors are still 6142 propagated to user code, it's just logging them is pointless and pollute 6143 asyncio logs. 6144 6145- bpo-37001: :func:`symtable.symtable` now accepts the same input types for 6146 source code as the built-in :func:`compile` function. Patch by Dino 6147 Viehland. 6148 6149- bpo-37028: Implement asyncio REPL 6150 6151- bpo-37027: Return safe to use proxy socket object from 6152 transport.get_extra_info('socket') 6153 6154- bpo-32528: Make asyncio.CancelledError a BaseException. 6155 6156 This will address the common mistake many asyncio users make: an "except 6157 Exception" clause breaking Tasks cancellation. 6158 6159 In addition to this change, we stop inheriting asyncio.TimeoutError and 6160 asyncio.InvalidStateError from their concurrent.futures.* counterparts. 6161 There's no point for these exceptions to share the inheritance chain. 6162 6163- bpo-1230540: Add a new :func:`threading.excepthook` function which handles 6164 uncaught :meth:`threading.Thread.run` exception. It can be overridden to 6165 control how uncaught :meth:`threading.Thread.run` exceptions are handled. 6166 6167- bpo-36996: Handle :func:`unittest.mock.patch` used as a decorator on async 6168 functions. 6169 6170- bpo-37008: Add support for calling :func:`next` with the mock resulting 6171 from :func:`unittest.mock.mock_open` 6172 6173- bpo-27737: Allow whitespace only header encoding in ``email.header`` - by 6174 Batuhan Taskaya 6175 6176- bpo-36969: PDB command `args` now display positional only arguments. 6177 Patch contributed by Rémi Lapeyre. 6178 6179- bpo-36969: PDB command `args` now display keyword only arguments. Patch 6180 contributed by Rémi Lapeyre. 6181 6182- bpo-36983: Add missing names to ``typing.__all__``: ``ChainMap``, 6183 ``ForwardRef``, ``OrderedDict`` - by Anthony Sottile. 6184 6185- bpo-36972: Add SupportsIndex protocol to the typing module to allow type 6186 checking to detect classes that can be passed to `hex()`, `oct()` and 6187 `bin()`. 6188 6189- bpo-32972: Implement ``unittest.IsolatedAsyncioTestCase`` to help testing 6190 asyncio-based code. 6191 6192- bpo-36952: :func:`fileinput.input` and :class:`fileinput.FileInput` 6193 **bufsize** argument has been removed (was deprecated and ignored since 6194 Python 3.6), and as a result the **mode** and **openhook** arguments have 6195 been made keyword-only. 6196 6197- bpo-36952: Starting with Python 3.3, importing ABCs from 6198 :mod:`collections` is deprecated, and import should be done from 6199 :mod:`collections.abc`. Still being able to import from :mod:`collections` 6200 was marked for removal in 3.8, but has been delayed to 3.9; documentation 6201 and ``DeprecationWarning`` clarified. 6202 6203- bpo-36949: Implement __repr__ for WeakSet objects. 6204 6205- bpo-36948: Fix :exc:`NameError` in 6206 :meth:`urllib.request.URLopener.retrieve`. Patch by Karthikeyan 6207 Singaravelan. 6208 6209- bpo-33524: Fix the folding of email header when the max_line_length is 0 6210 or None and the header contains non-ascii characters. Contributed by 6211 Licht Takeuchi (@Licht-T). 6212 6213- bpo-24564: :func:`shutil.copystat` now ignores :const:`errno.EINVAL` on 6214 :func:`os.setxattr` which may occur when copying files on filesystems 6215 without extended attributes support. 6216 6217 Original patch by Giampaolo Rodola, updated by Ying Wang. 6218 6219- bpo-36888: Python child processes can now access the status of their 6220 parent process using multiprocessing.process.parent_process 6221 6222- bpo-36921: Deprecate ``@coroutine`` for sake of ``async def``. 6223 6224- bpo-25652: Fix bug in ``__rmod__`` of ``UserString`` - by Batuhan Taskaya. 6225 6226- bpo-36916: Remove a message about an unhandled exception in a task when 6227 writer.write() is used without await and writer.drain() fails with an 6228 exception. 6229 6230- bpo-36889: Introduce :class:`asyncio.Stream` class that merges 6231 :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter` 6232 functionality. :class:`asyncio.Stream` can work in readonly, writeonly and 6233 readwrite modes. Provide :func:`asyncio.connect`, 6234 :func:`asyncio.connect_unix`, :func:`asyncio.connect_read_pipe` and 6235 :func:`asyncio.connect_write_pipe` factories to open 6236 :class:`asyncio.Stream` connections. Provide :class:`asyncio.StreamServer` 6237 and :class:`UnixStreamServer` to serve servers with asyncio.Stream API. 6238 Modify :func:`asyncio.create_subprocess_shell` and 6239 :func:`asyncio.create_subprocess_exec` to use :class:`asyncio.Stream` 6240 instead of deprecated :class:`StreamReader` and :class:`StreamWriter`. 6241 Deprecate :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter`. 6242 Deprecate usage of private classes, e.g. 6243 :class:`asyncio.FlowControlMixing` and 6244 :class:`asyncio.StreamReaderProtocol` outside of asyncio package. 6245 6246- bpo-36845: Added validation of integer prefixes to the construction of IP 6247 networks and interfaces in the ipaddress module. 6248 6249- bpo-23378: Add an extend action to argparser. 6250 6251- bpo-36867: Fix a bug making a SharedMemoryManager instance and its parent 6252 process use two separate resource_tracker processes. 6253 6254- bpo-23896: Adds a grammar to lib2to3.pygram that contains exec as a 6255 function not as statement. 6256 6257- bpo-36895: The function ``time.clock()`` was deprecated in 3.3 in favor of 6258 ``time.perf_counter()`` and marked for removal in 3.8, it has removed. 6259 6260- bpo-35545: Fix asyncio discarding IPv6 scopes when ensuring hostname 6261 resolutions internally 6262 6263- bpo-36887: Add new function :func:`math.isqrt` to compute integer square 6264 roots. 6265 6266- bpo-34632: Introduce the ``importlib.metadata`` module with (provisional) 6267 support for reading metadata from third-party packages. 6268 6269- bpo-36878: When using `type_comments=True` in `ast.parse`, treat `# type: 6270 ignore` followed by a non-alphanumeric character and then arbitrary text 6271 as a type ignore, instead of requiring nothing but whitespace or another 6272 comment. This is to permit formations such as `# type: ignore[E1000]`. 6273 6274- bpo-36778: ``cp65001`` encoding (Windows code page 65001) becomes an alias 6275 to ``utf_8`` encoding. 6276 6277- bpo-36867: The multiprocessing.resource_tracker replaces the 6278 multiprocessing.semaphore_tracker module. Other than semaphores, 6279 resource_tracker also tracks shared_memory segments. 6280 6281- bpo-30262: The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3` 6282 module are not exposed to the user. Patch by Aviv Palivoda. 6283 6284- bpo-24538: In `shutil.copystat()`, first copy extended file attributes and 6285 then file permissions, since extended attributes can only be set on the 6286 destination while it is still writeable. 6287 6288- bpo-36829: Add new :func:`sys.unraisablehook` function which can be 6289 overridden to control how "unraisable exceptions" are handled. It is 6290 called when an exception has occurred but there is no way for Python to 6291 handle it. For example, when a destructor raises an exception or during 6292 garbage collection (:func:`gc.collect`). 6293 6294- bpo-36832: Introducing ``zipfile.Path``, a pathlib-compatible wrapper for 6295 traversing zip files. 6296 6297- bpo-36814: Fix an issue where os.posix_spawnp() would incorrectly raise a 6298 TypeError when file_actions is None. 6299 6300- bpo-33110: Handle exceptions raised by functions added by 6301 concurrent.futures add_done_callback correctly when the Future has already 6302 completed. 6303 6304- bpo-26903: Limit `max_workers` in `ProcessPoolExecutor` to 61 to work 6305 around a WaitForMultipleObjects limitation. 6306 6307- bpo-36813: Fix :class:`~logging.handlers.QueueListener` to call 6308 ``queue.task_done()`` upon stopping. Patch by Bar Harel. 6309 6310- bpo-36806: Forbid creation of asyncio stream objects like StreamReader, 6311 StreamWriter, Process, and their protocols outside of asyncio package. 6312 6313- bpo-36802: Provide both sync and async calls for StreamWriter.write() and 6314 StreamWriter.close() 6315 6316- bpo-36801: Properly handle SSL connection closing in asyncio 6317 StreamWriter.drain() call. 6318 6319- bpo-36785: Implement PEP 574 (pickle protocol 5 with out-of-band buffers). 6320 6321- bpo-36772: functools.lru_cache() can now be used as a straight decorator 6322 in addition to its existing usage as a function that returns a decorator. 6323 6324- bpo-6584: Add a :exc:`~gzip.BadGzipFile` exception to the :mod:`gzip` 6325 module. 6326 6327- bpo-36748: Optimized write buffering in C implementation of 6328 ``TextIOWrapper``. Writing ASCII string to ``TextIOWrapper`` with ascii, 6329 latin1, or utf-8 encoding is about 20% faster. Patch by Inada Naoki. 6330 6331- bpo-8138: Don't mark ``wsgiref.simple_server.SimpleServer`` as 6332 multi-threaded since ``wsgiref.simple_server.WSGIServer`` is 6333 single-threaded. 6334 6335- bpo-22640: :func:`py_compile.compile` now supports silent mode. Patch by 6336 Joannah Nanjekye 6337 6338- bpo-29183: Fix double exceptions in :class:`wsgiref.handlers.BaseHandler` 6339 by calling its :meth:`~wsgiref.handlers.BaseHandler.close` method only 6340 when no exception is raised. 6341 6342- bpo-36548: Improved the repr of regular expression flags. 6343 6344- bpo-36542: The signature of Python functions can now be overridden by 6345 specifying the ``__text_signature__`` attribute. 6346 6347- bpo-36533: Reinitialize logging.Handler locks in forked child processes 6348 instead of attempting to acquire them all in the parent before forking 6349 only to be released in the child process. The acquire/release pattern was 6350 leading to deadlocks in code that has implemented any form of chained 6351 logging handlers that depend upon one another as the lock acquisition 6352 order cannot be guaranteed. 6353 6354- bpo-35252: Throw a TypeError instead of an AssertionError when using an 6355 invalid type annotation with singledispatch. 6356 6357- bpo-35900: Allow reduction methods to return a 6-item tuple where the 6th 6358 item specifies a custom state-setting method that's called instead of the 6359 regular ``__setstate__`` method. 6360 6361- bpo-35900: enable custom reduction callback registration for functions and 6362 classes in _pickle.c, using the new Pickler's attribute 6363 ``reducer_override`` 6364 6365- bpo-36368: Fix a bug crashing SharedMemoryManager instances in interactive 6366 sessions after a ctrl-c (KeyboardInterrupt) was sent 6367 6368- bpo-31904: Fix mmap fail for VxWorks 6369 6370- bpo-27497: :meth:`csv.DictWriter.writeheader` now returns the return value 6371 of the underlying :meth:`csv.Writer.writerow` method. Patch contributed by 6372 Ashish Nitin Patil. 6373 6374- bpo-36239: Parsing .mo files now ignores comments starting and ending with 6375 #-#-#-#-#. 6376 6377- bpo-26707: Enable plistlib to read and write binary plist files that were 6378 created as a KeyedArchive file. Specifically, this allows the plistlib to 6379 process 0x80 tokens as UID objects. 6380 6381- bpo-31904: Add posix module support for VxWorks. 6382 6383- bpo-35125: Asyncio: Remove inner callback on outer cancellation in shield 6384 6385- bpo-35721: Fix :meth:`asyncio.SelectorEventLoop.subprocess_exec()` leaks 6386 file descriptors if ``Popen`` fails and called with 6387 ``stdin=subprocess.PIPE``. Patch by Niklas Fiekas. 6388 6389- bpo-31855: :func:`unittest.mock.mock_open` results now respects the 6390 argument of read([size]). Patch contributed by Rémi Lapeyre. 6391 6392- bpo-35431: Implement :func:`math.comb` that returns binomial coefficient, 6393 that computes the number of ways to choose k items from n items without 6394 repetition and without order. Patch by Yash Aggarwal and Keller Fuchs. 6395 6396- bpo-26660: Fixed permission errors in 6397 :class:`~tempfile.TemporaryDirectory` clean up. Previously 6398 ``TemporaryDirectory.cleanup()`` failed when non-writeable or 6399 non-searchable files or directories were created inside a temporary 6400 directory. 6401 6402- bpo-34271: Add debugging helpers to ssl module. It's now possible to dump 6403 key material and to trace TLS protocol. The default and stdlib contexts 6404 also support SSLKEYLOGFILE env var. 6405 6406- bpo-26467: Added AsyncMock to support using unittest to mock asyncio 6407 coroutines. Patch by Lisa Roach. 6408 6409- bpo-33569: dataclasses.InitVar: Exposes the type used to create the init 6410 var. 6411 6412- bpo-34424: Fix serialization of messages containing encoded strings when 6413 the policy.linesep is set to a multi-character string. Patch by Jens 6414 Troeger. 6415 6416- bpo-34303: Performance of :func:`functools.reduce` is slightly improved. 6417 Patch by Sergey Fedoseev. 6418 6419- bpo-33361: Fix a bug in :class:`codecs.StreamRecoder` where seeking might 6420 leave old data in a buffer and break subsequent read calls. Patch by Ammar 6421 Askar. 6422 6423- bpo-22454: The :mod:`shlex` module now exposes :func:`shlex.join`, the 6424 inverse of :func:`shlex.split`. Patch by Bo Bayles. 6425 6426- bpo-31922: :meth:`asyncio.AbstractEventLoop.create_datagram_endpoint`: Do 6427 not connect UDP socket when broadcast is allowed. This allows to receive 6428 replies after a UDP broadcast. 6429 6430- bpo-24882: Change ThreadPoolExecutor to use existing idle threads before 6431 spinning up new ones. 6432 6433- bpo-31961: Added support for bytes and path-like objects in 6434 :func:`subprocess.Popen` on Windows. The *args* parameter now accepts a 6435 :term:`path-like object` if *shell* is ``False`` and a sequence containing 6436 bytes and path-like objects. The *executable* parameter now accepts a 6437 bytes and :term:`path-like object`. The *cwd* parameter now accepts a 6438 bytes object. Based on patch by Anders Lorentsen. 6439 6440- bpo-33123: :class:`pathlib.Path.unlink` now accepts a *missing_ok* 6441 parameter to avoid a :exc:`FileNotFoundError` from being raised. Patch by 6442 Robert Buchholz. 6443 6444- bpo-32941: Allow :class:`mmap.mmap` objects to access the madvise() system 6445 call (through :meth:`mmap.mmap.madvise`). 6446 6447- bpo-22102: Added support for ZIP files with disks set to 0. Such files are 6448 commonly created by builtin tools on Windows when use ZIP64 extension. 6449 Patch by Francisco Facioni. 6450 6451- bpo-32515: trace.py can now run modules via python3 -m trace -t --module 6452 module_name 6453 6454- bpo-32299: Changed :func:`unittest.mock.patch.dict` to return the patched 6455 dictionary when used as context manager. Patch by Vadim Tsander. 6456 6457- bpo-27141: Added a ``__copy__()`` to ``collections.UserList`` and 6458 ``collections.UserDict`` in order to correctly implement shallow copying 6459 of the objects. Patch by Bar Harel. 6460 6461- bpo-31829: ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) are now 6462 escaped in protocol 0 pickles of Unicode strings. This allows to load them 6463 without loss from files open in text mode in Python 2. 6464 6465- bpo-23395: ``_thread.interrupt_main()`` now avoids setting the Python 6466 error status if the ``SIGINT`` signal is ignored or not handled by Python. 6467 6468Documentation 6469------------- 6470 6471- bpo-36896: Clarify that some types have unstable constructor signature 6472 between Python versions. 6473 6474- bpo-36686: Improve documentation of the stdin, stdout, and stderr 6475 arguments of the ``asyncio.subprocess_exec`` function to specify which 6476 values are supported. Also mention that decoding as text is not supported. 6477 6478 Add a few tests to verify that the various values passed to the std* 6479 arguments actually work. 6480 6481- bpo-36984: Improve version added references in ``typing`` module - by 6482 Anthony Sottile. 6483 6484- bpo-36868: What's new now mentions SSLContext.hostname_checks_common_name 6485 instead of SSLContext.host_flags. 6486 6487- bpo-35924: Add a note to the ``curses.addstr()`` documentation to warn 6488 that multiline strings can cause segfaults because of an ncurses bug. 6489 6490- bpo-36783: Added C API Documentation for Time_FromTimeAndFold and 6491 PyDateTime_FromDateAndTimeAndFold as per PEP 495. Patch by Edison 6492 Abahurire. 6493 6494- bpo-36797: More of the legacy distutils documentation has been either 6495 pruned, or else more clearly marked as being retained solely until the 6496 setuptools documentation covers it independently. 6497 6498- bpo-22865: Add detail to the documentation on the `pty.spawn` function. 6499 6500- bpo-35397: Remove deprecation and document urllib.parse.unwrap(). Patch 6501 contributed by Rémi Lapeyre. 6502 6503- bpo-32995: Added the context variable in glossary. 6504 6505- bpo-33519: Clarify that `copy()` is not part of the `MutableSequence` ABC. 6506 6507- bpo-33482: Make `codecs.StreamRecoder.writelines` take a list of bytes. 6508 6509- bpo-25735: Added documentation for func factorial to indicate that returns 6510 integer values 6511 6512- bpo-20285: Expand object.__doc__ (docstring) to make it clearer. Modify 6513 pydoc.py so that help(object) lists object methods (for other classes, 6514 help omits methods of the object base class.) 6515 6516Tests 6517----- 6518 6519- bpo-37069: Modify test_coroutines, test_cprofile, test_generators, 6520 test_raise, test_ssl and test_yield_from to use 6521 :func:`test.support.catch_unraisable_exception` rather than 6522 :func:`test.support.captured_stderr`. 6523 6524- bpo-37098: Fix test_memfd_create on older Linux Kernels. 6525 6526- bpo-37081: Test with OpenSSL 1.1.1c 6527 6528- bpo-36829: Add :func:`test.support.catch_unraisable_exception`: context 6529 manager catching unraisable exception using :func:`sys.unraisablehook`. 6530 6531- bpo-36915: The main regrtest process now always removes all temporary 6532 directories of worker processes even if they crash or if they are killed 6533 on KeyboardInterrupt (CTRL+c). 6534 6535- bpo-36719: "python3 -m test -jN ..." now continues the execution of next 6536 tests when a worker process crash (CHILD_ERROR state). Previously, the 6537 test suite stopped immediately. Use --failfast to stop at the first error. 6538 6539- bpo-36816: Update Lib/test/selfsigned_pythontestdotnet.pem to match 6540 self-signed.pythontest.net's new TLS certificate. 6541 6542- bpo-35925: Skip httplib and nntplib networking tests when they would 6543 otherwise fail due to a modern OS or distro with a default OpenSSL policy 6544 of rejecting connections to servers with weak certificates. 6545 6546- bpo-36782: Add tests for several C API functions in the :mod:`datetime` 6547 module. Patch by Edison Abahurire. 6548 6549- bpo-36342: Fix test_multiprocessing in test_venv if platform lacks 6550 functioning sem_open. 6551 6552Build 6553----- 6554 6555- bpo-36721: To embed Python into an application, a new ``--embed`` option 6556 must be passed to ``python3-config --libs --embed`` to get ``-lpython3.8`` 6557 (link the application to libpython). To support both 3.8 and older, try 6558 ``python3-config --libs --embed`` first and fallback to ``python3-config 6559 --libs`` (without ``--embed``) if the previous command fails. 6560 6561 Add a pkg-config ``python-3.8-embed`` module to embed Python into an 6562 application: ``pkg-config python-3.8-embed --libs`` includes 6563 ``-lpython3.8``. To support both 3.8 and older, try ``pkg-config 6564 python-X.Y-embed --libs`` first and fallback to ``pkg-config python-X.Y 6565 --libs`` (without ``--embed``) if the previous command fails (replace 6566 ``X.Y`` with the Python version). 6567 6568 On the other hand, ``pkg-config python3.8 --libs`` no longer contains 6569 ``-lpython3.8``. C extensions must not be linked to libpython (except on 6570 Android, case handled by the script); this change is backward incompatible 6571 on purpose. 6572 6573- bpo-36786: "make install" now runs compileall in parallel. 6574 6575Windows 6576------- 6577 6578- bpo-36965: include of STATUS_CONTROL_C_EXIT without depending on MSC 6579 compiler 6580 6581- bpo-35926: Update to OpenSSL 1.1.1b for Windows. 6582 6583- bpo-29883: Add Windows support for UDP transports for the Proactor Event 6584 Loop. Patch by Adam Meily. 6585 6586- bpo-33407: The :c:macro:`Py_DEPRECATED()` macro has been implemented for 6587 MSVC. 6588 6589macOS 6590----- 6591 6592- bpo-36231: Support building Python on macOS without /usr/include 6593 installed. As of macOS 10.14, system header files are only available 6594 within an SDK provided by either the Command Line Tools or the Xcode app. 6595 6596IDLE 6597---- 6598 6599- bpo-35610: Replace now redundant .context_use_ps1 with .prompt_last_line. 6600 This finishes change started in bpo-31858. 6601 6602- bpo-37038: Make idlelib.run runnable; add test clause. 6603 6604- bpo-36958: Print any argument other than None or int passed to SystemExit 6605 or sys.exit(). 6606 6607- bpo-36807: When saving a file, call os.fsync() so bits are flushed to e.g. 6608 USB drive. 6609 6610- bpo-32411: In browser.py, remove extraneous sorting by line number since 6611 dictionary was created in line number order. 6612 6613Tools/Demos 6614----------- 6615 6616- bpo-37053: Handle strings like u"bar" correctly in 6617 Tools/parser/unparse.py. Patch by Chih-Hsuan Yen. 6618 6619C API 6620----- 6621 6622- bpo-36763: Implement the :pep:`587` "Python Initialization Configuration". 6623 6624- bpo-36379: Fix crashes when attempting to use the *modulo* parameter when 6625 ``__ipow__`` is implemented in C. 6626 6627- bpo-37107: Update :c:func:`PyObject_CallMethodObjArgs` and 6628 ``_PyObject_CallMethodIdObjArgs`` to use ``_PyObject_GetMethod`` to avoid 6629 creating a bound method object in many cases. Patch by Michael J. 6630 Sullivan. 6631 6632- bpo-36974: Implement :pep:`590`: Vectorcall: a fast calling protocol for 6633 CPython. This is a new protocol to optimize calls of custom callable 6634 objects. 6635 6636- bpo-36763: ``Py_Main()`` now returns the exitcode rather than calling 6637 ``Py_Exit(exitcode)`` when calling ``PyErr_Print()`` if the current 6638 exception type is ``SystemExit``. 6639 6640- bpo-36922: Add new type flag ``Py_TPFLAGS_METHOD_DESCRIPTOR`` for objects 6641 behaving like unbound methods. These are objects supporting the 6642 optimization given by the ``LOAD_METHOD``/``CALL_METHOD`` opcodes. See PEP 6643 590. 6644 6645- bpo-36728: The :c:func:`PyEval_ReInitThreads` function has been removed 6646 from the C API. It should not be called explicitly: use 6647 :c:func:`PyOS_AfterFork_Child` instead. 6648 6649 6650What's New in Python 3.8.0 alpha 4? 6651=================================== 6652 6653*Release date: 2019-05-06* 6654 6655Security 6656-------- 6657 6658- bpo-36742: Fixes mishandling of pre-normalization characters in 6659 urlsplit(). 6660 6661- bpo-30458: Address CVE-2019-9740 by disallowing URL paths with embedded 6662 whitespace or control characters through into the underlying http client 6663 request. Such potentially malicious header injection URLs now cause an 6664 http.client.InvalidURL exception to be raised. 6665 6666- bpo-35755: :func:`shutil.which` now uses ``os.confstr("CS_PATH")`` if 6667 available and if the :envvar:`PATH` environment variable is not set. 6668 Remove also the current directory from :data:`posixpath.defpath`. On Unix, 6669 :func:`shutil.which` and the :mod:`subprocess` module no longer search the 6670 executable in the current directory if the :envvar:`PATH` environment 6671 variable is not set. 6672 6673Core and Builtins 6674----------------- 6675 6676- bpo-36722: In debug build, import now also looks for C extensions compiled 6677 in release mode and for C extensions compiled in the stable ABI. 6678 6679- bpo-32849: Fix Python Initialization code on FreeBSD to detect properly 6680 when stdin file descriptor (fd 0) is invalid. 6681 6682- bpo-36623: Remove parser headers and related function declarations that 6683 lack implementations after the removal of pgen. 6684 6685- bpo-20180: ``dict.pop()`` is now up to 33% faster thanks to Argument 6686 Clinic. Patch by Inada Naoki. 6687 6688- bpo-36611: Debug memory allocators: disable serialno field by default from 6689 debug hooks on Python memory allocators to reduce the memory footprint by 6690 5%. Enable :mod:`tracemalloc` to get the traceback where a memory block 6691 has been allocated when a fatal memory error is logged to decide where to 6692 put a breakpoint. Compile Python with ``PYMEM_DEBUG_SERIALNO`` defined to 6693 get back the field. 6694 6695- bpo-36588: On AIX, :attr:`sys.platform` doesn't contain the major version 6696 anymore. Always return ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. 6697 Since older Python versions include the version number, it is recommended 6698 to always use ``sys.platform.startswith('aix')``. Contributed by M. Felt. 6699 6700- bpo-36549: Change str.capitalize to use titlecase for the first character 6701 instead of uppercase. 6702 6703- bpo-36540: Implement :pep:`570` (Python positional-only parameters). Patch 6704 by Pablo Galindo. 6705 6706- bpo-36475: :c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` 6707 now terminate the current thread if called while the interpreter is 6708 finalizing, making them consistent with :c:func:`PyEval_RestoreThread`, 6709 :c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`. 6710 6711- bpo-36504: Fix signed integer overflow in _ctypes.c's 6712 ``PyCArrayType_new()``. 6713 6714- bpo-20844: Fix running script with encoding cookie and LF line ending may 6715 fail on Windows. 6716 6717- bpo-24214: Fixed support of the surrogatepass error handler in the UTF-8 6718 incremental decoder. 6719 6720- bpo-36452: Changing ``dict`` keys during iteration of the dict itself, 6721 ``keys()``, ``values()``, or ``items()`` will now be detected in certain 6722 corner cases where keys are deleted/added so that the number of keys isn't 6723 changed. A `RuntimeError` will be raised after ``len(dict)`` iterations. 6724 Contributed by Thomas Perl. 6725 6726- bpo-36459: Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's 6727 ``tok_nextc()``. 6728 6729- bpo-36433: Fixed TypeError message in classmethoddescr_call. 6730 6731- bpo-36430: Fix a possible reference leak in :func:`itertools.count`. 6732 6733- bpo-36440: Include node names in ``ParserError`` messages, instead of 6734 numeric IDs. Patch by A. Skrobov. 6735 6736- bpo-36143: Regenerate :mod:`keyword` from the Grammar and Tokens file 6737 using pgen. Patch by Pablo Galindo. 6738 6739- bpo-18372: Add missing :c:func:`PyObject_GC_Track` calls in the 6740 :mod:`pickle` module. Patch by Zackery Spytz. 6741 6742Library 6743------- 6744 6745- bpo-35952: Fix pythoninfo when the compiler is missing. 6746 6747- bpo-28238: The ``.find*()`` methods of xml.etree.ElementTree can now 6748 search for wildcards like ``{*}tag`` and ``{ns}*`` that match a tag in any 6749 namespace or all tags in a namespace. Patch by Stefan Behnel. 6750 6751- bpo-26978: `pathlib.path.link_to()` is now implemented. It creates a hard 6752 link pointing to a path. 6753 6754- bpo-1613500: :class:`fileinput.FileInput` now uses the input file mode to 6755 correctly set the output file mode (previously it was hardcoded to 6756 ``'w'``) when ``inplace=True`` is passed to its constructor. 6757 6758- bpo-36734: Fix compilation of ``faulthandler.c`` on HP-UX. Initialize 6759 ``stack_t current_stack`` to zero using ``memset()``. 6760 6761- bpo-13611: The xml.etree.ElementTree packages gained support for C14N 2.0 6762 serialisation. Patch by Stefan Behnel. 6763 6764- bpo-36669: Add missing matrix multiplication operator support to 6765 weakref.proxy. 6766 6767- bpo-36676: The XMLParser() in xml.etree.ElementTree provides namespace 6768 prefix context to the parser target if it defines the callback methods 6769 "start_ns()" and/or "end_ns()". Patch by Stefan Behnel. 6770 6771- bpo-36673: The TreeBuilder and XMLPullParser in xml.etree.ElementTree 6772 gained support for parsing comments and processing instructions. Patch by 6773 Stefan Behnel. 6774 6775- bpo-36650: The C version of functools.lru_cache() was treating calls with 6776 an empty ``**kwargs`` dictionary as being distinct from calls with no 6777 keywords at all. This did not result in an incorrect answer, but it did 6778 trigger an unexpected cache miss. 6779 6780- bpo-28552: Fix :mod:`distutils.sysconfig` if :data:`sys.executable` is 6781 ``None`` or an empty string: use :func:`os.getcwd` to initialize 6782 ``project_base``. Fix also the distutils build command: don't use 6783 :data:`sys.executable` if it is ``None`` or an empty string. 6784 6785- bpo-35755: :func:`shutil.which` and 6786 :func:`distutils.spawn.find_executable` now use ``os.confstr("CS_PATH")`` 6787 if available instead of :data:`os.defpath`, if the ``PATH`` environment 6788 variable is not set. Moreover, don't use ``os.confstr("CS_PATH")`` nor 6789 :data:`os.defpath` if the ``PATH`` environment variable is set to an empty 6790 string. 6791 6792- bpo-25430: improve performance of ``IPNetwork.__contains__()`` 6793 6794- bpo-30485: Path expressions in xml.etree.ElementTree can now avoid 6795 explicit namespace prefixes for tags (or the "{namespace}tag" notation) by 6796 passing a default namespace with an empty string prefix. 6797 6798- bpo-36613: Fix :mod:`asyncio` wait() not removing callback if exception 6799 6800- bpo-36598: Fix ``isinstance`` check for Mock objects with spec when the 6801 code is executed under tracing. Patch by Karthikeyan Singaravelan. 6802 6803- bpo-18748: In development mode (:option:`-X` ``dev``) and in debug build, 6804 the :class:`io.IOBase` destructor now logs ``close()`` exceptions. These 6805 exceptions are silent by default in release mode. 6806 6807- bpo-36575: The ``_lsprof`` module now uses internal timer same to 6808 ``time.perf_counter()`` by default. ``gettimeofday(2)`` was used on Unix. 6809 New timer has better resolution on most Unix platforms and timings are no 6810 longer impacted by system clock updates since ``perf_counter()`` is 6811 monotonic. Patch by Inada Naoki. 6812 6813- bpo-33461: ``json.loads`` now emits ``DeprecationWarning`` when 6814 ``encoding`` option is specified. Patch by Matthias Bussonnier. 6815 6816- bpo-36559: The random module now prefers the lean internal _sha512 module 6817 over hashlib for seed(version=2) to optimize import time. 6818 6819- bpo-17561: Set backlog=None as the default for socket.create_server. 6820 6821- bpo-34373: Fix :func:`time.mktime` error handling on AIX for year before 6822 1970. 6823 6824- bpo-36232: Improve error message when trying to open existing DBM database 6825 that actually doesn't exist. Patch by Marco Rougeth. 6826 6827- bpo-36546: Add statistics.quantiles() 6828 6829- bpo-36050: Optimized ``http.client.HTTPResponse.read()`` for large 6830 response. Patch by Inada Naoki. 6831 6832- bpo-36522: If *debuglevel* is set to >0 in :mod:`http.client`, print all 6833 values for headers with multiple values for the same header name. Patch by 6834 Matt Houglum. 6835 6836- bpo-36492: Deprecated passing required arguments like *func* as keyword 6837 arguments in functions which should accept arbitrary keyword arguments and 6838 pass them to other function. Arbitrary keyword arguments (even with names 6839 "self" and "func") can now be passed to these functions if the required 6840 arguments are passed as positional arguments. 6841 6842- bpo-27181: Add statistics.geometric_mean(). 6843 6844- bpo-30427: ``os.path.normcase()`` relies on ``os.fspath()`` to check the 6845 type of its argument. Redundant checks have been removed from its 6846 ``posixpath.normcase()`` and ``ntpath.normcase()`` implementations. Patch 6847 by Wolfgang Maier. 6848 6849- bpo-36385: Stop rejecting IPv4 octets for being ambiguously octal. Leading 6850 zeros are ignored, and no longer are assumed to specify octal octets. 6851 Octets are always decimal numbers. Octets must still be no more than three 6852 digits, including leading zeroes. 6853 6854- bpo-36434: Errors during writing to a ZIP file no longer prevent to 6855 properly close it. 6856 6857- bpo-36407: Fixed wrong indentation writing for CDATA section in 6858 xml.dom.minidom. Patch by Vladimir Surjaninov. 6859 6860- bpo-36326: inspect.getdoc() can now find docstrings for member objects 6861 when __slots__ is a dictionary. 6862 6863- bpo-36366: Calling ``stop()`` on an unstarted or stopped 6864 :func:`unittest.mock.patch` object will now return `None` instead of 6865 raising :exc:`RuntimeError`, making the method idempotent. Patch by 6866 Karthikeyan Singaravelan. 6867 6868- bpo-36348: The :meth:`imap.IMAP4.logout` method no longer ignores silently 6869 arbitrary exceptions. 6870 6871- bpo-31904: Add time module support and fix test_time faiures for VxWorks. 6872 6873- bpo-36227: Added support for keyword arguments `default_namespace` and 6874 `xml_declaration` in functions ElementTree.tostring() and 6875 ElementTree.tostringlist(). 6876 6877- bpo-36004: Added new alternate constructors 6878 :meth:`datetime.date.fromisocalendar` and 6879 :meth:`datetime.datetime.fromisocalendar`, which construct date objects 6880 from ISO year, week number and weekday; these are the inverse of each 6881 class's ``isocalendar`` method. Patch by Paul Ganssle. 6882 6883- bpo-35936: :mod:`modulefinder` no longer depends on the deprecated 6884 :mod:`imp` module, and the initializer for 6885 :class:`modulefinder.ModuleFinder` now has immutable default arguments. 6886 Patch by Brandt Bucher. 6887 6888- bpo-35376: :mod:`modulefinder` correctly handles modules that have the 6889 same name as a bad package. Patch by Brandt Bucher. 6890 6891- bpo-17396: :mod:`modulefinder` no longer crashes when encountering syntax 6892 errors in followed imports. Patch by Brandt Bucher. 6893 6894- bpo-35934: Added :meth:`~socket.create_server()` and 6895 :meth:`~socket.has_dualstack_ipv6()` convenience functions to automate the 6896 necessary tasks usually involved when creating a server socket, including 6897 accepting both IPv4 and IPv6 connections on the same socket. (Contributed 6898 by Giampaolo Rodola in :issue:`17561`.) 6899 6900- bpo-23078: Add support for :func:`classmethod` and :func:`staticmethod` to 6901 :func:`unittest.mock.create_autospec`. Initial patch by Felipe Ochoa. 6902 6903- bpo-35416: Fix potential resource warnings in distutils. Patch by Mickaël 6904 Schoentgen. 6905 6906- bpo-25451: Add transparency methods to :class:`tkinter.PhotoImage`. Patch 6907 by Zackery Spytz. 6908 6909- bpo-35082: Don't return deleted attributes when calling dir on a 6910 :class:`unittest.mock.Mock`. 6911 6912- bpo-34547: :class:`wsgiref.handlers.BaseHandler` now handles abrupt client 6913 connection terminations gracefully. Patch by Petter Strandmark. 6914 6915- bpo-31658: :func:`xml.sax.parse` now supports :term:`path-like <path-like 6916 object>`. Patch by Mickaël Schoentgen. 6917 6918- bpo-34139: Remove stale unix datagram socket before binding 6919 6920- bpo-33530: Implemented Happy Eyeballs in `asyncio.create_connection()`. 6921 Added two new arguments, *happy_eyeballs_delay* and *interleave*, to 6922 specify Happy Eyeballs behavior. 6923 6924- bpo-33291: Do not raise AttributeError when calling the inspect functions 6925 isgeneratorfunction, iscoroutinefunction, isasyncgenfunction on a method 6926 created from an arbitrary callable. Instead, return False. 6927 6928- bpo-31310: Fix the multiprocessing.semaphore_tracker so it is reused by 6929 child processes 6930 6931- bpo-31292: Fix ``setup.py check --restructuredtext`` for files containing 6932 ``include`` directives. 6933 6934Documentation 6935------------- 6936 6937- bpo-36625: Remove obsolete comments from docstrings in fractions.Fraction 6938 6939- bpo-30840: Document relative imports 6940 6941- bpo-36523: Add docstring for io.IOBase.writelines(). 6942 6943- bpo-36425: New documentation translation: `Simplified Chinese 6944 <https://docs.python.org/zh-cn/>`_. 6945 6946- bpo-36345: Avoid the duplication of code from ``Tools/scripts/serve.py`` 6947 in using the :rst:dir:`literalinclude` directive for the basic 6948 wsgiref-based web server in the documentation of :mod:`wsgiref`. 6949 Contributed by Stéphane Wirtel. 6950 6951- bpo-36345: Using the code of the ``Tools/scripts/serve.py`` script as an 6952 example in the :mod:`wsgiref` documentation. Contributed by Stéphane 6953 Wirtel. 6954 6955- bpo-36157: Added Documention for PyInterpreterState_Main(). 6956 6957- bpo-33043: Updates the docs.python.org page with the addition of a 6958 'Contributing to Docs' link at the end of the page (between 'Reporting 6959 Bugs' and 'About Documentation'). Updates the 'Found a Bug' page with 6960 additional links and information in the Documentation Bugs section. 6961 6962- bpo-35581: @typing.type_check_only now allows type stubs to mark functions 6963 and classes not available during runtime. 6964 6965- bpo-33832: Add glossary entry for 'magic method'. 6966 6967- bpo-32913: Added re.Match.groupdict example to regex HOWTO. 6968 6969Tests 6970----- 6971 6972- bpo-36719: regrtest now always detects uncollectable objects. Previously, 6973 the check was only enabled by ``--findleaks``. The check now also works 6974 with ``-jN/--multiprocess N``. ``--findleaks`` becomes a deprecated alias 6975 to ``--fail-env-changed``. 6976 6977- bpo-36725: When using multiprocessing mode (-jN), regrtest now better 6978 reports errors if a worker process fails, and it exits immediately on a 6979 worker thread failure or when interrupted. 6980 6981- bpo-36454: Change test_time.test_monotonic() to test only the lower bound 6982 of elapsed time after a sleep command rather than the upper bound. This 6983 prevents unnecessary test failures on slow buildbots. Patch by Victor 6984 Stinner. 6985 6986- bpo-32424: Improve test coverage for xml.etree.ElementTree. Patch by 6987 Gordon P. Hemsley. 6988 6989- bpo-32424: Fix typo in test_cyclic_gc() test for xml.etree.ElementTree. 6990 Patch by Gordon P. Hemsley. 6991 6992- bpo-36635: Add a new :mod:`_testinternalcapi` module to test the internal 6993 C API. 6994 6995- bpo-36629: Fix ``test_imap4_host_default_value()`` of ``test_imaplib``: 6996 catch also :data:`errno.ENETUNREACH` error. 6997 6998- bpo-36611: Fix ``test_sys.test_getallocatedblocks()`` when 6999 :mod:`tracemalloc` is enabled. 7000 7001- bpo-36560: Fix reference leak hunting in regrtest: compute also deltas (of 7002 reference count, allocated memory blocks, file descriptor count) during 7003 warmup, to ensure that everything is initialized before starting to hunt 7004 reference leaks. 7005 7006- bpo-36565: Fix reference hunting (``python3 -m test -R 3:3``) when Python 7007 has no built-in abc module. 7008 7009- bpo-31904: Port test_resource to VxWorks: skip tests cases setting 7010 RLIMIT_FSIZE and RLIMIT_CPU. 7011 7012- bpo-31904: Fix test_tabnanny on VxWorks: adjust ENOENT error message. 7013 7014- bpo-36436: Fix ``_testcapi.pymem_buffer_overflow()``: handle memory 7015 allocation failure. 7016 7017- bpo-31904: Fix test_utf8_mode on VxWorks: Python always use UTF-8 on 7018 VxWorks. 7019 7020- bpo-36341: Fix tests that may fail with PermissionError upon calling 7021 bind() on AF_UNIX sockets. 7022 7023Build 7024----- 7025 7026- bpo-36747: Remove the stale scriptsinstall Makefile target. 7027 7028- bpo-21536: On Unix, C extensions are no longer linked to libpython except 7029 on Android and Cygwin. 7030 7031 It is now possible for a statically linked Python to load a C extension 7032 built using a shared library Python. 7033 7034 When Python is embedded, ``libpython`` must not be loaded with 7035 ``RTLD_LOCAL``, but ``RTLD_GLOBAL`` instead. Previously, using 7036 ``RTLD_LOCAL``, it was already not possible to load C extensions which 7037 were not linked to ``libpython``, such as C extensions of the standard 7038 library built by the ``*shared*`` section of ``Modules/Setup``. 7039 7040 distutils, python-config and python-config.py have been modified. 7041 7042- bpo-36707: ``./configure --with-pymalloc`` no longer adds the ``m`` flag 7043 to SOABI (sys.implementation.cache_tag). Enabling or disabling pymalloc 7044 has no impact on the ABI. 7045 7046- bpo-36635: Change ``PyAPI_FUNC(type)``, ``PyAPI_DATA(type)`` and 7047 ``PyMODINIT_FUNC`` macros of ``pyport.h`` when ``Py_BUILD_CORE_MODULE`` is 7048 defined. The ``Py_BUILD_CORE_MODULE`` define must be now be used to build 7049 a C extension as a dynamic library accessing Python internals: export the 7050 PyInit_xxx() function in DLL exports on Windows. 7051 7052- bpo-31904: Don't build the ``_crypt`` extension on VxWorks. 7053 7054- bpo-36618: Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is 7055 detected. The pymalloc memory allocator aligns memory on 8 bytes. On 7056 x86-64, clang expects alignment on 16 bytes by default and so uses MOVAPS 7057 instruction which can lead to segmentation fault. Instruct clang that 7058 Python is limited to alignment on 8 bytes to use MOVUPS instruction 7059 instead: slower but don't trigger a SIGSEGV if the memory is not aligned 7060 on 16 bytes. Sadly, the flag must be added to ``CFLAGS`` and not just 7061 ``CFLAGS_NODIST``, since third party C extensions can have the same issue. 7062 7063- bpo-36605: ``make tags`` and ``make TAGS`` now also parse 7064 ``Modules/_io/*.c`` and ``Modules/_io/*.h``. 7065 7066- bpo-36465: Release builds and debug builds are now ABI compatible: 7067 defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` 7068 macro, which introduces the only ABI incompatibility. The 7069 ``Py_TRACE_REFS`` macro, which adds the :func:`sys.getobjects` function 7070 and the :envvar:`PYTHONDUMPREFS` environment variable, can be set using 7071 the new ``./configure --with-trace-refs`` build option. 7072 7073- bpo-36577: setup.py now correctly reports missing OpenSSL headers and 7074 libraries again. 7075 7076- bpo-36544: Fix regression introduced in bpo-36146 refactoring setup.py 7077 7078- bpo-36508: ``python-config --ldflags`` no longer includes flags of the 7079 ``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be 7080 used to build executables. 7081 7082- bpo-36503: Remove references to "aix3" and "aix4". Patch by M. Felt. 7083 7084Windows 7085------- 7086 7087- bpo-35920: Added platform.win32_edition() and platform.win32_is_iot(). 7088 Added support for cross-compiling packages for Windows ARM32. Skip tests 7089 that are not expected to work on Windows IoT Core ARM32. 7090 7091- bpo-36649: Remove trailing spaces for registry keys when installed via the 7092 Store. 7093 7094- bpo-34144: Fixed activate.bat to correctly update codepage when chcp.com 7095 returns dots in output. Patch by Lorenz Mende. 7096 7097- bpo-36509: Added preset-iot layout for Windows IoT ARM containers. This 7098 layout doesn't contain UI components like tkinter or IDLE. It also doesn't 7099 contain files to support on-target builds since Windows ARM32 builds must 7100 be cross-compiled when using MSVC. 7101 7102- bpo-35941: enum_certificates function of the ssl module now returns 7103 certificates from all available certificate stores inside windows in a 7104 query instead of returning only certificates from the system wide 7105 certificate store. This includes certificates from these certificate 7106 stores: local machine, local machine enterprise, local machine group 7107 policy, current user, current user group policy, services, users. 7108 ssl.enum_crls() function is changed in the same way to return all 7109 certificate revocation lists inside the windows certificate revocation 7110 list stores. 7111 7112- bpo-36441: Fixes creating a venv when debug binaries are installed. 7113 7114- bpo-36085: Enable better DLL resolution on Windows by using safe DLL 7115 search paths and adding :func:`os.add_dll_directory`. 7116 7117- bpo-36010: Add the venv standard library module to the nuget distribution 7118 for Windows. 7119 7120- bpo-29515: Add the following socket module constants on Windows: 7121 IPPROTO_AH IPPROTO_CBT IPPROTO_DSTOPTS IPPROTO_EGP IPPROTO_ESP 7122 IPPROTO_FRAGMENT IPPROTO_GGP IPPROTO_HOPOPTS IPPROTO_ICLFXBM 7123 IPPROTO_ICMPV6 IPPROTO_IDP IPPROTO_IGMP IPPROTO_IGP IPPROTO_IPV4 7124 IPPROTO_IPV6 IPPROTO_L2TP IPPROTO_MAX IPPROTO_ND IPPROTO_NONE IPPROTO_PGM 7125 IPPROTO_PIM IPPROTO_PUP IPPROTO_RDP IPPROTO_ROUTING IPPROTO_SCTP 7126 IPPROTO_ST 7127 7128- bpo-35947: Added current version of libffi to cpython-source-deps. Change 7129 _ctypes to use current version of libffi on Windows. 7130 7131- bpo-34060: Report system load when running test suite on Windows. Patch by 7132 Ammar Askar. Based on prior work by Jeremy Kloth. 7133 7134- bpo-31512: With the Windows 10 Creators Update, non-elevated users can now 7135 create symlinks as long as the computer has Developer Mode enabled. 7136 7137macOS 7138----- 7139 7140- bpo-34602: Avoid failures setting macOS stack resource limit with 7141 resource.setrlimit. This reverts an earlier fix for bpo-18075 which forced 7142 a non-default stack size when building the interpreter executable on 7143 macOS. 7144 7145IDLE 7146---- 7147 7148- bpo-36429: Fix starting IDLE with pyshell. Add idlelib.pyshell alias at 7149 top; remove pyshell alias at bottom. Remove obsolete __name__=='__main__' 7150 command. 7151 7152Tools/Demos 7153----------- 7154 7155- bpo-14546: Fix the argument handling in Tools/scripts/lll.py. 7156 7157C API 7158----- 7159 7160- bpo-36763: Fix memory leak in :c:func:`Py_SetStandardStreamEncoding`: 7161 release memory if the function is called twice. 7162 7163- bpo-36641: :c:macro:`PyDoc_VAR(name)` and 7164 :c:macro:`PyDoc_STRVAR(name,str)` now create ``static const char name[]`` 7165 instead of ``static char name[]``. Patch by Inada Naoki. 7166 7167- bpo-36389: Change the value of ``CLEANBYTE``, ``DEADDYTE`` and 7168 ``FORBIDDENBYTE`` internal constants used by debug hooks on Python memory 7169 allocators (:c:func:`PyMem_SetupDebugHooks` function). Byte patterns 7170 ``0xCB``, ``0xDB`` and ``0xFB`` have been replaced with ``0xCD``, ``0xDD`` 7171 and ``0xFD`` to use the same values than Windows CRT debug ``malloc()`` 7172 and ``free()``. 7173 7174- bpo-36443: Since Python 3.7.0, calling :c:func:`Py_DecodeLocale` before 7175 :c:func:`Py_Initialize` produces mojibake if the ``LC_CTYPE`` locale is 7176 coerced and/or if the UTF-8 Mode is enabled by the user configuration. The 7177 LC_CTYPE coercion and UTF-8 Mode are now disabled by default to fix the 7178 mojibake issue. They must now be enabled explicitly (opt-in) using the new 7179 :c:func:`_Py_PreInitialize` API with ``_PyPreConfig``. 7180 7181- bpo-36025: Fixed an accidental change to the datetime C API where the 7182 arguments to the :c:func:`PyDate_FromTimestamp` function were incorrectly 7183 interpreted as a single timestamp rather than an arguments tuple, which 7184 causes existing code to start raising :exc:`TypeError`. The 7185 backwards-incompatible change was only present in alpha releases of Python 7186 3.8. Patch by Paul Ganssle. 7187 7188- bpo-35810: Modify ``PyObject_Init`` to correctly increase the refcount of 7189 heap- allocated Type objects. Also fix the refcounts of the heap-allocated 7190 types that were either doing this manually or not decreasing the type's 7191 refcount in tp_dealloc 7192 7193 7194What's New in Python 3.8.0 alpha 3? 7195=================================== 7196 7197*Release date: 2019-03-25* 7198 7199Security 7200-------- 7201 7202- bpo-36216: Changes urlsplit() to raise ValueError when the URL contains 7203 characters that decompose under IDNA encoding (NFKC-normalization) into 7204 characters that affect how the URL is parsed. 7205 7206- bpo-35121: Don't send cookies of domain A without Domain attribute to 7207 domain B when domain A is a suffix match of domain B while using a 7208 cookiejar with :class:`http.cookiejar.DefaultCookiePolicy` policy. Patch 7209 by Karthikeyan Singaravelan. 7210 7211Core and Builtins 7212----------------- 7213 7214- bpo-36421: Fix a possible double decref in _ctypes.c's 7215 ``PyCArrayType_new()``. 7216 7217- bpo-36412: Fix a possible crash when creating a new dictionary. 7218 7219- bpo-36398: Fix a possible crash in ``structseq_repr()``. 7220 7221- bpo-36256: Fix bug in parsermodule when parsing a state in a DFA that has 7222 two or more arcs with labels of the same type. Patch by Pablo Galindo. 7223 7224- bpo-36365: repr(structseq) is no longer limited to 512 bytes. 7225 7226- bpo-36374: Fix a possible null pointer dereference in 7227 ``merge_consts_recursive()``. Patch by Zackery Spytz. 7228 7229- bpo-36236: At Python initialization, the current directory is no longer 7230 prepended to :data:`sys.path` if it has been removed. 7231 7232- bpo-36352: Python initialization now fails with an error, rather than 7233 silently truncating paths, if a path is too long. 7234 7235- bpo-36301: Python initialization now fails if decoding ``pybuilddir.txt`` 7236 configuration file fails at startup. 7237 7238- bpo-36333: Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane 7239 Wirtel. 7240 7241- bpo-36332: The builtin :func:`compile` can now handle AST objects that 7242 contain assignment expressions. Patch by Pablo Galindo. 7243 7244- bpo-36282: Improved error message for too much positional arguments in 7245 some builtin functions. 7246 7247- bpo-30040: New empty dict uses fewer memory for now. It used more memory 7248 than empty dict created by ``dict.clear()``. And empty dict creation and 7249 deletion is about 2x faster. Patch by Inada Naoki. 7250 7251- bpo-36262: Fix an unlikely memory leak on conversion from string to float 7252 in the function ``_Py_dg_strtod()`` used by ``float(str)``, 7253 ``complex(str)``, :func:`pickle.load`, :func:`marshal.load`, etc. 7254 7255- bpo-36252: Update Unicode databases to version 12.0.0. 7256 7257- bpo-36218: Fix a segfault occurring when sorting a list of heterogeneous 7258 values. Patch contributed by Rémi Lapeyre and Elliot Gorokhovsky. 7259 7260- bpo-36188: Cleaned up left-over vestiges of Python 2 unbound method 7261 handling in method objects and documentation. Patch by Martijn Pieters 7262 7263- bpo-36124: Add a new interpreter-specific dict and expose it in the C-API 7264 via PyInterpreterState_GetDict(). This parallels PyThreadState_GetDict(). 7265 However, extension modules should continue using PyModule_GetState() for 7266 their own internal per-interpreter state. 7267 7268- bpo-35975: Add a ``feature_version`` flag to ``ast.parse()`` (documented) 7269 and ``compile()`` (hidden) that allows tweaking the parser to support 7270 older versions of the grammar. In particular, if ``feature_version`` is 5 7271 or 6, the hacks for the ``async`` and ``await`` keyword from PEP 492 are 7272 reinstated. (For 7 or higher, these are unconditionally treated as 7273 keywords, but they are still special tokens rather than ``NAME`` tokens 7274 that the parser driver recognizes.) 7275 7276- bpo-31904: Use UTF-8 as the system encoding on VxWorks. 7277 7278- bpo-36048: The :meth:`~object.__index__` special method will be used 7279 instead of :meth:`~object.__int__` for implicit conversion of Python 7280 numbers to C integers. Using the ``__int__()`` method in implicit 7281 conversions has been deprecated. 7282 7283- bpo-35808: Retire pgen and use a modified version of pgen2 to generate the 7284 parser. Patch by Pablo Galindo. 7285 7286Library 7287------- 7288 7289- bpo-36401: The class documentation created by pydoc now has a separate 7290 section for readonly properties. 7291 7292- bpo-36320: The typing.NamedTuple() class has deprecated the _field_types 7293 attribute in favor of the __annotations__ attribute which carried the same 7294 information. Also, both attributes were converted from OrderedDict to a 7295 regular dict. 7296 7297- bpo-34745: Fix :mod:`asyncio` ssl memory issues caused by circular 7298 references 7299 7300- bpo-36324: Add method to statistics.NormalDist for computing the inverse 7301 cumulative normal distribution. 7302 7303- bpo-36321: collections.namedtuple() misspelled the name of an attribute. 7304 To be consistent with typing.NamedTuple, the attribute name should have 7305 been "_field_defaults" instead of "_fields_defaults". For backwards 7306 compatibility, both spellings are now created. The misspelled version may 7307 be removed in the future. 7308 7309- bpo-36297: "unicode_internal" codec is removed. It was deprecated since 7310 Python 3.3. Patch by Inada Naoki. 7311 7312- bpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be 7313 found. Thanks to 'mental' for the bug report. 7314 7315- bpo-36268: Switch the default format used for writing tars with 7316 mod:`tarfile` to the modern POSIX.1-2001 pax standard, from the 7317 vendor-specific GNU. Contributed by C.A.M. Gerlach. 7318 7319- bpo-36285: Fix integer overflows in the array module. Patch by Stephan 7320 Hohe. 7321 7322- bpo-31904: Add _signal module support for VxWorks. 7323 7324- bpo-36272: :mod:`logging` does not silently ignore RecursionError anymore. 7325 Patch contributed by Rémi Lapeyre. 7326 7327- bpo-36280: Add a kind field to ast.Constant. It is 'u' if the literal has 7328 a 'u' prefix (i.e. a Python 2 style unicode literal), else None. 7329 7330- bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles all 7331 exceptions. 7332 7333- bpo-36251: Fix format strings used for stderrprinter and re.Match reprs. 7334 Patch by Stephan Hohe. 7335 7336- bpo-36235: Fix ``CFLAGS`` in ``customize_compiler()`` of 7337 ``distutils.sysconfig``: when the ``CFLAGS`` environment variable is 7338 defined, don't override ``CFLAGS`` variable with the ``OPT`` variable 7339 anymore. Initial patch written by David Malcolm. 7340 7341- bpo-35807: Update ensurepip to install pip 19.0.3 and setuptools 40.8.0. 7342 7343- bpo-36139: Release GIL when closing :class:`~mmap.mmap` objects. 7344 7345- bpo-36179: Fix two unlikely reference leaks in _hashopenssl. The leaks 7346 only occur in out-of-memory cases. 7347 7348- bpo-36169: Add overlap() method to statistics.NormalDist. Computes the 7349 overlapping coefficient for two normal distributions. 7350 7351- bpo-36103: Default buffer size used by ``shutil.copyfileobj()`` is changed 7352 from 16 KiB to 64 KiB on non-Windows platform to reduce system call 7353 overhead. Contributed by Inada Naoki. 7354 7355- bpo-36130: Fix ``pdb`` with ``skip=...`` when stepping into a frame 7356 without a ``__name__`` global. Patch by Anthony Sottile. 7357 7358- bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry 7359 instead of a path string. 7360 7361- bpo-35178: Ensure custom :func:`warnings.formatwarning` function can 7362 receive `line` as positional argument. Based on patch by Tashrif Billah. 7363 7364- bpo-36106: Resolve potential name clash with libm's sinpi(). Patch by 7365 Dmitrii Pasechnik. 7366 7367- bpo-36091: Clean up reference to async generator in Lib/types. Patch by 7368 Henry Chen. 7369 7370- bpo-36043: :class:`FileCookieJar` supports :term:`path-like object`. 7371 Contributed by Stéphane Wirtel 7372 7373- bpo-35899: Enum has been fixed to correctly handle empty strings and 7374 strings with non-Latin characters (ie. 'α', 'א') without crashing. 7375 Original patch contributed by Maxwell. Assisted by Stéphane Wirtel. 7376 7377- bpo-21269: Add ``args`` and ``kwargs`` properties to mock call objects. 7378 Contributed by Kumar Akshay. 7379 7380- bpo-30670: `pprint.pp` has been added to pretty-print objects with 7381 dictionary keys being sorted with their insertion order by default. 7382 Parameter *sort_dicts* has been added to `pprint.pprint`, `pprint.pformat` 7383 and `pprint.PrettyPrinter`. Contributed by Rémi Lapeyre. 7384 7385- bpo-35843: Implement ``__getitem__`` for ``_NamespacePath``. Patch by 7386 Anthony Sottile. 7387 7388- bpo-35802: Clean up code which checked presence of ``os.stat`` / 7389 ``os.lstat`` / ``os.chmod`` which are always present. Patch by Anthony 7390 Sottile. 7391 7392- bpo-35715: Librates the return value of a ProcessPoolExecutor 7393 _process_worker after it's no longer needed to free memory 7394 7395- bpo-35493: Use :func:`multiprocessing.connection.wait` instead of polling 7396 each 0.2 seconds for worker updates in :class:`multiprocessing.Pool`. 7397 Patch by Pablo Galindo. 7398 7399- bpo-35661: Store the venv prompt in pyvenv.cfg. 7400 7401- bpo-35121: Don't set cookie for a request when the request path is a 7402 prefix match of the cookie's path attribute but doesn't end with "/". 7403 Patch by Karthikeyan Singaravelan. 7404 7405- bpo-21478: Calls to a child function created with 7406 :func:`unittest.mock.create_autospec` should propagate to the parent. 7407 Patch by Karthikeyan Singaravelan. 7408 7409- bpo-35198: Fix C++ extension compilation on AIX 7410 7411Documentation 7412------------- 7413 7414- bpo-36329: Declare the path of the Python binary for the usage of 7415 ``Tools/scripts/serve.py`` when executing ``make -C Doc/ serve``. 7416 Contributed by Stéphane Wirtel 7417 7418- bpo-36138: Improve documentation about converting datetime.timedelta to 7419 scalars. 7420 7421- bpo-21314: A new entry was added to the Core Language Section of the 7422 Programming FAQ, which explaines the usage of slash(/) in the signature of 7423 a function. Patch by Lysandros Nikolaou 7424 7425Tests 7426----- 7427 7428- bpo-36234: test_posix.PosixUidGidTests: add tests for invalid uid/gid type 7429 (str). Initial patch written by David Malcolm. 7430 7431- bpo-29571: Fix ``test_re.test_locale_flag()``: use 7432 ``locale.getpreferredencoding()`` rather than ``locale.getlocale()`` to 7433 get the locale encoding. With some locales, ``locale.getlocale()`` returns 7434 the wrong encoding. 7435 7436- bpo-36123: Fix race condition in test_socket. 7437 7438Build 7439----- 7440 7441- bpo-36356: Fix leaks that led to build failure when configured with 7442 address sanitizer. 7443 7444- bpo-36146: Add ``TEST_EXTENSIONS`` constant to ``setup.py`` to allow to 7445 not build test extensions like ``_testcapi``. 7446 7447- bpo-36146: Fix setup.py on macOS: only add ``/usr/include/ffi`` to include 7448 directories of _ctypes, not for all extensions. 7449 7450- bpo-31904: Enable build system to cross-build for VxWorks RTOS. 7451 7452Windows 7453------- 7454 7455- bpo-36312: Fixed decoders for the following code pages: 50220, 50221, 7456 50222, 50225, 50227, 50229, 57002 through 57011, 65000 and 42. 7457 7458- bpo-36264: Don't honor POSIX ``HOME`` in ``os.path.expanduser`` on 7459 windows. Patch by Anthony Sottile. 7460 7461- bpo-24643: Fix name collisions due to ``#define timezone _timezone`` in 7462 PC/pyconfig.h. 7463 7464IDLE 7465---- 7466 7467- bpo-36405: Use dict unpacking in idlelib. 7468 7469- bpo-36396: Remove fgBg param of idlelib.config.GetHighlight(). This param 7470 was only used twice and changed the return type. 7471 7472- bpo-36176: Fix IDLE autocomplete & calltip popup colors. Prevent conflicts 7473 with Linux dark themes (and slightly darken calltip background). 7474 7475- bpo-23205: For the grep module, add tests for findfiles, refactor 7476 findfiles to be a module-level function, and refactor findfiles to use 7477 os.walk. 7478 7479- bpo-23216: Add docstrings to IDLE search modules. 7480 7481- bpo-36152: Remove colorizer.ColorDelegator.close_when_done and the 7482 corresponding argument of .close(). In IDLE, both have always been None 7483 or False since 2007. 7484 7485- bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Patch 7486 by Kevin Walzer. 7487 7488- bpo-36096: Refactor class variables to instance variables in colorizer. 7489 7490- bpo-30348: Increase test coverage of idlelib.autocomplete by 30%. Patch by 7491 Louie Lu 7492 7493Tools/Demos 7494----------- 7495 7496- bpo-35132: Fix py-list and py-bt commands of python-gdb.py on gdb7. 7497 7498- bpo-32217: Fix freeze script on Windows. 7499 7500C API 7501----- 7502 7503- bpo-36381: Raise ``DeprecationWarning`` when '#' formats are used for 7504 building or parsing values without ``PY_SSIZE_T_CLEAN``. 7505 7506- bpo-36142: The whole coreconfig.h header is now excluded from 7507 Py_LIMITED_API. Move functions definitions into a new internal 7508 pycore_coreconfig.h header. 7509 7510 7511What's New in Python 3.8.0 alpha 2? 7512=================================== 7513 7514*Release date: 2019-02-25* 7515 7516Core and Builtins 7517----------------- 7518 7519- bpo-36052: Raise a :exc:`SyntaxError` when assigning a value to 7520 `__debug__` with the Assignment Operator. Contributed by Stéphane Wirtel 7521 and Pablo Galindo. 7522 7523- bpo-36012: Doubled the speed of class variable writes. When a non-dunder 7524 attribute was updated, there was an unnecessary call to update slots. 7525 7526- bpo-35942: The error message emitted when returning invalid types from 7527 ``__fspath__`` in interfaces that allow passing :class:`~os.PathLike` 7528 objects has been improved and now it does explain the origin of the error. 7529 7530- bpo-36016: ``gc.get_objects`` can now receive an optional parameter 7531 indicating a generation to get objects from. Patch by Pablo Galindo. 7532 7533- bpo-1054041: When the main interpreter exits due to an uncaught 7534 KeyboardInterrupt, the process now exits in the appropriate manner for its 7535 parent process to detect that a SIGINT or ^C terminated the process. This 7536 allows shells and batch scripts to understand that the user has asked them 7537 to stop. 7538 7539- bpo-35992: Fix ``__class_getitem__()`` not being called on a class with a 7540 custom non-subscriptable metaclass. 7541 7542- bpo-35993: Fix a crash on fork when using subinterpreters. Contributed by 7543 Stéphane Wirtel 7544 7545- bpo-35991: Fix a potential double free in Modules/_randommodule.c. 7546 7547- bpo-35961: Fix a crash in slice_richcompare(): use strong references 7548 rather than stolen references for the two temporary internal tuples. 7549 7550- bpo-35911: Enable the creation of cell objects by adding a 7551 ``cell.__new__`` method, and expose the type ``cell`` in ``Lib/types.py`` 7552 under the name CellType. Patch by Pierre Glaser. 7553 7554- bpo-12822: Use monotonic clock for ``pthread_cond_timedwait`` when 7555 ``pthread_condattr_setclock`` and ``CLOCK_MONOTONIC`` are available. 7556 7557- bpo-15248: The compiler emits now syntax warnings in the case when a comma 7558 is likely missed before tuple or list. 7559 7560- bpo-35886: The implementation of PyInterpreterState has been moved into 7561 the internal header files (guarded by Py_BUILD_CORE). 7562 7563- bpo-31506: Clarify the errors reported when ``object.__new__`` and 7564 ``object.__init__`` receive more than one argument. Contributed by Sanyam 7565 Khurana. 7566 7567- bpo-35724: Signal-handling is now guaranteed to happen relative to the 7568 main interpreter. 7569 7570- bpo-33608: We added a new internal _Py_AddPendingCall() that operates 7571 relative to the provided interpreter. This allows us to use the existing 7572 implementation to ask another interpreter to do work that cannot be done 7573 in the current interpreter, like decref an object the other interpreter 7574 owns. The existing Py_AddPendingCall() only operates relative to the main 7575 interpreter. 7576 7577- bpo-33989: Fix a possible crash in :meth:`list.sort` when sorting objects 7578 with ``ob_type->tp_richcompare == NULL``. Patch by Zackery Spytz. 7579 7580Library 7581------- 7582 7583- bpo-35512: :func:`unittest.mock.patch.dict` used as a decorator with 7584 string target resolves the target during function call instead of during 7585 decorator construction. Patch by Karthikeyan Singaravelan. 7586 7587- bpo-36018: Add statistics.NormalDist, a tool for creating and manipulating 7588 normal distributions of random variable. Features a composite class that 7589 treats the mean and standard deviation of measurement data as single 7590 entity. 7591 7592- bpo-35904: Added statistics.fmean() as a faster, floating point variant of 7593 the existing mean() function. 7594 7595- bpo-35918: Removed broken ``has_key`` method from 7596 multiprocessing.managers.SyncManager.dict. Contributed by Rémi Lapeyre. 7597 7598- bpo-18283: Add support for bytes to :func:`shutil.which`. 7599 7600- bpo-35960: Fix :func:`dataclasses.field` throwing away empty mapping 7601 objects passed as metadata. 7602 7603- bpo-35500: Write expected and actual call parameters on separate lines in 7604 :meth:`unittest.mock.Mock.assert_called_with` assertion errors. 7605 Contributed by Susan Su. 7606 7607- bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles syntax 7608 errors. 7609 7610- bpo-24209: In http.server script, rely on getaddrinfo to bind to preferred 7611 address based on the bind parameter. Now default bind or binding to a name 7612 may bind to IPv6 or dual-stack, depending on the environment. 7613 7614- bpo-35321: Set ``__spec__.origin`` of ``_frozen_importlib`` to frozen so 7615 that it matches the behavior of ``_frozen_importlib_external``. Patch by 7616 Nina Zakharenko. 7617 7618- bpo-35378: Fix a reference issue inside :class:`multiprocessing.Pool` that 7619 caused the pool to remain alive if it was deleted without being closed or 7620 terminated explicitly. A new strong reference is added to the pool 7621 iterators to link the lifetime of the pool to the lifetime of its 7622 iterators so the pool does not get destroyed if a pool iterator is still 7623 alive. 7624 7625- bpo-34294: re module, fix wrong capturing groups in rare cases. 7626 :func:`re.search`, :func:`re.findall`, :func:`re.sub` and other functions 7627 that scan through string looking for a match, should reset capturing 7628 groups between two match attempts. Patch by Ma Lin. 7629 7630- bpo-35615: :mod:`weakref`: Fix a RuntimeError when copying a 7631 WeakKeyDictionary or a WeakValueDictionary, due to some keys or values 7632 disappearing while iterating. 7633 7634- bpo-35606: Implement :func:`math.prod` as analogous function to 7635 :func:`sum` that returns the product of a 'start' value (default: 1) times 7636 an iterable of numbers. Patch by Pablo Galindo. 7637 7638- bpo-32417: Performing arithmetic between :class:`datetime.datetime` 7639 subclasses and :class:`datetime.timedelta` now returns an object of the 7640 same type as the :class:`datetime.datetime` subclass. As a result, 7641 :meth:`datetime.datetime.astimezone` and alternate constructors like 7642 :meth:`datetime.datetime.now` and :meth:`datetime.fromtimestamp` called 7643 with a ``tz`` argument now *also* retain their subclass. 7644 7645- bpo-35153: Add *headers* optional keyword-only parameter to 7646 :class:`xmlrpc.client.ServerProxy`, :class:`xmlrpc.client.Transport` and 7647 :class:`xmlrpc.client.SafeTransport`. Patch by Cédric Krier. 7648 7649- bpo-34572: Fix C implementation of pickle.loads to use importlib's locking 7650 mechanisms, and thereby avoid using partially-loaded modules. Patch by Tim 7651 Burgess. 7652 7653Documentation 7654------------- 7655 7656- bpo-36083: Fix formatting of --check-hash-based-pycs options in the 7657 manpage Synopsis. 7658 7659- bpo-36007: Bump minimum sphinx version to 1.8. Patch by Anthony Sottile. 7660 7661- bpo-22062: Update documentation and docstrings for pathlib. Original patch 7662 by Mike Short. 7663 7664Tests 7665----- 7666 7667- bpo-27313: Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa 7668 Tk. 7669 7670- bpo-36019: Add test.support.TEST_HTTP_URL and replace references of 7671 http://www.example.com by this new constant. Contributed by Stéphane 7672 Wirtel. 7673 7674- bpo-36037: Fix test_ssl for strict OpenSSL configuration like RHEL8 strict 7675 crypto policy. Use older TLS version for minimum TLS version of the server 7676 SSL context if needed, to test TLS version older than default minimum TLS 7677 version. 7678 7679- bpo-35798: Added :func:`test.support.check_syntax_warning`. 7680 7681- bpo-35505: Make test_imap4_host_default_value independent on whether the 7682 local IMAP server is running. 7683 7684- bpo-35917: multiprocessing: provide unit tests for SyncManager and 7685 SharedMemoryManager classes + all the shareable types which are supposed 7686 to be supported by them. (patch by Giampaolo Rodola) 7687 7688- bpo-35704: Skip ``test_shutil.test_unpack_archive_xztar`` to prevent a 7689 MemoryError on 32-bit AIX when MAXDATA setting is less than 0x20000000. 7690 7691 Patch by Michael Felt (aixtools) 7692 7693- bpo-34720: Assert m_state != NULL to mimic GC traversal functions that do 7694 not correctly handle module creation when the module state has not been 7695 created. 7696 7697Windows 7698------- 7699 7700- bpo-35976: Added ARM build support to Windows build files in PCBuild. 7701 7702- bpo-35692: ``pathlib`` no longer raises when checking file and directory 7703 existence on drives that are not ready 7704 7705- bpo-35872: Uses the base Python executable when invoking venv in a virtual 7706 environment 7707 7708- bpo-35873: Prevents venv paths being inherited by child processes 7709 7710- bpo-35299: Fix sysconfig detection of the source directory and distutils 7711 handling of pyconfig.h during PGO profiling 7712 7713IDLE 7714---- 7715 7716- bpo-24310: IDLE -- Document settings dialog font tab sample. 7717 7718- bpo-35833: Revise IDLE doc for control codes sent to Shell. Add a code 7719 example block. 7720 7721- bpo-35689: Add docstrings and unittests for colorizer.py. 7722 7723 7724What's New in Python 3.8.0 alpha 1? 7725=================================== 7726 7727*Release date: 2019-02-03* 7728 7729Security 7730-------- 7731 7732- bpo-35746: [CVE-2019-5010] Fix a NULL pointer deref in ssl module. The 7733 cert parser did not handle CRL distribution points with empty DP or URI 7734 correctly. A malicious or buggy certificate can result into segfault. 7735 Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas Edet of 7736 Cisco. 7737 7738- bpo-34812: The :option:`-I` command line option (run Python in isolated 7739 mode) is now also copied by the :mod:`multiprocessing` and 7740 :mod:`distutils` modules when spawning child processes. Previously, only 7741 :option:`-E` and :option:`-s` options (enabled by :option:`-I`) were 7742 copied. 7743 7744- bpo-34791: The xml.sax and xml.dom.domreg no longer use environment 7745 variables to override parser implementations when 7746 sys.flags.ignore_environment is set by -E or -I arguments. 7747 7748- bpo-17239: The xml.sax and xml.dom.minidom parsers no longer processes 7749 external entities by default. External DTD and ENTITY declarations no 7750 longer load files or create network connections. 7751 7752- bpo-34623: CVE-2018-14647: The C accelerated _elementtree module now 7753 initializes hash randomization salt from _Py_HashSecret instead of 7754 libexpat's default CSPRNG. 7755 7756- bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. 7757 7758- bpo-33871: Fixed sending the part of the file in :func:`os.sendfile` on 7759 macOS. Using the *trailers* argument could cause sending more bytes from 7760 the input file than was specified. 7761 7762- bpo-32533: Fixed thread-safety of error handling in _ssl. 7763 7764- bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970. 7765 X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new 7766 test ensures that NULL bytes are not allowed. 7767 7768- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows 7769 7770- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic 7771 backtracking. These regexes formed potential DOS vectors (REDOS). They 7772 have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch 7773 by Jamie Davis. 7774 7775- bpo-28414: The ssl module now allows users to perform their own IDN 7776 en/decoding when using SNI. 7777 7778Core and Builtins 7779----------------- 7780 7781- bpo-35877: Make parenthesis optional for named expressions in while 7782 statement. Patch by Karthikeyan Singaravelan. 7783 7784- bpo-35814: Allow same right hand side expressions in annotated assignments 7785 as in normal ones. In particular, ``x: Tuple[int, int] = 1, 2`` (without 7786 parentheses on the right) is now allowed. 7787 7788- bpo-35766: Add the option to parse PEP 484 type comments in the ast 7789 module. (Off by default.) This is merging the key functionality of the 7790 third party fork thereof, 7791 [typed_ast](https://github.com/python/typed_ast). 7792 7793- bpo-35713: Reorganize Python initialization to get working exceptions and 7794 sys.stderr earlier. 7795 7796- bpo-33416: Add end line and end column position information to the Python 7797 AST nodes. This is a C-level backwards incompatible change. 7798 7799- bpo-35720: Fixed a minor memory leak in pymain_parse_cmdline_impl function 7800 in Modules/main.c 7801 7802- bpo-35634: ``func(**kwargs)`` will now raise an error when ``kwargs`` is a 7803 mapping containing multiple entries with the same key. An error was 7804 already raised when other keyword arguments are passed before ``**kwargs`` 7805 since Python 3.6. 7806 7807- bpo-35623: Fix a crash when sorting very long lists. Patch by Stephan 7808 Hohe. 7809 7810- bpo-35214: clang Memory Sanitizer build instrumentation was added to work 7811 around false positives from posix, socket, time, test_io, and 7812 test_faulthandler. 7813 7814- bpo-35560: Fix an assertion error in :func:`format` in debug build for 7815 floating point formatting with "n" format, zero padding and small width. 7816 Release build is not impacted. Patch by Karthikeyan Singaravelan. 7817 7818- bpo-35552: Format characters ``%s`` and ``%V`` in 7819 :c:func:`PyUnicode_FromFormat` and ``%s`` in :c:func:`PyBytes_FromFormat` 7820 no longer read memory past the limit if *precision* is specified. 7821 7822- bpo-35504: Fix segfaults and :exc:`SystemError`\ s when deleting certain 7823 attributes. Patch by Zackery Spytz. 7824 7825- bpo-35504: Fixed a SystemError when delete the characters_written 7826 attribute of an OSError. 7827 7828- bpo-35494: Improved syntax error messages for unbalanced parentheses in 7829 f-string. 7830 7831- bpo-35444: Fixed error handling in pickling methods when fail to look up 7832 builtin "getattr". Sped up pickling iterators. 7833 7834- bpo-35436: Fix various issues with memory allocation error handling. 7835 Patch by Zackery Spytz. 7836 7837- bpo-35423: Separate the signal handling trigger in the eval loop from the 7838 "pending calls" machinery. There is no semantic change and the difference 7839 in performance is insignificant. 7840 7841- bpo-35357: Internal attributes' names of unittest.mock._Call and 7842 unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with 7843 _mock_ in order to prevent clashes with widely used object attributes. 7844 Fixed minor typo in test function name. 7845 7846- bpo-35372: Fixed the code page decoder for input longer than 2 GiB 7847 containing undecodable bytes. 7848 7849- bpo-35336: Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the 7850 C locale if the LC_CTYPE locale is "C". 7851 7852- bpo-31241: The *lineno* and *col_offset* attributes of AST nodes for list 7853 comprehensions, generator expressions and tuples are now point to the 7854 opening parenthesis or square brace. For tuples without parenthesis they 7855 point to the position of the first item. 7856 7857- bpo-33954: For :meth:`str.format`, :meth:`float.__format__` and 7858 :meth:`complex.__format__` methods for non-ASCII decimal point when using 7859 the "n" formatter. 7860 7861- bpo-35269: Fix a possible segfault involving a newly-created coroutine. 7862 Patch by Zackery Spytz. 7863 7864- bpo-35224: Implement :pep:`572` (assignment expressions). Patch by Emily 7865 Morehouse. 7866 7867- bpo-32492: Speed up :class:`namedtuple` attribute access by 1.6x using a C 7868 fast-path for the name descriptors. Patch by Pablo Galindo. 7869 7870- bpo-35214: Fixed an out of bounds memory access when parsing a truncated 7871 unicode escape sequence at the end of a string such as ``'\N'``. It would 7872 read one byte beyond the end of the memory allocation. 7873 7874- bpo-35214: The interpreter and extension modules have had annotations 7875 added so that they work properly under clang's Memory Sanitizer. A new 7876 configure flag --with-memory-sanitizer has been added to make test builds 7877 of this nature easier to perform. 7878 7879- bpo-35193: Fix an off by one error in the bytecode peephole optimizer 7880 where it could read bytes beyond the end of bounds of an array when 7881 removing unreachable code. This bug was present in every release of Python 7882 3.6 and 3.7 until now. 7883 7884- bpo-35169: Improved error messages for forbidden assignments. 7885 7886- bpo-34022: Fix handling of hash-based bytecode files in :mod:`zipimport`. 7887 Patch by Elvis Pranskevichus. 7888 7889- bpo-28401: Debug builds will no longer to attempt to import extension 7890 modules built for the ABI as they were never compatible to begin with. 7891 Patch by Stefano Rivera. 7892 7893- bpo-29341: Clarify in the docstrings of :mod:`os` methods that path-like 7894 objects are also accepted as input parameters. 7895 7896- bpo-35050: :mod:`socket`: Fix off-by-one bug in length check for 7897 ``AF_ALG`` name and type. 7898 7899- bpo-29743: Raise :exc:`ValueError` instead of :exc:`OverflowError` in case 7900 of a negative ``_length_`` in a :class:`ctypes.Array` subclass. Also 7901 raise :exc:`TypeError` instead of :exc:`AttributeError` for non-integer 7902 ``_length_``. Original patch by Oren Milman. 7903 7904- bpo-16806: Fix ``lineno`` and ``col_offset`` for multi-line string tokens. 7905 7906- bpo-35029: :exc:`SyntaxWarning` raised as an exception at code generation 7907 time will be now replaced with a :exc:`SyntaxError` for better error 7908 reporting. 7909 7910- bpo-34983: Expose :meth:`symtable.Symbol.is_nonlocal` in the symtable 7911 module. Patch by Pablo Galindo. 7912 7913- bpo-34974: :class:`bytes` and :class:`bytearray` constructors no longer 7914 convert unexpected exceptions (e.g. :exc:`MemoryError` and 7915 :exc:`KeyboardInterrupt`) to :exc:`TypeError`. 7916 7917- bpo-34939: Allow annotated names in module namespace that are declared 7918 global before the annotation happens. Patch by Pablo Galindo. 7919 7920- bpo-34973: Fixed crash in :func:`bytes` when the :class:`list` argument is 7921 mutated while it is iterated. 7922 7923- bpo-34876: The *lineno* and *col_offset* attributes of the AST for 7924 decorated function and class refer now to the position of the 7925 corresponding ``def``, ``async def`` and ``class`` instead of the position 7926 of the first decorator. This leads to more correct line reporting in 7927 tracing. This is the only case when the position of child AST nodes can 7928 precede the position of the parent AST node. 7929 7930- bpo-34879: Fix a possible null pointer dereference in bytesobject.c. 7931 Patch by Zackery Spytz. 7932 7933- bpo-34784: Fix the implementation of PyStructSequence_NewType in order to 7934 create heap allocated StructSequences. 7935 7936- bpo-32912: A :exc:`SyntaxWarning` is now emitted instead of a 7937 :exc:`DeprecationWarning` for invalid escape sequences in string and bytes 7938 literals. 7939 7940- bpo-34854: Fixed a crash in compiling string annotations containing a 7941 lambda with a keyword-only argument that doesn't have a default value. 7942 7943- bpo-34850: The compiler now produces a :exc:`SyntaxWarning` when identity 7944 checks (``is`` and ``is not``) are used with certain types of literals 7945 (e.g. strings, ints). These can often work by accident in CPython, but 7946 are not guaranteed by the language spec. The warning advises users to use 7947 equality tests (``==`` and ``!=``) instead. 7948 7949- bpo-34824: Fix a possible null pointer dereference in Modules/_ssl.c. 7950 Patch by Zackery Spytz. 7951 7952- bpo-30156: The C function ``property_descr_get()`` uses a "cached" tuple 7953 to optimize function calls. But this tuple can be discovered in debug mode 7954 with :func:`sys.getobjects()`. Remove the optimization, it's not really 7955 worth it and it causes 3 different crashes last years. 7956 7957- bpo-34762: Fix contextvars C API to use PyObject* pointer types. 7958 7959- bpo-34751: The hash function for tuples is now based on xxHash which gives 7960 better collision results on (formerly) pathological cases. Additionally, 7961 on 64-bit systems it improves tuple hashes in general. Patch by Jeroen 7962 Demeyer with substantial contributions by Tim Peters. 7963 7964- bpo-34735: Fix a memory leak in Modules/timemodule.c. Patch by Zackery 7965 Spytz. 7966 7967- bpo-34683: Fixed a bug where some SyntaxError error pointed to locations 7968 that were off-by-one. 7969 7970- bpo-34651: Only allow the main interpreter to fork. The avoids the 7971 possibility of affecting the main interpreter, which is critical to 7972 operation of the runtime. 7973 7974- bpo-34653: Remove unused function PyParser_SimpleParseStringFilename. 7975 7976- bpo-32236: Warn that line buffering is not supported if :func:`open` is 7977 called with binary mode and ``buffering=1``. 7978 7979- bpo-34641: Further restrict the syntax of the left-hand side of keyword 7980 arguments in function calls. In particular, ``f((keyword)=arg)`` is now 7981 disallowed. 7982 7983- bpo-34637: Make the *start* argument to *sum()* visible as a keyword 7984 argument. 7985 7986- bpo-1621: Do not assume signed integer overflow behavior (C undefined 7987 behavior) when performing set hash table resizing. 7988 7989- bpo-34588: Fix an off-by-one in the recursive call pruning feature of 7990 traceback formatting. 7991 7992- bpo-34485: On Windows, the LC_CTYPE is now set to the user preferred 7993 locale at startup. Previously, the LC_CTYPE locale was "C" at startup, but 7994 changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, ""). 7995 7996- bpo-34485: Standard streams like sys.stdout now use the "surrogateescape" 7997 error handler, instead of "strict", on the POSIX locale (when the C locale 7998 is not coerced and the UTF-8 Mode is disabled). 7999 8000- bpo-34485: Fix the error handler of standard streams like sys.stdout: 8001 PYTHONIOENCODING=":" is now ignored instead of setting the error handler 8002 to "strict". 8003 8004- bpo-34485: Python now gets the locale encoding with C code to initialize 8005 the encoding of standard streams like sys.stdout. Moreover, the encoding 8006 is now initialized to the Python codec name to get a normalized encoding 8007 name and to ensure that the codec is loaded. The change avoids importing 8008 _bootlocale and _locale modules at startup by default. 8009 8010- bpo-34527: On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also 8011 forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if 8012 the LC_CTYPE locale is "C". 8013 8014- bpo-34527: The UTF-8 Mode is now also enabled by the "POSIX" locale, not 8015 only by the "C" locale. 8016 8017- bpo-34403: On HP-UX with C or POSIX locale, sys.getfilesystemencoding() 8018 now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled 8019 and the C locale is not coerced). 8020 8021- bpo-34523: The Python filesystem encoding is now read earlier during the 8022 Python initialization. 8023 8024- bpo-12458: Tracebacks show now correct line number for subexpressions in 8025 multiline expressions. Tracebacks show now the line number of the first 8026 line for multiline expressions instead of the line number of the last 8027 subexpression. 8028 8029- bpo-34408: Prevent a null pointer dereference and resource leakage in 8030 ``PyInterpreterState_New()``. 8031 8032- bpo-34400: Fix undefined behavior in parsetok.c. Patch by Zackery Spytz. 8033 8034- bpo-33073: Added as_integer_ratio to ints to make them more interoperable 8035 with floats. 8036 8037- bpo-34377: Update valgrind suppression list to use 8038 ``_PyObject_Free``/``_PyObject_Realloc`` instead of 8039 ``PyObject_Free``/``PyObject_Realloc``. 8040 8041- bpo-34353: Added the "socket" option in the `stat.filemode()` Python 8042 implementation to match the C implementation. 8043 8044- bpo-34320: Fix ``dict(od)`` didn't copy iteration order of OrderedDict. 8045 8046- bpo-34113: Fixed crash on debug builds when opcode stack was adjusted with 8047 negative numbers. Patch by Constantin Petrisor. 8048 8049- bpo-34100: Compiler now merges constants in tuples and frozensets 8050 recursively. Code attributes like ``co_names`` are merged too. 8051 8052- bpo-34151: Performance of list concatenation, repetition and slicing 8053 operations is slightly improved. Patch by Sergey Fedoseev. 8054 8055- bpo-34170: -X dev: it is now possible to override the memory allocator 8056 using PYTHONMALLOC even if the developer mode is enabled. 8057 8058- bpo-33237: Improved :exc:`AttributeError` message for partially 8059 initialized module. 8060 8061- bpo-34149: Fix min and max functions to get default behavior when key is 8062 None. 8063 8064- bpo-34125: Profiling of unbound built-in methods now works when 8065 ``**kwargs`` is given. 8066 8067- bpo-34141: Optimized pickling atomic types (None, bool, int, float, bytes, 8068 str). 8069 8070- bpo-34126: Fix crashes when profiling certain invalid calls of unbound 8071 methods. Patch by Jeroen Demeyer. 8072 8073- bpo-24618: Fixed reading invalid memory when create the code object with 8074 too small varnames tuple or too large argument counts. 8075 8076- bpo-34068: In :meth:`io.IOBase.close`, ensure that the 8077 :attr:`~io.IOBase.closed` attribute is not set with a live exception. 8078 Patch by Zackery Spytz and Serhiy Storchaka. 8079 8080- bpo-34087: Fix buffer overflow while converting unicode to numeric values. 8081 8082- bpo-34080: Fixed a memory leak in the compiler when it raised some 8083 uncommon errors during tokenizing. 8084 8085- bpo-34066: Disabled interruption by Ctrl-C between calling ``open()`` and 8086 entering a **with** block in ``with open()``. 8087 8088- bpo-34042: Fix dict.copy() to maintain correct total refcount (as reported 8089 by sys.gettotalrefcount()). 8090 8091- bpo-33418: Fix potential memory leak in function object when it creates 8092 reference cycle. 8093 8094- bpo-33985: Implement contextvars.ContextVar.name attribute. 8095 8096- bpo-33956: Update vendored Expat library copy to version 2.2.5. 8097 8098- bpo-24596: Decref the module object in :c:func:`PyRun_SimpleFileExFlags` 8099 before calling :c:func:`PyErr_Print()`. Patch by Zackery Spytz. 8100 8101- bpo-33451: Close directly executed pyc files before calling 8102 ``PyEval_EvalCode()``. 8103 8104- bpo-1617161: The hash of :class:`BuiltinMethodType` instances (methods of 8105 built-in classes) now depends on the hash of the identity of *__self__* 8106 instead of its value. The hash and equality of :class:`ModuleType` and 8107 :class:`MethodWrapperType` instances (methods of user-defined classes and 8108 some methods of built-in classes like ``str.__add__``) now depend on the 8109 hash and equality of the identity of *__self__* instead of its value. 8110 :class:`MethodWrapperType` instances no longer support ordering. 8111 8112- bpo-33824: Fix "LC_ALL=C python3.7 -V": reset properly the command line 8113 parser when the encoding changes after reading the Python configuration. 8114 8115- bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an 8116 object that hadn't all of its fields set to NULL. 8117 8118- bpo-33738: Seven macro incompatibilities with the Limited API were fixed, 8119 and the macros :c:func:`PyIter_Check`, :c:func:`PyIndex_Check` and 8120 :c:func:`PyExceptionClass_Name` were added as functions. A script for 8121 automatic macro checks was added. 8122 8123- bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 8124 correctly 8125 8126- bpo-30167: ``PyRun_SimpleFileExFlags`` removes ``__cached__`` from module 8127 in addition to ``__file__``. 8128 8129- bpo-33706: Fix a crash in Python initialization when parsing the command 8130 line options. Thanks Christoph Gohlke for the bug report and the fix! 8131 8132- bpo-33597: Reduce ``PyGC_Head`` size from 3 words to 2 words. 8133 8134- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter 8135 shutdown even when there was a custom handler set previously. Patch by 8136 Philipp Kerling. 8137 8138- bpo-33622: Fixed a leak when the garbage collector fails to add an object 8139 with the ``__del__`` method or referenced by it into the 8140 :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an 8141 exception is set and preserves it. 8142 8143- bpo-33462: Make dict and dict views reversible. Patch by Rémi Lapeyre. 8144 8145- bpo-23722: A :exc:`RuntimeError` is now raised when the custom metaclass 8146 doesn't provide the ``__classcell__`` entry in the namespace passed to 8147 ``type.__new__``. A :exc:`DeprecationWarning` was emitted in Python 8148 3.6--3.7. 8149 8150- bpo-33499: Add :envvar:`PYTHONPYCACHEPREFIX` environment variable and 8151 :option:`-X` ``pycache_prefix`` command-line option to set an alternate 8152 root directory for writing module bytecode cache files. 8153 8154- bpo-25711: The :mod:`zipimport` module has been rewritten in pure Python. 8155 8156- bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't 8157 crash if module_globals is not a dict. 8158 8159- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c. 8160 8161- bpo-33475: Fixed miscellaneous bugs in converting annotations to strings 8162 and optimized parentheses in the string representation. 8163 8164- bpo-20104: Added support for the `setpgroup`, `resetids`, `setsigmask`, 8165 `setsigdef` and `scheduler` parameters of `posix_spawn`. Patch by Pablo 8166 Galindo. 8167 8168- bpo-33391: Fix a leak in set_symmetric_difference(). 8169 8170- bpo-33363: Raise a SyntaxError for ``async with`` and ``async for`` 8171 statements outside of async functions. 8172 8173- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer. 8174 8175- bpo-33128: Fix a bug that causes PathFinder to appear twice on 8176 sys.meta_path. Patch by Pablo Galindo Salgado. 8177 8178- bpo-33331: Modules imported last are now cleared first at interpreter 8179 shutdown. 8180 8181- bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in 8182 dictobject.c by adjusting how the internal struct _dictkeysobject shared 8183 keys structure is declared. 8184 8185- bpo-33305: Improved syntax error messages for invalid numerical literals. 8186 8187- bpo-33306: Improved syntax error messages for unbalanced parentheses. 8188 8189- bpo-33234: The list constructor will pre-size and not over-allocate when 8190 the input length is known. 8191 8192- bpo-33270: Intern the names for all anonymous code objects. Patch by 8193 Zackery Spytz. 8194 8195- bpo-30455: The C and Python code and the documentation related to tokens 8196 are now generated from a single source file :file:`Grammar/Tokens`. 8197 8198- bpo-33176: Add a ``toreadonly()`` method to memoryviews. 8199 8200- bpo-33231: Fix potential memory leak in ``normalizestring()``. 8201 8202- bpo-33205: Change dict growth function from 8203 ``round_up_to_power_2(used*2+hashtable_size/2)`` to 8204 ``round_up_to_power_2(used*3)``. Previously, dict is shrinked only when 8205 ``used == 0``. Now dict has more chance to be shrinked. 8206 8207- bpo-29922: Improved error messages in 'async with' when ``__aenter__()`` 8208 or ``__aexit__()`` return non-awaitable object. 8209 8210- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized 8211 when copying from key-sharing dict. 8212 8213- bpo-33053: When using the -m switch, sys.path[0] is now explicitly 8214 expanded as the *starting* working directory, rather than being left as 8215 the empty path (which allows imports from the current working directory at 8216 the time of the import) 8217 8218- bpo-33138: Changed standard error message for non-pickleable and 8219 non-copyable types. It now says "cannot pickle" instead of "can't pickle" 8220 or "cannot serialize". 8221 8222- bpo-33018: Improve consistency of errors raised by ``issubclass()`` when 8223 called with a non-class and an abstract base class as the first and second 8224 arguments, respectively. Patch by Josh Bronson. 8225 8226- bpo-33083: ``math.factorial`` no longer accepts arguments that are not 8227 int-like. Patch by Pablo Galindo. 8228 8229- bpo-33041: Added new opcode :opcode:`END_ASYNC_FOR` and fixes the 8230 following issues: 8231 8232 * Setting global :exc:`StopAsyncIteration` no longer breaks ``async for`` 8233 loops. 8234 * Jumping into an ``async for`` loop is now disabled. 8235 * Jumping out of an ``async for`` loop no longer corrupts the stack. 8236 8237- bpo-25750: Fix rare Python crash due to bad refcounting in 8238 ``type_getattro()`` if a descriptor deletes itself from the class. Patch 8239 by Jeroen Demeyer. 8240 8241- bpo-33041: Fixed bytecode generation for "async for" with a complex 8242 target. A StopAsyncIteration raised on assigning or unpacking will be now 8243 propagated instead of stopping the iteration. 8244 8245- bpo-33026: Fixed jumping out of "with" block by setting f_lineno. 8246 8247- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex: 8248 using PYTHONMALLOC env var). _PyGILState_Reinit() and 8249 _PyInterpreterState_Enable() now use the default RAW memory allocator to 8250 allocate a new interpreters mutex on fork. 8251 8252- bpo-32911: Due to unexpected compatibility issues discovered during 8253 downstream beta testing, reverted :issue:`29463`. ``docstring`` field is 8254 removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes 8255 which was added in 3.7a1. Docstring expression is restored as a first 8256 statement in their body. Based on patch by Inada Naoki. 8257 8258- bpo-17288: Prevent jumps from 'return' and 'exception' trace events. 8259 8260- bpo-32946: Importing names from already imported module with "from ... 8261 import ..." is now 30% faster if the module is not a package. 8262 8263- bpo-32932: Make error message more revealing when there are non-str 8264 objects in ``__all__``. 8265 8266- bpo-32925: Optimized iterating and containing test for literal lists 8267 consisting of non-constants: ``x in [a, b]`` and ``for x in [a, b]``. The 8268 case of all constant elements already was optimized. 8269 8270- bpo-32889: Update Valgrind suppression list to account for the rename of 8271 ``Py_ADDRESS_IN_RANG`` to ``address_in_range``. 8272 8273- bpo-32836: Don't use temporary variables in cases of list/dict/set 8274 comprehensions 8275 8276- bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled() 8277 context manager). 8278 8279- bpo-32305: For namespace packages, ensure that both ``__file__`` and 8280 ``__spec__.origin`` are set to None. 8281 8282- bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for 8283 namespace packages. 8284 8285- bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by 8286 Stéphane Wirtel 8287 8288- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by 8289 write out-of-bound errors when using customized decode error handlers. 8290 8291- bpo-32489: A :keyword:`continue` statement is now allowed in the 8292 :keyword:`finally` clause. 8293 8294- bpo-17611: Simplified the interpreter loop by moving the logic of 8295 unrolling the stack of blocks into the compiler. The compiler emits now 8296 explicit instructions for adjusting the stack of values and calling the 8297 cleaning up code for :keyword:`break`, :keyword:`continue` and 8298 :keyword:`return`. 8299 8300 Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, 8301 :opcode:`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes 8302 :opcode:`ROT_FOUR`, :opcode:`BEGIN_FINALLY` and :opcode:`CALL_FINALLY` and 8303 :opcode:`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY` and 8304 :opcode:`WITH_CLEANUP_START`. 8305 8306- bpo-32285: New function unicodedata.is_normalized, which can check whether 8307 a string is in a specific normal form. 8308 8309- bpo-10544: Yield expressions are now disallowed in comprehensions and 8310 generator expressions except the expression for the outermost iterable. 8311 8312- bpo-32117: Iterable unpacking is now allowed without parentheses in yield 8313 and return statements, e.g. ``yield 1, 2, 3, *rest``. Thanks to David 8314 Cuthbert for the change and Jordan Chapman for added tests. 8315 8316- bpo-31902: Fix the ``col_offset`` attribute for ast nodes 8317 ``ast.AsyncFor``, ``ast.AsyncFunctionDef``, and ``ast.AsyncWith``. 8318 Previously, ``col_offset`` pointed to the keyword after ``async``. 8319 8320- bpo-25862: Fix assertion failures in the ``tell()`` method of 8321 ``io.TextIOWrapper``. Patch by Zackery Spytz. 8322 8323- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a 8324 ctypes structured data type. Patch by Eryk Sun and Oren Milman. 8325 8326- bpo-31577: Fix a crash in `os.utime()` in case of a bad ns argument. Patch 8327 by Oren Milman. 8328 8329- bpo-29832: Remove references to 'getsockaddrarg' from various socket error 8330 messages. Patch by Oren Milman. 8331 8332Library 8333------- 8334 8335- bpo-35845: Add 'order' parameter to memoryview.tobytes(). 8336 8337- bpo-35864: The _asdict() method for collections.namedtuple now returns a 8338 regular dict instead of an OrderedDict. 8339 8340- bpo-35537: An ExitStack is now used internally within subprocess.POpen to 8341 clean up pipe file handles. No behavior change in normal operation. But if 8342 closing one handle were ever to cause an exception, the others will now be 8343 closed instead of leaked. (patch by Giampaolo Rodola) 8344 8345- bpo-35847: RISC-V needed the CTYPES_PASS_BY_REF_HACK. Fixes ctypes 8346 Structure test_pass_by_value. 8347 8348- bpo-35813: Shared memory submodule added to multiprocessing to avoid need 8349 for serialization between processes 8350 8351- bpo-35780: Fix lru_cache() errors arising in recursive, reentrant, or 8352 multi-threaded code. These errors could result in orphan links and in the 8353 cache being trapped in a state with fewer than the specified maximum 8354 number of links. Fix handling of negative maxsize which should have been 8355 treated as zero. Fix errors in toggling the "full" status flag. Fix 8356 misordering of links when errors are encountered. Sync-up the C code and 8357 pure Python code for the space saving path in functions with a single 8358 positional argument. In this common case, the space overhead of an lru 8359 cache entry is reduced by almost half. Fix counting of cache misses. In 8360 error cases, the miss count was out of sync with the actual number of 8361 times the underlying user function was called. 8362 8363- bpo-35537: :func:`os.posix_spawn` and :func:`os.posix_spawnp` now have a 8364 *setsid* parameter. 8365 8366- bpo-23846: :class:`asyncio.ProactorEventLoop` now catches and logs send 8367 errors when the self-pipe is full. 8368 8369- bpo-34323: :mod:`asyncio`: Enhance ``IocpProactor.close()`` log: wait 1 8370 second before the first log, then log every second. Log also the number of 8371 seconds since ``close()`` was called. 8372 8373- bpo-35674: Add a new :func:`os.posix_spawnp` function. Patch by Joannah 8374 Nanjekye. 8375 8376- bpo-35733: ``ast.Constant(boolean)`` no longer an instance of 8377 :class:`ast.Num`. Patch by Anthony Sottile. 8378 8379- bpo-35726: QueueHandler.prepare() now makes a copy of the record before 8380 modifying and enqueueing it, to avoid affecting other handlers in the 8381 chain. 8382 8383- bpo-35719: Sped up multi-argument :mod:`math` functions atan2(), 8384 copysign(), remainder() and hypot() by 1.3--2.5 times. 8385 8386- bpo-35717: Fix KeyError exception raised when using enums and compile. 8387 Patch contributed by Rémi Lapeyre. 8388 8389- bpo-35699: Fixed detection of Visual Studio Build Tools 2017 in distutils 8390 8391- bpo-32710: Fix memory leaks in asyncio ProactorEventLoop on overlapped 8392 operation failure. 8393 8394- bpo-35702: The :data:`time.CLOCK_UPTIME_RAW` constant is now available for 8395 macOS 10.12. 8396 8397- bpo-32710: Fix a memory leak in asyncio in the ProactorEventLoop when 8398 ``ReadFile()`` or ``WSASend()`` overlapped operation fail immediately: 8399 release the internal buffer. 8400 8401- bpo-35682: Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to 8402 set the result of an internal future if it's already done. 8403 8404- bpo-35283: Add a deprecated warning for the 8405 :meth:`threading.Thread.isAlive` method. Patch by Dong-hee Na. 8406 8407- bpo-35664: Improve operator.itemgetter() performance by 33% with optimized 8408 argument handling and with adding a fast path for the common case of a 8409 single non-negative integer index into a tuple (which is the typical use 8410 case in the standard library). 8411 8412- bpo-35643: Fixed a SyntaxWarning: invalid escape sequence in 8413 Modules/_sha3/cleanup.py. Patch by Mickaël Schoentgen. 8414 8415- bpo-35619: Improved support of custom data descriptors in :func:`help` and 8416 :mod:`pydoc`. 8417 8418- bpo-28503: The `crypt` module now internally uses the `crypt_r()` library 8419 function instead of `crypt()` when available. 8420 8421- bpo-35614: Fixed help() on metaclasses. Patch by Sanyam Khurana. 8422 8423- bpo-35568: Expose ``raise(signum)`` as `raise_signal` 8424 8425- bpo-35588: The floor division and modulo operations and the :func:`divmod` 8426 function on :class:`fractions.Fraction` types are 2--4x faster. Patch by 8427 Stefan Behnel. 8428 8429- bpo-35585: Speed-up building enums by value, e.g. http.HTTPStatus(200). 8430 8431- bpo-30561: random.gammavariate(1.0, beta) now computes the same result as 8432 random.expovariate(1.0 / beta). This synchronizes the two algorithms and 8433 eliminates some idiosyncrasies in the old implementation. It does however 8434 produce a difference stream of random variables than it used to. 8435 8436- bpo-35537: The :mod:`subprocess` module can now use the 8437 :func:`os.posix_spawn` function in some cases for better performance. 8438 8439- bpo-35526: Delaying the 'joke' of barry_as_FLUFL.mandatory to Python 8440 version 4.0 8441 8442- bpo-35523: Remove :mod:`ctypes` callback workaround: no longer create a 8443 callback at startup. Avoid SELinux alert on ``import ctypes`` and ``import 8444 uuid``. 8445 8446- bpo-31784: :func:`uuid.uuid1` now calls :func:`time.time_ns` rather than 8447 ``int(time.time() * 1e9)``. 8448 8449- bpo-35513: :class:`~unittest.runner.TextTestRunner` of 8450 :mod:`unittest.runner` now uses :func:`time.perf_counter` rather than 8451 :func:`time.time` to measure the execution time of a test: 8452 :func:`time.time` can go backwards, whereas :func:`time.perf_counter` is 8453 monotonic. 8454 8455- bpo-35502: Fixed reference leaks in 8456 :class:`xml.etree.ElementTree.TreeBuilder` in case of unfinished building 8457 of the tree (in particular when an error was raised during parsing XML). 8458 8459- bpo-35348: Make :func:`platform.architecture` parsing of ``file`` command 8460 output more reliable: add the ``-b`` option to the ``file`` command to 8461 omit the filename, force the usage of the C locale, and search also the 8462 "shared object" pattern. 8463 8464- bpo-35491: :mod:`multiprocessing`: Add ``Pool.__repr__()`` and enhance 8465 ``BaseProcess.__repr__()`` (add pid and parent pid) to ease debugging. 8466 Pool state constant values are now strings instead of integers, for 8467 example ``RUN`` value becomes ``'RUN'`` instead of ``0``. 8468 8469- bpo-35477: :meth:`multiprocessing.Pool.__enter__` now fails if the pool is 8470 not running: ``with pool:`` fails if used more than once. 8471 8472- bpo-31446: Copy command line that was passed to CreateProcessW since this 8473 function can change the content of the input buffer. 8474 8475- bpo-35471: Python 2.4 dropped MacOS 9 support. The macpath module was 8476 deprecated in Python 3.7. The module is now removed. 8477 8478- bpo-23057: Unblock Proactor event loop when keyboard interrupt is received 8479 on Windows 8480 8481- bpo-35052: Fix xml.dom.minidom cloneNode() on a document with an entity: 8482 pass the correct arguments to the user data handler of an entity. 8483 8484- bpo-20239: Allow repeated assignment deletion of 8485 :class:`unittest.mock.Mock` attributes. Patch by Pablo Galindo. 8486 8487- bpo-17185: Set ``__signature__`` on mock for :mod:`inspect` to get 8488 signature. Patch by Karthikeyan Singaravelan. 8489 8490- bpo-35445: Memory errors during creating posix.environ no longer ignored. 8491 8492- bpo-35415: Validate fileno= argument to socket.socket(). 8493 8494- bpo-35424: :class:`multiprocessing.Pool` destructor now emits 8495 :exc:`ResourceWarning` if the pool is still running. 8496 8497- bpo-35330: When a :class:`Mock` instance was used to wrap an object, if 8498 `side_effect` is used in one of the mocks of it methods, don't call the 8499 original implementation and return the result of using the side effect the 8500 same way that it is done with return_value. 8501 8502- bpo-35346: Drop Mac OS 9 and Rhapsody support from the :mod:`platform` 8503 module. Rhapsody last release was in 2000. Mac OS 9 last release was in 8504 2001. 8505 8506- bpo-10496: :func:`~distutils.utils.check_environ` of 8507 :mod:`distutils.utils` now catches :exc:`KeyError` on calling 8508 :func:`pwd.getpwuid`: don't create the ``HOME`` environment variable in 8509 this case. 8510 8511- bpo-10496: :func:`posixpath.expanduser` now returns the input *path* 8512 unchanged if the ``HOME`` environment variable is not set and the current 8513 user has no home directory (if the current user identifier doesn't exist 8514 in the password database). This change fix the :mod:`site` module if the 8515 current user doesn't exist in the password database (if the user has no 8516 home directory). 8517 8518- bpo-35389: :func:`platform.libc_ver` now uses 8519 ``os.confstr('CS_GNU_LIBC_VERSION')`` if available and the *executable* 8520 parameter is not set. 8521 8522- bpo-35394: Add empty slots to asyncio abstract protocols. 8523 8524- bpo-35310: Fix a bug in :func:`select.select` where, in some cases, the 8525 file descriptor sequences were returned unmodified after a signal 8526 interruption, even though the file descriptors might not be ready yet. 8527 :func:`select.select` will now always return empty lists if a timeout has 8528 occurred. Patch by Oran Avraham. 8529 8530- bpo-35380: Enable TCP_NODELAY on Windows for proactor asyncio event loop. 8531 8532- bpo-35341: Add generic version of ``collections.OrderedDict`` to the 8533 ``typing`` module. Patch by Ismo Toijala. 8534 8535- bpo-35371: Fixed possible crash in ``os.utime()`` on Windows when pass 8536 incorrect arguments. 8537 8538- bpo-35346: :func:`platform.uname` now redirects ``stderr`` to 8539 :data:`os.devnull` when running external programs like ``cmd /c ver``. 8540 8541- bpo-35066: Previously, calling the strftime() method on a datetime object 8542 with a trailing '%' in the format string would result in an exception. 8543 However, this only occurred when the datetime C module was being used; the 8544 python implementation did not match this behavior. Datetime is now PEP-399 8545 compliant, and will not throw an exception on a trailing '%'. 8546 8547- bpo-35345: The function `platform.popen` has been removed, it was 8548 deprecated since Python 3.3: use :func:`os.popen` instead. 8549 8550- bpo-35344: On macOS, :func:`platform.platform` now uses 8551 :func:`platform.mac_ver`, if it returns a non-empty release string, to get 8552 the macOS version rather than the darwin version. 8553 8554- bpo-35312: Make ``lib2to3.pgen2.parse.ParseError`` round-trip pickle-able. 8555 Patch by Anthony Sottile. 8556 8557- bpo-35308: Fix regression in ``webbrowser`` where default browsers may be 8558 preferred over browsers in the ``BROWSER`` environment variable. 8559 8560- bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff. 8561 Original patch by R. David Murray & Jairo Trad. Enhanced by Sanyam 8562 Khurana. 8563 8564- bpo-28604: :func:`locale.localeconv` now sets temporarily the ``LC_CTYPE`` 8565 locale to the ``LC_MONETARY`` locale if the two locales are different and 8566 monetary strings are non-ASCII. This temporary change affects other 8567 threads. 8568 8569- bpo-35277: Update ensurepip to install pip 18.1 and setuptools 40.6.2. 8570 8571- bpo-24209: Adds IPv6 support when invoking http.server directly. 8572 8573- bpo-35226: Recursively check arguments when testing for equality of 8574 :class:`unittest.mock.call` objects and add note that tracking of 8575 parameters used to create ancestors of mocks in ``mock_calls`` is not 8576 possible. 8577 8578- bpo-29564: The warnings module now suggests to enable tracemalloc if the 8579 source is specified, the tracemalloc module is available, but tracemalloc 8580 is not tracing memory allocations. 8581 8582- bpo-35189: Modify the following fnctl function to retry if interrupted by 8583 a signal (EINTR): flock, lockf, fnctl 8584 8585- bpo-30064: Use add_done_callback() in sock_* asyncio API to unsubscribe 8586 reader/writer early on calcellation. 8587 8588- bpo-35186: Removed the "built with" comment added when ``setup.py upload`` 8589 is used with either ``bdist_rpm`` or ``bdist_dumb``. 8590 8591- bpo-35152: Allow sending more than 2 GB at once on a multiprocessing 8592 connection on non-Windows systems. 8593 8594- bpo-35062: Fix incorrect parsing of 8595 :class:`_io.IncrementalNewlineDecoder`'s *translate* argument. 8596 8597- bpo-35065: Remove `StreamReaderProtocol._untrack_reader`. The call to 8598 `_untrack_reader` is currently performed too soon, causing the protocol to 8599 forget about the reader before `connection_lost` can run and feed the EOF 8600 to the reader. 8601 8602- bpo-34160: ElementTree and minidom now preserve the attribute order 8603 specified by the user. 8604 8605- bpo-35079: Improve difflib.SequenceManager.get_matching_blocks doc by 8606 adding 'non-overlapping' and changing '!=' to '<'. 8607 8608- bpo-33710: Deprecated ``l*gettext()`` functions and methods in the 8609 :mod:`gettext` module. They return encoded bytes instead of Unicode 8610 strings and are artifacts from Python 2 times. Also deprecated functions 8611 and methods related to setting the charset for ``l*gettext()`` functions 8612 and methods. 8613 8614- bpo-35017: :meth:`socketserver.BaseServer.serve_forever` now exits 8615 immediately if it's :meth:`~socketserver.BaseServer.shutdown` method is 8616 called while it is polling for new events. 8617 8618- bpo-35024: `importlib` no longer logs `wrote <bytecode path>` redundantly 8619 after `(created|could not create) <bytecode path>` is already logged. 8620 Patch by Quentin Agren. 8621 8622- bpo-35047: ``unittest.mock`` now includes mock calls in exception messages 8623 if ``assert_not_called``, ``assert_called_once``, or 8624 ``assert_called_once_with`` fails. Patch by Petter Strandmark. 8625 8626- bpo-31047: Fix ``ntpath.abspath`` regression where it didn't remove a 8627 trailing separator on Windows. Patch by Tim Graham. 8628 8629- bpo-35053: tracemalloc now tries to update the traceback when an object is 8630 reused from a "free list" (optimization for faster object creation, used 8631 by the builtin list type for example). 8632 8633- bpo-31553: Add the --json-lines option to json.tool. Patch by hongweipeng. 8634 8635- bpo-34794: Fixed a leak in Tkinter when pass the Python wrapper around 8636 Tcl_Obj back to Tcl/Tk. 8637 8638- bpo-34909: Enum: fix grandchildren subclassing when parent mixed with 8639 concrete data types. 8640 8641- bpo-35022: :class:`unittest.mock.MagicMock` now supports the 8642 ``__fspath__`` method (from :class:`os.PathLike`). 8643 8644- bpo-35008: Fixed references leaks when call the ``__setstate__()`` method 8645 of :class:`xml.etree.ElementTree.Element` in the C implementation for 8646 already initialized element. 8647 8648- bpo-23420: Verify the value for the parameter '-s' of the cProfile CLI. 8649 Patch by Robert Kuska 8650 8651- bpo-33947: dataclasses now handle recursive reprs without raising 8652 RecursionError. 8653 8654- bpo-34890: Make :func:`inspect.iscoroutinefunction`, 8655 :func:`inspect.isgeneratorfunction` and :func:`inspect.isasyncgenfunction` 8656 work with :func:`functools.partial`. Patch by Pablo Galindo. 8657 8658- bpo-34521: Use :func:`socket.CMSG_SPACE` to calculate ancillary data size 8659 instead of :func:`socket.CMSG_LEN` in 8660 :func:`multiprocessing.reduction.recvfds` as :rfc:`3542` requires the use 8661 of the former for portable applications. 8662 8663- bpo-31522: The `mailbox.mbox.get_string` function *from_* parameter can 8664 now successfully be set to a non-default value. 8665 8666- bpo-34970: Protect tasks weak set manipulation in ``asyncio.all_tasks()`` 8667 8668- bpo-34969: gzip: Add --fast, --best on the gzip CLI, these parameters will 8669 be used for the fast compression method (quick) or the best method 8670 compress (slower, but smaller file). Also, change the default compression 8671 level to 6 (tradeoff). 8672 8673- bpo-16965: The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file 8674 with mode ``'rb'``. Patch by Zackery Spytz. 8675 8676- bpo-34966: :mod:`pydoc` now supports aliases not only to methods defined 8677 in the end class, but also to inherited methods. The docstring is not 8678 duplicated for aliases. 8679 8680- bpo-34926: :meth:`mimetypes.MimeTypes.guess_type` now accepts 8681 :term:`path-like object` in addition to url strings. Patch by Mayank 8682 Asthana. 8683 8684- bpo-23831: Add ``moveto()`` method to the ``tkinter.Canvas`` widget. Patch 8685 by Juliette Monsel. 8686 8687- bpo-34941: Methods ``find()``, ``findtext()`` and ``findall()`` of the 8688 ``Element`` class in the :mod:`xml.etree.ElementTree` module are now able 8689 to find children which are instances of ``Element`` subclasses. 8690 8691- bpo-32680: :class:`smtplib.SMTP` objects now always have a `sock` 8692 attribute present 8693 8694- bpo-34769: Fix for async generators not finalizing when event loop is in 8695 debug mode and garbage collector runs in another thread. 8696 8697- bpo-34936: Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. 8698 Patch by Juliette Monsel. 8699 8700- bpo-34829: Add methods ``selection_from``, ``selection_range``, 8701 ``selection_present`` and ``selection_to`` to the ``tkinter.Spinbox`` for 8702 consistency with the ``tkinter.Entry`` widget. Patch by Juliette Monsel. 8703 8704- bpo-34911: Added *secure_protocols* argument to 8705 *http.cookiejar.DefaultCookiePolicy* to allow for tweaking of protocols 8706 and also to add support by default for *wss*, the secure websocket 8707 protocol. 8708 8709- bpo-34922: Fixed integer overflow in the :meth:`~hashlib.shake.digest()` 8710 and :meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm in 8711 the :mod:`hashlib` module. 8712 8713- bpo-34925: 25% speedup in argument parsing for the functions in the bisect 8714 module. 8715 8716- bpo-34900: Fixed :meth:`unittest.TestCase.debug` when used to call test 8717 methods with subtests. Patch by Bruno Oliveira. 8718 8719- bpo-34844: logging.Formatter enhancement - Ensure styles and fmt matches 8720 in logging.Formatter - Added validate method in each format style class: 8721 StrFormatStyle, PercentStyle, StringTemplateStyle. - This method is called 8722 in the constructor of logging.Formatter class - Also re-raise the KeyError 8723 in the format method of each style class, so it would a bit clear that 8724 it's an error with the invalid format fields. 8725 8726- bpo-34897: Adjust test.support.missing_compiler_executable check so that a 8727 nominal command name of "" is ignored. Patch by Michael Felt. 8728 8729- bpo-34871: Fix inspect module polluted ``sys.modules`` when parsing 8730 ``__text_signature__`` of callable. 8731 8732- bpo-34898: Add `mtime` argument to `gzip.compress` for reproducible 8733 output. Patch by Guo Ci Teo. 8734 8735- bpo-28441: On Cygwin and MinGW, ensure that ``sys.executable`` always 8736 includes the full filename in the path, including the ``.exe`` suffix 8737 (unless it is a symbolic link). 8738 8739- bpo-34866: Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS 8740 attacks harder by limiting the number of ``MiniFieldStorage`` objects 8741 created by ``FieldStorage``. 8742 8743- bpo-34711: http.server ensures it reports HTTPStatus.NOT_FOUND when the 8744 local path ends with "/" and is not a directory, even if the underlying OS 8745 (e.g. AIX) accepts such paths as a valid file reference. Patch by Michael 8746 Felt. 8747 8748- bpo-34872: Fix self-cancellation in C implementation of asyncio.Task 8749 8750- bpo-34849: Don't log waiting for ``selector.select`` in asyncio loop 8751 iteration. The waiting is pretty normal for any asyncio program, logging 8752 its time just adds a noise to logs without any useful information 8753 provided. 8754 8755- bpo-34022: The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer 8756 overrides the value of the *invalidation_mode* argument to 8757 :func:`py_compile.compile`, and determines its default value instead. 8758 8759- bpo-34819: Use a monotonic clock to compute timeouts in 8760 :meth:`Executor.map` and :func:`as_completed`, in order to prevent 8761 timeouts from deviating when the system clock is adjusted. 8762 8763- bpo-34758: Add .wasm -> application/wasm to list of recognized file types 8764 and content type headers 8765 8766- bpo-34789: :func:`xml.sax.make_parser` now accepts any iterable as its 8767 *parser_list* argument. Patch by Andrés Delfino. 8768 8769- bpo-34334: In :class:`QueueHandler`, clear `exc_text` from 8770 :class:`LogRecord` to prevent traceback from being written twice. 8771 8772- bpo-34687: On Windows, asyncio now uses ProactorEventLoop, instead of 8773 SelectorEventLoop, by default. 8774 8775- bpo-5950: Support reading zip files with archive comments in 8776 :mod:`zipimport`. 8777 8778- bpo-32892: The parser now represents all constants as 8779 :class:`ast.Constant` instead of using specific constant AST types 8780 (``Num``, ``Str``, ``Bytes``, ``NameConstant`` and ``Ellipsis``). These 8781 classes are considered deprecated and will be removed in future Python 8782 versions. 8783 8784- bpo-34728: Add deprecation warning when `loop` is used in methods: 8785 `asyncio.sleep`, `asyncio.wait` and `asyncio.wait_for`. 8786 8787- bpo-34738: ZIP files created by :mod:`distutils` will now include entries 8788 for directories. 8789 8790- bpo-34659: Add an optional *initial* argument to itertools.accumulate(). 8791 8792- bpo-29577: Support multiple mixin classes when creating Enums. 8793 8794- bpo-34670: Add SSLContext.post_handshake_auth and 8795 SSLSocket.verify_client_post_handshake for TLS 1.3's post handshake 8796 authentication feature. 8797 8798- bpo-32718: The Activate.ps1 script from venv works with PowerShell Core 8799 6.1 and is now available under all operating systems. 8800 8801- bpo-31177: Fix bug that prevented using :meth:`reset_mock 8802 <unittest.mock.Mock.reset_mock>` on mock instances with deleted attributes 8803 8804- bpo-34672: Add a workaround, so the ``'Z'`` :func:`time.strftime` 8805 specifier on the musl C library can work in some cases. 8806 8807- bpo-34666: Implement ``asyncio.StreamWriter.awrite`` and 8808 ``asyncio.StreamWriter.aclose()`` coroutines. Methods are needed for 8809 providing a consistent stream API with control flow switched on by 8810 default. 8811 8812- bpo-6721: Acquire the logging module's commonly used internal locks while 8813 fork()ing to avoid deadlocks in the child process. 8814 8815- bpo-34658: Fix a rare interpreter unhandled exception state SystemError 8816 only seen when using subprocess with a preexec_fn while an after_parent 8817 handler has been registered with os.register_at_fork and the fork system 8818 call fails. 8819 8820- bpo-34652: Ensure :func:`os.lchmod` is never defined on Linux. 8821 8822- bpo-34638: Store a weak reference to stream reader to break strong 8823 references loop between reader and protocol. It allows to detect and 8824 close the socket if the stream is deleted (garbage collected) without 8825 ``close()`` call. 8826 8827- bpo-34536: `Enum._missing_`: raise `ValueError` if None returned and 8828 `TypeError` if non-member is returned. 8829 8830- bpo-34636: Speed up re scanning of many non-matching characters for \s \w 8831 and \d within bytes objects. (microoptimization) 8832 8833- bpo-24412: Add :func:`~unittest.addModuleCleanup()` and 8834 :meth:`~unittest.TestCase.addClassCleanup()` to unittest to support 8835 cleanups for :func:`~unittest.setUpModule()` and 8836 :meth:`~unittest.TestCase.setUpClass()`. Patch by Lisa Roach. 8837 8838- bpo-34630: Don't log SSL certificate errors in asyncio code (connection 8839 error logging is skipped already). 8840 8841- bpo-32490: Prevent filename duplication in :mod:`subprocess` exception 8842 messages. Patch by Zackery Spytz. 8843 8844- bpo-34363: dataclasses.asdict() and .astuple() now handle namedtuples 8845 correctly. 8846 8847- bpo-34625: Update vendorized expat library version to 2.2.6. 8848 8849- bpo-32270: The subprocess module no longer mistakenly closes redirected 8850 fds even when they were in pass_fds when outside of the default {0, 1, 2} 8851 set. 8852 8853- bpo-34622: Create a dedicated ``asyncio.CancelledError``, 8854 ``asyncio.InvalidStateError`` and ``asyncio.TimeoutError`` exception 8855 classes. Inherit them from corresponding exceptions from 8856 ``concurrent.futures`` package. Extract ``asyncio`` exceptions into a 8857 separate file. 8858 8859- bpo-34610: Fixed iterator of :class:`multiprocessing.managers.DictProxy`. 8860 8861- bpo-34421: Fix distutils logging for non-ASCII strings. This caused 8862 installation issues on Windows. 8863 8864- bpo-34604: Fix possible mojibake in the error message of `pwd.getpwnam` 8865 and `grp.getgrnam` using string representation because of invisible 8866 characters or trailing whitespaces. Patch by William Grzybowski. 8867 8868- bpo-30977: Make uuid.UUID use ``__slots__`` to reduce its memory 8869 footprint. Based on original patch by Wouter Bolsterlee. 8870 8871- bpo-34574: OrderedDict iterators are not exhausted during pickling 8872 anymore. Patch by Sergey Fedoseev. 8873 8874- bpo-8110: Refactored :mod:`subprocess` to check for Windows-specific 8875 modules rather than ``sys.platform == 'win32'``. 8876 8877- bpo-34530: ``distutils.spawn.find_executable()`` now falls back on 8878 :data:`os.defpath` if the ``PATH`` environment variable is not set. 8879 8880- bpo-34563: On Windows, fix multiprocessing.Connection for very large read: 8881 fix _winapi.PeekNamedPipe() and _winapi.ReadFile() for read larger than 8882 INT_MAX (usually 2^31-1). 8883 8884- bpo-34558: Correct typo in Lib/ctypes/_aix.py 8885 8886- bpo-34282: Move ``Enum._convert`` to ``EnumMeta._convert_`` and fix enum 8887 members getting shadowed by parent attributes. 8888 8889- bpo-22872: When the queue is closed, :exc:`ValueError` is now raised by 8890 :meth:`multiprocessing.Queue.put` and :meth:`multiprocessing.Queue.get` 8891 instead of :exc:`AssertionError` and :exc:`OSError`, respectively. Patch 8892 by Zackery Spytz. 8893 8894- bpo-34515: Fix parsing non-ASCII identifiers in 8895 :mod:`lib2to3.pgen2.tokenize` (PEP 3131). 8896 8897- bpo-13312: Avoids a possible integer underflow (undefined behavior) in the 8898 time module's year handling code when passed a very low negative year 8899 value. 8900 8901- bpo-34472: Improved compatibility for streamed files in :mod:`zipfile`. 8902 Previously an optional signature was not being written and certain ZIP 8903 applications were not supported. Patch by Silas Sewell. 8904 8905- bpo-34454: Fix the .fromisoformat() methods of datetime types crashing 8906 when given unicode with non-UTF-8-encodable code points. Specifically, 8907 datetime.fromisoformat() now accepts surrogate unicode code points used as 8908 the separator. Report and tests by Alexey Izbyshev, patch by Paul Ganssle. 8909 8910- bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks. 8911 Patch by Vladimir Matveev. 8912 8913- bpo-34171: Running the :mod:`trace` module no longer creates the 8914 ``trace.cover`` file. 8915 8916- bpo-34441: Fix crash when an ``ABC``-derived class with invalid 8917 ``__subclasses__`` is passed as the second argument to 8918 :func:`issubclass()`. Patch by Alexey Izbyshev. 8919 8920- bpo-34427: Fix infinite loop in ``a.extend(a)`` for ``MutableSequence`` 8921 subclasses. 8922 8923- bpo-34412: Make :func:`signal.strsignal` work on HP-UX. Patch by Michael 8924 Osipov. 8925 8926- bpo-20849: shutil.copytree now accepts a new ``dirs_exist_ok`` keyword 8927 argument. Patch by Josh Bronson. 8928 8929- bpo-31715: Associate ``.mjs`` file extension with 8930 ``application/javascript`` MIME Type. 8931 8932- bpo-34384: :func:`os.readlink` now accepts :term:`path-like <path-like 8933 object>` and :class:`bytes` objects on Windows. 8934 8935- bpo-22602: The UTF-7 decoder now raises :exc:`UnicodeDecodeError` for 8936 ill-formed sequences starting with "+" (as specified in RFC 2152). Patch 8937 by Zackery Spytz. 8938 8939- bpo-2122: The :meth:`mmap.flush() <mmap.mmap.flush>` method now returns 8940 ``None`` on success, raises an exception on error under all platforms. 8941 8942- bpo-34341: Appending to the ZIP archive with the ZIP64 extension no longer 8943 grows the size of extra fields of existing entries. 8944 8945- bpo-34333: Fix %-formatting in :meth:`pathlib.PurePath.with_suffix` when 8946 formatting an error message. 8947 8948- bpo-18540: The :class:`imaplib.IMAP4` and :class:`imaplib.IMAP4_SSL` 8949 classes now resolve to the local host IP correctly when the default value 8950 of *host* parameter (``''``) is used. 8951 8952- bpo-26502: Implement ``traceback.FrameSummary.__len__()`` method to 8953 preserve compatibility with the old tuple API. 8954 8955- bpo-34318: :func:`~unittest.TestCase.assertRaises`, 8956 :func:`~unittest.TestCase.assertRaisesRegex`, 8957 :func:`~unittest.TestCase.assertWarns` and 8958 :func:`~unittest.TestCase.assertWarnsRegex` no longer success if the 8959 passed callable is None. They no longer ignore unknown keyword arguments 8960 in the context manager mode. A DeprecationWarning was raised in these 8961 cases since Python 3.5. 8962 8963- bpo-9372: Deprecate :meth:`__getitem__` methods of 8964 :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper` 8965 and :class:`fileinput.FileInput`. 8966 8967- bpo-33613: Fix a race condition in ``multiprocessing.semaphore_tracker`` 8968 when the tracker receives SIGINT before it can register signal handlers 8969 for ignoring it. 8970 8971- bpo-34248: Report filename in the exception raised when the database file 8972 cannot be opened by :func:`dbm.gnu.open` and :func:`dbm.ndbm.open` due to 8973 OS-related error. Patch by Zsolt Cserna. 8974 8975- bpo-33089: Add math.dist() to compute the Euclidean distance between two 8976 points. 8977 8978- bpo-34246: :meth:`smtplib.SMTP.send_message` no longer modifies the 8979 content of the *mail_options* argument. Patch by Pablo S. Blum de Aguiar. 8980 8981- bpo-31047: Fix ``ntpath.abspath`` for invalid paths on windows. Patch by 8982 Franz Woellert. 8983 8984- bpo-32321: Add pure Python fallback for functools.reduce. Patch by Robert 8985 Wright. 8986 8987- bpo-34270: The default asyncio task class now always has a name which can 8988 be get or set using two new methods (:meth:`~asyncio.Task.get_name()` and 8989 :meth:`~asyncio.Task.set_name`) and is visible in the :func:`repr` output. 8990 An initial name can also be set using the new ``name`` keyword argument to 8991 :func:`asyncio.create_task` or the 8992 :meth:`~asyncio.AbstractEventLoop.create_task` method of the event loop. 8993 If no initial name is set, the default Task implementation generates a 8994 name like ``Task-1`` using a monotonic counter. 8995 8996- bpo-34263: asyncio's event loop will not pass timeouts longer than one day 8997 to epoll/select etc. 8998 8999- bpo-34035: Fix several AttributeError in zipfile seek() methods. Patch by 9000 Mickaël Schoentgen. 9001 9002- bpo-32215: Fix performance regression in :mod:`sqlite3` when a DML 9003 statement appeared in a different line than the rest of the SQL query. 9004 9005- bpo-34075: Deprecate passing non-ThreadPoolExecutor instances to 9006 :meth:`AbstractEventLoop.set_default_executor`. 9007 9008- bpo-34251: Restore ``msilib.Win64`` to preserve backwards compatibility 9009 since it's already used by :mod:`distutils`' ``bdist_msi`` command. 9010 9011- bpo-19891: Ignore errors caused by missing / non-writable homedir while 9012 writing history during exit of an interactive session. Patch by Anthony 9013 Sottile. 9014 9015- bpo-33089: Enhanced math.hypot() to support more than two dimensions. 9016 9017- bpo-34228: tracemalloc: PYTHONTRACEMALLOC=0 environment variable and -X 9018 tracemalloc=0 command line option are now allowed to disable explicitly 9019 tracemalloc at startup. 9020 9021- bpo-13041: Use :func:`shutil.get_terminal_size` to calculate the terminal 9022 width correctly in the ``argparse.HelpFormatter`` class. Initial patch by 9023 Zbyszek Jędrzejewski-Szmek. 9024 9025- bpo-34213: Allow frozen dataclasses to have a field named "object". 9026 Previously this conflicted with an internal use of "object". 9027 9028- bpo-34052: :meth:`sqlite3.Connection.create_aggregate`, 9029 :meth:`sqlite3.Connection.create_function`, 9030 :meth:`sqlite3.Connection.set_authorizer`, 9031 :meth:`sqlite3.Connection.set_progress_handler` methods raises TypeError 9032 when unhashable objects are passed as callable. These methods now don't 9033 pass such objects to SQLite API. Previous behavior could lead to 9034 segfaults. Patch by Sergey Fedoseev. 9035 9036- bpo-34197: Attributes *skipinitialspace*, *doublequote* and *strict* of 9037 the *dialect* attribute of the :mod:`csv` reader are now :class:`bool` 9038 instances instead of integers 0 or 1. 9039 9040- bpo-32788: Errors other than :exc:`TypeError` raised in methods 9041 ``__adapt__()`` and ``__conform__()`` in the :mod:`sqlite3` module are now 9042 propagated to the user. 9043 9044- bpo-21446: The :2to3fixer:`reload` fixer now uses :func:`importlib.reload` 9045 instead of deprecated :func:`imp.reload`. 9046 9047- bpo-940286: pydoc's ``Helper.showtopic()`` method now prints the cross 9048 references of a topic correctly. 9049 9050- bpo-34164: :func:`base64.b32decode` could raise UnboundLocalError or 9051 OverflowError for incorrect padding. Now it always raises 9052 :exc:`base64.Error` in these cases. 9053 9054- bpo-33729: Fixed issues with arguments parsing in :mod:`hashlib`. 9055 9056- bpo-34097: ZipFile can zip files older than 1980-01-01 and newer than 9057 2107-12-31 using a new ``strict_timestamps`` parameter at the cost of 9058 setting the timestamp to the limit. 9059 9060- bpo-34108: Remove extraneous CR in 2to3 refactor. 9061 9062- bpo-34070: Make sure to only check if the handle is a tty, when opening a 9063 file with ``buffering=-1``. 9064 9065- bpo-27494: Reverted :issue:`27494`. 2to3 rejects now a trailing comma in 9066 generator expressions. 9067 9068- bpo-33967: functools.singledispatch now raises TypeError instead of 9069 IndexError when no positional arguments are passed. 9070 9071- bpo-34041: Add the parameter *deterministic* to the 9072 :meth:`sqlite3.Connection.create_function` method. Patch by Sergey 9073 Fedoseev. 9074 9075- bpo-34056: Ensure the loader shim created by ``imp.load_module`` always 9076 returns bytes from its ``get_data()`` function. This fixes using 9077 ``imp.load_module`` with :pep:`552` hash-based pycs. 9078 9079- bpo-34054: The multiprocessing module now uses the monotonic clock 9080 :func:`time.monotonic` instead of the system clock :func:`time.time` to 9081 implement timeout. 9082 9083- bpo-34043: Optimize tarfile uncompress performance about 15% when gzip is 9084 used. 9085 9086- bpo-34044: ``subprocess.Popen`` now copies the *startupinfo* argument to 9087 leave it unchanged: it will modify the copy, so that the same 9088 ``STARTUPINFO`` object can be used multiple times. 9089 9090- bpo-34010: Fixed a performance regression for reading streams with 9091 tarfile. The buffered read should use a list, instead of appending to a 9092 bytes object. 9093 9094- bpo-34019: webbrowser: Correct the arguments passed to Opera Browser when 9095 opening a new URL using the ``webbrowser`` module. Patch by Bumsik Kim. 9096 9097- bpo-34003: csv.DictReader now creates dicts instead of OrderedDicts. Patch 9098 by Michael Selik. 9099 9100- bpo-33978: Closed existing logging handlers before reconfiguration via 9101 fileConfig and dictConfig. Patch by Karthikeyan Singaravelan. 9102 9103- bpo-14117: Make minor tweaks to turtledemo. The 'wikipedia' example is now 9104 'rosette', describing what it draws. The 'penrose' print output is 9105 reduced. The'1024' output of 'tree' is eliminated. 9106 9107- bpo-33974: Fixed passing lists and tuples of strings containing special 9108 characters ``"``, ``\``, ``{``, ``}`` and ``\n`` as options to 9109 :mod:`~tkinter.ttk` widgets. 9110 9111- bpo-27500: Fix getaddrinfo to resolve IPv6 addresses correctly. 9112 9113- bpo-24567: Improve random.choices() to handle subnormal input weights that 9114 could occasionally trigger an IndexError. 9115 9116- bpo-33871: Fixed integer overflow in :func:`os.readv`, :func:`os.writev`, 9117 :func:`os.preadv` and :func:`os.pwritev` and in :func:`os.sendfile` with 9118 *headers* or *trailers* arguments (on BSD-based OSes and macOS). 9119 9120- bpo-25007: Add :func:`copy.copy` and :func:`copy.deepcopy` support to zlib 9121 compressors and decompressors. Patch by Zackery Spytz. 9122 9123- bpo-33929: multiprocessing: Fix a race condition in Popen of 9124 multiprocessing.popen_spawn_win32. The child process now duplicates the 9125 read end of pipe instead of "stealing" it. Previously, the read end of 9126 pipe was "stolen" by the child process, but it leaked a handle if the 9127 child process had been terminated before it could steal the handle from 9128 the parent process. 9129 9130- bpo-33899: Tokenize module now implicitly emits a NEWLINE when provided 9131 with input that does not have a trailing new line. This behavior now 9132 matches what the C tokenizer does internally. Contributed by Ammar Askar. 9133 9134- bpo-33897: Added a 'force' keyword argument to logging.basicConfig(). 9135 9136- bpo-33695: :func:`shutil.copytree` uses :func:`os.scandir` function and 9137 all copy functions depending from it use cached :func:`os.stat` values. 9138 The speedup for copying a directory with 8000 files is around +9% on 9139 Linux, +20% on Windows and + 30% on a Windows SMB share. Also the number 9140 of :func:`os.stat` syscalls is reduced by 38% making 9141 :func:`shutil.copytree` especially faster on network filesystems. 9142 (Contributed by Giampaolo Rodola' in :issue:`33695`.) 9143 9144- bpo-33916: bz2 and lzma: When Decompressor.__init__() is called twice, 9145 free the old lock to not leak memory. 9146 9147- bpo-32568: Make select.epoll() and its documentation consistent regarding 9148 *sizehint* and *flags*. 9149 9150- bpo-33833: Fixed bug in asyncio where ProactorSocketTransport logs 9151 AssertionError if force closed during write. 9152 9153- bpo-33663: Convert content length to string before putting to header. 9154 9155- bpo-33721: :mod:`os.path` functions that return a boolean result like 9156 :func:`~os.path.exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`, 9157 :func:`~os.path.isfile`, :func:`~os.path.islink`, and 9158 :func:`~os.path.ismount`, and :mod:`pathlib.Path` methods that return a 9159 boolean result like :meth:`~pathlib.Path.exists()`, 9160 :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib.Path.is_file()`, 9161 :meth:`~pathlib.Path.is_mount()`, :meth:`~pathlib.Path.is_symlink()`, 9162 :meth:`~pathlib.Path.is_block_device()`, 9163 :meth:`~pathlib.Path.is_char_device()`, :meth:`~pathlib.Path.is_fifo()`, 9164 :meth:`~pathlib.Path.is_socket()` now return ``False`` instead of raising 9165 :exc:`ValueError` or its subclasses :exc:`UnicodeEncodeError` and 9166 :exc:`UnicodeDecodeError` for paths that contain characters or bytes 9167 unrepresentable at the OS level. 9168 9169- bpo-26544: Fixed implementation of :func:`platform.libc_ver`. It almost 9170 always returned version '2.9' for glibc. 9171 9172- bpo-33843: Remove deprecated ``cgi.escape``, ``cgi.parse_qs`` and 9173 ``cgi.parse_qsl``. 9174 9175- bpo-33842: Remove ``tarfile.filemode`` which is deprecated since Python 9176 3.3. 9177 9178- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by 9179 Steve Weber. 9180 9181- bpo-33805: Improve error message of dataclasses.replace() when an InitVar 9182 is not specified 9183 9184- bpo-33687: Fix the call to ``os.chmod()`` for ``uu.decode()`` if a mode is 9185 given or decoded. Patch by Timo Furrer. 9186 9187- bpo-33812: Datetime instance d with non-None tzinfo, but with 9188 d.tzinfo.utcoffset(d) returning None is now treated as naive by the 9189 astimezone() method. 9190 9191- bpo-32108: In configparser, don't clear section when it is assigned to 9192 itself. 9193 9194- bpo-27397: Make email module properly handle invalid-length base64 9195 strings. 9196 9197- bpo-33578: Implement multibyte encoder/decoder state methods 9198 9199- bpo-30805: Avoid race condition with debug logging 9200 9201- bpo-33476: Fix _header_value_parser.py when address group is missing final 9202 ';'. Contributed by Enrique Perez-Terron 9203 9204- bpo-33694: asyncio: Fix a race condition causing data loss on 9205 pause_reading()/resume_reading() when using the ProactorEventLoop. 9206 9207- bpo-32493: Correct test for ``uuid_enc_be`` availability in 9208 ``configure.ac``. Patch by Michael Felt. 9209 9210- bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and 9211 asyncio.WindowsProactorEventLoopPolicy. 9212 9213- bpo-33274: W3C DOM Level 1 specifies return value of 9214 Element.removeAttributeNode() as "The Attr node that was removed." 9215 xml.dom.minidom now complies with this requirement. 9216 9217- bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0. 9218 9219- bpo-33165: Added a stacklevel parameter to logging calls to allow use of 9220 wrapper/helper functions for logging APIs. 9221 9222- bpo-33770: improve base64 exception message for encoded inputs of invalid 9223 length 9224 9225- bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case 9226 of an unhandled error; mark SSLTransport as closed if it is aborted. 9227 9228- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence 9229 operations now raise :exc:`TypeError` instead of :exc:`SystemError` when 9230 performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz. 9231 9232- bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake 9233 timeout 9234 9235- bpo-31014: Fixed creating a controller for :mod:`webbrowser` when a user 9236 specifies a path to an entry in the BROWSER environment variable. Based 9237 on patch by John Still. 9238 9239- bpo-2504: Add gettext.pgettext() and variants. 9240 9241- bpo-33197: Add description property for _ParameterKind 9242 9243- bpo-32751: When cancelling the task due to a timeout, 9244 :meth:`asyncio.wait_for` will now wait until the cancellation is complete. 9245 9246- bpo-32684: Fix gather to propagate cancellation of itself even with 9247 return_exceptions. 9248 9249- bpo-33654: Support protocol type switching in SSLTransport.set_protocol(). 9250 9251- bpo-33674: Pause the transport as early as possible to further reduce the 9252 risk of data_received() being called before connection_made(). 9253 9254- bpo-33671: :func:`shutil.copyfile`, :func:`shutil.copy`, 9255 :func:`shutil.copy2`, :func:`shutil.copytree` and :func:`shutil.move` use 9256 platform-specific fast-copy syscalls on Linux and macOS in order to copy 9257 the file more efficiently. On Windows :func:`shutil.copyfile` uses a 9258 bigger default buffer size (1 MiB instead of 16 KiB) and a 9259 :func:`memoryview`-based variant of :func:`shutil.copyfileobj` is used. 9260 The speedup for copying a 512MiB file is about +26% on Linux, +50% on 9261 macOS and +40% on Windows. Also, much less CPU cycles are consumed. 9262 (Contributed by Giampaolo Rodola' in :issue:`25427`.) 9263 9264- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of 9265 asyncio.sslproto: start immediately the handshake instead of using 9266 call_soon(). Previously, data_received() could be called before the 9267 handshake started, causing the handshake to hang or fail. 9268 9269- bpo-31647: Fixed bug where calling write_eof() on a 9270 _SelectorSocketTransport after it's already closed raises AttributeError. 9271 9272- bpo-32610: Make asyncio.all_tasks() return only pending tasks. 9273 9274- bpo-32410: Avoid blocking on file IO in sendfile fallback code 9275 9276- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor 9277 9278- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines 9279 9280- bpo-33654: Fix transport.set_protocol() to support switching between 9281 asyncio.Protocol and asyncio.BufferedProtocol. Fix loop.start_tls() to 9282 work with asyncio.BufferedProtocols. 9283 9284- bpo-33652: Pickles of type variables and subscripted generics are now 9285 future-proof and compatible with older Python versions. 9286 9287- bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD. 9288 9289- bpo-33238: Add ``InvalidStateError`` to :mod:`concurrent.futures`. 9290 ``Future.set_result`` and ``Future.set_exception`` now raise 9291 ``InvalidStateError`` if the futures are not pending or running. Patch by 9292 Jason Haydaman. 9293 9294- bpo-33618: Finalize and document preliminary and experimental TLS 1.3 9295 support with OpenSSL 1.1.1 9296 9297- bpo-33625: Release GIL on `grp.getgrnam`, `grp.getgrgid`, `pwd.getpwnam` 9298 and `pwd.getpwuid` if reentrant variants of these functions are available. 9299 Patch by William Grzybowski. 9300 9301- bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ 9302 9303- bpo-11874: Use a better regex when breaking usage into wrappable parts. 9304 Avoids bogus assertion errors from custom metavar strings. 9305 9306- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder 9307 that prevented the cache of parsed strings from clearing after finishing 9308 the decoding. Based on patch by c-fos. 9309 9310- bpo-33604: Remove HMAC default to md5 marked for removal in 3.8 (removal 9311 originally planned in 3.6, bump to 3.8 in gh-7062). 9312 9313- bpo-33582: Emit a deprecation warning for inspect.formatargspec 9314 9315- bpo-21145: Add ``functools.cached_property`` decorator, for computed 9316 properties cached for the life of the instance. 9317 9318- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with 9319 OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers 9320 enabled by default. 9321 9322- bpo-28556: Do not simplify arguments to `typing.Union`. Now 9323 `Union[Manager, Employee]` is not simplified to `Employee` at runtime. 9324 Such simplification previously caused several bugs and limited 9325 possibilities for introspection. 9326 9327- bpo-12486: :func:`tokenize.generate_tokens` is now documented as a public 9328 API to tokenize unicode strings. It was previously present but 9329 undocumented. 9330 9331- bpo-33540: Add a new ``block_on_close`` class attribute to 9332 ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`. 9333 9334- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP 9335 locations 9336 9337- bpo-33109: argparse subparsers are once again not required by default, 9338 reverting the change in behavior introduced by bpo-26510 in 3.7.0a2. 9339 9340- bpo-33541: Remove unused private method ``_strptime.LocaleTime.__pad`` 9341 (a.k.a. ``_LocaleTime__pad``). 9342 9343- bpo-33536: dataclasses.make_dataclass now checks for invalid field names 9344 and duplicate fields. Also, added a check for invalid field 9345 specifications. 9346 9347- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on 9348 Windows. Patch by Zvi Effron 9349 9350- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in 9351 Windows proactor event loop. 9352 9353- Fix failure in `typing.get_type_hints()` when ClassVar was provided as a 9354 string forward reference. 9355 9356- bpo-33516: :class:`unittest.mock.MagicMock` now supports the ``__round__`` 9357 magic method. 9358 9359- bpo-28612: Added support for Site Maps to urllib's ``RobotFileParser`` as 9360 :meth:`RobotFileParser.site_maps() 9361 <urllib.robotparser.RobotFileParser.site_maps>`. Patch by Lady Red, based 9362 on patch by Peter Wirtz. 9363 9364- bpo-28167: Remove platform.linux_distribution, which was deprecated since 9365 3.5. 9366 9367- bpo-33504: Switch the default dictionary implementation for 9368 :mod:`configparser` from :class:`collections.OrderedDict` to the standard 9369 :class:`dict` type. 9370 9371- bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x 9372 faster. 9373 9374- bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in 9375 FieldStorage use the given errors (needed for Twisted). Patch by Amber 9376 Brown. 9377 9378- bpo-29235: The :class:`cProfile.Profile` class can now be used as a 9379 context manager. Patch by Scott Sanderson. 9380 9381- bpo-33495: Change dataclasses.Fields repr to use the repr of each of its 9382 members, instead of str. This makes it more clear what each field 9383 actually represents. This is especially true for the 'type' member. 9384 9385- bpo-26103: Correct ``inspect.isdatadescriptor`` to look for ``__set__`` or 9386 ``__delete__``. Patch by Aaron Hall. 9387 9388- bpo-29209: Removed the ``doctype()`` method and the *html* parameter of 9389 the constructor of :class:`~xml.etree.ElementTree.XMLParser`. The 9390 ``doctype()`` method defined in a subclass will no longer be called. 9391 Deprecated methods ``getchildren()`` and ``getiterator()`` in the 9392 :mod:`~xml.etree.ElementTree` module emit now a :exc:`DeprecationWarning` 9393 instead of :exc:`PendingDeprecationWarning`. 9394 9395- bpo-33453: Fix dataclasses to work if using literal string type 9396 annotations or if using PEP 563 "Postponed Evaluation of Annotations". 9397 Only specific string prefixes are detected for both ClassVar ("ClassVar" 9398 and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar"). 9399 9400- bpo-28556: Minor fixes in typing module: add annotations to 9401 ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in 9402 ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova. 9403 9404- bpo-33365: Print the header values besides the header keys instead just 9405 the header keys if *debuglevel* is set to >0 in :mod:`http.client`. Patch 9406 by Marco Strigl. 9407 9408- bpo-20087: Updated alias mapping with glibc 2.27 supported locales. 9409 9410- bpo-33422: Fix trailing quotation marks getting deleted when looking up 9411 byte/string literals on pydoc. Patch by Andrés Delfino. 9412 9413- bpo-28167: The function ``platform.linux_distribution`` and 9414 ``platform.dist`` now trigger a ``DeprecationWarning`` and have been 9415 marked for removal in Python 3.8 9416 9417- bpo-33281: Fix ctypes.util.find_library regression on macOS. 9418 9419- bpo-33311: Text and html output generated by cgitb does not display 9420 parentheses if the current call is done directly in the module. Patch by 9421 Stéphane Blondon. 9422 9423- bpo-27300: The file classes in *tempfile* now accept an *errors* parameter 9424 that complements the already existing *encoding*. Patch by Stephan Hohe. 9425 9426- bpo-32933: :func:`unittest.mock.mock_open` now supports iteration over the 9427 file contents. Patch by Tony Flury. 9428 9429- bpo-33217: Raise :exc:`TypeError` when looking up non-Enum objects in Enum 9430 classes and Enum members. 9431 9432- bpo-33197: Update error message when constructing invalid 9433 inspect.Parameters Patch by Dong-hee Na. 9434 9435- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database 9436 object when it is called with a single argument. 9437 9438- bpo-33375: The warnings module now finds the Python file associated with a 9439 warning from the code object, rather than the frame's global namespace. 9440 This is consistent with how tracebacks and pdb find filenames, and should 9441 work better for dynamically executed code. 9442 9443- bpo-33336: ``imaplib`` now allows ``MOVE`` command in ``IMAP4.uid()`` (RFC 9444 6851: IMAP MOVE Extension) and potentially as a name of supported method 9445 of ``IMAP4`` object. 9446 9447- bpo-32455: Added *jump* parameter to :func:`dis.stack_effect`. 9448 9449- bpo-27485: Rename and deprecate undocumented functions in 9450 :func:`urllib.parse`. 9451 9452- bpo-33332: Add ``signal.valid_signals()`` to expose the POSIX sigfillset() 9453 functionality. 9454 9455- bpo-33251: `ConfigParser.items()` was fixed so that key-value pairs passed 9456 in via `vars` are not included in the resulting output. 9457 9458- bpo-33329: Fix multiprocessing regression on newer glibcs 9459 9460- bpo-33334: :func:`dis.stack_effect` now supports all defined opcodes 9461 including NOP and EXTENDED_ARG. 9462 9463- bpo-991266: Fix quoting of the ``Comment`` attribute of 9464 :class:`http.cookies.SimpleCookie`. 9465 9466- bpo-33131: Upgrade bundled version of pip to 10.0.1. 9467 9468- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST 9469 object to a tree of tuples or lists with ``line_info=False`` and 9470 ``col_info=True``. 9471 9472- bpo-23403: lib2to3 now uses pickle protocol 4 for pre-computed grammars. 9473 9474- bpo-33266: lib2to3 now recognizes ``rf'...'`` strings. 9475 9476- bpo-11594: Ensure line-endings are respected when using lib2to3. 9477 9478- bpo-33254: Have :func:`importlib.resources.contents` and 9479 :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable` 9480 instead of an :term:`iterator`. 9481 9482- bpo-33265: ``contextlib.ExitStack`` and ``contextlib.AsyncExitStack`` now 9483 use a method instead of a wrapper function for exit callbacks. 9484 9485- bpo-33263: Fix FD leak in `_SelectorSocketTransport` Patch by Vlad 9486 Starostin. 9487 9488- bpo-33256: Fix display of ``<module>`` call in the html produced by 9489 ``cgitb.html()``. Patch by Stéphane Blondon. 9490 9491- bpo-33144: ``random.Random()`` and its subclassing mechanism got optimized 9492 to check only once at class/subclass instantiation time whether its 9493 ``getrandbits()`` method can be relied on by other methods, including 9494 ``randrange()``, for the generation of arbitrarily large random integers. 9495 Patch by Wolfgang Maier. 9496 9497- bpo-33185: Fixed regression when running pydoc with the :option:`-m` 9498 switch. (The regression was introduced in 3.7.0b3 by the resolution of 9499 :issue:`33053`) 9500 9501 This fix also changed pydoc to add ``os.getcwd()`` to :data:`sys.path` 9502 when necessary, rather than adding ``"."``. 9503 9504- bpo-29613: Added support for the ``SameSite`` cookie flag to the 9505 ``http.cookies`` module. 9506 9507- bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache` 9508 when :meth:`importlib.machinery.invalidate_caches` is called. 9509 9510- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty 9511 sequences consistently even when called from subclasses without a 9512 ``getrandbits()`` implementation. 9513 9514- bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught 9515 StopIteration in a generator into a return-statement. 9516 9517- bpo-33209: End framing at the end of C implementation of 9518 :func:`pickle.Pickler.dump`. 9519 9520- bpo-32861: The urllib.robotparser's ``__str__`` representation now 9521 includes wildcard entries and the "Crawl-delay" and "Request-rate" fields. 9522 Also removes extra newlines that were being appended to the end of the 9523 string. Patch by Michael Lazar. 9524 9525- bpo-23403: ``DEFAULT_PROTOCOL`` in :mod:`pickle` was bumped to 4. Protocol 9526 4 is described in :pep:`3154` and available since Python 3.4. It offers 9527 better performance and smaller size compared to protocol 3 introduced in 9528 Python 3.0. 9529 9530- bpo-20104: Improved error handling and fixed a reference leak in 9531 :func:`os.posix_spawn()`. 9532 9533- bpo-33106: Deleting a key from a read-only dbm database raises module 9534 specific error instead of KeyError. 9535 9536- bpo-33175: In dataclasses, Field.__set_name__ now looks up the 9537 __set_name__ special method on the class, not the instance, of the default 9538 value. 9539 9540- bpo-32380: Create functools.singledispatchmethod to support generic single 9541 dispatch on descriptors and methods. 9542 9543- bpo-33141: Have Field objects pass through __set_name__ to their default 9544 values, if they have their own __set_name__. 9545 9546- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false 9547 boolean value. Note iid=0 and iid=False would be same. Patch by Garvit 9548 Khatri. 9549 9550- bpo-32873: Treat type variables and special typing forms as immutable by 9551 copy and pickle. This fixes several minor issues and inconsistencies, and 9552 improves backwards compatibility with Python 3.6. 9553 9554- bpo-33134: When computing dataclass's __hash__, use the lookup table to 9555 contain the function which returns the __hash__ value. This is an 9556 improvement over looking up a string, and then testing that string to see 9557 what to do. 9558 9559- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1. 9560 9561- bpo-32505: Raise TypeError if a member variable of a dataclass is of type 9562 Field, but doesn't have a type annotation. 9563 9564- bpo-33078: Fix the failure on OSX caused by the tests relying on 9565 sem_getvalue 9566 9567- bpo-33116: Add 'Field' to dataclasses.__all__. 9568 9569- bpo-32896: Fix an error where subclassing a dataclass with a field that 9570 uses a default_factory would generate an incorrect class. 9571 9572- bpo-33100: Dataclasses: If a field has a default value that's a 9573 MemberDescriptorType, then it's from that field being in __slots__, not an 9574 actual default value. 9575 9576- bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow 9577 attributes to be added to the derived class. Only attributes from the 9578 frozen dataclass cannot be assigned to. Require all dataclasses in a 9579 hierarchy to be either all frozen or all non-frozen. 9580 9581- bpo-33097: Raise RuntimeError when ``executor.submit`` is called during 9582 interpreter shutdown. 9583 9584- bpo-32968: Modulo and floor division involving Fraction and float should 9585 return float. 9586 9587- bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py 9588 9589- bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling 9590 error occurs. 9591 9592- bpo-33064: lib2to3 now properly supports trailing commas after ``*args`` 9593 and ``**kwargs`` in function signatures. 9594 9595- bpo-33056: FIX properly close leaking fds in 9596 concurrent.futures.ProcessPoolExecutor. 9597 9598- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all 9599 threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch 9600 by Nir Soffer. 9601 9602- bpo-31804: Avoid failing in multiprocessing.Process if the standard 9603 streams are closed or None at exit. 9604 9605- bpo-33034: Providing an explicit error message when casting the port 9606 property to anything that is not an integer value using ``urlparse()`` and 9607 ``urlsplit()``. Patch by Matt Eaton. 9608 9609- bpo-30249: Improve struct.unpack_from() exception messages for problems 9610 with the buffer size and offset. 9611 9612- bpo-33037: Skip sending/receiving data after SSL transport closing. 9613 9614- bpo-27683: Fix a regression in :mod:`ipaddress` that result of 9615 :meth:`hosts` is empty when the network is constructed by a tuple 9616 containing an integer mask and only 1 bit left for addresses. 9617 9618- bpo-22674: Add the strsignal() function in the signal module that returns 9619 the system description of the given signal, as returned by strsignal(3). 9620 9621- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls, 9622 subclass)`` crashed when ``subclass`` is not a type object. 9623 9624- bpo-33009: Fix inspect.signature() for single-parameter partialmethods. 9625 9626- bpo-32969: Expose several missing constants in zlib and fix corresponding 9627 documentation. 9628 9629- bpo-32056: Improved exceptions raised for invalid number of channels and 9630 sample width when read an audio file in modules :mod:`aifc`, :mod:`wave` 9631 and :mod:`sunau`. 9632 9633- bpo-32970: Improved disassembly of the MAKE_FUNCTION instruction. 9634 9635- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in 9636 subprocess if another low descriptor is closed. 9637 9638- bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen 9639 classes, and also disallow inheriting non-frozen from frozen classes. This 9640 restriction will be relaxed at a future date. 9641 9642- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch 9643 by Joffrey Fuhrer. 9644 9645- bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant, 9646 available with OpenSSL 1.1.0h or 1.1.1. 9647 9648- bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now 9649 prohibited. The constructors were never documented, tested, or designed as 9650 public constructors. Users were suppose to use ssl.wrap_socket() or 9651 SSLContext. 9652 9653- bpo-32929: Remove the tri-state parameter "hash", and add the boolean 9654 "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a 9655 __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__ 9656 based on the values of eq= and frozen=. The unsafe_hash=False behavior is 9657 the same as the old hash=None behavior. unsafe_hash=False is the default, 9658 just as hash=None used to be. 9659 9660- bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 9661 for future compatibility with OpenSSL 1.1.1. 9662 9663- bpo-32146: Document the interaction between frozen executables and the 9664 spawn and forkserver start methods in multiprocessing. 9665 9666- bpo-30622: The ssl module now detects missing NPN support in LibreSSL. 9667 9668- bpo-32922: dbm.open() now encodes filename with the filesystem encoding 9669 rather than default encoding. 9670 9671- bpo-32759: Free unused arenas in multiprocessing.heap. 9672 9673- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3`` 9674 syscall exists or not. 9675 9676- bpo-32556: nt._getfinalpathname, nt._getvolumepathname and 9677 nt._getdiskusage now correctly convert from bytes. 9678 9679- bpo-21060: Rewrite confusing message from setup.py upload from "No dist 9680 file created in earlier command" to the more helpful "Must create and 9681 upload files in one command". 9682 9683- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a 9684 :exc:`ValueError` instead of canceling the first scheduled function. 9685 Patch by Cheryl Sabella. 9686 9687- bpo-32852: Make sure sys.argv remains as a list when running trace. 9688 9689- bpo-31333: ``_abc`` module is added. It is a speedup module with C 9690 implementations for various functions and methods in ``abc``. Creating an 9691 ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC 9692 subclass are up to 1.5x faster. In addition, this makes Python start-up up 9693 to 10% faster. 9694 9695 Note that the new implementation hides internal registry and caches, 9696 previously accessible via private attributes ``_abc_registry``, 9697 ``_abc_cache``, and ``_abc_negative_cache``. There are three debugging 9698 helper methods that can be used instead ``_dump_registry``, 9699 ``_abc_registry_clear``, and ``_abc_caches_clear``. 9700 9701- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored 9702 cancellation after notifying and cancelling a conditional lock. Patch by 9703 Bar Harel. 9704 9705- bpo-32819: ssl.match_hostname() has been simplified and no longer depends 9706 on re and ipaddress module for wildcard and IP addresses. Error reporting 9707 for invalid wildcards has been improved. 9708 9709- bpo-19675: ``multiprocessing.Pool`` no longer leaks processes if its 9710 initialization fails. 9711 9712- bpo-32394: socket: Remove 9713 TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version 9714 Windows during run-time. 9715 9716- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules. 9717 (Contributed by Oren Milman) 9718 9719- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when 9720 only the last field is quoted. Patch by Jake Davis. 9721 9722- bpo-30688: Added support of ``\N{name}`` escapes in regular expressions. 9723 Based on patch by Jonathan Eunice. 9724 9725- bpo-32792: collections.ChainMap() preserves the order of the underlying 9726 mappings. 9727 9728- bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which 9729 contain set operations. Sets starting with '[' or containing '--', '&&', 9730 '~~' or '||' will be interpreted differently in regular expressions in 9731 future versions. Currently they emit warnings. fnmatch.translate() now 9732 avoids producing patterns containing such sets by accident. 9733 9734- bpo-32622: Implement native fast sendfile for Windows proactor event loop. 9735 9736- bpo-32777: Fix a rare but potential pre-exec child process deadlock in 9737 subprocess on POSIX systems when marking file descriptors inheritable on 9738 exec in the child process. This bug appears to have been introduced in 9739 3.4. 9740 9741- bpo-32647: The ctypes module used to depend on indirect linking for 9742 dlopen. The shared extension is now explicitly linked against libdl on 9743 platforms with dl. 9744 9745- bpo-32749: A :mod:`dbm.dumb` database opened with flags 'r' is now 9746 read-only. :func:`dbm.dumb.open` with flags 'r' and 'w' no longer creates 9747 a database if it does not exist. 9748 9749- bpo-32741: Implement ``asyncio.TimerHandle.when()`` method. 9750 9751- bpo-32691: Use mod_spec.parent when running modules with pdb 9752 9753- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring 9754 and locking the same lock multiple times, without it being free. Patch by 9755 Bar Harel. 9756 9757- bpo-32727: Do not include name field in SMTP envelope from address. Patch 9758 by Stéphane Wirtel 9759 9760- bpo-31453: Add TLSVersion constants and SSLContext.maximum_version / 9761 minimum_version attributes. The new API wraps OpenSSL 1.1 9762 https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html 9763 feature. 9764 9765- bpo-24334: Internal implementation details of ssl module were cleaned up. 9766 The SSLSocket has one less layer of indirection. Owner and session 9767 information are now handled by the SSLSocket and SSLObject constructor. 9768 Channel binding implementation has been simplified. 9769 9770- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND 9771 chunk is not found. Patch by Zackery Spytz. 9772 9773- bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D 9774 Moore. 9775 9776- bpo-32512: :mod:`profile` CLI accepts `-m module_name` as an alternative 9777 to script path. 9778 9779- bpo-8525: help() on a type now displays builtin subclasses. This is 9780 intended primarily to help with notification of more specific exception 9781 subclasses. 9782 9783 Patch by Sanyam Khurana. 9784 9785- bpo-31639: http.server now exposes a ThreadingHTTPServer class and uses it 9786 when the module is run with ``-m`` to cope with web browsers pre-opening 9787 sockets. 9788 9789- bpo-29877: compileall: import ProcessPoolExecutor only when needed, 9790 preventing hangs on low resource platforms 9791 9792- bpo-32221: Various functions returning tuple containing IPv6 addresses now 9793 omit ``%scope`` part since the same information is already encoded in 9794 *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` 9795 when it receives multicast packet since useless resolving of network 9796 interface name is omitted. 9797 9798- bpo-32147: :func:`binascii.unhexlify` is now up to 2 times faster. Patch 9799 by Sergey Fedoseev. 9800 9801- bpo-30693: The TarFile class now recurses directories in a reproducible 9802 way. 9803 9804- bpo-30693: The ZipFile class now recurses directories in a reproducible 9805 way. 9806 9807- bpo-31680: Added :data:`curses.ncurses_version`. 9808 9809- bpo-31908: Fix output of cover files for ``trace`` module command-line 9810 tool. Previously emitted cover files only when ``--missing`` option was 9811 used. Patch by Michael Selik. 9812 9813- bpo-31608: Raise a ``TypeError`` instead of crashing if a 9814 ``collections.deque`` subclass returns a non-deque from ``__new__``. Patch 9815 by Oren Milman. 9816 9817- bpo-31425: Add support for sockets of the AF_QIPCRTR address family, 9818 supported by the Linux kernel. This is used to communicate with services, 9819 such as GPS or radio, running on Qualcomm devices. Patch by Bjorn 9820 Andersson. 9821 9822- bpo-22005: Implemented unpickling instances of 9823 :class:`~datetime.datetime`, :class:`~datetime.date` and 9824 :class:`~datetime.time` pickled by Python 2. ``encoding='latin1'`` should 9825 be used for successful decoding. 9826 9827- bpo-27645: :class:`sqlite3.Connection` now exposes a 9828 :class:`~sqlite3.Connection.backup` method, if the underlying SQLite 9829 library is at version 3.6.11 or higher. Patch by Lele Gaifax. 9830 9831- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer. 9832 9833- bpo-31508: Removed support of arguments in 9834 `tkinter.ttk.Treeview.selection`. It was deprecated in 3.6. Use 9835 specialized methods like `selection_set` for changing the selection. 9836 9837- bpo-29456: Fix bugs in hangul normalization: u1176, u11a7 and u11c3 9838 9839Documentation 9840------------- 9841 9842- bpo-21257: Document :func:`http.client.parse_headers`. 9843 9844- bpo-34764: Improve example of iter() with 2nd sentinel argument. 9845 9846- bpo-35564: Explicitly set master_doc variable in conf.py for compliance 9847 with Sphinx 2.0 9848 9849- bpo-35511: Specified that profile.Profile class doesn't not support enable 9850 or disable methods. Also, elaborated that Profile object as a context 9851 manager is only supported in cProfile module. 9852 9853- bpo-10536: Enhance the gettext docs. Patch by Éric Araujo 9854 9855- bpo-35089: Remove mention of ``typing.io`` and ``typing.re``. Their types 9856 should be imported from ``typing`` directly. 9857 9858- bpo-35038: Fix the documentation about an unexisting `f_restricted` 9859 attribute in the frame object. Patch by Stéphane Wirtel 9860 9861- bpo-35042: Replace PEP XYZ by the pep role and allow to use the direct 9862 links to the PEPs. 9863 9864- bpo-35044: Fix the documentation with the role ``exc`` for the 9865 appropriated exception. Patch by Stéphane Wirtel 9866 9867- bpo-35035: Rename documentation for :mod:`email.utils` to 9868 ``email.utils.rst``. 9869 9870- bpo-34967: Use app.add_object_type() instead of the deprecated Sphinx 9871 function app.description_unit() 9872 9873- bpo-34913: Add documentation about the new command line interface of the 9874 gzip module. 9875 9876- bpo-32174: chm document displays non-ASCII charaters properly on some MBCS 9877 Windows systems. 9878 9879- bpo-11233: Create availability directive for documentation. Original 9880 patch by Georg Brandl. 9881 9882- bpo-34790: Document how passing coroutines to asyncio.wait() can be 9883 confusing. 9884 9885- bpo-34552: Make clear that ``==`` operator sometimes is equivalent to 9886 `is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where 9887 they make sense. 9888 9889- bpo-28617: Fixed info in the stdtypes docs concerning the types that 9890 support membership tests. 9891 9892- bpo-20177: Migrate datetime.date.fromtimestamp to Argument Clinic. Patch 9893 by Tim Hoffmann. 9894 9895- bpo-34065: Fix wrongly written basicConfig documentation markup syntax 9896 9897- bpo-33460: replaced ellipsis with correct error codes in tutorial chapter 9898 3. 9899 9900- bpo-33847: Add '@' operator entry to index. 9901 9902- bpo-33409: Clarified the relationship between :pep:`538`'s 9903 PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode. 9904 9905- bpo-33197: Add versionadded tag to the documentation of 9906 ParameterKind.description 9907 9908- bpo-17045: Improve the C-API doc for PyTypeObject. This includes adding 9909 several quick-reference tables and a lot of missing slot/typedef entries. 9910 The existing entries were also cleaned up with a slightly more consistent 9911 format. 9912 9913- bpo-33736: Improve the documentation of :func:`asyncio.open_connection`, 9914 :func:`asyncio.start_server` and their UNIX socket counterparts. 9915 9916- bpo-23859: Document that `asyncio.wait()` does not cancel its futures on 9917 timeout. 9918 9919- bpo-32436: Document :pep:`567` changes to asyncio. 9920 9921- bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal 9922 to 3.8. 9923 9924- bpo-33594: Document ``getargspec``, ``from_function`` and ``from_builtin`` 9925 as deprecated in their respective docstring, and include version since 9926 deprecation in DeprecationWarning message. 9927 9928- bpo-33503: Fix broken pypi link 9929 9930- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``. 9931 9932- bpo-33487: BZ2file now emit a DeprecationWarning when buffering=None is 9933 passed, the deprecation message and documentation also now explicitly 9934 state it is deprecated since 3.0. 9935 9936- bpo-33378: Add Korean language switcher for https://docs.python.org/3/ 9937 9938- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be 9939 just any value. 9940 9941- bpo-33201: Modernize documentation for writing C extension types. 9942 9943- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document. 9944 ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is 9945 missed in the document. 9946 9947- bpo-33126: Document PyBuffer_ToContiguous(). 9948 9949- bpo-27212: Modify documentation for the :func:`islice` recipe to consume 9950 initial values up to the start index. 9951 9952- bpo-28247: Update :mod:`zipapp` documentation to describe how to make 9953 standalone applications. 9954 9955- bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and 9956 Berker Peksag. 9957 9958- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder`` 9959 implements ``MetaPathFinder``. (Patch by Himanshu Lakhara) 9960 9961- bpo-28124: The ssl module function ssl.wrap_socket() has been 9962 de-emphasized and deprecated in favor of the more secure and efficient 9963 SSLContext.wrap_socket() method. 9964 9965- bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy. 9966 9967- bpo-32436: Add documentation for the contextvars module (PEP 567). 9968 9969- bpo-32800: Update link to w3c doc for xml default namespaces. 9970 9971- bpo-11015: Update :mod:`test.support` documentation. 9972 9973- bpo-32613: Update the faq/windows.html to use the py command from PEP 397 9974 instead of python. 9975 9976- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get` 9977 method raises :exc:`AttributeError`. 9978 9979- bpo-32614: Modify RE examples in documentation to use raw strings to 9980 prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight 9981 the deprecation. 9982 9983- bpo-20709: Remove the paragraph where we explain that os.utime() does not 9984 support a directory as path under Windows. Patch by Jan-Philip Gehrcke 9985 9986- bpo-32722: Remove the bad example in the tutorial of the Generator 9987 Expression. Patch by Stéphane Wirtel 9988 9989- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses. 9990 9991- bpo-30607: Use the externalized ``python-docs-theme`` package when 9992 building the documentation. 9993 9994- bpo-8243: Add a note about curses.addch and curses.addstr exception 9995 behavior when writing outside a window, or pad. 9996 9997- bpo-32337: Update documentation related with ``dict`` order. 9998 9999- bpo-25041: Document ``AF_PACKET`` in the :mod:`socket` module. 10000 10001- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED 10002 flags for ssl.SSLContext.verify_mode. 10003 10004Tests 10005----- 10006 10007- bpo-35772: Fix sparse file tests of test_tarfile on ppc64 with the tmpfs 10008 filesystem. Fix the function testing if the filesystem supports sparse 10009 files: create a file which contains data and "holes", instead of creating 10010 a file which contains no data. tmpfs effective block size is a page size 10011 (tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64, 10012 ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch 10013 holes of 4 KiB. 10014 10015- bpo-35045: Make ssl tests less strict and also accept TLSv1 as system 10016 default. The changes unbreaks test_min_max_version on Fedora 29. 10017 10018- bpo-32710: ``test_asyncio/test_sendfile.py`` now resets the event loop 10019 policy using :func:`tearDownModule` as done in other tests, to prevent a 10020 warning when running tests on Windows. 10021 10022- bpo-33717: test.pythoninfo now logs information of all clocks, not only 10023 time.time() and time.perf_counter(). 10024 10025- bpo-35488: Add a test to pathlib's Path.match() to verify it does not 10026 support glob-style ** recursive pattern matching. 10027 10028- bpo-31731: Fix a race condition in ``check_interrupted_write()`` of 10029 test_io: create directly the thread with SIGALRM signal blocked, rather 10030 than blocking the signal later from the thread. Previously, it was 10031 possible that the thread gets the signal before the signal is blocked. 10032 10033- bpo-35424: Fix test_multiprocessing_main_handling: use 10034 :class:`multiprocessing.Pool` with a context manager and then explicitly 10035 join the pool. 10036 10037- bpo-35519: Rename :mod:`test.bisect` module to :mod:`test.bisect_cmd` to 10038 avoid conflict with :mod:`bisect` module when running directly a test like 10039 ``./python Lib/test/test_xmlrpc.py``. 10040 10041- bpo-35513: Replace :func:`time.time` with :func:`time.monotonic` in tests 10042 to measure time delta. 10043 10044- bpo-34279: :func:`test.support.run_unittest` no longer raise 10045 :exc:`TestDidNotRun` if the test result contains skipped tests. The 10046 exception is now only raised if no test have been run and no test have 10047 been skipped. 10048 10049- bpo-35412: Add testcase to ``test_future4``: check unicode literal. 10050 10051- bpo-26704: Added test demonstrating double-patching of an instance method. 10052 Patch by Anthony Sottile. 10053 10054- bpo-33725: test_multiprocessing_fork may crash on recent versions of 10055 macOS. Until the issue is resolved, skip the test on macOS. 10056 10057- bpo-35352: Modify test_asyncio to use the certificate set from the test 10058 directory. 10059 10060- bpo-35317: Fix ``mktime()`` overflow error in ``test_email``: run 10061 ``test_localtime_daylight_true_dst_true()`` and 10062 ``test_localtime_daylight_false_dst_true()`` with a specific timezone. 10063 10064- bpo-21263: After several reports that test_gdb does not work properly on 10065 macOS and since gdb is not shipped by default anymore, test_gdb is now 10066 skipped on macOS when LLVM Clang has been used to compile Python. Patch by 10067 Lysandros Nikolaou 10068 10069- bpo-34279: regrtest issue a warning when no tests have been executed in a 10070 particular test file. Also, a new final result state is issued if no test 10071 have been executed across all test files. Patch by Pablo Galindo. 10072 10073- bpo-34962: make docstest in Doc now passes., and is enforced in CI 10074 10075- bpo-23596: Use argparse for the command line of the gzip module. Patch by 10076 Antony Lee 10077 10078- bpo-34537: Fix ``test_gdb.test_strings()`` when ``LC_ALL=C`` and GDB was 10079 compiled with Python 3.6 or earlier. 10080 10081- bpo-34587: test_socket: Remove RDSTest.testCongestion(). The test tries to 10082 fill the receiver's socket buffer and expects an error. But the RDS 10083 protocol doesn't require that. Moreover, the Linux implementation of RDS 10084 expects that the producer of the messages reduces its rate, it's not the 10085 role of the receiver to trigger an error. The test fails on Fedora 28 by 10086 design, so just remove it. 10087 10088- bpo-34661: Fix test_shutil if unzip doesn't support -t. 10089 10090- bpo-34200: Fixed non-deterministic flakiness of test_pkg by not using the 10091 scary test.support.module_cleanup() logic to save and restore sys.modules 10092 contents between test cases. 10093 10094- bpo-34569: The experimental PEP 554 data channels now correctly pass 10095 negative PyLong objects between subinterpreters on 32-bit systems. Patch 10096 by Michael Felt. 10097 10098- bpo-34594: Fix usage of hardcoded ``errno`` values in the tests. 10099 10100- bpo-34579: Fix test_embed for AIX Patch by Michael Felt 10101 10102- bpo-34542: Use 3072 RSA keys and SHA-256 signature for test certs and 10103 keys. 10104 10105- bpo-11193: Remove special condition for AIX in 10106 `test_subprocess.test_undecodable_env` 10107 10108- bpo-34347: Fix `test_utf8_mode.test_cmd_line` for AIX 10109 10110- bpo-34490: On AIX with AF_UNIX family sockets getsockname() does not 10111 provide 'sockname', so skip calls to transport.get_extra_info('sockname') 10112 10113- bpo-34391: Fix ftplib test for TLS 1.3 by reading from data socket. 10114 10115- bpo-11192: Fix `test_socket` on AIX 6.1 and later IPv6 zone id supports 10116 only supported by inet_pton6_zone() Switch to runtime-based 10117 platform.system() to establish current platform rather than build-time 10118 based sys.platform() 10119 10120- bpo-34399: Update all RSA keys and DH params to use at least 2048 bits. 10121 10122- bpo-34373: Fix ``test_mktime`` and ``test_pthread_getcpuclickid`` tests 10123 for AIX Add range checking for ``_PyTime_localtime`` for AIX Patch by 10124 Michael Felt 10125 10126- bpo-11191: Skip the distutils test 'test_search_cpp' when using XLC as 10127 compiler patch by aixtools (Michael Felt) 10128 10129- Improved an error message when mock assert_has_calls fails. 10130 10131- bpo-33746: Fix test_unittest when run in verbose mode. 10132 10133- bpo-33901: Fix test_dbm_gnu on macOS with gdbm 1.15: add a larger value to 10134 make sure that the file size changes. 10135 10136- bpo-33873: Fix a bug in ``regrtest`` that caused an extra test to run if 10137 --huntrleaks/-R was used. Exit with error in case that invalid parameters 10138 are specified to --huntrleaks/-R (at least one warmup run and one 10139 repetition must be used). 10140 10141- bpo-33562: Check that a global asyncio event loop policy is not left 10142 behind by any tests. 10143 10144- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that 10145 might be due to running on ZFS. 10146 10147- bpo-32962: Fixed test_gdb when Python is compiled with flags -mcet 10148 -fcf-protection -O0. 10149 10150- bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when 10151 the interpreter is built with ``--enable-shared``. 10152 10153- bpo-32872: Avoid regrtest compatibility issue with namespace packages. 10154 10155- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport 10156 of ``KqueueSelector`` loop was not being closed. 10157 10158- bpo-32663: Making sure the `SMTPUTF8SimTests` class of tests gets run in 10159 test_smtplib.py. 10160 10161- bpo-27643: Test_C test case needs "signed short" bitfields, but the IBM 10162 XLC compiler (on AIX) does not support this Skip the code and test when 10163 AIX and XLC are used 10164 10165 Applicable to Python2-2.7 and later 10166 10167- bpo-19417: Add test_bdb.py. 10168 10169- bpo-31809: Add tests to verify connection with secp ECDH curves. 10170 10171Build 10172----- 10173 10174- bpo-34691: The _contextvars module is now built into the core Python 10175 library on Windows. 10176 10177- bpo-35683: Improved Azure Pipelines build steps and now verifying layouts 10178 correctly 10179 10180- bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj 10181 10182- bpo-35550: Fix incorrect Solaris #ifdef checks to look for __sun && __SVR4 10183 instead of sun when compiling. 10184 10185- bpo-35499: ``make profile-opt`` no longer replaces ``CFLAGS_NODIST`` with 10186 ``CFLAGS``. It now adds profile-guided optimization (PGO) flags to 10187 ``CFLAGS_NODIST``: existing ``CFLAGS_NODIST`` flags are kept. 10188 10189- bpo-35257: Avoid leaking the linker flags from Link Time Optimizations 10190 (LTO) into distutils when compiling C extensions. 10191 10192- bpo-35351: When building Python with clang and LTO, LTO flags are no 10193 longer passed into CFLAGS to build third-party C extensions through 10194 distutils. 10195 10196- bpo-35139: Fix a compiler error when statically linking `pyexpat` in 10197 `Modules/Setup`. 10198 10199- bpo-35059: PCbuild: Set InlineFunctionExpansion to OnlyExplicitInline 10200 ("/Ob1" option) in pyproject.props in Debug mode to expand functions 10201 marked as inline. This change should make Python compiled in Debug mode a 10202 little bit faster on Windows. 10203 10204- bpo-35011: Restores the use of pyexpatns.h to isolate our embedded copy of 10205 the expat C library so that its symbols do not conflict at link or dynamic 10206 loading time with an embedding application or other extension modules with 10207 their own version of libexpat. 10208 10209- bpo-28015: Have --with-lto works correctly with clang. 10210 10211- bpo-34765: Update the outdated install-sh file to the latest revision from 10212 automake v1.16.1 10213 10214- bpo-34585: Check for floating-point byte order in configure.ac using 10215 compilation tests instead of executing code, so that these checks work in 10216 cross-compiled builds. 10217 10218- bpo-34710: Fixed SSL module build with OpenSSL & pedantic CFLAGS. 10219 10220- bpo-34582: Add JUnit XML output for regression tests and update Azure 10221 DevOps builds. 10222 10223- bpo-34081: Make Sphinx warnings as errors in the Docs Makefile. 10224 10225- bpo-34555: Fix for case where it was not possible to have both 10226 ``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined. 10227 10228- bpo-33015: Fix an undefined behaviour in the pthread implementation of 10229 :c:func:`PyThread_start_new_thread`: add a function wrapper to always 10230 return ``NULL``. 10231 10232- bpo-34245: The Python shared library is now installed with write 10233 permission (mode 0755), which is the standard way of installing such 10234 libraries. 10235 10236- bpo-34121: Fix detection of C11 atomic support on clang. 10237 10238- bpo-32430: Rename Modules/Setup.dist to Modules/Setup, and remove the 10239 necessity to copy the former manually to the latter when updating the 10240 local source tree. 10241 10242- bpo-30345: Add -g to LDFLAGS when compiling with LTO to get debug symbols. 10243 10244- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from 10245 ``OPT``. This option emitted annoying warnings when building extension 10246 modules written in C++. 10247 10248- bpo-33614: Ensures module definition files for the stable ABI on Windows 10249 are correctly regenerated. 10250 10251- bpo-33648: The --with-c-locale-warning configuration flag has been 10252 removed. It has had no effect for about a year. 10253 10254- bpo-33522: Enable CI builds on Visual Studio Team Services at 10255 https://python.visualstudio.com/cpython 10256 10257- bpo-33512: configure's check for "long double" has been simplified 10258 10259- bpo-33483: C compiler is now correctly detected from the standard 10260 environment variables. --without-gcc and --with-icc options have been 10261 removed. 10262 10263- bpo-33394: Enable the verbose build for extension modules, when GNU make 10264 is passed macros on the command line. 10265 10266- bpo-33393: Update config.guess and config.sub files. 10267 10268- bpo-33377: Add new triplets for mips r6 and riscv variants (used in 10269 extension suffixes). 10270 10271- bpo-32232: By default, modules configured in `Modules/Setup` are no longer 10272 built with `-DPy_BUILD_CORE`. Instead, modules that specifically need that 10273 preprocessor definition include it in their individual entries. 10274 10275- bpo-33182: The embedding tests can once again be built with clang 6.0 10276 10277- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. 10278 10279- bpo-33012: gcc 8 has added a new warning heuristic to detect invalid 10280 function casts and a stock python build seems to hit that warning quite 10281 often. The most common is the cast of a METH_NOARGS function (that uses 10282 just one argument) to a PyCFunction. Fix this by adding a dummy argument 10283 to all functions that implement METH_NOARGS. 10284 10285- bpo-32898: Fix the python debug build when using COUNT_ALLOCS. 10286 10287- bpo-29442: Replace optparse with argparse in setup.py 10288 10289Windows 10290------- 10291 10292- bpo-35890: Fix API calling consistency of GetVersionEx and wcstok. 10293 10294- bpo-32560: The ``py`` launcher now forwards its ``STARTUPINFO`` structure 10295 to child processes. 10296 10297- bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows 10298 10299- bpo-35811: Avoid propagating venv settings when launching via py.exe 10300 10301- bpo-35797: Fix default executable used by the multiprocessing module 10302 10303- bpo-35758: Allow building on ARM with MSVC. 10304 10305- bpo-29734: Fix handle leaks in os.stat on Windows. 10306 10307- bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport 10308 restrictions. 10309 10310- bpo-35596: Fix vcruntime140.dll being added to embeddable distro multiple 10311 times. 10312 10313- bpo-35402: Update Windows build to use Tcl and Tk 8.6.9 10314 10315- bpo-35401: Updates Windows build to OpenSSL 1.1.0j 10316 10317- bpo-34977: venv on Windows will now use a python.exe redirector rather 10318 than copying the actual binaries from the base environment. 10319 10320- bpo-34977: Adds support for building a Windows App Store package 10321 10322- bpo-35067: Remove _distutils_findvs module and use vswhere.exe instead. 10323 10324- bpo-32557: Allow shutil.disk_usage to take a file path on Windows 10325 10326- bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp. 10327 10328- bpo-34603: Fix returning structs from functions produced by MSVC 10329 10330- bpo-34581: Guard MSVC-specific code in socketmodule.c with ``#ifdef 10331 _MSC_VER``. 10332 10333- bpo-34532: Fixes exit code of list version arguments for py.exe. 10334 10335- bpo-34062: Fixed the '--list' and '--list-paths' arguments for the py.exe 10336 launcher 10337 10338- bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. 10339 10340- bpo-34011: A suite of code has been changed which copied across DLLs and 10341 init.tcl from the running Python location into a venv being created. These 10342 copies are needed only when running from a Python source build, and the 10343 copying code is now only run when that is the case, rather than whenever a 10344 venv is created. 10345 10346- bpo-34006: Revert line length limit for Windows help docs. The line-length 10347 limit is not needed because the pages appear in a separate app rather than 10348 on a browser tab. It can also interact badly with the DPI setting. 10349 10350- bpo-31546: Restore running PyOS_InputHook while waiting for user input at 10351 the prompt. The restores integration of interactive GUI windows (such as 10352 Matplotlib figures) with the prompt on Windows. 10353 10354- bpo-30237: Output error when ReadConsole is canceled by 10355 CancelSynchronousIo instead of crashing. 10356 10357- bpo-33895: GIL is released while calling functions that acquire Windows 10358 loader lock. 10359 10360- bpo-33720: Reduces maximum marshal recursion depth on release builds. 10361 10362- bpo-29097: Fix bug where :meth:`datetime.fromtimestamp` erroneously throws 10363 an :exc:`OSError` on Windows for values between 0 and 86400. Patch by 10364 Ammar Askar. 10365 10366- bpo-33316: PyThread_release_lock always fails 10367 10368- bpo-33184: Update Windows installer to use OpenSSL 1.1.0h. 10369 10370- bpo-32890: Fix usage of GetLastError() instead of errno in os.execve() and 10371 os.truncate(). 10372 10373- bpo-33016: Fix potential use of uninitialized memory in 10374 nt._getfinalpathname 10375 10376- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current 10377 directory is set to a UNC path. 10378 10379- bpo-32901: Update Tcl and Tk versions to 8.6.8 10380 10381- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. 10382 10383- bpo-32409: Ensures activate.bat can handle Unicode contents. 10384 10385- bpo-32457: Improves handling of denormalized executable path when 10386 launching Python. 10387 10388- bpo-32370: Use the correct encoding for ipconfig output in the uuid 10389 module. Patch by Segev Finer. 10390 10391- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly 10392 treating the ``PrintNameOffset`` field of the reparse data buffer as a 10393 number of characters instead of bytes. Patch by Craig Holmquist and SSE4. 10394 10395- bpo-1104: Correctly handle string length in 10396 ``msilib.SummaryInfo.GetProperty()`` to prevent it from truncating the 10397 last character. 10398 10399macOS 10400----- 10401 10402- bpo-35401: Update macOS installer to use OpenSSL 1.1.0j. 10403 10404- bpo-35025: Properly guard the use of the ``CLOCK_GETTIME`` et al. macros 10405 in ``timemodule`` on macOS. 10406 10407- bpo-24658: On macOS, fix reading from and writing into a file with a size 10408 larger than 2 GiB. 10409 10410- bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds. 10411 10412- bpo-33635: In macOS stat on some file descriptors (/dev/fd/3 f.e) will 10413 result in bad file descriptor OSError. Guard against this exception was 10414 added in is_dir, is_file and similar methods. DirEntry.is_dir can also 10415 throw this exception so _RecursiveWildcardSelector._iterate_directories 10416 was also extended with the same error ignoring pattern. 10417 10418- bpo-13631: The .editrc file in user's home directory is now processed 10419 correctly during the readline initialization through editline emulation on 10420 macOS. 10421 10422- bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. 10423 10424- bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS 10425 10.6+ installer. The 10.9+ installer variant already does this. This 10426 means that the Python 3.7 provided by the python.org macOS installers no 10427 longer need or use any external versions of Tcl/Tk, either system-provided 10428 or user-installed, such as ActiveTcl. 10429 10430- bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8. 10431 10432- bpo-31903: In :mod:`_scproxy`, drop the GIL when calling into 10433 ``SystemConfiguration`` to avoid deadlocks. 10434 10435IDLE 10436---- 10437 10438- bpo-35770: IDLE macosx deletes Options => Configure IDLE. It previously 10439 deleted Window => Zoom Height by mistake. (Zoom Height is now on the 10440 Options menu). On Mac, the settings dialog is accessed via Preferences on 10441 the IDLE menu. 10442 10443- bpo-35769: Change IDLE's new file name from 'Untitled' to 'untitled' 10444 10445- bpo-35660: Fix imports in idlelib.window. 10446 10447- bpo-35641: Proper format `calltip` when the function has no docstring. 10448 10449- bpo-33987: Use ttk Frame for ttk widgets. 10450 10451- bpo-34055: Fix erroneous 'smart' indents and newlines in IDLE Shell. 10452 10453- bpo-35591: Find Selection now works when selection not found. 10454 10455- bpo-35196: Speed up squeezer line counting. 10456 10457- bpo-35598: Update config_key: use PEP 8 names and ttk widgets, make some 10458 objects global, and add tests. 10459 10460- bpo-28097: Add Previous/Next History entries to Shell menu. 10461 10462- bpo-35208: Squeezer now properly counts wrapped lines before newlines. 10463 10464- bpo-35555: Gray out Code Context menu entry when it's not applicable. 10465 10466- bpo-35521: Document the IDLE editor code context feature. Add some 10467 internal references within the IDLE doc. 10468 10469- bpo-22703: The Code Context menu label now toggles between Show/Hide Code 10470 Context. The Zoom Height menu now toggles between Zoom/Restore Height. 10471 Zoom Height has moved from the Window menu to the Options menu. 10472 10473- bpo-35213: Where appropriate, use 'macOS' in idlelib. 10474 10475- bpo-34864: On macOS, warn if the system preference "Prefer tabs when 10476 opening documents" is set to "Always". 10477 10478- bpo-34864: Document two IDLE on MacOS issues. The System Preferences Dock 10479 "prefer tabs always" setting disables some IDLE features. Menus are a bit 10480 different than as described for Windows and Linux. 10481 10482- bpo-35202: Remove unused imports from lib/idlelib 10483 10484- bpo-33000: Document that IDLE's shell has no line limit. A program that 10485 runs indefinitely can overfill memory. 10486 10487- bpo-23220: Explain how IDLE's Shell displays output. 10488 10489- bpo-35099: Improve the doc about IDLE running user code. The section is 10490 renamed from "IDLE -- console differences" is renamed "Running user code". 10491 It mostly covers the implications of using custom sys.stdxxx objects. 10492 10493- bpo-35097: Add IDLE doc subsection explaining editor windows. Topics 10494 include opening, title and status bar, .py* extension, and running. 10495 10496- bpo-35093: Document the IDLE document viewer in the IDLE doc. Add a 10497 paragraph in "Help and preferences", "Help sources" subsection. 10498 10499- bpo-35088: Update idlelib.help.copy_string docstring. We now use git and 10500 backporting instead of hg and forward merging. 10501 10502- bpo-35087: Update idlelib help files for the current doc build. The main 10503 change is the elimination of chapter-section numbers. 10504 10505- bpo-34548: Use configured color theme for read-only text views. 10506 10507- bpo-1529353: Enable "squeezing" of long outputs in the shell, to avoid 10508 performance degradation and to clean up the history without losing it. 10509 Squeezed outputs may be copied, viewed in a separate window, and 10510 "unsqueezed". 10511 10512- bpo-34047: Fixed mousewheel scrolling direction on macOS. 10513 10514- bpo-34275: Make IDLE calltips always visible on Mac. Some MacOS-tk 10515 combinations need .update_idletasks(). Patch by Kevin Walzer. 10516 10517- bpo-34120: Fix unresponsiveness after closing certain windows and dialogs. 10518 10519- bpo-33975: Avoid small type when running htests. Since part of the purpose 10520 of human-viewed tests is to determine that widgets look right, it is 10521 important that they look the same for testing as when running IDLE. 10522 10523- bpo-33905: Add test for idlelib.stackview.StackBrowser. 10524 10525- bpo-33924: Change mainmenu.menudefs key 'windows' to 'window'. Every other 10526 menudef key is lowercase version of main menu entry. 10527 10528- bpo-33906: Rename idlelib.windows as window Match Window on the main menu 10529 and remove last plural module name. 10530 10531- bpo-33917: Fix and document idlelib/idle_test/template.py. The revised 10532 file compiles, runs, and tests OK. idle_test/README.txt explains how to 10533 use it to create new IDLE test files. 10534 10535- bpo-33904: IDLE: In rstrip, rename class RstripExtension as Rstrip 10536 10537- bpo-33907: For consistency and clarity, rename an IDLE module and classes. 10538 Module calltips and its class CallTips are now calltip and Calltip. In 10539 module calltip_w, class CallTip is now CalltipWindow. 10540 10541- bpo-33856: Add "help" in the welcome message of IDLE 10542 10543- bpo-33839: IDLE: refactor ToolTip and CallTip and add documentation and 10544 tests 10545 10546- bpo-33855: Minimally test all IDLE modules. Add missing files, import 10547 module, instantiate classes, and check coverage. Check existing files. 10548 10549- bpo-33656: On Windows, add API call saying that tk scales for DPI. On 10550 Windows 8.1+ or 10, with DPI compatibility properties of the Python binary 10551 unchanged, and a monitor resolution greater than 96 DPI, this should make 10552 text and lines sharper. It should otherwise have no effect. 10553 10554- bpo-33768: Clicking on a context line moves that line to the top of the 10555 editor window. 10556 10557- bpo-33763: IDLE: Use read-only text widget for code context instead of 10558 label widget. 10559 10560- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel 10561 and scrollbar slider moved text by a fixed number of pixels, resulting in 10562 partial lines at the top of the editor box. The change also applies to 10563 the shell and grep output windows, but not to read-only text views. 10564 10565- bpo-33679: Enable theme-specific color configuration for Code Context. Use 10566 the Highlights tab to see the setting for built-in themes or add settings 10567 to custom themes. 10568 10569- bpo-33642: Display up to maxlines non-blank lines for Code Context. If 10570 there is no current context, show a single blank line. 10571 10572- bpo-33628: IDLE: Cleanup codecontext.py and its test. 10573 10574- bpo-33564: IDLE's code context now recognizes async as a block opener. 10575 10576- bpo-21474: Update word/identifier definition from ascii to unicode. In 10577 text and entry boxes, this affects selection by double-click, movement 10578 left/right by control-left/right, and deletion left/right by 10579 control-BACKSPACE/DEL. 10580 10581- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string 10582 prefix cannot be paired with either 'r' or 'f'. Consistently color as much 10583 of the prefix, starting at the right, as is valid. Revise and extend 10584 colorizer test. 10585 10586- bpo-32984: Set ``__file__`` while running a startup file. Like Python, 10587 IDLE optionally runs one startup file in the Shell window before 10588 presenting the first interactive input prompt. For IDLE, ``-s`` runs a 10589 file named in environmental variable :envvar:`IDLESTARTUP` or 10590 :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets 10591 ``__file__`` to the startup file name before running the file and unsets 10592 it before the first prompt. IDLE now does the same when run normally, 10593 without the ``-n`` option. 10594 10595- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse. 10596 10597- bpo-32916: Change ``str`` to ``code`` in pyparse. 10598 10599- bpo-32905: Remove unused code in pyparse module. 10600 10601- bpo-32874: Add tests for pyparse. 10602 10603- bpo-32837: Using the system and place-dependent default encoding for 10604 open() is a bad idea for IDLE's system and location-independent files. 10605 10606- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI 10607 test test_file_buttons() only looks at initial ascii-only lines, but 10608 failed on systems where open() defaults to 'ascii' because readline() 10609 internally reads and decodes far enough ahead to encounter a non-ascii 10610 character in CREDITS.txt. 10611 10612- bpo-32831: Add docstrings and tests for codecontext. 10613 10614- bpo-32765: Update configdialog General tab docstring to add new widgets to 10615 the widget list. 10616 10617Tools/Demos 10618----------- 10619 10620- bpo-35884: Add a benchmark script for timing various ways to access 10621 variables: ``Tools/scripts/var_access_benchmark.py``. 10622 10623- bpo-34989: python-gdb.py now handles errors on computing the line number 10624 of a Python frame. 10625 10626- bpo-20260: Argument Clinic now has non-bitwise unsigned int converters. 10627 10628- bpo-32962: python-gdb now catches ``UnicodeDecodeError`` exceptions when 10629 calling ``string()``. 10630 10631- bpo-32962: python-gdb now catches ValueError on read_var(): when Python 10632 has no debug symbols for example. 10633 10634- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as 10635 docstrings and translatable strings, and rejects bytes literals and 10636 f-string expressions. 10637 10638- bpo-31920: Fixed handling directories as arguments in the ``pygettext`` 10639 script. Based on patch by Oleg Krasnikov. 10640 10641- bpo-29673: Fix pystackv and pystack gdbinit macros. 10642 10643- bpo-25427: Remove the pyvenv script in favor of ``python3 -m venv`` in 10644 order to lower confusion as to what Python interpreter a virtual 10645 environment will be created for. 10646 10647- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable 10648 automatic backup creation (files with ``~`` suffix). 10649 10650- bpo-32222: Fix pygettext not extracting docstrings for functions with type 10651 annotated arguments. Patch by Toby Harradine. 10652 10653- bpo-31583: Fix 2to3 for using with --add-suffix option but without 10654 --output-dir option for relative path to files in current directory. 10655 10656C API 10657----- 10658 10659- bpo-35713: The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` 10660 functions have been removed. They did nothing since Python 2.7.4 and 10661 Python 3.2.0, were excluded from the limited API (stable ABI), and were 10662 not documented. 10663 10664- bpo-33817: Fixed :c:func:`_PyBytes_Resize` for empty bytes objects. 10665 10666- bpo-35322: Fix memory leak in :c:func:`PyUnicode_EncodeLocale` and 10667 :c:func:`PyUnicode_EncodeFSDefault` on error handling. 10668 10669- bpo-35059: The following C macros have been converted to static inline 10670 functions: :c:func:`Py_INCREF`, :c:func:`Py_DECREF`, :c:func:`Py_XINCREF`, 10671 :c:func:`Py_XDECREF`, :c:func:`PyObject_INIT`, 10672 :c:func:`PyObject_INIT_VAR`. 10673 10674- bpo-35296: ``make install`` now also installs the internal API: 10675 ``Include/internal/*.h`` header files. 10676 10677- bpo-35081: Internal APIs surrounded by ``#ifdef Py_BUILD_CORE`` have been 10678 moved from ``Include/*.h`` headers to new header files 10679 ``Include/internal/pycore_*.h``. 10680 10681- bpo-35259: Conditionally declare :c:func:`Py_FinalizeEx()` (new in 3.6) 10682 based on Py_LIMITED_API. Patch by Arthur Neufeld. 10683 10684- bpo-35081: The :c:func:`_PyObject_GC_TRACK` and 10685 :c:func:`_PyObject_GC_UNTRACK` macros have been removed from the public C 10686 API. 10687 10688- bpo-35134: Creation of a new ``Include/cpython/`` subdirectory. 10689 10690- bpo-34725: Adds _Py_SetProgramFullPath so embedders may override 10691 sys.executable 10692 10693- bpo-34910: Ensure that :c:func:`PyObject_Print` always returns ``-1`` on 10694 error. Patch by Zackery Spytz. 10695 10696- bpo-34523: Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 10697 encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero. 10698 10699- bpo-34193: Fix pluralization in TypeError messages in getargs.c and 10700 typeobject.c: '1 argument' instead of '1 arguments' and '1 element' 10701 instead of '1 elements'. 10702 10703- bpo-34127: Return grammatically correct error message based on argument 10704 count. Patch by Karthikeyan Singaravelan. 10705 10706- bpo-23927: Fixed :exc:`SystemError` in 10707 :c:func:`PyArg_ParseTupleAndKeywords` when the ``w*`` format unit is used 10708 for optional parameter. 10709 10710- bpo-32455: Added :c:func:`PyCompile_OpcodeStackEffectWithJump`. 10711 10712- bpo-34008: Py_Main() can again be called after Py_Initialize(), as in 10713 Python 3.6. 10714 10715- bpo-32500: Fixed error messages for :c:func:`PySequence_Size`, 10716 :c:func:`PySequence_GetItem`, :c:func:`PySequence_SetItem` and 10717 :c:func:`PySequence_DelItem` called with a mapping and 10718 :c:func:`PyMapping_Size` called with a sequence. 10719 10720- bpo-33818: :c:func:`PyExceptionClass_Name` will now return ``const char 10721 *`` instead of ``char *``. 10722 10723- bpo-33042: Embedding applications may once again call 10724 PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to 10725 calling Py_Initialize. 10726 10727- bpo-32374: Document that m_traverse for multi-phase initialized modules 10728 can be called with m_state=NULL, and add a sanity check 10729 10730- bpo-30863: :c:func:`PyUnicode_AsWideChar` and 10731 :c:func:`PyUnicode_AsWideCharString` no longer cache the ``wchar_t*`` 10732 representation of string objects. 10733 10734 10735What's New in Python 3.7.0 final? 10736================================= 10737 10738*Release date: 2018-06-27* 10739 10740Library 10741------- 10742 10743- bpo-33851: Fix :func:`ast.get_docstring` for a node that lacks a 10744 docstring. 10745 10746C API 10747----- 10748 10749- bpo-33932: Calling Py_Initialize() twice does nothing, instead of failing 10750 with a fatal error: restore the Python 3.6 behaviour. 10751 10752 10753What's New in Python 3.7.0 release candidate 1? 10754=============================================== 10755 10756*Release date: 2018-06-12* 10757 10758Core and Builtins 10759----------------- 10760 10761- bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an 10762 object that hadn't all of its fields set to NULL. 10763 10764- bpo-33706: Fix a crash in Python initialization when parsing the command 10765 line options. Thanks Christoph Gohlke for the bug report and the fix! 10766 10767- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter 10768 shutdown even when there was a custom handler set previously. Patch by 10769 Philipp Kerling. 10770 10771- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c. 10772 10773Library 10774------- 10775 10776- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by 10777 Steve Weber. 10778 10779- bpo-33812: Datetime instance d with non-None tzinfo, but with 10780 d.tzinfo.utcoffset(d) returning None is now treated as naive by the 10781 astimezone() method. 10782 10783- bpo-30805: Avoid race condition with debug logging 10784 10785- bpo-33694: asyncio: Fix a race condition causing data loss on 10786 pause_reading()/resume_reading() when using the ProactorEventLoop. 10787 10788- bpo-32493: Correct test for ``uuid_enc_be`` availability in 10789 ``configure.ac``. Patch by Michael Felt. 10790 10791- bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and 10792 asyncio.WindowsProactorEventLoopPolicy. 10793 10794- bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0. 10795 10796- bpo-33770: improve base64 exception message for encoded inputs of invalid 10797 length 10798 10799- bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case 10800 of an unhandled error; mark SSLTransport as closed if it is aborted. 10801 10802- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence 10803 operations now raise :exc:`TypeError` instead of :exc:`SystemError` when 10804 performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz. 10805 10806- bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake 10807 timeout 10808 10809- bpo-11874: Use a better regex when breaking usage into wrappable parts. 10810 Avoids bogus assertion errors from custom metavar strings. 10811 10812- bpo-33582: Emit a deprecation warning for inspect.formatargspec 10813 10814Documentation 10815------------- 10816 10817- bpo-33409: Clarified the relationship between :pep:`538`'s 10818 PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode. 10819 10820- bpo-33736: Improve the documentation of :func:`asyncio.open_connection`, 10821 :func:`asyncio.start_server` and their UNIX socket counterparts. 10822 10823- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED 10824 flags for ssl.SSLContext.verify_mode. 10825 10826Build 10827----- 10828 10829- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from 10830 ``OPT``. This option emitted annoying warnings when building extension 10831 modules written in C++. 10832 10833Windows 10834------- 10835 10836- bpo-33720: Reduces maximum marshal recursion depth on release builds. 10837 10838IDLE 10839---- 10840 10841- bpo-33656: On Windows, add API call saying that tk scales for DPI. On 10842 Windows 8.1+ or 10, with DPI compatibility properties of the Python binary 10843 unchanged, and a monitor resolution greater than 96 DPI, this should make 10844 text and lines sharper. It should otherwise have no effect. 10845 10846- bpo-33768: Clicking on a context line moves that line to the top of the 10847 editor window. 10848 10849- bpo-33763: IDLE: Use read-only text widget for code context instead of 10850 label widget. 10851 10852- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel 10853 and scrollbar slider moved text by a fixed number of pixels, resulting in 10854 partial lines at the top of the editor box. The change also applies to 10855 the shell and grep output windows, but not to read-only text views. 10856 10857- bpo-33679: Enable theme-specific color configuration for Code Context. Use 10858 the Highlights tab to see the setting for built-in themes or add settings 10859 to custom themes. 10860 10861- bpo-33642: Display up to maxlines non-blank lines for Code Context. If 10862 there is no current context, show a single blank line. 10863 10864 10865What's New in Python 3.7.0 beta 5? 10866================================== 10867 10868*Release date: 2018-05-30* 10869 10870Core and Builtins 10871----------------- 10872 10873- bpo-33622: Fixed a leak when the garbage collector fails to add an object 10874 with the ``__del__`` method or referenced by it into the 10875 :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an 10876 exception is set and preserves it. 10877 10878- bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't 10879 crash if module_globals is not a dict. 10880 10881- bpo-20104: The new `os.posix_spawn` added in 3.7.0b1 was removed as we are 10882 still working on what the API should look like. Expect this in 3.8 10883 instead. 10884 10885- bpo-33475: Fixed miscellaneous bugs in converting annotations to strings 10886 and optimized parentheses in the string representation. 10887 10888- bpo-33391: Fix a leak in set_symmetric_difference(). 10889 10890- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer. 10891 10892- bpo-32911: Due to unexpected compatibility issues discovered during 10893 downstream beta testing, reverted :issue:`29463`. ``docstring`` field is 10894 removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes 10895 which was added in 3.7a1. Docstring expression is restored as a first 10896 statement in their body. Based on patch by Inada Naoki. 10897 10898- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a 10899 ctypes structured data type. Patch by Eryk Sun and Oren Milman. 10900 10901Library 10902------- 10903 10904- bpo-32751: When cancelling the task due to a timeout, 10905 :meth:`asyncio.wait_for` will now wait until the cancellation is complete. 10906 10907- bpo-32684: Fix gather to propagate cancellation of itself even with 10908 return_exceptions. 10909 10910- bpo-33654: Support protocol type switching in SSLTransport.set_protocol(). 10911 10912- bpo-33674: Pause the transport as early as possible to further reduce the 10913 risk of data_received() being called before connection_made(). 10914 10915- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of 10916 asyncio.sslproto: start immediately the handshake instead of using 10917 call_soon(). Previously, data_received() could be called before the 10918 handshake started, causing the handshake to hang or fail. 10919 10920- bpo-31647: Fixed bug where calling write_eof() on a 10921 _SelectorSocketTransport after it's already closed raises AttributeError. 10922 10923- bpo-32610: Make asyncio.all_tasks() return only pending tasks. 10924 10925- bpo-32410: Avoid blocking on file IO in sendfile fallback code 10926 10927- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor 10928 10929- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines 10930 10931- bpo-33654: Fix transport.set_protocol() to support switching between 10932 asyncio.Protocol and asyncio.BufferedProtocol. Fix loop.start_tls() to 10933 work with asyncio.BufferedProtocols. 10934 10935- bpo-33652: Pickles of type variables and subscripted generics are now 10936 future-proof and compatible with older Python versions. 10937 10938- bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD. 10939 10940- bpo-33618: Finalize and document preliminary and experimental TLS 1.3 10941 support with OpenSSL 1.1.1 10942 10943- bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ 10944 10945- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder 10946 that prevented the cache of parsed strings from clearing after finishing 10947 the decoding. Based on patch by c-fos. 10948 10949- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with 10950 OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers 10951 enabled by default. 10952 10953- bpo-28556: Do not simplify arguments to `typing.Union`. Now 10954 `Union[Manager, Employee]` is not simplified to `Employee` at runtime. 10955 Such simplification previously caused several bugs and limited 10956 possibilities for introspection. 10957 10958- bpo-33540: Add a new ``block_on_close`` class attribute to 10959 ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`. 10960 10961- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP 10962 locations 10963 10964- bpo-33109: argparse subparsers are once again not required by default, 10965 reverting the change in behavior introduced by bpo-26510 in 3.7.0a2. 10966 10967- bpo-33536: dataclasses.make_dataclass now checks for invalid field names 10968 and duplicate fields. Also, added a check for invalid field 10969 specifications. 10970 10971- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on 10972 Windows. Patch by Zvi Effron 10973 10974- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in 10975 Windows proactor event loop. 10976 10977- Fix failure in `typing.get_type_hints()` when ClassVar was provided as a 10978 string forward reference. 10979 10980- bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x 10981 faster. 10982 10983- bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in 10984 FieldStorage use the given errors (needed for Twisted). Patch by Amber 10985 Brown. 10986 10987- bpo-33495: Change dataclasses.Fields repr to use the repr of each of its 10988 members, instead of str. This makes it more clear what each field 10989 actually represents. This is especially true for the 'type' member. 10990 10991- bpo-33453: Fix dataclasses to work if using literal string type 10992 annotations or if using PEP 563 "Postponed Evaluation of Annotations". 10993 Only specific string prefixes are detected for both ClassVar ("ClassVar" 10994 and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar"). 10995 10996- bpo-28556: Minor fixes in typing module: add annotations to 10997 ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in 10998 ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova. 10999 11000- bpo-20087: Updated alias mapping with glibc 2.27 supported locales. 11001 11002- bpo-33422: Fix trailing quotation marks getting deleted when looking up 11003 byte/string literals on pydoc. Patch by Andrés Delfino. 11004 11005- bpo-28167: The function ``platform.linux_distribution`` and 11006 ``platform.dist`` now trigger a ``DeprecationWarning`` and have been 11007 marked for removal in Python 3.8 11008 11009- bpo-33197: Update error message when constructing invalid 11010 inspect.Parameters Patch by Dong-hee Na. 11011 11012- bpo-33263: Fix FD leak in `_SelectorSocketTransport` Patch by Vlad 11013 Starostin. 11014 11015- bpo-32861: The urllib.robotparser's ``__str__`` representation now 11016 includes wildcard entries and the "Crawl-delay" and "Request-rate" fields. 11017 Patch by Michael Lazar. 11018 11019- bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant, 11020 available with OpenSSL 1.1.0h or 1.1.1. 11021 11022- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer. 11023 11024Documentation 11025------------- 11026 11027- bpo-23859: Document that `asyncio.wait()` does not cancel its futures on 11028 timeout. 11029 11030- bpo-32436: Document :pep:`567` changes to asyncio. 11031 11032- bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal 11033 to 3.8. 11034 11035- bpo-33503: Fix broken pypi link 11036 11037- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``. 11038 11039Tests 11040----- 11041 11042- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that 11043 might be due to running on ZFS. 11044 11045- bpo-32604: Remove the _xxsubinterpreters module (meant for testing) and 11046 associated helpers. This module was originally added recently in 3.7b1. 11047 11048Build 11049----- 11050 11051- bpo-33614: Ensures module definition files for the stable ABI on Windows 11052 are correctly regenerated. 11053 11054- bpo-33522: Enable CI builds on Visual Studio Team Services at 11055 https://python.visualstudio.com/cpython 11056 11057- bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing 11058 warnings about function casts like casting to PyCFunction in method 11059 definition lists. 11060 11061macOS 11062----- 11063 11064- bpo-13631: The .editrc file in user's home directory is now processed 11065 correctly during the readline initialization through editline emulation on 11066 macOS. 11067 11068IDLE 11069---- 11070 11071- bpo-33628: IDLE: Cleanup codecontext.py and its test. 11072 11073- bpo-33564: IDLE's code context now recognizes async as a block opener. 11074 11075- bpo-32831: Add docstrings and tests for codecontext. 11076 11077 11078What's New in Python 3.7.0 beta 4? 11079================================== 11080 11081*Release date: 2018-05-02* 11082 11083Core and Builtins 11084----------------- 11085 11086- bpo-33363: Raise a SyntaxError for ``async with`` and ``async for`` 11087 statements outside of async functions. 11088 11089- bpo-33128: Fix a bug that causes PathFinder to appear twice on 11090 sys.meta_path. Patch by Pablo Galindo Salgado. 11091 11092- bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in 11093 dictobject.c by adjusting how the internal struct _dictkeysobject shared 11094 keys structure is declared. 11095 11096- bpo-33231: Fix potential memory leak in ``normalizestring()``. 11097 11098- bpo-33205: Change dict growth function from 11099 ``round_up_to_power_2(used*2+hashtable_size/2)`` to 11100 ``round_up_to_power_2(used*3)``. Previously, dict is shrinked only when 11101 ``used == 0``. Now dict has more chance to be shrinked. 11102 11103- bpo-29922: Improved error messages in 'async with' when ``__aenter__()`` 11104 or ``__aexit__()`` return non-awaitable object. 11105 11106- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized 11107 when copying from key-sharing dict. 11108 11109Library 11110------- 11111 11112- bpo-33281: Fix ctypes.util.find_library regression on macOS. 11113 11114- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database 11115 object when it is called with a single argument. 11116 11117- bpo-33329: Fix multiprocessing regression on newer glibcs 11118 11119- bpo-991266: Fix quoting of the ``Comment`` attribute of 11120 :class:`http.cookies.SimpleCookie`. 11121 11122- bpo-33131: Upgrade bundled version of pip to 10.0.1. 11123 11124- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST 11125 object to a tree of tuples or lists with ``line_info=False`` and 11126 ``col_info=True``. 11127 11128- bpo-33266: lib2to3 now recognizes ``rf'...'`` strings. 11129 11130- bpo-11594: Ensure line-endings are respected when using lib2to3. 11131 11132- bpo-33254: Have :func:`importlib.resources.contents` and 11133 :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable` 11134 instead of an :term:`iterator`. 11135 11136- bpo-33256: Fix display of ``<module>`` call in the html produced by 11137 ``cgitb.html()``. Patch by Stéphane Blondon. 11138 11139- bpo-33185: Fixed regression when running pydoc with the :option:`-m` 11140 switch. (The regression was introduced in 3.7.0b3 by the resolution of 11141 :issue:`33053`) This fix also changed pydoc to add ``os.getcwd()`` to 11142 :data:`sys.path` when necessary, rather than adding ``"."``. 11143 11144- bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache` 11145 when :meth:`importlib.machinery.invalidate_caches` is called. 11146 11147- bpo-33217: Deprecate looking up non-Enum objects in Enum classes and Enum 11148 members (will raise :exc:`TypeError` in 3.8+). 11149 11150- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty 11151 sequences consistently even when called from subclasses without a 11152 ``getrandbits()`` implementation. 11153 11154- bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught 11155 StopIteration in a generator into a return-statement. 11156 11157- bpo-33209: End framing at the end of C implementation of 11158 :func:`pickle.Pickler.dump`. 11159 11160- bpo-20104: Improved error handling and fixed a reference leak in 11161 :func:`os.posix_spawn()`. 11162 11163- bpo-33175: In dataclasses, Field.__set_name__ now looks up the 11164 __set_name__ special method on the class, not the instance, of the default 11165 value. 11166 11167- bpo-33097: Raise RuntimeError when ``executor.submit`` is called during 11168 interpreter shutdown. 11169 11170- bpo-31908: Fix output of cover files for ``trace`` module command-line 11171 tool. Previously emitted cover files only when ``--missing`` option was 11172 used. Patch by Michael Selik. 11173 11174Documentation 11175------------- 11176 11177- bpo-33378: Add Korean language switcher for https://docs.python.org/3/ 11178 11179- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be 11180 just any value. 11181 11182- bpo-33201: Modernize documentation for writing C extension types. 11183 11184- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document. 11185 ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is 11186 missed in the document. 11187 11188- bpo-8243: Add a note about curses.addch and curses.addstr exception 11189 behavior when writing outside a window, or pad. 11190 11191- bpo-32337: Update documentation related with ``dict`` order. 11192 11193Tests 11194----- 11195 11196- bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when 11197 the interpreter is built with ``--enable-shared``. 11198 11199Build 11200----- 11201 11202- bpo-33394: Enable the verbose build for extension modules, when GNU make 11203 is passed macros on the command line. 11204 11205- bpo-33393: Update config.guess and config.sub files. 11206 11207- bpo-33377: Add new triplets for mips r6 and riscv variants (used in 11208 extension suffixes). 11209 11210- bpo-32232: By default, modules configured in `Modules/Setup` are no longer 11211 built with `-DPy_BUILD_CORE`. Instead, modules that specifically need that 11212 preprocessor definition include it in their individual entries. 11213 11214- bpo-33182: The embedding tests can once again be built with clang 6.0 11215 11216Windows 11217------- 11218 11219- bpo-33184: Update Windows installer to use OpenSSL 1.1.0h. 11220 11221macOS 11222----- 11223 11224- bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. 11225 11226IDLE 11227---- 11228 11229- bpo-21474: Update word/identifier definition from ascii to unicode. In 11230 text and entry boxes, this affects selection by double-click, movement 11231 left/right by control-left/right, and deletion left/right by 11232 control-BACKSPACE/DEL. 11233 11234- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string 11235 prefix cannot be paired with either 'r' or 'f'. Consistently color as much 11236 of the prefix, starting at the right, as is valid. Revise and extend 11237 colorizer test. 11238 11239Tools/Demos 11240----------- 11241 11242- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as 11243 docstrings and translatable strings, and rejects bytes literals and 11244 f-string expressions. 11245 11246- bpo-31920: Fixed handling directories as arguments in the ``pygettext`` 11247 script. Based on patch by Oleg Krasnikov. 11248 11249- bpo-29673: Fix pystackv and pystack gdbinit macros. 11250 11251- bpo-31583: Fix 2to3 for using with --add-suffix option but without 11252 --output-dir option for relative path to files in current directory. 11253 11254 11255What's New in Python 3.7.0 beta 3? 11256================================== 11257 11258*Release date: 2018-03-29* 11259 11260Security 11261-------- 11262 11263- bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970. 11264 X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new 11265 test ensures that NULL bytes are not allowed. 11266 11267- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows 11268 11269- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic 11270 backtracking. These regexes formed potential DOS vectors (REDOS). They 11271 have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch 11272 by Jamie Davis. 11273 11274Core and Builtins 11275----------------- 11276 11277- bpo-33053: When using the -m switch, sys.path[0] is now explicitly 11278 expanded as the *starting* working directory, rather than being left as 11279 the empty path (which allows imports from the current working directory at 11280 the time of the import) 11281 11282- bpo-33018: Improve consistency of errors raised by ``issubclass()`` when 11283 called with a non-class and an abstract base class as the first and second 11284 arguments, respectively. Patch by Josh Bronson. 11285 11286- bpo-33041: Fixed jumping when the function contains an ``async for`` loop. 11287 11288- bpo-33026: Fixed jumping out of "with" block by setting f_lineno. 11289 11290- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex: 11291 using PYTHONMALLOC env var). _PyGILState_Reinit() and 11292 _PyInterpreterState_Enable() now use the default RAW memory allocator to 11293 allocate a new interpreters mutex on fork. 11294 11295- bpo-17288: Prevent jumps from 'return' and 'exception' trace events. 11296 11297- bpo-32836: Don't use temporary variables in cases of list/dict/set 11298 comprehensions 11299 11300Library 11301------- 11302 11303- bpo-33141: Have Field objects pass through __set_name__ to their default 11304 values, if they have their own __set_name__. 11305 11306- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false 11307 boolean value. Note iid=0 and iid=False would be same. Patch by Garvit 11308 Khatri. 11309 11310- bpo-32873: Treat type variables and special typing forms as immutable by 11311 copy and pickle. This fixes several minor issues and inconsistencies, and 11312 improves backwards compatibility with Python 3.6. 11313 11314- bpo-33134: When computing dataclass's __hash__, use the lookup table to 11315 contain the function which returns the __hash__ value. This is an 11316 improvement over looking up a string, and then testing that string to see 11317 what to do. 11318 11319- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1. 11320 11321- bpo-32505: Raise TypeError if a member variable of a dataclass is of type 11322 Field, but doesn't have a type annotation. 11323 11324- bpo-33078: Fix the failure on OSX caused by the tests relying on 11325 sem_getvalue 11326 11327- bpo-33116: Add 'Field' to dataclasses.__all__. 11328 11329- bpo-32896: Fix an error where subclassing a dataclass with a field that 11330 uses a default_factory would generate an incorrect class. 11331 11332- bpo-33100: Dataclasses: If a field has a default value that's a 11333 MemberDescriptorType, then it's from that field being in __slots__, not an 11334 actual default value. 11335 11336- bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow 11337 attributes to be added to the derived class. Only attributes from the 11338 frozen dataclass cannot be assigned to. Require all dataclasses in a 11339 hierarchy to be either all frozen or all non-frozen. 11340 11341- bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py 11342 11343- bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling 11344 error occurs. 11345 11346- bpo-33064: lib2to3 now properly supports trailing commas after ``*args`` 11347 and ``**kwargs`` in function signatures. 11348 11349- bpo-33056: FIX properly close leaking fds in 11350 concurrent.futures.ProcessPoolExecutor. 11351 11352- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all 11353 threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch 11354 by Nir Soffer. 11355 11356- bpo-31804: Avoid failing in multiprocessing.Process if the standard 11357 streams are closed or None at exit. 11358 11359- bpo-33037: Skip sending/receiving data after SSL transport closing. 11360 11361- bpo-27683: Fix a regression in :mod:`ipaddress` that result of 11362 :meth:`hosts` is empty when the network is constructed by a tuple 11363 containing an integer mask and only 1 bit left for addresses. 11364 11365- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls, 11366 subclass)`` crashed when ``subclass`` is not a type object. 11367 11368- bpo-33009: Fix inspect.signature() for single-parameter partialmethods. 11369 11370- bpo-32969: Expose several missing constants in zlib and fix corresponding 11371 documentation. 11372 11373- bpo-32056: Improved exceptions raised for invalid number of channels and 11374 sample width when read an audio file in modules :mod:`aifc`, :mod:`wave` 11375 and :mod:`sunau`. 11376 11377- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in 11378 subprocess if another low descriptor is closed. 11379 11380- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a 11381 :exc:`ValueError` instead of canceling the first scheduled function. 11382 Patch by Cheryl Sabella. 11383 11384- bpo-31639: http.server now exposes a ThreadedHTTPServer class and uses it 11385 when the module is run with ``-m`` to cope with web browsers pre-opening 11386 sockets. 11387 11388- bpo-27645: :class:`sqlite3.Connection` now exposes a 11389 :class:`~sqlite3.Connection.backup` method, if the underlying SQLite 11390 library is at version 3.6.11 or higher. Patch by Lele Gaifax. 11391 11392Documentation 11393------------- 11394 11395- bpo-33126: Document PyBuffer_ToContiguous(). 11396 11397- bpo-27212: Modify documentation for the :func:`islice` recipe to consume 11398 initial values up to the start index. 11399 11400- bpo-28247: Update :mod:`zipapp` documentation to describe how to make 11401 standalone applications. 11402 11403- bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and 11404 Berker Peksag. 11405 11406- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder`` 11407 implements ``MetaPathFinder``. (Patch by Himanshu Lakhara) 11408 11409Tests 11410----- 11411 11412- bpo-32872: Avoid regrtest compatibility issue with namespace packages. 11413 11414- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport 11415 of ``KqueueSelector`` loop was not being closed. 11416 11417- bpo-19417: Add test_bdb.py. 11418 11419Build 11420----- 11421 11422- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. 11423 11424Windows 11425------- 11426 11427- bpo-33016: Fix potential use of uninitialized memory in 11428 nt._getfinalpathname 11429 11430- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current 11431 directory is set to a UNC path. 11432 11433macOS 11434----- 11435 11436- bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS 11437 10.6+ installer. The 10.9+ installer variant already does this. This 11438 means that the Python 3.7 provided by the python.org macOS installers no 11439 longer need or use any external versions of Tcl/Tk, either system-provided 11440 or user-installed, such as ActiveTcl. 11441 11442IDLE 11443---- 11444 11445- bpo-32984: Set ``__file__`` while running a startup file. Like Python, 11446 IDLE optionally runs one startup file in the Shell window before 11447 presenting the first interactive input prompt. For IDLE, ``-s`` runs a 11448 file named in environmental variable :envvar:`IDLESTARTUP` or 11449 :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets 11450 ``__file__`` to the startup file name before running the file and unsets 11451 it before the first prompt. IDLE now does the same when run normally, 11452 without the ``-n`` option. 11453 11454- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse. 11455 11456Tools/Demos 11457----------- 11458 11459- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable 11460 automatic backup creation (files with ``~`` suffix). 11461 11462C API 11463----- 11464 11465- bpo-33042: Embedding applications may once again call 11466 PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to 11467 calling Py_Initialize. 11468 11469- bpo-32374: Document that m_traverse for multi-phase initialized modules 11470 can be called with m_state=NULL, and add a sanity check 11471 11472 11473What's New in Python 3.7.0 beta 2? 11474================================== 11475 11476*Release date: 2018-02-27* 11477 11478Security 11479-------- 11480 11481- bpo-28414: The ssl module now allows users to perform their own IDN 11482 en/decoding when using SNI. 11483 11484Core and Builtins 11485----------------- 11486 11487- bpo-32889: Update Valgrind suppression list to account for the rename of 11488 ``Py_ADDRESS_IN_RANG`` to ``address_in_range``. 11489 11490- bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled() 11491 context manager). 11492 11493- bpo-32305: For namespace packages, ensure that both ``__file__`` and 11494 ``__spec__.origin`` are set to None. 11495 11496- bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for 11497 namespace packages. 11498 11499- bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by 11500 Stéphane Wirtel 11501 11502- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by 11503 write out-of-bound errors when using customized decode error handlers. 11504 11505Library 11506------- 11507 11508- bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen 11509 classes, and also disallow inheriting non-frozen from frozen classes. This 11510 restriction will be relaxed at a future date. 11511 11512- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch 11513 by Joffrey Fuhrer. 11514 11515- bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now 11516 prohibited. The constructors were never documented, tested, or designed as 11517 public constructors. Users were suppose to use ssl.wrap_socket() or 11518 SSLContext. 11519 11520- bpo-32929: Remove the tri-state parameter "hash", and add the boolean 11521 "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a 11522 __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__ 11523 based on the values of eq= and frozen=. The unsafe_hash=False behavior is 11524 the same as the old hash=None behavior. unsafe_hash=False is the default, 11525 just as hash=None used to be. 11526 11527- bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 11528 for future compatibility with OpenSSL 1.1.1. 11529 11530- bpo-30622: The ssl module now detects missing NPN support in LibreSSL. 11531 11532- bpo-32922: dbm.open() now encodes filename with the filesystem encoding 11533 rather than default encoding. 11534 11535- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3`` 11536 syscall exists or not. 11537 11538- bpo-32556: nt._getfinalpathname, nt._getvolumepathname and 11539 nt._getdiskusage now correctly convert from bytes. 11540 11541- bpo-25988: Emit a :exc:`DeprecationWarning` when using or importing an ABC 11542 directly from :mod:`collections` rather than from :mod:`collections.abc`. 11543 11544- bpo-21060: Rewrite confusing message from setup.py upload from "No dist 11545 file created in earlier command" to the more helpful "Must create and 11546 upload files in one command". 11547 11548- bpo-32852: Make sure sys.argv remains as a list when running trace. 11549 11550- bpo-31333: ``_abc`` module is added. It is a speedup module with C 11551 implementations for various functions and methods in ``abc``. Creating an 11552 ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC 11553 subclass are up to 1.5x faster. In addition, this makes Python start-up up 11554 to 10% faster. Note that the new implementation hides internal registry 11555 and caches, previously accessible via private attributes 11556 ``_abc_registry``, ``_abc_cache``, and ``_abc_negative_cache``. There are 11557 three debugging helper methods that can be used instead 11558 ``_dump_registry``, ``_abc_registry_clear``, and ``_abc_caches_clear``. 11559 11560- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored 11561 cancellation after notifying and cancelling a conditional lock. Patch by 11562 Bar Harel. 11563 11564- bpo-32819: ssl.match_hostname() has been simplified and no longer depends 11565 on re and ipaddress module for wildcard and IP addresses. Error reporting 11566 for invalid wildcards has been improved. 11567 11568- bpo-32394: socket: Remove 11569 TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version 11570 Windows during run-time. 11571 11572- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules. 11573 (Contributed by Oren Milman) 11574 11575- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when 11576 only the last field is quoted. Patch by Jake Davis. 11577 11578- bpo-32792: collections.ChainMap() preserves the order of the underlying 11579 mappings. 11580 11581- bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which 11582 contain set operations. Sets starting with '[' or containing '--', '&&', 11583 '~~' or '||' will be interpreted differently in regular expressions in 11584 future versions. Currently they emit warnings. fnmatch.translate() now 11585 avoids producing patterns containing such sets by accident. 11586 11587- bpo-32622: Implement native fast sendfile for Windows proactor event loop. 11588 11589- bpo-32777: Fix a rare but potential pre-exec child process deadlock in 11590 subprocess on POSIX systems when marking file descriptors inheritable on 11591 exec in the child process. This bug appears to have been introduced in 11592 3.4. 11593 11594- bpo-32647: The ctypes module used to depend on indirect linking for 11595 dlopen. The shared extension is now explicitly linked against libdl on 11596 platforms with dl. 11597 11598- bpo-32741: Implement ``asyncio.TimerHandle.when()`` method. 11599 11600- bpo-32691: Use mod_spec.parent when running modules with pdb 11601 11602- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring 11603 and locking the same lock multiple times, without it being free. Patch by 11604 Bar Harel. 11605 11606- bpo-32727: Do not include name field in SMTP envelope from address. Patch 11607 by Stéphane Wirtel 11608 11609- bpo-31453: Add TLSVersion constants and SSLContext.maximum_version / 11610 minimum_version attributes. The new API wraps OpenSSL 1.1 11611 https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html 11612 feature. 11613 11614- bpo-24334: Internal implementation details of ssl module were cleaned up. 11615 The SSLSocket has one less layer of indirection. Owner and session 11616 information are now handled by the SSLSocket and SSLObject constructor. 11617 Channel binding implementation has been simplified. 11618 11619- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND 11620 chunk is not found. Patch by Zackery Spytz. 11621 11622- bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D 11623 Moore. 11624 11625- bpo-32221: Various functions returning tuple containing IPv6 addresses now 11626 omit ``%scope`` part since the same information is already encoded in 11627 *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` 11628 when it receives multicast packet since useless resolving of network 11629 interface name is omitted. 11630 11631- bpo-30693: The TarFile class now recurses directories in a reproducible 11632 way. 11633 11634- bpo-30693: The ZipFile class now recurses directories in a reproducible 11635 way. 11636 11637Documentation 11638------------- 11639 11640- bpo-28124: The ssl module function ssl.wrap_socket() has been 11641 de-emphasized and deprecated in favor of the more secure and efficient 11642 SSLContext.wrap_socket() method. 11643 11644- bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy. 11645 11646- bpo-32436: Add documentation for the contextvars module (PEP 567). 11647 11648- bpo-32800: Update link to w3c doc for xml default namespaces. 11649 11650- bpo-11015: Update :mod:`test.support` documentation. 11651 11652- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get` 11653 method raises :exc:`AttributeError`. 11654 11655- bpo-32614: Modify RE examples in documentation to use raw strings to 11656 prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight 11657 the deprecation. 11658 11659- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses. 11660 11661Tests 11662----- 11663 11664- bpo-31809: Add tests to verify connection with secp ECDH curves. 11665 11666Build 11667----- 11668 11669- bpo-32898: Fix the python debug build when using COUNT_ALLOCS. 11670 11671Windows 11672------- 11673 11674- bpo-32901: Update Tcl and Tk versions to 8.6.8 11675 11676- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. 11677 11678- bpo-32409: Ensures activate.bat can handle Unicode contents. 11679 11680- bpo-32457: Improves handling of denormalized executable path when 11681 launching Python. 11682 11683- bpo-32370: Use the correct encoding for ipconfig output in the uuid 11684 module. Patch by Segev Finer. 11685 11686- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly 11687 treating the ``PrintNameOffset`` field of the reparse data buffer as a 11688 number of characters instead of bytes. Patch by Craig Holmquist and SSE4. 11689 11690macOS 11691----- 11692 11693- bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8. 11694 11695IDLE 11696---- 11697 11698- bpo-32916: Change ``str`` to ``code`` in pyparse. 11699 11700- bpo-32905: Remove unused code in pyparse module. 11701 11702- bpo-32874: Add tests for pyparse. 11703 11704- bpo-32837: Using the system and place-dependent default encoding for 11705 open() is a bad idea for IDLE's system and location-independent files. 11706 11707- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI 11708 test test_file_buttons() only looks at initial ascii-only lines, but 11709 failed on systems where open() defaults to 'ascii' because readline() 11710 internally reads and decodes far enough ahead to encounter a non-ascii 11711 character in CREDITS.txt. 11712 11713- bpo-32765: Update configdialog General tab docstring to add new widgets to 11714 the widget list. 11715 11716Tools/Demos 11717----------- 11718 11719- bpo-32222: Fix pygettext not extracting docstrings for functions with type 11720 annotated arguments. Patch by Toby Harradine. 11721 11722 11723What's New in Python 3.7.0 beta 1? 11724================================== 11725 11726*Release date: 2018-01-30* 11727 11728Core and Builtins 11729----------------- 11730 11731- bpo-32703: Fix coroutine's ResourceWarning when there's an active error 11732 set when it's being finalized. 11733 11734- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step 11735 over (next command) native coroutines. Patch by Pablo Galindo. 11736 11737- bpo-28685: Optimize list.sort() and sorted() by using type specialized 11738 comparisons when possible. 11739 11740- bpo-32685: Improve suggestion when the Python 2 form of print statement is 11741 either present on the same line as the header of a compound statement or 11742 else terminated by a semi-colon instead of a newline. Patch by Nitish 11743 Chandra. 11744 11745- bpo-32697: Python now explicitly preserves the definition order of 11746 keyword-only parameters. It's always preserved their order, but this 11747 behavior was never guaranteed before; this behavior is now guaranteed and 11748 tested. 11749 11750- bpo-32690: The locals() dictionary now displays in the lexical order that 11751 variables were defined. Previously, the order was reversed. 11752 11753- bpo-32677: Add ``.isascii()`` method to ``str``, ``bytes`` and 11754 ``bytearray``. It can be used to test that string contains only ASCII 11755 characters. 11756 11757- bpo-32670: Enforce :pep:`479` for all code. This means that manually 11758 raising a StopIteration exception from a generator is prohibited for all 11759 code, regardless of whether 'from __future__ import generator_stop' was 11760 used or not. 11761 11762- bpo-32591: Added built-in support for tracking the origin of coroutine 11763 objects; see sys.set_coroutine_origin_tracking_depth and 11764 CoroutineType.cr_origin. This replaces the asyncio debug mode's use of 11765 coroutine wrapping for native coroutine objects. 11766 11767- bpo-31368: Expose preadv and pwritev system calls in the os module. Patch 11768 by Pablo Galindo 11769 11770- bpo-32544: ``hasattr(obj, name)`` and ``getattr(obj, name, default)`` are 11771 about 4 times faster than before when ``name`` is not found and ``obj`` 11772 doesn't override ``__getattr__`` or ``__getattribute__``. 11773 11774- bpo-26163: Improved frozenset() hash to create more distinct hash values 11775 when faced with datasets containing many similar values. 11776 11777- bpo-32550: Remove the STORE_ANNOTATION bytecode. 11778 11779- bpo-20104: Expose posix_spawn as a low level API in the os module. 11780 (removed before 3.7.0rc1) 11781 11782- bpo-24340: Fixed estimation of the code stack size. 11783 11784- bpo-32436: Implement :pep:`567` Context Variables. 11785 11786- bpo-18533: ``repr()`` on a dict containing its own ``values()`` or 11787 ``items()`` no longer raises ``RecursionError``; OrderedDict similarly. 11788 Instead, use ``...``, as for other recursive structures. Patch by Ben 11789 North. 11790 11791- bpo-20891: Py_Initialize() now creates the GIL. The GIL is no longer 11792 created "on demand" to fix a race condition when PyGILState_Ensure() is 11793 called in a non-Python thread. 11794 11795- bpo-32028: Leading whitespace is now correctly ignored when generating 11796 suggestions for converting Py2 print statements to Py3 builtin print 11797 function calls. Patch by Sanyam Khurana. 11798 11799- bpo-31179: Make dict.copy() up to 5.5 times faster. 11800 11801- bpo-31113: Get rid of recursion in the compiler for normal control flow. 11802 11803Library 11804------- 11805 11806- bpo-25988: Deprecate exposing the contents of collections.abc in the 11807 regular collections module. 11808 11809- bpo-31429: The default cipher suite selection of the ssl module now uses a 11810 blacklist approach rather than a hard-coded whitelist. Python no longer 11811 re-enables ciphers that have been blocked by OpenSSL security update. 11812 Default cipher suite selection can be configured on compile time. 11813 11814- bpo-30306: contextlib.contextmanager now releases the arguments passed to 11815 the underlying generator as soon as the context manager is entered. 11816 Previously it would keep them alive for as long as the context manager was 11817 alive, even when not being used as a function decorator. Patch by Martin 11818 Teichmann. 11819 11820- bpo-21417: Added support for setting the compression level for 11821 zipfile.ZipFile. 11822 11823- bpo-32251: Implement asyncio.BufferedProtocol (provisional API). 11824 11825- bpo-32513: In dataclasses, allow easier overriding of dunder methods 11826 without specifying decorator parameters. 11827 11828- bpo-32660: :mod:`termios` makes available ``FIONREAD``, ``FIONCLEX``, 11829 ``FIOCLEX``, ``FIOASYNC`` and ``FIONBIO`` also under Solaris/derivatives. 11830 11831- bpo-27931: Fix email address header parsing error when the username is an 11832 empty quoted string. Patch by Xiang Zhang. 11833 11834- bpo-32659: Under Solaris and derivatives, :class:`os.stat_result` provides 11835 a st_fstype attribute. 11836 11837- bpo-32662: Implement Server.start_serving(), Server.serve_forever(), and 11838 Server.is_serving() methods. Add 'start_serving' keyword parameter to 11839 loop.create_server() and loop.create_unix_server(). 11840 11841- bpo-32391: Implement :meth:`asyncio.StreamWriter.wait_closed` and 11842 :meth:`asyncio.StreamWriter.is_closing` methods 11843 11844- bpo-32643: Make Task._step, Task._wakeup and Future._schedule_callbacks 11845 methods private. 11846 11847- bpo-32630: Refactor decimal module to use contextvars to store decimal 11848 context. 11849 11850- bpo-32622: Add :meth:`asyncio.AbstractEventLoop.sendfile` method. 11851 11852- bpo-32304: distutils' upload command no longer corrupts tar files ending 11853 with a CR byte, and no longer tries to convert CR to CRLF in any of the 11854 upload text fields. 11855 11856- bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware 11857 address is encountered. 11858 11859- bpo-32596: ``concurrent.futures`` imports ``ThreadPoolExecutor`` and 11860 ``ProcessPoolExecutor`` lazily (using :pep:`562`). It makes ``import 11861 asyncio`` about 15% faster because asyncio uses only 11862 ``ThreadPoolExecutor`` by default. 11863 11864- bpo-31801: Add ``_ignore_`` to ``Enum`` so temporary variables can be used 11865 during class construction without being turned into members. 11866 11867- bpo-32576: Use queue.SimpleQueue() in places where it can be invoked from 11868 a weakref callback. 11869 11870- bpo-32574: Fix memory leak in asyncio.Queue, when the queue has limited 11871 size and it is full, the cancelation of queue.put() can cause a memory 11872 leak. Patch by: José Melero. 11873 11874- bpo-32521: The nis module is now compatible with new libnsl and headers 11875 location. 11876 11877- bpo-32467: collections.abc.ValuesView now inherits from 11878 collections.abc.Collection. 11879 11880- bpo-32473: Improve ABCMeta._dump_registry() output readability 11881 11882- bpo-32102: New argument ``capture_output`` for subprocess.run 11883 11884- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and 11885 library in nis module. 11886 11887- bpo-32493: UUID module fixes build for FreeBSD/OpenBSD 11888 11889- bpo-32503: Pickling with protocol 4 no longer creates too small frames. 11890 11891- bpo-29237: Create enum for pstats sorting options 11892 11893- bpo-32454: Add close(fd) function to the socket module. 11894 11895- bpo-25942: The subprocess module is now more graceful when handling a 11896 Ctrl-C KeyboardInterrupt during subprocess.call, subprocess.run, or a 11897 Popen context manager. It now waits a short amount of time for the child 11898 (presumed to have also gotten the SIGINT) to exit, before continuing the 11899 KeyboardInterrupt exception handling. This still includes a SIGKILL in 11900 the call() and run() APIs, but at least the child had a chance first. 11901 11902- bpo-32433: The hmac module now has hmac.digest(), which provides an 11903 optimized HMAC digest. 11904 11905- bpo-28134: Sockets now auto-detect family, type and protocol from file 11906 descriptor by default. 11907 11908- bpo-32404: Fix bug where :meth:`datetime.datetime.fromtimestamp` did not 11909 call __new__ in :class:`datetime.datetime` subclasses. 11910 11911- bpo-32403: Improved speed of :class:`datetime.date` and 11912 :class:`datetime.datetime` alternate constructors. 11913 11914- bpo-32228: Ensure that ``truncate()`` preserves the file position (as 11915 reported by ``tell()``) after writes longer than the buffer size. 11916 11917- bpo-32410: Implement ``loop.sock_sendfile`` for asyncio event loop. 11918 11919- bpo-22908: Added seek and tell to the ZipExtFile class. This only works if 11920 the file object used to open the zipfile is seekable. 11921 11922- bpo-32373: Add socket.getblocking() method. 11923 11924- bpo-32248: Add :mod:`importlib.resources` and 11925 :class:`importlib.abc.ResourceReader` as the unified API for reading 11926 resources contained within packages. Loaders wishing to support resource 11927 reading must implement the :meth:`get_resource_reader()` method. 11928 File-based and zipimport-based loaders both implement these APIs. 11929 :class:`importlib.abc.ResourceLoader` is deprecated in favor of these new 11930 APIs. 11931 11932- bpo-32320: collections.namedtuple() now supports default values. 11933 11934- bpo-29302: Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya 11935 Kulakov. 11936 11937- bpo-31961: *Removed in Python 3.7.0b2.* The *args* argument of 11938 subprocess.Popen can now be a :term:`path-like object`. If *args* is given 11939 as a sequence, it's first element can now be a :term:`path-like object` as 11940 well. 11941 11942- bpo-31900: The :func:`locale.localeconv` function now sets temporarily the 11943 ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode 11944 ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII 11945 or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the 11946 ``LC_CTYPE`` locale. This temporary change affects other threads. Same 11947 change for the :meth:`str.format` method when formatting a number 11948 (:class:`int`, :class:`float`, :class:`float` and subclasses) with the 11949 ``n`` type (ex: ``'{:n}'.format(1234)``). 11950 11951- bpo-31853: Use super().method instead of socket.method in SSLSocket. They 11952 were there most likely for legacy reasons. 11953 11954- bpo-31399: The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() 11955 and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. 11956 Subject common name fallback can be disabled with 11957 SSLContext.hostname_checks_common_name. 11958 11959- bpo-14976: Add a queue.SimpleQueue class, an unbounded FIFO queue with a 11960 reentrant C implementation of put(). 11961 11962Documentation 11963------------- 11964 11965- bpo-32724: Add references to some commands in the documentation of Pdb. 11966 Patch by Stéphane Wirtel 11967 11968- bpo-32649: Complete the C API documentation, profiling and tracing part 11969 with the newly added per-opcode events. 11970 11971- bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and 11972 their C-API counterparts regarding which type of events are received in 11973 each function. Patch by Pablo Galindo Salgado. 11974 11975Tests 11976----- 11977 11978- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built. 11979 11980- bpo-28414: Add test cases for IDNA 2003 and 2008 host names. IDNA 2003 11981 internationalized host names are working since bpo-31399 has landed. IDNA 11982 2008 are still broken. 11983 11984- bpo-32604: Add a new "_xxsubinterpreters" extension module that exposes 11985 the existing subinterpreter C-API and a new cross-interpreter data sharing 11986 mechanism. The module is primarily intended for more thorough testing of 11987 the existing subinterpreter support. Note that the _xxsubinterpreters 11988 module has been removed in 3.7.0rc1. 11989 11990- bpo-32602: Add test certs and test for ECDSA cert and EC/RSA dual mode. 11991 11992- bpo-32549: On Travis CI, Python now Compiles and uses a local copy of 11993 OpenSSL 1.1.0g for testing. 11994 11995Build 11996----- 11997 11998- bpo-32635: Fix segfault of the crypt module when libxcrypt is provided 11999 instead of libcrypt at the system. 12000 12001- bpo-32598: Use autoconf to detect OpenSSL libs, headers and supported 12002 features. The ax_check_openssl M4 macro uses pkg-config to locate OpenSSL 12003 and falls back to manual search. 12004 12005- bpo-32593: Drop support of FreeBSD 9 and older. 12006 12007- bpo-29708: If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, 12008 :mod:`py_compile` will always create hash-based ``.pyc`` files. 12009 12010Windows 12011------- 12012 12013- bpo-32588: Create standalone _distutils_findvs module and add missing 12014 _queue module to installer. 12015 12016- bpo-29911: Ensure separate Modify and Uninstall buttons are displayed. 12017 12018- bpo-32507: Use app-local UCRT install rather than the proper update for 12019 old versions of Windows. 12020 12021macOS 12022----- 12023 12024- bpo-32726: Provide an additional, more modern macOS installer variant that 12025 supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied 12026 third-party libraries to OpenSSL 1.1.0g and to SQLite 3.22.0. The 10.9+ 12027 installer now links with and supplies its own copy of Tcl/Tk 8.6. 12028 12029- bpo-28440: No longer add /Library/Python/3.x/site-packages to sys.path for 12030 macOS framework builds to avoid future conflicts. 12031 12032C API 12033----- 12034 12035- bpo-32681: Fix uninitialized variable 'res' in the C implementation of 12036 os.dup2. Patch by Stéphane Wirtel 12037 12038- bpo-10381: Add C API access to the ``datetime.timezone`` constructor and 12039 ``datetime.timzone.UTC`` singleton. 12040 12041 12042What's New in Python 3.7.0 alpha 4? 12043=================================== 12044 12045*Release date: 2018-01-08* 12046 12047Core and Builtins 12048----------------- 12049 12050- bpo-31975: The default warning filter list now starts with a 12051 "default::DeprecationWarning:__main__" entry, so deprecation warnings are 12052 once again shown by default in single-file scripts and at the interactive 12053 prompt. 12054 12055- bpo-32226: ``__class_getitem__`` is now an automatic class method. 12056 12057- bpo-32399: Add AIX uuid library support for RFC4122 using uuid_create() in 12058 libc.a 12059 12060- bpo-32390: Fix the compilation failure on AIX after the f_fsid field has 12061 been added to the object returned by os.statvfs() (issue #32143). Original 12062 patch by Michael Felt. 12063 12064- bpo-32379: Make MRO computation faster when a class inherits from a single 12065 base. 12066 12067- bpo-32259: The error message of a TypeError raised when unpack 12068 non-iterable is now more specific. 12069 12070- bpo-27169: The ``__debug__`` constant is now optimized out at compile 12071 time. This fixes also bpo-22091. 12072 12073- bpo-32329: The :option:`-R` option now turns on hash randomization when 12074 the :envvar:`PYTHONHASHSEED` environment variable is set to ``0``. 12075 Previously, the option was ignored. Moreover, 12076 ``sys.flags.hash_randomization`` is now properly set to 0 when hash 12077 randomization is turned off by ``PYTHONHASHSEED=0``. 12078 12079- bpo-30416: The optimizer is now protected from spending much time doing 12080 complex calculations and consuming much memory for creating large 12081 constants in constant folding. Increased limits for constants that can be 12082 produced in constant folding. 12083 12084- bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in 12085 socketmodule on Windows. 12086 12087- bpo-30579: Implement TracebackType.__new__ to allow Python-level creation 12088 of traceback objects, and make TracebackType.tb_next mutable. 12089 12090- bpo-32260: Don't byte swap the input keys to the SipHash algorithm on 12091 big-endian platforms. This should ensure siphash gives consistent results 12092 across platforms. 12093 12094- bpo-31506: Improve the error message logic for object.__new__ and 12095 object.__init__. Patch by Sanyam Khurana. 12096 12097- bpo-20361: ``-b`` and ``-bb`` now inject ``'default::BytesWarning'`` and 12098 ``error::BytesWarning`` entries into ``sys.warnoptions``, ensuring that 12099 they take precedence over any other warning filters configured via the 12100 ``-W`` option or the ``PYTHONWARNINGS`` environment variable. 12101 12102- bpo-32230: `-X dev` now injects a ``'default'`` entry into 12103 sys.warnoptions, ensuring that it behaves identically to actually passing 12104 ``-Wdefault`` at the command line. 12105 12106- bpo-29240: Add a new UTF-8 mode: implementation of the :pep:`540`. 12107 12108- bpo-32226: :pep:`560`: Add support for ``__mro_entries__`` and 12109 ``__class_getitem__``. Implemented by Ivan Levkivskyi. 12110 12111- bpo-32225: :pep:`562`: Add support for module ``__getattr__`` and 12112 ``__dir__``. Implemented by Ivan Levkivskyi. 12113 12114- bpo-31901: The `atexit` module now has its callback stored per 12115 interpreter. 12116 12117- bpo-31650: Implement :pep:`552` (Deterministic pycs). Python now supports 12118 invalidating bytecode cache files bashed on a source content hash rather 12119 than source last-modified time. 12120 12121- bpo-29469: Move constant folding from bytecode layer to AST layer. 12122 Original patch by Eugene Toder. 12123 12124Library 12125------- 12126 12127- bpo-32506: Now that dict is defined as keeping insertion order, drop 12128 OrderedDict and just use plain dict. 12129 12130- bpo-32279: Add params to dataclasses.make_dataclasses(): init, repr, eq, 12131 order, hash, and frozen. Pass them through to dataclass(). 12132 12133- bpo-32278: Make type information optional on dataclasses.make_dataclass(). 12134 If omitted, the string 'typing.Any' is used. 12135 12136- bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is 12137 a dataclass or an instance of one. 12138 12139- bpo-32468: Improve frame repr() to mention filename, code name and current 12140 line number. 12141 12142- bpo-23749: asyncio: Implement loop.start_tls() 12143 12144- bpo-32441: Return the new file descriptor (i.e., the second argument) from 12145 ``os.dup2``. Previously, ``None`` was always returned. 12146 12147- bpo-32422: ``functools.lru_cache`` uses less memory (3 words for each 12148 cached key) and takes about 1/3 time for cyclic GC. 12149 12150- bpo-31721: Prevent Python crash from happening when Future._log_traceback 12151 is set to True manually. Now it can only be set to False, or a ValueError 12152 is raised. 12153 12154- bpo-32415: asyncio: Add Task.get_loop() and Future.get_loop() 12155 12156- bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on 12157 interpreter shutdown. 12158 12159- bpo-32363: Make asyncio.Task.set_exception() and set_result() raise 12160 NotImplementedError. Task._step() and Future.__await__() raise proper 12161 exceptions when they are in an invalid state, instead of raising an 12162 AssertionError. 12163 12164- bpo-32357: Optimize asyncio.iscoroutine() and loop.create_task() for 12165 non-native coroutines (e.g. async/await compiled with Cython). 12166 'loop.create_task(python_coroutine)' used to be 20% faster than 12167 'loop.create_task(cython_coroutine)'. Now, the latter is as fast. 12168 12169- bpo-32356: asyncio.transport.resume_reading() and pause_reading() are now 12170 idempotent. New transport.is_reading() method is added. 12171 12172- bpo-32355: Optimize asyncio.gather(); now up to 15% faster. 12173 12174- bpo-32351: Use fastpath in asyncio.sleep if delay<0 (2x boost) 12175 12176- bpo-32348: Optimize asyncio.Future schedule/add/remove callback. The 12177 optimization shows 3-6% performance improvements of async/await code. 12178 12179- bpo-32331: Fix socket.settimeout() and socket.setblocking() to keep 12180 socket.type as is. Fix socket.socket() constructor to reset any bit flags 12181 applied to socket's type. This change only affects OSes that have 12182 SOCK_NONBLOCK and/or SOCK_CLOEXEC. 12183 12184- bpo-32248: Add :class:`importlib.abc.ResourceReader` as an ABC for loaders 12185 to provide a unified API for reading resources contained within packages. 12186 Also add :mod:`importlib.resources` as the port of 12187 ``importlib_resources``. 12188 12189- bpo-32311: Implement asyncio.create_task(coro) shortcut 12190 12191- bpo-32327: Convert asyncio functions that were documented as coroutines to 12192 coroutines. Affected functions: loop.sock_sendall, loop.sock_recv, 12193 loop.sock_accept, loop.getaddrinfo, loop.getnameinfo. 12194 12195- bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id 12196 (scope) to lower case for scoped IPv6 addresses in hostnames now. 12197 12198- bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary 12199 compatible with CRT v140. 12200 12201- bpo-29711: Fix ``stop_serving`` in asyncio proactor loop kill all 12202 listening servers 12203 12204- bpo-32308: :func:`re.sub()` now replaces empty matches adjacent to a 12205 previous non-empty match. 12206 12207- bpo-29970: Abort asyncio SSLProtocol connection if handshake not complete 12208 within 10s 12209 12210- bpo-32314: Implement asyncio.run(). 12211 12212- bpo-17852: Revert incorrect fix based on misunderstanding of 12213 _Py_PyAtExit() semantics. 12214 12215- bpo-32296: Implement asyncio._get_running_loop() and get_event_loop() in 12216 C. This makes them 4x faster. 12217 12218- bpo-32250: Implement ``asyncio.current_task()`` and 12219 ``asyncio.all_tasks()``. Add helpers intended to be used by alternative 12220 task implementations: ``asyncio._register_task``, ``asyncio._enter_task``, 12221 ``asyncio._leave_task`` and ``asyncio._unregister_task``. Deprecate 12222 ``asyncio.Task.current_task()`` and ``asyncio.Task.all_tasks()``. 12223 12224- bpo-32255: A single empty field is now always quoted when written into a 12225 CSV file. This allows to distinguish an empty row from a row consisting of 12226 a single empty field. Patch by Licht Takeuchi. 12227 12228- bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on 12229 platforms where ``chmod(..., follow_symlinks=False)`` is not supported. 12230 Patch by Anthony Sottile. 12231 12232- bpo-30050: New argument warn_on_full_buffer to signal.set_wakeup_fd lets 12233 you control whether Python prints a warning on stderr when the wakeup fd 12234 buffer overflows. 12235 12236- bpo-29137: The ``fpectl`` library has been removed. It was never enabled 12237 by default, never worked correctly on x86-64, and it changed the Python 12238 ABI in ways that caused unexpected breakage of C extensions. 12239 12240- bpo-32273: Move asyncio.test_utils to test.test_asyncio. 12241 12242- bpo-32272: Remove asyncio.async() function. 12243 12244- bpo-32269: Add asyncio.get_running_loop() function. 12245 12246- bpo-32265: All class and static methods of builtin types now are correctly 12247 classified by inspect.classify_class_attrs() and grouped in pydoc ouput. 12248 Added types.ClassMethodDescriptorType for unbound class methods of builtin 12249 types. 12250 12251- bpo-32253: Deprecate ``yield from lock``, ``await lock``, ``with (yield 12252 from lock)`` and ``with await lock`` for asyncio synchronization 12253 primitives. 12254 12255- bpo-22589: Changed MIME type of .bmp from 'image/x-ms-bmp' to 'image/bmp' 12256 12257- bpo-32193: Convert asyncio to use *async/await* syntax. Old styled ``yield 12258 from`` is still supported too. 12259 12260- bpo-32206: Add support to run modules with pdb 12261 12262- bpo-32227: ``functools.singledispatch`` now supports registering 12263 implementations using type annotations. 12264 12265- bpo-15873: Added new alternate constructors 12266 :meth:`datetime.datetime.fromisoformat`, 12267 :meth:`datetime.time.fromisoformat` and 12268 :meth:`datetime.date.fromisoformat` as the inverse operation of each 12269 classes's respective ``isoformat`` methods. 12270 12271- bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link 12272 list'. 12273 12274- bpo-32143: os.statvfs() includes the f_fsid field from statvfs(2) 12275 12276- bpo-26439: Fix ctypes.util.find_library() for AIX by implementing 12277 ctypes._aix.find_library() Patch by: Michael Felt 12278 12279- bpo-31993: The pickler now uses less memory when serializing large bytes 12280 and str objects into a file. Pickles created with protocol 4 will require 12281 less memory for unpickling large bytes and str objects. 12282 12283- bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner. 12284 12285- bpo-31778: ast.literal_eval() is now more strict. Addition and subtraction 12286 of arbitrary numbers no longer allowed. 12287 12288- bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now 12289 works even if the ``os`` module still is not imported. 12290 12291- bpo-30241: Add contextlib.AbstractAsyncContextManager. Patch by Jelle 12292 Zijlstra. 12293 12294- bpo-31699: Fix deadlocks in 12295 :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or 12296 results cause pickling or unpickling errors. This should make sure that 12297 calls to the :class:`ProcessPoolExecutor` API always eventually return. 12298 12299- bpo-15216: ``TextIOWrapper.reconfigure()`` supports changing *encoding*, 12300 *errors*, and *newline*. 12301 12302Documentation 12303------------- 12304 12305- bpo-32418: Add get_loop() method to Server and AbstractServer classes. 12306 12307Tests 12308----- 12309 12310- bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core 12311 dump files when testing crashes. getrlimit() returns zero on success. 12312 12313- bpo-32002: Adjust C locale coercion testing for the empty locale and POSIX 12314 locale cases to more readily adjust to platform dependent behaviour. 12315 12316Windows 12317------- 12318 12319- bpo-19764: Implement support for `subprocess.Popen(close_fds=True)` on 12320 Windows. Patch by Segev Finer. 12321 12322Tools/Demos 12323----------- 12324 12325- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using 12326 pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and 12327 lib2to3 work when run from a zipfile. 12328 12329C API 12330----- 12331 12332- bpo-32030: Py_Initialize() doesn't reset the memory allocators to default 12333 if the ``PYTHONMALLOC`` environment variable is not set. 12334 12335- bpo-29084: Undocumented C API for OrderedDict has been excluded from the 12336 limited C API. It was added by mistake and actually never worked in the 12337 limited C API. 12338 12339- bpo-32264: Moved the pygetopt.h header into internal/, since it has no 12340 public APIs. 12341 12342- bpo-32241: :c:func:`Py_SetProgramName` and :c:func:`Py_SetPythonHome` now 12343 take the ``const wchar *`` arguments instead of ``wchar *``. 12344 12345 12346What's New in Python 3.7.0 alpha 3? 12347=================================== 12348 12349*Release date: 2017-12-05* 12350 12351Core and Builtins 12352----------------- 12353 12354- bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code 12355 object constructor based on freevars and cellvars, rather than needing to 12356 be set correctly by the caller. This ensures it will be cleared 12357 automatically when additional cell references are injected into a modified 12358 code object and function. 12359 12360- bpo-10544: Yield expressions are now deprecated in comprehensions and 12361 generator expressions. They are still permitted in the definition of the 12362 outermost iterable, as that is evaluated directly in the enclosing scope. 12363 12364- bpo-32137: The repr of deeply nested dict now raises a RecursionError 12365 instead of crashing due to a stack overflow. 12366 12367- bpo-32096: Revert memory allocator changes in the C API: move structures 12368 back from _PyRuntime to Objects/obmalloc.c. The memory allocators are once 12369 again initialized statically, and so PyMem_RawMalloc() and 12370 Py_DecodeLocale() can be called before _PyRuntime_Initialize(). 12371 12372- bpo-32043: Add a new "developer mode": new "-X dev" command line option to 12373 enable debug checks at runtime. 12374 12375- bpo-32023: SyntaxError is now correctly raised when a generator expression 12376 without parenthesis is used instead of an inheritance list in a class 12377 definition. The duplication of the parentheses can be omitted only on 12378 calls. 12379 12380- bpo-32012: SyntaxError is now correctly raised when a generator expression 12381 without parenthesis is passed as an argument, but followed by a trailing 12382 comma. A generator expression always needs to be directly inside a set of 12383 parentheses and cannot have a comma on either side. 12384 12385- bpo-28180: A new internal ``_Py_SetLocaleFromEnv(category)`` helper 12386 function has been added in order to improve the consistency of behaviour 12387 across different ``libc`` implementations (e.g. Android doesn't support 12388 setting the locale from the environment by default). 12389 12390- bpo-31949: Fixed several issues in printing tracebacks 12391 (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now 12392 suppresses printing tracebacks. Setting sys.tracebacklimit to None now 12393 causes using the default limit. Setting sys.tracebacklimit to an integer 12394 larger than LONG_MAX now means using the limit LONG_MAX rather than the 12395 default limit. Fixed integer overflows in the case of more than 2**31 12396 traceback items on Windows. Fixed output errors handling. 12397 12398- bpo-30696: Fix the interactive interpreter looping endlessly when no 12399 memory. 12400 12401- bpo-20047: Bytearray methods partition() and rpartition() now accept only 12402 bytes-like objects as separator, as documented. In particular they now 12403 raise TypeError rather of returning a bogus result when an integer is 12404 passed as a separator. 12405 12406- bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of 12407 ``__import__()`` or the ``__all__`` attribute of the module contain bytes 12408 instances. 12409 12410- bpo-31845: Environment variables are once more read correctly at 12411 interpreter startup. 12412 12413- bpo-28936: Ensure that lexically first syntax error involving a parameter 12414 and ``global`` or ``nonlocal`` is detected first at a given scope. Patch 12415 by Ivan Levkivskyi. 12416 12417- bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in 12418 codecs.escape_decode() when decode an escaped non-ascii byte. 12419 12420- bpo-31618: The per-frame tracing logic added in 3.7a1 has been altered so 12421 that ``frame->f_lineno`` is updated before either ``"line"`` or 12422 ``"opcode"`` events are emitted. Previously, opcode events were emitted 12423 first, and therefore would occasionally see stale line numbers on the 12424 frame. The behavior of this feature has changed slightly as a result: when 12425 both ``f_trace_lines`` and ``f_trace_opcodes`` are enabled, line events 12426 now occur first. 12427 12428- bpo-28603: Print the full context/cause chain of exceptions on interpreter 12429 exit, even if an exception in the chain is unhashable or compares equal to 12430 later ones. Patch by Zane Bitter. 12431 12432- bpo-31786: Fix timeout rounding in the select module to round correctly 12433 negative timeouts between -1.0 and 0.0. The functions now block waiting 12434 for events as expected. Previously, the call was incorrectly non-blocking. 12435 Patch by Pablo Galindo. 12436 12437- bpo-31781: Prevent crashes when calling methods of an uninitialized 12438 ``zipimport.zipimporter`` object. Patch by Oren Milman. 12439 12440- bpo-30399: Standard repr() of BaseException with a single argument no 12441 longer contains redundant trailing comma. 12442 12443- bpo-31626: Fixed a bug in debug memory allocator. There was a write to 12444 freed memory after shrinking a memory block. 12445 12446- bpo-30817: `PyErr_PrintEx()` clears now the ignored exception that may be 12447 raised by `_PySys_SetObjectId()`, for example when no memory. 12448 12449Library 12450------- 12451 12452- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying 12453 instances of generic classes, improve interaction of ``__init_subclass__`` 12454 with generics. Original PRs by Ivan Levkivskyi. 12455 12456- bpo-32214: PEP 557, Data Classes. Provides a decorator which adds 12457 boilerplate methods to classes which use type annotations so specify 12458 fields. 12459 12460- bpo-27240: The header folding algorithm for the new email policies has 12461 been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In 12462 particular, RFC2231 folding is now done correctly. 12463 12464- bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL 12465 when getting the file size. Fixed hang of all threads with inaccessible 12466 NFS server. Patch by Nir Soffer. 12467 12468- bpo-321010: Add :attr:`sys.flags.dev_mode` flag 12469 12470- bpo-32154: The ``asyncio.windows_utils.socketpair()`` function has been 12471 removed: use directly :func:`socket.socketpair` which is available on all 12472 platforms since Python 3.5 (before, it wasn't available on Windows). 12473 ``asyncio.windows_utils.socketpair()`` was just an alias to 12474 ``socket.socketpair`` on Python 3.5 and newer. 12475 12476- bpo-32089: warnings: In development (-X dev) and debug mode (pydebug 12477 build), use the "default" action for ResourceWarning, rather than the 12478 "always" action, in the default warnings filters. 12479 12480- bpo-32107: ``uuid.getnode()`` now preferentially returns universally 12481 administered MAC addresses if available, over locally administered MAC 12482 addresses. This makes a better guarantee for global uniqueness of UUIDs 12483 returned from ``uuid.uuid1()``. If only locally administered MAC 12484 addresses are available, the first such one found is returned. 12485 12486- bpo-23033: Wildcard is now supported in hostname when it is one and only 12487 character in the left most segment of hostname in second argument of 12488 :meth:`ssl.match_hostname`. Patch by Mandeep Singh. 12489 12490- bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return 12491 ``None`` when the value of property is ``VT_EMPTY``. Initial patch by 12492 Mark Mc Mahon. 12493 12494- bpo-28334: Use :func:`os.path.expanduser` to find the ``~/.netrc`` file in 12495 :class:`netrc.netrc`. If it does not exist, :exc:`FileNotFoundError` is 12496 raised. Patch by Dimitri Merejkowsky. 12497 12498- bpo-32121: Made ``tracemalloc.Traceback`` behave more like the traceback 12499 module, sorting the frames from oldest to most recent. 12500 ``Traceback.format()`` now accepts negative *limit*, truncating the result 12501 to the ``abs(limit)`` oldest frames. To get the old behaviour, one can use 12502 the new *most_recent_first* argument to ``Traceback.format()``. (Patch by 12503 Jesse Bakker.) 12504 12505- bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the 12506 :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>` 12507 method. Initial patch by Robin Wellner. 12508 12509- bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception 12510 message when it couldn't open or create an MSI file. Initial patch by 12511 William Tisäter. 12512 12513- bpo-19610: ``setup()`` now warns about invalid types for some fields. The 12514 ``distutils.dist.Distribution`` class now warns when ``classifiers``, 12515 ``keywords`` and ``platforms`` fields are not specified as a list or a 12516 string. 12517 12518- bpo-32071: Added the ``-k`` command-line option to ``python -m unittest`` 12519 to run only tests that match the given pattern(s). 12520 12521- bpo-10049: Added *nullcontext* no-op context manager to contextlib. This 12522 provides a simpler and faster alternative to ExitStack() when handling 12523 optional context managers. 12524 12525- bpo-28684: The new test.support.skip_unless_bind_unix_socket() decorator 12526 is used here to skip asyncio tests that fail because the platform lacks a 12527 functional bind() function for unix domain sockets (as it is the case for 12528 non root users on the recent Android versions that run now SELinux in 12529 enforcing mode). 12530 12531- bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n* 12532 characters/bytes for non-negative *n*. This makes it compatible with 12533 ``read()`` methods of other file-like objects. 12534 12535- bpo-27535: The warnings module doesn't leak memory anymore in the hidden 12536 warnings registry for the "ignore" action of warnings filters. 12537 warn_explicit() function doesn't add the warning key to the registry 12538 anymore for the "ignore" action. 12539 12540- bpo-32088: warnings: When Python is build is debug mode (``Py_DEBUG``), 12541 :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning` and 12542 :exc:`ImportWarning` warnings are now displayed by default. 12543 12544- bpo-1647489: Fixed searching regular expression patterns that could match 12545 an empty string. Non-empty string can now be correctly found after 12546 matching an empty string. 12547 12548- bpo-25054: Added support of splitting on a pattern that could match an 12549 empty string. 12550 12551- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays. 12552 Identical objects will be saved only once. Equal references will be load 12553 as identical objects. Added support for saving and loading recursive data 12554 structures. 12555 12556- bpo-32069: Drop legacy SSL transport from asyncio, ssl.MemoryBIO is always 12557 used anyway. 12558 12559- bpo-32066: asyncio: Support pathlib.Path in create_unix_connection; sock 12560 arg should be optional 12561 12562- bpo-32046: Updates 2to3 to convert from operator.isCallable(obj) to 12563 callable(obj). Patch by Dong-hee Na. 12564 12565- bpo-32018: inspect.signature should follow :pep:`8`, if the parameter has 12566 an annotation and a default value. Patch by Dong-hee Na. 12567 12568- bpo-32025: Add time.thread_time() and time.thread_time_ns() 12569 12570- bpo-32037: Integers that fit in a signed 32-bit integer will be now 12571 pickled with protocol 0 using the INT opcode. This will decrease the size 12572 of a pickle, speed up pickling and unpickling, and make these integers be 12573 unpickled as int instances in Python 2. 12574 12575- bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError 12576 pickleable. 12577 12578- bpo-32015: Fixed the looping of asyncio in the case of reconnection the 12579 socket during waiting async read/write from/to the socket. 12580 12581- bpo-32011: Restored support of loading marshal files with the TYPE_INT64 12582 code. These files can be produced in Python 2.7. 12583 12584- bpo-28369: Enhance add_reader/writer check that socket is not used by some 12585 transport. Before, only cases when add_reader/writer were called with an 12586 int FD were supported. Now the check is implemented correctly for all 12587 file-like objects. 12588 12589- bpo-31976: Fix race condition when flushing a file is slow, which can 12590 cause a segfault if closing the file from another thread. 12591 12592- bpo-31985: Formally deprecated aifc.openfp, sunau.openfp, and wave.openfp. 12593 Since change 7bc817d5ba917528e8bd07ec461c635291e7b06a in 1993, openfp in 12594 each of the three modules had been pointing to that module's open function 12595 as a matter of backwards compatibility, though it had been both untested 12596 and undocumented. 12597 12598- bpo-21862: cProfile command line now accepts `-m module_name` as an 12599 alternative to script path. Patch by Sanyam Khurana. 12600 12601- bpo-31970: Reduce performance overhead of asyncio debug mode. 12602 12603- bpo-31843: *database* argument of sqlite3.connect() now accepts a 12604 :term:`path-like object`, instead of just a string. 12605 12606- bpo-31945: Add Configurable *blocksize* to ``HTTPConnection`` and 12607 ``HTTPSConnection`` for improved upload throughput. Patch by Nir Soffer. 12608 12609- bpo-31943: Add a ``cancelled()`` method to :class:`asyncio.Handle`. Patch 12610 by Marat Sharafutdinov. 12611 12612- bpo-9678: Fixed determining the MAC address in the uuid module: Using 12613 ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and 12614 OpenBSD. Based on patch by Takayuki Shimizukawa. 12615 12616- bpo-30057: Fix potential missed signal in signal.signal(). 12617 12618- bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian 12619 platforms. Patch by Jack O'Connor. 12620 12621- bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor 12622 12623- bpo-31927: Fixed compilation of the socket module on NetBSD 8. Fixed 12624 assertion failure or reading arbitrary data when parse a AF_BLUETOOTH 12625 address on NetBSD and DragonFly BSD. 12626 12627- bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse() 12628 when the size of types chtype or mmask_t is less than the size of C long. 12629 curses.box() now accepts characters as arguments. Based on patch by Steve 12630 Fink. 12631 12632- bpo-31917: Add 3 new clock identifiers: :data:`time.CLOCK_BOOTTIME`, 12633 :data:`time.CLOCK_PROF` and :data:`time.CLOCK_UPTIME`. 12634 12635- bpo-31897: plistlib now catches more errors when read binary plists and 12636 raises InvalidFileException instead of unexpected exceptions. 12637 12638- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch 12639 by Masayuki Yamamoto. 12640 12641- bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and 12642 NetBSD. Fixed the comparison of the kqueue_event objects. 12643 12644- bpo-31891: Fixed building the curses module on NetBSD. 12645 12646- bpo-31884: added required constants to subprocess module for setting 12647 priority on windows 12648 12649- bpo-28281: Remove year (1-9999) limits on the Calendar.weekday() function. 12650 Patch by Mark Gollahon. 12651 12652- bpo-31702: crypt.mksalt() now allows to specify the number of rounds for 12653 SHA-256 and SHA-512 hashing. 12654 12655- bpo-30639: :func:`inspect.getfile` no longer computes the repr of unknown 12656 objects to display in an error message, to protect against badly behaved 12657 custom reprs. 12658 12659- bpo-30768: Fix the pthread+semaphore implementation of 12660 PyThread_acquire_lock_timed() when called with timeout > 0 and 12661 intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a 12662 signal (EINTR). See also the :pep:`475`. 12663 12664- bpo-31854: Add ``mmap.ACCESS_DEFAULT`` constant. 12665 12666- bpo-31834: Use optimized code for BLAKE2 only with SSSE3+. The pure SSE2 12667 implementation is slower than the pure C reference implementation. 12668 12669- bpo-28292: Calendar.itermonthdates() will now consistently raise an 12670 exception when a date falls outside of the 0001-01-01 through 9999-12-31 12671 range. To support applications that cannot tolerate such exceptions, the 12672 new methods itermonthdays3() and itermonthdays4() are added. The new 12673 methods return tuples and are not restricted by the range supported by 12674 datetime.date. 12675 12676- bpo-28564: The shutil.rmtree() function has been sped up to 20--40%. This 12677 was done using the os.scandir() function. 12678 12679- bpo-28416: Instances of pickle.Pickler subclass with the persistent_id() 12680 method and pickle.Unpickler subclass with the persistent_load() method no 12681 longer create reference cycles. 12682 12683- bpo-31653: Don't release the GIL if we can acquire a multiprocessing 12684 semaphore immediately. 12685 12686- bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed 12687 or None. 12688 12689- bpo-20825: Add `subnet_of` and `superset_of` containment tests to 12690 :class:`ipaddress.IPv6Network` and :class:`ipaddress.IPv4Network`. Patch 12691 by Michel Albert and Cheryl Sabella. 12692 12693- bpo-31827: Remove the os.stat_float_times() function. It was introduced in 12694 Python 2.3 for backward compatibility with Python 2.2, and was deprecated 12695 since Python 3.1. 12696 12697- bpo-31756: Add a ``subprocess.Popen(text=False)`` keyword argument to 12698 `subprocess` functions to be more explicit about when the library should 12699 attempt to decode outputs into text. Patch by Andrew Clegg. 12700 12701- bpo-31819: Add AbstractEventLoop.sock_recv_into(). 12702 12703- bpo-31457: If nested log adapters are used, the inner ``process()`` 12704 methods are no longer omitted. 12705 12706- bpo-31457: The ``manager`` property on LoggerAdapter objects is now 12707 properly settable. 12708 12709- bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire() 12710 and socket.socket.settimeout() to round correctly negative timeouts 12711 between -1.0 and 0.0. The functions now block waiting for events as 12712 expected. Previously, the call was incorrectly non-blocking. Patch by 12713 Pablo Galindo. 12714 12715- bpo-31803: time.clock() and time.get_clock_info('clock') now emit a 12716 DeprecationWarning warning. 12717 12718- bpo-31800: Extended support for parsing UTC offsets. strptime '%z' can now 12719 parse the output generated by datetime.isoformat, including seconds and 12720 microseconds. 12721 12722- bpo-28603: traceback: Fix a TypeError that occurred during printing of 12723 exception tracebacks when either the current exception or an exception in 12724 its context/cause chain is unhashable. Patch by Zane Bitter. 12725 12726- bpo-30541: Add new function to seal a mock and prevent the automatically 12727 creation of child mocks. Patch by Mario Corchero. 12728 12729- bpo-31784: Implement the :pep:`564`, add new 6 new functions with 12730 nanosecond resolution to the :mod:`time` module: 12731 :func:`~time.clock_gettime_ns`, :func:`~time.clock_settime_ns`, 12732 :func:`~time.monotonic_ns`, :func:`~time.perf_counter_ns`, 12733 :func:`~time.process_time_ns`, :func:`~time.time_ns`. 12734 12735- bpo-30143: 2to3 now generates a code that uses abstract collection classes 12736 from collections.abc rather than collections. 12737 12738- bpo-31770: Prevent a crash when calling the ``__init__()`` method of a 12739 ``sqlite3.Cursor`` object more than once. Patch by Oren Milman. 12740 12741- bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the 12742 ``Cursor`` object is uninitialized. Patch by Oren Milman. 12743 12744- bpo-31752: Fix possible crash in timedelta constructor called with custom 12745 integers. 12746 12747- bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get 12748 pollers timeout 12749 12750- bpo-31690: Allow the flags re.ASCII, re.LOCALE, and re.UNICODE to be used 12751 as group flags for regular expressions. 12752 12753- bpo-30349: FutureWarning is now emitted if a regular expression contains 12754 character set constructs that will change semantically in the future 12755 (nested sets and set operations). 12756 12757- bpo-31664: Added support for the Blowfish hashing in the crypt module. 12758 12759- bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in 12760 asyncio module. This method was previously modifying a wrong reference to 12761 the protocol. 12762 12763- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and 12764 earlier. 12765 12766- bpo-31307: Allow use of bytes objects for arguments to 12767 :meth:`configparser.ConfigParser.read`. Patch by Vincent Michel. 12768 12769- bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for 12770 arbitrary negative timeouts on all OSes where it can only be a 12771 non-negative integer or -1. Patch by Riccardo Coccioli. 12772 12773- bpo-31310: multiprocessing's semaphore tracker should be launched again if 12774 crashed. 12775 12776- bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and 12777 other user interruptions. If it crashes, restart it when necessary. 12778 12779- bpo-31245: Added support for AF_UNIX socket in asyncio 12780 `create_datagram_endpoint`. 12781 12782- bpo-30553: Add HTTP/2 status code 421 (Misdirected Request) to 12783 :class:`http.HTTPStatus`. Patch by Vitor Pereira. 12784 12785Documentation 12786------------- 12787 12788- bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket 12789 versionadded marker. 12790 12791Tests 12792----- 12793 12794- bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on 12795 APFS. 12796 12797- bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5. 12798 The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged 12799 into the kernel 4.5. 12800 12801- bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV and 12802 remove the test.support.requires_android_level decorator. 12803 12804- bpo-32136: The runtime embedding tests have been split out from 12805 ``Lib/test/test_capi.py`` into a new ``Lib/test/test_embed.py`` file. 12806 12807- bpo-28668: test.support.requires_multiprocessing_queue is removed. Skip 12808 tests with test.support.import_module('multiprocessing.synchronize') 12809 instead when the semaphore implementation is broken or missing. 12810 12811- bpo-32126: Skip test_get_event_loop_new_process in 12812 test.test_asyncio.test_events when sem_open() is not functional. 12813 12814- bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the 12815 names sample to always test the same files. It prevents false alarms when 12816 hunting reference leaks. 12817 12818Build 12819----- 12820 12821- bpo-28538: Revert the previous changes, the if_nameindex structure is 12822 defined by Unified Headers. 12823 12824- bpo-28762: Revert the last commit, the F_LOCK macro is defined by Android 12825 Unified Headers. 12826 12827- bpo-29040: Support building Android with Unified Headers. The first NDK 12828 release to support Unified Headers is android-ndk-r14. 12829 12830- bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the 12831 sysroot paths when cross-compiling. 12832 12833- bpo-31957: Fixes Windows SDK version detection when building for Windows. 12834 12835- bpo-31609: Fixes quotes in PCbuild/clean.bat 12836 12837- bpo-31934: Abort the build when building out of a not clean source tree. 12838 12839- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when 12840 there was more than one function and/or method in a .c file with the same 12841 name. 12842 12843- bpo-28791: Update Windows builds to use SQLite 3.21.0. 12844 12845- bpo-28791: Update OS X installer to use SQLite 3.21.0. 12846 12847- bpo-28643: Record profile-opt build progress with stamp files. 12848 12849- bpo-31866: Finish removing support for AtheOS. 12850 12851Windows 12852------- 12853 12854- bpo-1102: Return ``None`` when ``View.Fetch()`` returns 12855 ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by 12856 Anthony Tuininga. 12857 12858- bpo-31944: Fixes Modify button in Apps and Features dialog. 12859 12860- bpo-20486: Implement the ``Database.Close()`` method to help closing MSI 12861 database objects. 12862 12863- bpo-31857: Make the behavior of USE_STACKCHECK deterministic in a 12864 multi-threaded environment. 12865 12866macOS 12867----- 12868 12869- bpo-31392: Update macOS installer to use OpenSSL 1.0.2m 12870 12871IDLE 12872---- 12873 12874- bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event 12875 handling is driven by IDLE's run loop, a confusing and distracting 12876 queue.EMPTY traceback context is no longer added to tk event exception 12877 tracebacks. The traceback is now the same as when event handling is 12878 driven by user code. Patch based on a suggestion by Serhiy Storchaka. 12879 12880- bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet 12881 in configdialog was replaced by ttk.Notebook. 12882 12883- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch 12884 mostly by Cheryl Sabella. 12885 12886- bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor 12887 and output windows only see an empty last prompt line. This simplifies 12888 the code and fixes a minor bug when newline is inserted. Sys.ps1, if 12889 present, is read on Shell start-up, but is not set or changed. 12890 12891- bpo-31860: The font sample in the IDLE configuration dialog is now 12892 editable. Changes persist while IDLE remains open 12893 12894- bpo-31836: Test_code_module now passes if run after test_idle, which sets 12895 ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not. 12896 Test_code_module now properly tests both behaviors. Ditto for ps2. 12897 12898- bpo-28603: Fix a TypeError that caused a shell restart when printing a 12899 traceback that includes an exception that is unhashable. Patch by Zane 12900 Bitter. 12901 12902- bpo-13802: Use non-Latin characters in the IDLE's Font settings sample. 12903 Even if one selects a font that defines a limited subset of the unicode 12904 Basic Multilingual Plane, tcl/tk will use other fonts that define a 12905 character. The expanded example give users of non-Latin characters a 12906 better idea of what they might see in IDLE's shell and editors. To make 12907 room for the expanded sample, frames on the Font tab are re-arranged. The 12908 Font/Tabs help explains a bit about the additions. 12909 12910Tools/Demos 12911----------- 12912 12913- bpo-32159: Remove CVS and Subversion tools: remove svneol.py and 12914 treesync.py scripts. CPython migrated from CVS to Subversion, to 12915 Mercurial, and then to Git. CVS and Subversion are no longer used to 12916 develop CPython. 12917 12918- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also, 12919 remove the ``LOCALE`` option since it doesn't work with string patterns in 12920 Python 3. Patch by Christoph Sarnowski. 12921 12922C API 12923----- 12924 12925- bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in 12926 a non-Python thread before PyEval_InitThreads(), only call 12927 PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. 12928 12929- bpo-32125: The ``Py_UseClassExceptionsFlag`` flag has been removed. It was 12930 deprecated and wasn't used anymore since Python 2.0. 12931 12932- bpo-25612: Move the current exception state from the frame object to the 12933 co-routine. This simplifies the interpreter and fixes a couple of obscure 12934 bugs caused by having swap exception state when entering or exiting a 12935 generator. 12936 12937- bpo-23699: Add Py_RETURN_RICHCOMPARE macro to reduce boilerplate code in 12938 rich comparison functions. 12939 12940- bpo-30697: The `PyExc_RecursionErrorInst` singleton is removed and 12941 `PyErr_NormalizeException()` does not use it anymore. This singleton is 12942 persistent and its members being never cleared may cause a segfault during 12943 finalization of the interpreter. See also issue #22898. 12944 12945 12946What's New in Python 3.7.0 alpha 2? 12947=================================== 12948 12949*Release date: 2017-10-16* 12950 12951Core and Builtins 12952----------------- 12953 12954- bpo-31558: ``gc.freeze()`` is a new API that allows for moving all objects 12955 currently tracked by the garbage collector to a permanent generation, 12956 effectively removing them from future collection events. This can be used 12957 to protect those objects from having their PyGC_Head mutated. In effect, 12958 this enables great copy-on-write stability at fork(). 12959 12960- bpo-31642: Restored blocking "from package import module" by setting 12961 sys.modules["package.module"] to None. 12962 12963- bpo-31708: Allow use of asynchronous generator expressions in synchronous 12964 functions. 12965 12966- bpo-31709: Drop support of asynchronous __aiter__. 12967 12968- bpo-30404: The -u option now makes the stdout and stderr streams 12969 unbuffered rather than line-buffered. 12970 12971- bpo-31619: Fixed a ValueError when convert a string with large number of 12972 underscores to integer with binary base. 12973 12974- bpo-31602: Fix an assertion failure in `zipimporter.get_source()` in case 12975 of a bad `zlib.decompress()`. Patch by Oren Milman. 12976 12977- bpo-31592: Fixed an assertion failure in Python parser in case of a bad 12978 `unicodedata.normalize()`. Patch by Oren Milman. 12979 12980- bpo-31588: Raise a `TypeError` with a helpful error message when class 12981 creation fails due to a metaclass with a bad ``__prepare__()`` method. 12982 Patch by Oren Milman. 12983 12984- bpo-31574: Importlib was instrumented with two dtrace probes to profile 12985 import timing. 12986 12987- bpo-31566: Fix an assertion failure in `_warnings.warn()` in case of a bad 12988 ``__name__`` global. Patch by Oren Milman. 12989 12990- bpo-31506: Improved the error message logic for object.__new__ and 12991 object.__init__. 12992 12993- bpo-31505: Fix an assertion failure in `json`, in case 12994 `_json.make_encoder()` received a bad `encoder()` argument. Patch by Oren 12995 Milman. 12996 12997- bpo-31492: Fix assertion failures in case of failing to import from a 12998 module with a bad ``__name__`` attribute, and in case of failing to access 12999 an attribute of such a module. Patch by Oren Milman. 13000 13001- bpo-31478: Fix an assertion failure in `_random.Random.seed()` in case the 13002 argument has a bad ``__abs__()`` method. Patch by Oren Milman. 13003 13004- bpo-31336: Speed up class creation by 10-20% by reducing the overhead in 13005 the necessary special method lookups. Patch by Stefan Behnel. 13006 13007- bpo-31415: Add ``-X importtime`` option to show how long each import 13008 takes. It can be used to optimize application's startup time. Support the 13009 :envvar:`PYTHONPROFILEIMPORTTIME` as an equivalent way to enable this. 13010 13011- bpo-31410: Optimized calling wrapper and classmethod descriptors. 13012 13013- bpo-31353: :pep:`553` - Add a new built-in called ``breakpoint()`` which 13014 calls ``sys.breakpointhook()``. By default this imports ``pdb`` and calls 13015 ``pdb.set_trace()``, but users may override ``sys.breakpointhook()`` to 13016 call whatever debugger they want. The original value of the hook is saved 13017 in ``sys.__breakpointhook__``. 13018 13019- bpo-17852: Maintain a list of open buffered files, flush them before 13020 exiting the interpreter. Based on a patch from Armin Rigo. 13021 13022- bpo-31315: Fix an assertion failure in imp.create_dynamic(), when 13023 spec.name is not a string. Patch by Oren Milman. 13024 13025- bpo-31311: Fix a crash in the ``__setstate__()`` method of 13026 `ctypes._CData`, in case of a bad ``__dict__``. Patch by Oren Milman. 13027 13028- bpo-31293: Fix crashes in true division and multiplication of a timedelta 13029 object by a float with a bad as_integer_ratio() method. Patch by Oren 13030 Milman. 13031 13032- bpo-31285: Fix an assertion failure in `warnings.warn_explicit`, when the 13033 return value of the received loader's get_source() has a bad splitlines() 13034 method. Patch by Oren Milman. 13035 13036- bpo-30406: Make ``async`` and ``await`` proper keywords, as specified in 13037 :pep:`492`. 13038 13039Library 13040------- 13041 13042- bpo-30058: Fixed buffer overflow in select.kqueue.control(). 13043 13044- bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII 13045 characters. Now it uses ``-i`` regular expression local flag to avoid 13046 non-ASCII characters. 13047 13048- bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM 13049 exceptions. 13050 13051- bpo-31728: Prevent crashes in `_elementtree` due to unsafe cleanup of 13052 `Element.text` and `Element.tail`. Patch by Oren Milman. 13053 13054- bpo-31671: Now ``re.compile()`` converts passed RegexFlag to normal int 13055 object before compiling. bm_regex_compile benchmark shows 14% performance 13056 improvements. 13057 13058- bpo-30397: The types of compiled regular objects and match objects are now 13059 exposed as `re.Pattern` and `re.Match`. This adds information in pydoc 13060 output for the re module. 13061 13062- bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split() 13063 when pass a string larger than 2 GiB. 13064 13065- bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo(). 13066 13067- bpo-31648: Improvements to path predicates in ElementTree: Allow 13068 whitespace around predicate parts, i.e. "[a = 'text']" instead of 13069 requiring the less readable "[a='text']". Add support for text comparison 13070 of the current node, like "[.='text']". Patch by Stefan Behnel. 13071 13072- bpo-30806: Fix the string representation of a netrc object. 13073 13074- bpo-31638: Add optional argument ``compressed`` to 13075 ``zipapp.create_archive``, and add option ``--compress`` to the command 13076 line interface of ``zipapp``. 13077 13078- bpo-25351: Avoid venv activate failures with undefined variables 13079 13080- bpo-20519: Avoid ctypes use (if possible) and improve import time for 13081 uuid. 13082 13083- bpo-28293: The regular expression cache is no longer completely dumped 13084 when it is full. 13085 13086- bpo-31596: Added pthread_getcpuclockid() to the time module 13087 13088- bpo-27494: Make 2to3 accept a trailing comma in generator expressions. For 13089 example, ``set(x for x in [],)`` is now allowed. 13090 13091- bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() 13092 iterators. 13093 13094- bpo-30346: An iterator produced by itertools.groupby() iterator now 13095 becomes exhausted after advancing the groupby iterator. 13096 13097- bpo-31556: Cancel asyncio.wait_for future faster if timeout <= 0 13098 13099- bpo-31540: Allow passing a context object in 13100 :class:`concurrent.futures.ProcessPoolExecutor` constructor. Also, free 13101 job resources in :class:`concurrent.futures.ProcessPoolExecutor` earlier 13102 to improve memory usage when a worker waits for new jobs. 13103 13104- bpo-31516: ``threading.current_thread()`` should not return a dummy thread 13105 at shutdown. 13106 13107- bpo-31525: In the sqlite module, require the sqlite3_prepare_v2 API. Thus, 13108 the sqlite module now requires sqlite version at least 3.3.9. 13109 13110- bpo-26510: argparse subparsers are now required by default. This matches 13111 behaviour in Python 2. For optional subparsers, use the new parameter 13112 ``add_subparsers(required=False)``. Patch by Anthony Sottile. (As of 13113 3.7.0rc1, the default was changed to not required as had been the case 13114 since Python 3.3.) 13115 13116- bpo-27541: Reprs of subclasses of some collection and iterator classes 13117 (`bytearray`, `array.array`, `collections.deque`, 13118 `collections.defaultdict`, `itertools.count`, `itertools.repeat`) now 13119 contain actual type name insteads of hardcoded name of the base class. 13120 13121- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip 13122 bootstrapping has failed. 13123 13124- bpo-31389: ``pdb.set_trace()`` now takes an optional keyword-only argument 13125 ``header``. If given, this is printed to the console just before debugging 13126 begins. 13127 13128Documentation 13129------------- 13130 13131- bpo-31537: Fix incorrect usage of ``get_history_length`` in readline 13132 documentation example code. Patch by Brad Smith. 13133 13134- bpo-30085: The operator functions without double underscores are preferred 13135 for clarity. The one with underscores are only kept for 13136 back-compatibility. 13137 13138Build 13139----- 13140 13141- bpo-31696: Improve compiler version information in :data:`sys.version` 13142 when Python is built with Clang. 13143 13144- bpo-31625: Stop using ranlib on static libraries. Instead, we assume ar 13145 supports the 's' flag. 13146 13147- bpo-31624: Remove support for BSD/OS. 13148 13149- bpo-22140: Prevent double substitution of prefix in python-config.sh. 13150 13151- bpo-31569: Correct PCBuild/ case to PCbuild/ in build scripts and 13152 documentation. 13153 13154- bpo-31536: Avoid wholesale rebuild after `make regen-all` if nothing 13155 changed. 13156 13157IDLE 13158---- 13159 13160- bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget 13161 instead of an flist with a root widget opens the option of creating a 13162 browser frame that is only part of a window. Passing a full file name 13163 instead of pieces assumed to come from a .py file opens the possibility of 13164 browsing python files that do not end in .py. 13165 13166- bpo-31649: IDLE - Make _htest, _utest parameters keyword only. 13167 13168- bpo-31559: Remove test order dependence in idle_test.test_browser. 13169 13170- bpo-31459: Rename IDLE's module browser from Class Browser to Module 13171 Browser. The original module-level class and method browser became a 13172 module browser, with the addition of module-level functions, years ago. 13173 Nested classes and functions were added yesterday. For 13174 back-compatibility, the virtual event <<open-class-browser>>, which 13175 appears on the Keys tab of the Settings dialog, is not changed. Patch by 13176 Cheryl Sabella. 13177 13178- bpo-31500: Default fonts now are scaled on HiDPI displays. 13179 13180- bpo-1612262: IDLE module browser now shows nested classes and functions. 13181 Original patches for code and tests by Guilherme Polo and Cheryl Sabella, 13182 respectively. 13183 13184C API 13185----- 13186 13187- bpo-28280: Make `PyMapping_Keys()`, `PyMapping_Values()` and 13188 `PyMapping_Items()` always return a `list` (rather than a `list` or a 13189 `tuple`). Patch by Oren Milman. 13190 13191- bpo-31532: Fix memory corruption due to allocator mix in getpath.c between 13192 Py_GetPath() and Py_SetPath() 13193 13194- bpo-25658: Implement :pep:`539` for Thread Specific Storage (TSS) API: it 13195 is a new Thread Local Storage (TLS) API to CPython which would supersede 13196 use of the existing TLS API within the CPython interpreter, while 13197 deprecating the existing API. PEP written by Erik M. Bray, patch by 13198 Masayuki Yamamoto. 13199 13200 13201What's New in Python 3.7.0 alpha 1? 13202=================================== 13203 13204*Release date: 2017-09-19* 13205 13206Security 13207-------- 13208 13209- bpo-29781: SSLObject.version() now correctly returns None when handshake 13210 over BIO has not been performed yet. 13211 13212- bpo-29505: Add fuzz tests for float(str), int(str), unicode(str); for 13213 oss-fuzz. 13214 13215- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to 13216 get security fixes. 13217 13218- bpo-30730: Prevent environment variables injection in subprocess on 13219 Windows. Prevent passing other environment variables and command 13220 arguments. 13221 13222- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple 13223 security vulnerabilities including: CVE-2017-9233 (External entity 13224 infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), 13225 CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and 13226 CVE-2012-0876 (Counter hash flooding with SipHash). Note: the 13227 CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't 13228 impact Python, since Python already gets entropy from the OS to set the 13229 expat secret using ``XML_SetHashSalt()``. 13230 13231- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For 13232 example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the 13233 ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an 13234 authentication (``login@host``). 13235 13236- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of 13237 CVE-2016-0718 and CVE-2016-4472. See 13238 https://sourceforge.net/p/expat/bugs/537/ for more information. 13239 13240Core and Builtins 13241----------------- 13242 13243- bpo-31490: Fix an assertion failure in `ctypes` class definition, in case 13244 the class has an attribute whose name is specified in ``_anonymous_`` but 13245 not in ``_fields_``. Patch by Oren Milman. 13246 13247- bpo-31471: Fix an assertion failure in `subprocess.Popen()` on Windows, in 13248 case the env argument has a bad keys() method. Patch by Oren Milman. 13249 13250- bpo-31418: Fix an assertion failure in `PyErr_WriteUnraisable()` in case 13251 of an exception with a bad ``__module__`` attribute. Patch by Oren Milman. 13252 13253- bpo-31416: Fix assertion failures in case of a bad warnings.filters or 13254 warnings.defaultaction. Patch by Oren Milman. 13255 13256- bpo-28411: Change direct usage of PyInterpreterState.modules to 13257 PyImport_GetModuleDict(). Also introduce more uniformity in other code 13258 that deals with sys.modules. This helps reduce complications when working 13259 on sys.modules. 13260 13261- bpo-28411: Switch to the abstract API when dealing with 13262 ``PyInterpreterState.modules``. This allows later support for all dict 13263 subclasses and other Mapping implementations. Also add a 13264 ``PyImport_GetModule()`` function to reduce a bunch of duplicated code. 13265 13266- bpo-31411: Raise a TypeError instead of SystemError in case 13267 warnings.onceregistry is not a dictionary. Patch by Oren Milman. 13268 13269- bpo-31344: For finer control of tracing behaviour when testing the 13270 interpreter, two new frame attributes have been added to control the 13271 emission of particular trace events: ``f_trace_lines`` (``True`` by 13272 default) to turn off per-line trace events; and ``f_trace_opcodes`` 13273 (``False`` by default) to turn on per-opcode trace events. 13274 13275- bpo-31373: Fix several possible instances of undefined behavior due to 13276 floating-point demotions. 13277 13278- bpo-30465: Location information (``lineno`` and ``col_offset``) in 13279 f-strings is now (mostly) correct. This fixes tools like flake8 from 13280 showing warnings on the wrong line (typically the first line of the file). 13281 13282- bpo-30860: Consolidate CPython's global runtime state under a single 13283 struct. This improves discoverability of the runtime state. 13284 13285- bpo-31347: Fix possible undefined behavior in _PyObject_FastCall_Prepend. 13286 13287- bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev(). 13288 GNU C libray plans to remove the functions from sys/types.h. 13289 13290- bpo-31291: Fix an assertion failure in `zipimport.zipimporter.get_data` on 13291 Windows, when the return value of ``pathname.replace('/','\\')`` isn't a 13292 string. Patch by Oren Milman. 13293 13294- bpo-31271: Fix an assertion failure in the write() method of 13295 `io.TextIOWrapper`, when the encoder doesn't return a bytes object. Patch 13296 by Oren Milman. 13297 13298- bpo-31243: Fix a crash in some methods of `io.TextIOWrapper`, when the 13299 decoder's state is invalid. Patch by Oren Milman. 13300 13301- bpo-30721: ``print`` now shows correct usage hint for using Python 2 13302 redirection syntax. Patch by Sanyam Khurana. 13303 13304- bpo-31070: Fix a race condition in importlib _get_module_lock(). 13305 13306- bpo-30747: Add a non-dummy implementation of _Py_atomic_store and 13307 _Py_atomic_load on MSVC. 13308 13309- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which 13310 doesn't call ``PyObject_GC_UnTrack()``. 13311 13312- bpo-31071: Avoid masking original TypeError in call with * unpacking when 13313 other arguments are passed. 13314 13315- bpo-30978: str.format_map() now passes key lookup exceptions through. 13316 Previously any exception was replaced with a KeyError exception. 13317 13318- bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state. 13319 13320- bpo-30876: Relative import from unloaded package now reimports the package 13321 instead of failing with SystemError. Relative import from non-package now 13322 fails with ImportError rather than SystemError. 13323 13324- bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from 13325 signal handler, to avoid calling signal-unsafe functions. The tests I'm 13326 adding here fail without the rest of the patch, on Linux and OS X. This 13327 means our signal delivery logic had defects (some signals could be lost). 13328 13329- bpo-30765: Avoid blocking in pthread_mutex_lock() when 13330 PyThread_acquire_lock() is asked not to block. 13331 13332- bpo-31161: Make sure the 'Missing parentheses' syntax error message is 13333 only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters. 13334 13335- bpo-30814: Fixed a race condition when import a submodule from a package. 13336 13337- bpo-30736: The internal unicodedata database has been upgraded to Unicode 13338 10.0. 13339 13340- bpo-30604: Move co_extra_freefuncs from per-thread to per-interpreter to 13341 avoid crashes. 13342 13343- bpo-30597: ``print`` now shows expected input in custom error message when 13344 used as a Python 2 statement. Patch by Sanyam Khurana. 13345 13346- bpo-30682: Removed a too-strict assertion that failed for certain 13347 f-strings, such as eval("f'\\\n'") and eval("f'\\\r'"). 13348 13349- bpo-30501: The compiler now produces more optimal code for complex 13350 condition expressions in the "if", "while" and "assert" statement, the 13351 "if" expression, and generator expressions and comprehensions. 13352 13353- bpo-28180: Implement :pep:`538` (legacy C locale coercion). This means 13354 that when a suitable coercion target locale is available, both the core 13355 interpreter and locale-aware C extensions will assume the use of UTF-8 as 13356 the default text encoding, rather than ASCII. 13357 13358- bpo-30486: Allows setting cell values for __closure__. Patch by Lisa 13359 Roach. 13360 13361- bpo-30537: itertools.islice now accepts integer-like objects (having an 13362 __index__ method) as start, stop, and slice arguments 13363 13364- bpo-25324: Tokens needed for parsing in Python moved to C. ``COMMENT``, 13365 ``NL`` and ``ENCODING``. This way the tokens and tok_names in the token 13366 module don't get changed when you import the tokenize module. 13367 13368- bpo-29104: Fixed parsing backslashes in f-strings. 13369 13370- bpo-27945: Fixed various segfaults with dict when input collections are 13371 mutated during searching, inserting or comparing. Based on patches by 13372 Duane Griffin and Tim Mitchell. 13373 13374- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for 13375 non-interned attribute names. Based on patch by Eryk Sun. 13376 13377- bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the 13378 middle of resuming a chain of nested 'yield from' or 'await' calls, it's 13379 now correctly delivered to the innermost frame. 13380 13381- bpo-28974: ``object.__format__(x, '')`` is now equivalent to ``str(x)`` 13382 rather than ``format(str(self), '')``. 13383 13384- bpo-30024: Circular imports involving absolute imports with binding a 13385 submodule to a name are now supported. 13386 13387- bpo-12414: sys.getsizeof() on a code object now returns the sizes which 13388 includes the code struct and sizes of objects which it references. Patch 13389 by Dong-hee Na. 13390 13391- bpo-29839: len() now raises ValueError rather than OverflowError if 13392 __len__() returned a large negative integer. 13393 13394- bpo-11913: README.rst is now included in the list of distutils standard 13395 READMEs and therefore included in source distributions. 13396 13397- bpo-29914: Fixed default implementations of __reduce__ and 13398 __reduce_ex__(). object.__reduce__() no longer takes arguments, 13399 object.__reduce_ex__() now requires one argument. 13400 13401- bpo-29949: Fix memory usage regression of set and frozenset object. 13402 13403- bpo-29935: Fixed error messages in the index() method of tuple, list and 13404 deque when pass indices of wrong type. 13405 13406- bpo-29816: Shift operation now has less opportunity to raise 13407 OverflowError. ValueError always is raised rather than OverflowError for 13408 negative counts. Shifting zero with non-negative count always returns 13409 zero. 13410 13411- bpo-24821: Fixed the slowing down to 25 times in the searching of some 13412 unlucky Unicode characters. 13413 13414- bpo-29102: Add a unique ID to PyInterpreterState. This makes it easier to 13415 identify each subinterpreter. 13416 13417- bpo-29894: The deprecation warning is emitted if __complex__ returns an 13418 instance of a strict subclass of complex. In a future versions of Python 13419 this can be an error. 13420 13421- bpo-29859: Show correct error messages when any of the pthread_* calls in 13422 thread_pthread.h fails. 13423 13424- bpo-29849: Fix a memory leak when an ImportError is raised during from 13425 import. 13426 13427- bpo-28856: Fix an oversight that %b format for bytes should support 13428 objects follow the buffer protocol. 13429 13430- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused 13431 a regression by revealing an inconsistency in how sys.path is initialized 13432 when executing ``__main__`` from a zipfile, directory, or other import 13433 location. The interpreter now consistently avoids ever adding the import 13434 location's parent directory to ``sys.path``, and ensures no other 13435 ``sys.path`` entries are inadvertently modified when inserting the import 13436 location named on the command line. 13437 13438- bpo-29568: Escaped percent "%%" in the format string for classic string 13439 formatting no longer allows any characters between two percents. 13440 13441- bpo-29714: Fix a regression that bytes format may fail when containing 13442 zero bytes inside. 13443 13444- bpo-29695: bool(), float(), list() and tuple() no longer take keyword 13445 arguments. The first argument of int() can now be passes only as 13446 positional argument. 13447 13448- bpo-28893: Set correct __cause__ for errors about invalid awaitables 13449 returned from __aiter__ and __anext__. 13450 13451- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises 13452 :exc:`OverflowError`. 13453 13454- bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian 13455 Coleman. 13456 13457- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It 13458 should raise TypeError when kwargs is not a dict. But it might cause segv 13459 when args=NULL and kwargs is not a dict. 13460 13461- bpo-28598: Support __rmod__ for subclasses of str being called before 13462 str.__mod__. Patch by Martijn Pieters. 13463 13464- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by 13465 Matthieu Dartiailh. 13466 13467- bpo-29602: Fix incorrect handling of signed zeros in complex constructor 13468 for complex subclasses and for inputs having a __complex__ method. Patch 13469 by Serhiy Storchaka. 13470 13471- bpo-29347: Fixed possibly dereferencing undefined pointers when creating 13472 weakref objects. 13473 13474- bpo-29463: Add ``docstring`` field to Module, ClassDef, FunctionDef, and 13475 AsyncFunctionDef ast nodes. docstring is not first stmt in their body 13476 anymore. It affects ``co_firstlineno`` and ``co_lnotab`` of code object 13477 for module and class. (Reverted in :issue:`32911`.) 13478 13479- bpo-29438: Fixed use-after-free problem in key sharing dict. 13480 13481- bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from 13482 ... import ...``. 13483 13484- bpo-29546: Improve from-import error message with location 13485 13486- bpo-29478: If max_line_length=None is specified while using the Compat32 13487 policy, it is no longer ignored. Patch by Mircea Cosbuc. 13488 13489- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0]. 13490 13491- bpo-29337: Fixed possible BytesWarning when compare the code objects. 13492 Warnings could be emitted at compile time. 13493 13494- bpo-29327: Fixed a crash when pass the iterable keyword argument to 13495 sorted(). 13496 13497- bpo-29034: Fix memory leak and use-after-free in os module 13498 (path_converter). 13499 13500- bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception. 13501 13502- bpo-29049: Call _PyObject_GC_TRACK() lazily when calling Python function. 13503 Calling function is up to 5% faster. 13504 13505- bpo-28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII 13506 whitespace, not only spaces. Patch by Robert Xiao. 13507 13508- bpo-28932: Do not include <sys/random.h> if it does not exist. 13509 13510- bpo-25677: Correct the positioning of the syntax error caret for indented 13511 blocks. Based on patch by Michael Layzell. 13512 13513- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate 13514 form. 13515 13516- bpo-18896: Python function can now have more than 255 parameters. 13517 collections.namedtuple() now supports tuples with more than 255 elements. 13518 13519- bpo-28596: The preferred encoding is UTF-8 on Android. Patch written by 13520 Chi Hsuan Yen. 13521 13522- bpo-22257: Clean up interpreter startup (see :pep:`432`). 13523 13524- bpo-26919: On Android, operating system data is now always encoded/decoded 13525 to/from UTF-8, instead of the locale encoding to avoid inconsistencies 13526 with os.fsencode() and os.fsdecode() which are already using UTF-8. 13527 13528- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy 13529 bug triggerable by a monkey-patched len() function. 13530 13531- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must 13532 not convert combined table into split table. Patch written by INADA Naoki. 13533 13534- bpo-28739: f-string expressions are no longer accepted as docstrings and 13535 by ast.literal_eval() even if they do not include expressions. 13536 13537- bpo-28512: Fixed setting the offset attribute of SyntaxError by 13538 PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). 13539 13540- bpo-28918: Fix the cross compilation of xxlimited when Python has been 13541 built with Py_DEBUG defined. 13542 13543- bpo-23722: Rather than silently producing a class that doesn't support 13544 zero-argument ``super()`` in methods, failing to pass the new 13545 ``__classcell__`` namespace entry up to ``type.__new__`` now results in a 13546 ``DeprecationWarning`` and a class that supports zero-argument 13547 ``super()``. 13548 13549- bpo-28797: Modifying the class __dict__ inside the __set_name__ method of 13550 a descriptor that is used inside that class no longer prevents calling the 13551 __set_name__ method of other descriptors. 13552 13553- bpo-28799: Remove the ``PyEval_GetCallStats()`` function and deprecate the 13554 untested and undocumented ``sys.callstats()`` function. Remove the 13555 ``CALL_PROFILE`` special build: use the :func:`sys.setprofile` function, 13556 :mod:`cProfile` or :mod:`profile` to profile function calls. 13557 13558- bpo-12844: More than 255 arguments can now be passed to a function. 13559 13560- bpo-28782: Fix a bug in the implementation ``yield from`` when checking if 13561 the next instruction is YIELD_FROM. Regression introduced by WORDCODE 13562 (issue #26647). 13563 13564- bpo-28774: Fix error position of the unicode error in ASCII and Latin1 13565 encoders when a string returned by the error handler contains multiple 13566 non-encodable characters (non-ASCII for the ASCII codec, characters out of 13567 the U+0000-U+00FF range for Latin1). 13568 13569- bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict. 13570 Improve speed of dict literal with constant keys up to 30%. 13571 13572- bpo-28532: Show sys.version when -V option is supplied twice. 13573 13574- bpo-27100: The with-statement now checks for __enter__ before it checks 13575 for __exit__. This gives less confusing error messages when both methods 13576 are missing. Patch by Jonathan Ellington. 13577 13578- bpo-28746: Fix the set_inheritable() file descriptor method on platforms 13579 that do not have the ioctl FIOCLEX and FIONCLEX commands. 13580 13581- bpo-26920: Fix not getting the locale's charset upon initializing the 13582 interpreter, on platforms that do not have langinfo. 13583 13584- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X 13585 when decode astral characters. Patch by Xiang Zhang. 13586 13587- bpo-28665: Improve speed of the STORE_DEREF opcode by 40%. 13588 13589- bpo-19398: Extra slash no longer added to sys.path components in case of 13590 empty compile-time PYTHONPATH components. 13591 13592- bpo-28621: Sped up converting int to float by reusing faster bits counting 13593 implementation. Patch by Adrian Wielgosik. 13594 13595- bpo-28580: Optimize iterating split table values. Patch by Xiang Zhang. 13596 13597- bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch 13598 by Xiang Zhang. 13599 13600- bpo-28128: Deprecation warning for invalid str and byte escape sequences 13601 now prints better information about where the error occurs. Patch by 13602 Serhiy Storchaka and Eric Smith. 13603 13604- bpo-28509: dict.update() no longer allocate unnecessary large memory. 13605 13606- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug 13607 build. 13608 13609- bpo-28517: Fixed of-by-one error in the peephole optimizer that caused 13610 keeping unreachable code. 13611 13612- bpo-28214: Improved exception reporting for problematic __set_name__ 13613 attributes. 13614 13615- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception 13616 loss in PyTraceBack_Here(). 13617 13618- bpo-28183: Optimize and cleanup dict iteration. 13619 13620- bpo-26081: Added C implementation of asyncio.Future. Original patch by 13621 Yury Selivanov. 13622 13623- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). 13624 Patch by Xiang Zhang. 13625 13626- bpo-28376: The type of long range iterator is now registered as Iterator. 13627 Patch by Oren Milman. 13628 13629- bpo-28376: Creating instances of range_iterator by calling range_iterator 13630 type now is disallowed. Calling iter() on range instance is the only way. 13631 Patch by Oren Milman. 13632 13633- bpo-26906: Resolving special methods of uninitialized type now causes 13634 implicit initialization of the type instead of a fail. 13635 13636- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original 13637 patch by Niklas Koep. 13638 13639- bpo-24098: Fixed possible crash when AST is changed in process of 13640 compiling it. 13641 13642- bpo-28201: Dict reduces possibility of 2nd conflict in hash table when 13643 hashes have same lower bits. 13644 13645- bpo-28350: String constants with null character no longer interned. 13646 13647- bpo-26617: Fix crash when GC runs during weakref callbacks. 13648 13649- bpo-27942: String constants now interned recursively in tuples and 13650 frozensets. 13651 13652- bpo-28289: ImportError.__init__ now resets not specified attributes. 13653 13654- bpo-21578: Fixed misleading error message when ImportError called with 13655 invalid keyword args. 13656 13657- bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch 13658 by Soumya Sharma. 13659 13660- bpo-28086: Single var-positional argument of tuple subtype was passed 13661 unscathed to the C-defined function. Now it is converted to exact tuple. 13662 13663- bpo-28214: Now __set_name__ is looked up on the class instead of the 13664 instance. 13665 13666- bpo-27955: Fallback on reading /dev/urandom device when the getrandom() 13667 syscall fails with EPERM, for example when blocked by SECCOMP. 13668 13669- bpo-28192: Don't import readline in isolated mode. 13670 13671- bpo-27441: Remove some redundant assignments to ob_size in longobject.c. 13672 Thanks Oren Milman. 13673 13674- bpo-27222: Clean up redundant code in long_rshift function. Thanks Oren 13675 Milman. 13676 13677- Upgrade internal unicode databases to Unicode version 9.0.0. 13678 13679- bpo-28131: Fix a regression in zipimport's compile_source(). zipimport 13680 should use the same optimization level as the interpreter. 13681 13682- bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly 13683 optimize memcpy(). 13684 13685- bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a 13686 "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. 13687 13688- bpo-26182: Raise DeprecationWarning when async and await keywords are used 13689 as variable/attribute/class/function name. 13690 13691- bpo-26182: Fix a refleak in code that raises DeprecationWarning. 13692 13693- bpo-28721: Fix asynchronous generators aclose() and athrow() to handle 13694 StopAsyncIteration propagation properly. 13695 13696- bpo-26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes. 13697 13698Library 13699------- 13700 13701- bpo-31499: xml.etree: Fix a crash when a parser is part of a reference 13702 cycle. 13703 13704- bpo-31482: ``random.seed()`` now works with bytes in version=1 13705 13706- bpo-28556: typing.get_type_hints now finds the right globalns for classes 13707 and modules by default (when no ``globalns`` was specified by the caller). 13708 13709- bpo-28556: Speed improvements to the ``typing`` module. Original PRs by 13710 Ivan Levkivskyi and Mitar. 13711 13712- bpo-31544: The C accelerator module of ElementTree ignored exceptions 13713 raised when looking up TreeBuilder target methods in XMLParser(). 13714 13715- bpo-31234: socket.create_connection() now fixes manually a reference 13716 cycle: clear the variable storing the last exception on success. 13717 13718- bpo-31457: LoggerAdapter objects can now be nested. 13719 13720- bpo-31431: SSLContext.check_hostname now automatically sets 13721 SSLContext.verify_mode to ssl.CERT_REQUIRED instead of failing with a 13722 ValueError. 13723 13724- bpo-31233: socketserver.ThreadingMixIn now keeps a list of non-daemonic 13725 threads to wait until all these threads complete in server_close(). 13726 13727- bpo-28638: Changed the implementation strategy for 13728 collections.namedtuple() to substantially reduce the use of exec() in 13729 favor of precomputed methods. As a result, the *verbose* parameter and 13730 *_source* attribute are no longer supported. The benefits include 1) 13731 having a smaller memory footprint for applications using multiple named 13732 tuples, 2) faster creation of the named tuple class (approx 4x to 6x 13733 depending on how it is measured), and 3) minor speed-ups for instance 13734 creation using __new__, _make, and _replace. (The primary patch 13735 contributor is Jelle Zijlstra with further improvements by INADA Naoki, 13736 Serhiy Storchaka, and Raymond Hettinger.) 13737 13738- bpo-31400: Improves SSL error handling to avoid losing error numbers. 13739 13740- bpo-27629: Make return types of SSLContext.wrap_bio() and 13741 SSLContext.wrap_socket() customizable. 13742 13743- bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a 13744 context cannot be instantiated. 13745 13746- bpo-28182: The SSL module now raises SSLCertVerificationError when OpenSSL 13747 fails to verify the peer's certificate. The exception contains more 13748 information about the error. 13749 13750- bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of 13751 data. This fixes support for all bytes-like object. It is also more 13752 efficient and avoids costly copies. 13753 13754- bpo-14191: A new function 13755 ``argparse.ArgumentParser.parse_intermixed_args`` provides the ability to 13756 parse command lines where there user intermixes options and positional 13757 arguments. 13758 13759- bpo-31178: Fix string concatenation bug in rare error path in the 13760 subprocess module 13761 13762- bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up 13763 to 10% faster. 13764 13765- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of 13766 partial characters for UTF-8 input (libexpat bug 115): 13767 https://github.com/libexpat/libexpat/issues/115 13768 13769- bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3. 13770 13771- bpo-1198569: ``string.Template`` subclasses can optionally define 13772 ``braceidpattern`` if they want to specify different placeholder patterns 13773 inside and outside the braces. If None (the default) it falls back to 13774 ``idpattern``. 13775 13776- bpo-31326: concurrent.futures.ProcessPoolExecutor.shutdown() now 13777 explicitly closes the call queue. Moreover, shutdown(wait=True) now also 13778 join the call queue thread, to prevent leaking a dangling thread. 13779 13780- bpo-27144: The ``map()`` and ``as_completed()`` iterators in 13781 ``concurrent.futures`` now avoid keeping a reference to yielded objects. 13782 13783- bpo-31281: Fix ``fileinput.FileInput(files, inplace=True)`` when ``files`` 13784 contain ``pathlib.Path`` objects. 13785 13786- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer 13787 types. 13788 13789- bpo-27584: ``AF_VSOCK`` has been added to the socket interface which 13790 allows communication between virtual machines and their host. 13791 13792- bpo-22536: The subprocess module now sets the filename when 13793 FileNotFoundError is raised on POSIX systems due to the executable or cwd 13794 not being found. 13795 13796- bpo-29741: Update some methods in the _pyio module to also accept integer 13797 types. Patch by Oren Milman. 13798 13799- bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor 13800 now breaks a reference cycle between an exception object and the WorkItem 13801 object. 13802 13803- bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using 13804 sys.exc_info() in code handling exceptions. 13805 13806- bpo-23835: configparser: reading defaults in the ``ConfigParser()`` 13807 constructor is now using ``read_dict()``, making its behavior consistent 13808 with the rest of the parser. Non-string keys and values in the defaults 13809 dictionary are now being implicitly converted to strings. Patch by James 13810 Tocknell. 13811 13812- bpo-31238: pydoc: the stop() method of the private ServerThread class now 13813 waits until DocServer.serve_until_quit() completes and then explicitly 13814 sets its docserver attribute to None to break a reference cycle. 13815 13816- bpo-5001: Many asserts in `multiprocessing` are now more informative, and 13817 some error types have been changed to more specific ones. 13818 13819- bpo-31109: Convert zipimport to use Argument Clinic. 13820 13821- bpo-30102: The ssl and hashlib modules now call 13822 OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function 13823 detects CPU features and enables optimizations on some CPU architectures 13824 such as POWER8. Patch is based on research from Gustavo Serra Scalet. 13825 13826- bpo-18966: Non-daemonic threads created by a multiprocessing.Process are 13827 now joined on child exit. 13828 13829- bpo-31183: `dis` now works with asynchronous generator and coroutine 13830 objects. Patch by George Collins based on diagnosis by Luciano Ramalho. 13831 13832- bpo-5001: There are a number of uninformative asserts in the 13833 `multiprocessing` module, as noted in issue 5001. This change fixes two of 13834 the most potentially problematic ones, since they are in error-reporting 13835 code, in the `multiprocessing.managers.convert_to_error` function. (It 13836 also makes more informative a ValueError message.) The only potentially 13837 problematic change is that the AssertionError is now a TypeError; however, 13838 this should also help distinguish it from an AssertionError being 13839 *reported* by the function/its caller (such as in issue 31169). - Patch by 13840 Allen W. Smith (drallensmith on github). 13841 13842- bpo-31185: Fixed miscellaneous errors in asyncio speedup module. 13843 13844- bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all 13845 child processes completed to prevent leaking zombie processes. 13846 13847- bpo-31072: Add an ``include_file`` parameter to 13848 ``zipapp.create_archive()`` 13849 13850- bpo-24700: Optimize array.array comparison. It is now from 10x up to 70x 13851 faster when comparing arrays holding values of the same integer type. 13852 13853- bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu 13854 classes. Call the parent destroy() method even if the used attribute 13855 doesn't exist. The LabeledScale.destroy() method now also explicitly 13856 clears label and scale attributes to help the garbage collector to destroy 13857 all widgets. 13858 13859- bpo-31107: Fix `copyreg._slotnames()` mangled attribute calculation for 13860 classes whose name begins with an underscore. Patch by Shane Harvey. 13861 13862- bpo-31080: Allow `logging.config.fileConfig` to accept kwargs and/or args. 13863 13864- bpo-30897: ``pathlib.Path`` objects now include an ``is_mount()`` method 13865 (only implemented on POSIX). This is similar to ``os.path.ismount(p)``. 13866 Patch by Cooper Ry Lees. 13867 13868- bpo-31061: Fixed a crash when using asyncio and threads. 13869 13870- bpo-30987: Added support for CAN ISO-TP protocol in the socket module. 13871 13872- bpo-30522: Added a ``setStream`` method to ``logging.StreamHandler`` to 13873 allow the stream to be set after creation. 13874 13875- bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian 13876 Heimes. 13877 13878- bpo-5288: Support tzinfo objects with sub-minute offsets. 13879 13880- bpo-30919: Fix shared memory performance regression in multiprocessing in 13881 3.x. Shared memory used anonymous memory mappings in 2.x, while 3.x mmaps 13882 actual files. Try to be careful to do as little disk I/O as possible. 13883 13884- bpo-26732: Fix too many fds in processes started with the "forkserver" 13885 method. A child process would inherit as many fds as the number of 13886 still-running children. 13887 13888- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound 13889 builtin functions. Patch by Aaron Gallagher. 13890 13891- bpo-30961: Fix decrementing a borrowed reference in tracemalloc. 13892 13893- bpo-19896: Fix multiprocessing.sharedctypes to recognize typecodes ``'q'`` 13894 and ``'Q'``. 13895 13896- bpo-30946: Remove obsolete code in readline module for platforms where GNU 13897 readline is older than 2.1 or where select() is not available. 13898 13899- bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across 13900 instances of ``OptionMenu``. 13901 13902- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the 13903 thread completes, even if the thread was started by the same process which 13904 created the queue. 13905 13906- bpo-29854: Fix segfault in readline when using readline's history-size 13907 option. Patch by Nir Soffer. 13908 13909- bpo-30794: Added multiprocessing.Process.kill method to terminate using 13910 the SIGKILL signal on Unix. 13911 13912- bpo-30319: socket.close() now ignores ECONNRESET error. 13913 13914- bpo-30828: Fix out of bounds write in 13915 `asyncio.CFuture.remove_done_callback()`. 13916 13917- bpo-30302: Use keywords in the ``repr`` of ``datetime.timedelta``. 13918 13919- bpo-30807: signal.setitimer() may disable the timer when passed a tiny 13920 value. Tiny values (such as 1e-6) are valid non-zero values for 13921 setitimer(), which is specified as taking microsecond-resolution 13922 intervals. However, on some platform, our conversion routine could convert 13923 1e-6 into a zero interval, therefore disabling the timer instead of 13924 (re-)scheduling it. 13925 13926- bpo-30441: Fix bug when modifying os.environ while iterating over it 13927 13928- bpo-29585: Avoid importing ``sysconfig`` from ``site`` to improve startup 13929 speed. Python startup is about 5% faster on Linux and 30% faster on macOS. 13930 13931- bpo-29293: Add missing parameter "n" on 13932 multiprocessing.Condition.notify(). The doc claims 13933 multiprocessing.Condition behaves like threading.Condition, but its 13934 notify() method lacked the optional "n" argument (to specify the number of 13935 sleepers to wake up) that threading.Condition.notify() accepts. 13936 13937- bpo-30532: Fix email header value parser dropping folding white space in 13938 certain cases. 13939 13940- bpo-30596: Add a ``close()`` method to ``multiprocessing.Process``. 13941 13942- bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash 13943 functions such as md5 are not available in the linked OpenSSL library. As 13944 in some special FIPS-140 build environments. 13945 13946- bpo-29169: Update zlib to 1.2.11. 13947 13948- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that 13949 contains CR or LF. Patch by Dong-hee Na. 13950 13951- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called 13952 with bytes-like argument. 13953 13954- bpo-30746: Prohibited the '=' character in environment variable names in 13955 ``os.putenv()`` and ``os.spawn*()``. 13956 13957- bpo-30664: The description of a unittest subtest now preserves the order 13958 of keyword arguments of TestCase.subTest(). 13959 13960- bpo-21071: struct.Struct.format type is now :class:`str` instead of 13961 :class:`bytes`. 13962 13963- bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to 13964 have a non repr() based thread name by default when no thread_name_prefix 13965 is supplied. They will now identify themselves as 13966 "ThreadPoolExecutor-y_n". 13967 13968- bpo-29755: Fixed the lgettext() family of functions in the gettext module. 13969 They now always return bytes. 13970 13971- bpo-30616: Functional API of enum allows to create empty enums. Patched by 13972 Dong-hee Na 13973 13974- bpo-30038: Fix race condition between signal delivery and wakeup file 13975 descriptor. Patch by Nathaniel Smith. 13976 13977- bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings. 13978 13979- bpo-24744: pkgutil.walk_packages function now raises ValueError if *path* 13980 is a string. Patch by Sanyam Khurana. 13981 13982- bpo-24484: Avoid race condition in multiprocessing cleanup. 13983 13984- bpo-30589: Fix multiprocessing.Process.exitcode to return the opposite of 13985 the signal number when the process is killed by a signal (instead of 255) 13986 when using the "forkserver" method. 13987 13988- bpo-28994: The traceback no longer displayed for SystemExit raised in a 13989 callback registered by atexit. 13990 13991- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was 13992 called. 13993 13994- bpo-30645: Fix path calculation in `imp.load_package()`, fixing it for 13995 cases when a package is only shipped with bytecodes. Patch by Alexandru 13996 Ardelean. 13997 13998- bpo-11822: The dis.dis() function now is able to disassemble nested code 13999 objects. 14000 14001- bpo-30624: selectors does not take KeyboardInterrupt and SystemExit into 14002 account, leaving a fd in a bad state in case of error. Patch by Giampaolo 14003 Rodola'. 14004 14005- bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader 14006 in non-blocking mode if it succeeded to acquire the lock but the acquire 14007 took longer than the timeout. 14008 14009- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add 14010 support for ContextManager on all versions. Original PRs by Jelle Zijlstra 14011 and Ivan Levkivskyi 14012 14013- bpo-30605: re.compile() no longer raises a BytesWarning when compiling a 14014 bytes instance with misplaced inline modifier. Patch by Roy Williams. 14015 14016- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl 14017 implementation. Patch by Michaël Sghaïer. 14018 14019- bpo-29743: Closing transport during handshake process leaks open socket. 14020 Patch by Nikolay Kim 14021 14022- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu 14023 Sornay. 14024 14025- bpo-30014: modify() method of poll(), epoll() and devpoll() based classes 14026 of selectors module is around 10% faster. Patch by Giampaolo Rodola'. 14027 14028- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore 14029 EINVAL on stdin.write() if the child process is still running but closed 14030 the pipe. 14031 14032- bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers to 14033 deny __dict__ and __weakref__ creation. Patch by Aaron Hall. 14034 14035- bpo-30520: Loggers are now pickleable. 14036 14037- bpo-30557: faulthandler now correctly filters and displays exception codes 14038 on Windows 14039 14040- bpo-30526: Add TextIOWrapper.reconfigure() and a 14041 TextIOWrapper.write_through attribute. 14042 14043- bpo-30245: Fix possible overflow when organize struct.pack_into error 14044 message. Patch by Yuan Liu. 14045 14046- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot 14047 handle IPv6 addresses. 14048 14049- bpo-16500: Allow registering at-fork handlers. 14050 14051- bpo-30470: Deprecate invalid ctypes call protection on Windows. Patch by 14052 Mariatta Wijaya. 14053 14054- bpo-30414: multiprocessing.Queue._feed background running thread do not 14055 break from main loop on exception. 14056 14057- bpo-30003: Fix handling escape characters in HZ codec. Based on patch by 14058 Ma Lin. 14059 14060- bpo-30149: inspect.signature() now supports callables with 14061 variable-argument parameters wrapped with partialmethod. Patch by Dong-hee 14062 Na. 14063 14064- bpo-30436: importlib.find_spec() raises ModuleNotFoundError instead of 14065 AttributeError if the specified parent module is not a package (i.e. lacks 14066 a __path__ attribute). 14067 14068- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn* 14069 and *forkserver* start methods. 14070 14071- bpo-30375: Warnings emitted when compile a regular expression now always 14072 point to the line in the user code. Previously they could point into 14073 inners of the re module if emitted from inside of groups or conditionals. 14074 14075- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error 14076 (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. 14077 This error occurs sometimes on SSL connections. 14078 14079- bpo-29196: Removed previously deprecated in Python 2.4 classes Plist, Dict 14080 and _InternalDict in the plistlib module. Dict values in the result of 14081 functions readPlist() and readPlistFromBytes() are now normal dicts. You 14082 no longer can use attribute access to access items of these dictionaries. 14083 14084- bpo-9850: The :mod:`macpath` is now deprecated and will be removed in 14085 Python 3.8. 14086 14087- bpo-30299: Compiling regular expression in debug mode on CPython now 14088 displays the compiled bytecode in human readable form. 14089 14090- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running 14091 coroutine and the coroutine returned without any more ``await``. 14092 14093- bpo-30266: contextlib.AbstractContextManager now supports 14094 anti-registration by setting __enter__ = None or __exit__ = None, 14095 following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra. 14096 14097- bpo-30340: Enhanced regular expressions optimization. This increased the 14098 performance of matching some patterns up to 25 times. 14099 14100- bpo-30298: Weaken the condition of deprecation warnings for inline 14101 modifiers. Now allowed several subsequential inline modifiers at the start 14102 of the pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and 14103 comments now are allowed before and between inline modifiers (e.g. ``'(?x) 14104 (?i) (?s)...'``). 14105 14106- bpo-30285: Optimized case-insensitive matching and searching of regular 14107 expressions. 14108 14109- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma 14110 Lin. 14111 14112- bpo-29979: rewrite cgi.parse_multipart, reusing the FieldStorage class and 14113 making its results consistent with those of FieldStorage for 14114 multipart/form-data requests. Patch by Pierre Quentel. 14115 14116- bpo-30243: Removed the __init__ methods of _json's scanner and encoder. 14117 Misusing them could cause memory leaks or crashes. Now scanner and 14118 encoder objects are completely initialized in the __new__ methods. 14119 14120- bpo-30215: Compiled regular expression objects with the re.LOCALE flag no 14121 longer depend on the locale at compile time. Only the locale at matching 14122 time affects the result of matching. 14123 14124- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process 14125 when Ctrl-C is received. 14126 14127- bpo-30103: binascii.b2a_uu() and uu.encode() now support using ``'`'`` as 14128 zero instead of space. 14129 14130- bpo-28556: Various updates to typing module: add typing.NoReturn type, use 14131 WrapperDescriptorType, minor bug-fixes. Original PRs by Jim 14132 Fasarakis-Hilliard and Ivan Levkivskyi. 14133 14134- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux. 14135 14136- bpo-30228: The seek() and tell() methods of io.FileIO now set the internal 14137 seekable attribute to avoid one syscall on open() (in buffered or text 14138 mode). 14139 14140- bpo-30190: unittest's assertAlmostEqual and assertNotAlmostEqual provide a 14141 better message in case of failure which includes the difference between 14142 left and right arguments. (patch by Giampaolo Rodola') 14143 14144- bpo-30101: Add support for curses.A_ITALIC. 14145 14146- bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch 14147 by Nate Soares. 14148 14149- bpo-29960: Preserve generator state when _random.Random.setstate() raises 14150 an exception. Patch by Bryan Olson. 14151 14152- bpo-30070: Fixed leaks and crashes in errors handling in the parser 14153 module. 14154 14155- bpo-22352: Column widths in the output of dis.dis() are now adjusted for 14156 large line numbers and instruction offsets. 14157 14158- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when 14159 readline() or __next__() respectively return non-sizeable object. Fixed 14160 possible other errors caused by not checking results of PyObject_Size(), 14161 PySequence_Size(), or PyMapping_Size(). 14162 14163- bpo-30218: Fix PathLike support for shutil.unpack_archive. Patch by Jelle 14164 Zijlstra. 14165 14166- bpo-10076: Compiled regular expression and match objects in the re module 14167 now support copy.copy() and copy.deepcopy() (they are considered atomic). 14168 14169- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint 14170 is present. 14171 14172- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. 14173 Patch by Armin Rigo. 14174 14175- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in 14176 contextlib.contextmanager. Patch by Siddharth Velankar. 14177 14178- bpo-26187: Test that sqlite3 trace callback is not called multiple times 14179 when schema is changing. Indirectly fixed by switching to use 14180 sqlite3_prepare_v2() in bpo-9303. Patch by Aviv Palivoda. 14181 14182- bpo-30017: Allowed calling the close() method of the zip entry writer 14183 object multiple times. Writing to a closed writer now always produces a 14184 ValueError. 14185 14186- bpo-29998: Pickling and copying ImportError now preserves name and path 14187 attributes. 14188 14189- bpo-29995: re.escape() now escapes only regex special characters. 14190 14191- bpo-29962: Add math.remainder operation, implementing remainder as 14192 specified in IEEE 754. 14193 14194- bpo-29649: Improve struct.pack_into() exception messages for problems with 14195 the buffer size and offset. Patch by Andrew Nester. 14196 14197- bpo-29654: Support If-Modified-Since HTTP header (browser cache). Patch 14198 by Pierre Quentel. 14199 14200- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. 14201 Patch by Sanjay Sundaresan. 14202 14203- bpo-29953: Fixed memory leaks in the replace() method of datetime and time 14204 objects when pass out of bound fold argument. 14205 14206- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering 14207 long runs of empty iterables. 14208 14209- bpo-10030: Sped up reading encrypted ZIP files by 2 times. 14210 14211- bpo-29204: Element.getiterator() and the html parameter of XMLParser() 14212 were deprecated only in the documentation (since Python 3.2 and 3.4 14213 correspondingly). Now using them emits a deprecation warning. 14214 14215- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions 14216 and wrong types. 14217 14218- bpo-25996: Added support of file descriptors in os.scandir() on Unix. 14219 os.fwalk() is sped up by 2 times by using os.scandir(). 14220 14221- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an 14222 exception at the very first of an iterable may swallow the exception or 14223 make the program hang. Patch by Davin Potts and Xiang Zhang. 14224 14225- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a 14226 reference cycle to not keep objects alive longer than expected. 14227 14228- bpo-29901: The zipapp module now supports general path-like objects, not 14229 just pathlib.Path. 14230 14231- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when 14232 the OS gives priority to errors such as EACCES over EEXIST. 14233 14234- bpo-29861: Release references to tasks, their arguments and their results 14235 as soon as they are finished in multiprocessing.Pool. 14236 14237- bpo-19930: The mode argument of os.makedirs() no longer affects the file 14238 permission bits of newly-created intermediate-level directories. 14239 14240- bpo-29884: faulthandler: Restore the old sigaltstack during teardown. 14241 Patch by Christophe Zeitouny. 14242 14243- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. 14244 14245- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords 14246 are not strings. Patch by Michael Seifert. 14247 14248- bpo-8256: Fixed possible failing or crashing input() if attributes 14249 "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not 14250 strings. 14251 14252- bpo-28692: Using non-integer value for selecting a plural form in gettext 14253 is now deprecated. 14254 14255- bpo-26121: Use C library implementation for math functions erf() and 14256 erfc(). 14257 14258- bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino) 14259 using unsigned integers. 14260 14261- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting 14262 big intables (objects that have __int__) as elements. 14263 14264- bpo-29645: Speed up importing the webbrowser module. 14265 webbrowser.register() is now thread-safe. 14266 14267- bpo-28231: The zipfile module now accepts path-like objects for external 14268 paths. 14269 14270- bpo-26915: index() and count() methods of collections.abc.Sequence now 14271 check identity before checking equality when do comparisons. 14272 14273- bpo-28682: Added support for bytes paths in os.fwalk(). 14274 14275- bpo-29728: Add new :data:`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constant. 14276 Patch by Nathaniel J. Smith. 14277 14278- bpo-29623: Allow use of path-like object as a single argument in 14279 ConfigParser.read(). Patch by David Ellis. 14280 14281- bpo-9303: Migrate sqlite3 module to _v2 API. Patch by Aviv Palivoda. 14282 14283- bpo-28963: Fix out of bound iteration in 14284 asyncio.Future.remove_done_callback implemented in C. 14285 14286- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes 14287 before all pipes are closed. 14288 14289- bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to 14290 accept None argument as their pure Python implementation. 14291 14292- bpo-29703: Fix asyncio to support instantiation of new event loops in 14293 child processes. 14294 14295- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other 14296 exception) to exception(s) raised in the dispatched methods. Patch by Petr 14297 Motejlek. 14298 14299- bpo-7769: Method register_function() of 14300 xmlrpc.server.SimpleXMLRPCDispatcher and its subclasses can now be used as 14301 a decorator. 14302 14303- bpo-29376: Fix assertion error in threading._DummyThread.is_alive(). 14304 14305- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts 14306 PathLike objects. Patch by Sayan Chowdhury. 14307 14308- bpo-28518: Start a transaction implicitly before a DML statement. Patch by 14309 Aviv Palivoda. 14310 14311- bpo-29742: get_extra_info() raises exception if get called on closed ssl 14312 transport. Patch by Nikolay Kim. 14313 14314- bpo-16285: urllib.parse.quote is now based on RFC 3986 and hence includes 14315 '~' in the set of characters that is not quoted by default. Patch by 14316 Christian Theune and Ratnadeep Debnath. 14317 14318- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no 14319 longer affects a partial object after creation. 14320 14321- bpo-29110: Fix file object leak in aifc.open() when file is given as a 14322 filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. 14323 14324- bpo-22807: Add uuid.SafeUUID and uuid.UUID.is_safe to relay information 14325 from the platform about whether generated UUIDs are generated with a 14326 multiprocessing safe method. 14327 14328- bpo-29576: Improve some deprecations in importlib. Some deprecated methods 14329 now emit DeprecationWarnings and have better descriptive messages. 14330 14331- bpo-29534: Fixed different behaviour of Decimal.from_float() for _decimal 14332 and _pydecimal. Thanks Andrew Nester. 14333 14334- bpo-10379: locale.format_string now supports the 'monetary' keyword 14335 argument, and locale.format is deprecated. 14336 14337- bpo-29851: importlib.reload() now raises ModuleNotFoundError if the module 14338 lacks a spec. 14339 14340- bpo-28556: Various updates to typing module: typing.Counter, 14341 typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle 14342 Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. 14343 14344- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 14345 3.6.0: check minimum and maximum years. 14346 14347- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir 14348 14349- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the 14350 match object. Based on patch by WGH. 14351 14352- bpo-29377: Add WrapperDescriptorType, MethodWrapperType, and 14353 MethodDescriptorType built-in types to types module. Original patch by 14354 Manuel Krebber. 14355 14356- bpo-29218: Unused install_misc command is now removed. It has been 14357 documented as unused since 2000. Patch by Eric N. Vander Weele. 14358 14359- bpo-29368: The extend() method is now called instead of the append() 14360 method when unpickle collections.deque and other list-like objects. This 14361 can speed up unpickling to 2 times. 14362 14363- bpo-29338: The help of a builtin or extension class now includes the 14364 constructor signature if __text_signature__ is provided for the class. 14365 14366- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited 14367 to a stopped instead of terminated state (ex: when under ptrace). 14368 14369- bpo-29290: Fix a regression in argparse that help messages would wrap at 14370 non-breaking spaces. 14371 14372- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY. 14373 14374- bpo-29197: Removed deprecated function ntpath.splitunc(). 14375 14376- bpo-29210: Removed support of deprecated argument "exclude" in 14377 tarfile.TarFile.add(). 14378 14379- bpo-29219: Fixed infinite recursion in the repr of uninitialized 14380 ctypes.CDLL instances. 14381 14382- bpo-29192: Removed deprecated features in the http.cookies module. 14383 14384- bpo-29193: A format string argument for string.Formatter.format() is now 14385 positional-only. 14386 14387- bpo-29195: Removed support of deprecated undocumented keyword arguments in 14388 methods of regular expression objects. 14389 14390- bpo-28969: Fixed race condition in C implementation of 14391 functools.lru_cache. KeyError could be raised when cached function with 14392 full cache was simultaneously called from different threads with the same 14393 uncached arguments. 14394 14395- bpo-20804: The unittest.mock.sentinel attributes now preserve their 14396 identity when they are copied or pickled. 14397 14398- bpo-29142: In urllib.request, suffixes in no_proxy environment variable 14399 with leading dots could match related hostnames again (e.g. .b.c matches 14400 a.b.c). Patch by Milan Oberkirch. 14401 14402- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter 14403 anymore. Patch written by Jiajun Huang. 14404 14405- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a 14406 context. Patch by Sam Breese. 14407 14408- bpo-28985: Update authorizer constants in sqlite3 module. Patch by 14409 Dingyuan Wang. 14410 14411- bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows 14412 14413- bpo-13051: Fixed recursion errors in large or resized 14414 curses.textpad.Textbox. Based on patch by Tycho Andersen. 14415 14416- bpo-9770: curses.ascii predicates now work correctly with negative 14417 integers. 14418 14419- bpo-28427: old keys should not remove new values from WeakValueDictionary 14420 when collecting from another thread. 14421 14422- bpo-28923: Remove editor artifacts from Tix.py. 14423 14424- bpo-28871: Fixed a crash when deallocate deep ElementTree. 14425 14426- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and 14427 WeakValueDictionary.pop() when a GC collection happens in another thread. 14428 14429- bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence 14430 that doesn't own its elements as limits. 14431 14432- bpo-16255: subprocess.Popen uses /system/bin/sh on Android as the shell, 14433 instead of /bin/sh. 14434 14435- bpo-28779: multiprocessing.set_forkserver_preload() would crash the 14436 forkserver process if a preloaded module instantiated some multiprocessing 14437 objects such as locks. 14438 14439- bpo-26937: The chown() method of the tarfile.TarFile class does not fail 14440 now when the grp module cannot be imported, as for example on Android 14441 platforms. 14442 14443- bpo-28847: dbm.dumb now supports reading read-only files and no longer 14444 writes the index file when it is not changed. A deprecation warning is 14445 now emitted if the index file is missed and recreated in the 'r' and 'w' 14446 modes (will be an error in future Python releases). 14447 14448- bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in 14449 re.sub() replacement templates regular expressions now are errors. 14450 14451- bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call 14452 warnings.showwarning() if it was overridden inside the context manager. 14453 14454- bpo-27172: To assist with upgrades from 2.7, the previously documented 14455 deprecation of ``inspect.getfullargspec()`` has been reversed. This 14456 decision may be revisited again after the Python 2.7 branch is no longer 14457 officially supported. 14458 14459- bpo-28740: Add sys.getandroidapilevel(): return the build time API version 14460 of Android as an integer. Function only available on Android. 14461 14462- bpo-26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and 14463 :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by 14464 Omar Sandoval. 14465 14466- bpo-28752: Restored the __reduce__() methods of datetime objects. 14467 14468- bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created 14469 by re.compile(), become comparable (only x==y and x!=y operators). This 14470 change should fix the issue #18383: don't duplicate warning filters when 14471 the warnings module is reloaded (thing usually only done in unit tests). 14472 14473- bpo-20572: Remove the subprocess.Popen.wait endtime parameter. It was 14474 deprecated in 3.4 and undocumented prior to that. 14475 14476- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and 14477 from_buffer_copy() methods on abstract classes like Array. 14478 14479- bpo-28548: In the "http.server" module, parse the protocol version if 14480 possible, to avoid using HTTP 0.9 in some error responses. 14481 14482- bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch 14483 by Vajrasky Kok 14484 14485- bpo-28563: Fixed possible DoS and arbitrary code execution when handle 14486 plural form selections in the gettext module. The expression parser now 14487 supports exact syntax supported by GNU gettext. 14488 14489- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the 14490 garbage collector is invoked in other thread. Based on patch by Sebastian 14491 Cufre. 14492 14493- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if 14494 given empty data twice. Patch by Benjamin Fogle. 14495 14496- bpo-28549: Fixed segfault in curses's addch() with ncurses6. 14497 14498- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar 14499 file with compression before trying to open it without compression. 14500 Otherwise it had 50% chance failed with ignore_zeros=True. 14501 14502- bpo-23262: The webbrowser module now supports Firefox 36+ and derived 14503 browsers. Based on patch by Oleg Broytman. 14504 14505- bpo-24241: The webbrowser in an X environment now prefers using the 14506 default browser directly. Also, the webbrowser register() function now has 14507 a documented 'preferred' argument, to specify browsers to be returned by 14508 get() with no arguments. Patch by David Steele 14509 14510- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused 14511 by representing the scale as float value internally in Tk. tkinter.IntVar 14512 now works if float value is set to underlying Tk variable. 14513 14514- bpo-28255: calendar.TextCalendar.prweek() no longer prints a space after a 14515 weeks's calendar. calendar.TextCalendar.pryear() no longer prints 14516 redundant newline after a year's calendar. Based on patch by Xiang Zhang. 14517 14518- bpo-28255: calendar.TextCalendar.prmonth() no longer prints a space at the 14519 start of new line after printing a month's calendar. Patch by Xiang 14520 Zhang. 14521 14522- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. 14523 Based on patch by Kaarle Ritvanen. 14524 14525- bpo-28353: os.fwalk() no longer fails on broken links. 14526 14527- bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept 14528 non-None value is passed to it.send(val). 14529 14530- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix 14531 for readability. 14532 14533- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a 14534 workaround to Tix library bug. 14535 14536- bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive. 14537 14538- bpo-25953: re.sub() now raises an error for invalid numerical group 14539 reference in replacement template even if the pattern is not found in the 14540 string. Error message for invalid group reference now includes the group 14541 index and the position of the reference. Based on patch by SilentGhost. 14542 14543- bpo-28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead of 14544 1, 10, 100,... for autoranging. 14545 14546- bpo-28115: Command-line interface of the zipfile module now uses argparse. 14547 Added support of long options. 14548 14549- bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by 14550 Mariatta Wijaya. 14551 14552- bpo-28448: Fix C implemented asyncio.Future didn't work on Windows. 14553 14554- bpo-23214: In the "io" module, the argument to BufferedReader and 14555 BytesIO's read1() methods is now optional and can be -1, matching the 14556 BufferedIOBase specification. 14557 14558- bpo-28480: Fix error building socket module when multithreading is 14559 disabled. 14560 14561- bpo-28240: timeit: remove ``-c/--clock`` and ``-t/--time`` command line 14562 options which were deprecated since Python 3.3. 14563 14564- bpo-28240: timeit now repeats the benchmarks 5 times instead of only 3 to 14565 make benchmarks more reliable. 14566 14567- bpo-28240: timeit autorange now uses a single loop iteration if the 14568 benchmark takes less than 10 seconds, instead of 10 iterations. "python3 14569 -m timeit -s 'import time' 'time.sleep(1)'" now takes 4 seconds instead of 14570 40 seconds. 14571 14572- Distutils.sdist now looks for README and setup.py files with case 14573 sensitivity. This behavior matches that found in Setuptools 6.0 and later. 14574 See `setuptools 100 <https://github.com/pypa/setuptools/issues/100>`_ for 14575 rationale. 14576 14577- bpo-24452: Make webbrowser support Chrome on Mac OS X. Patch by Ned 14578 Batchelder. 14579 14580- bpo-20766: Fix references leaked by pdb in the handling of SIGINT 14581 handlers. 14582 14583- bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by 14584 Eryk Sun. 14585 14586- bpo-28317: The disassembler now decodes FORMAT_VALUE argument. 14587 14588- bpo-28380: unittest.mock Mock autospec functions now properly support 14589 assert_called, assert_not_called, and assert_called_once. 14590 14591- bpo-28229: lzma module now supports pathlib. 14592 14593- bpo-28321: Fixed writing non-BMP characters with binary format in 14594 plistlib. 14595 14596- bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan 14597 Furman. 14598 14599- bpo-28227: gzip now supports pathlib. Patch by Ethan Furman. 14600 14601- bpo-28332: Deprecated silent truncations in socket.htons and socket.ntohs. 14602 Original patch by Oren Milman. 14603 14604- bpo-27358: Optimized merging var-keyword arguments and improved error 14605 message when passing a non-mapping as a var-keyword argument. 14606 14607- bpo-28257: Improved error message when passing a non-iterable as a 14608 var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. 14609 14610- bpo-28322: Fixed possible crashes when unpickle itertools objects from 14611 incorrect pickle data. Based on patch by John Leitch. 14612 14613- bpo-28228: imghdr now supports pathlib. 14614 14615- bpo-28226: compileall now supports pathlib. 14616 14617- bpo-28314: Fix function declaration (C flags) for the getiterator() method 14618 of xml.etree.ElementTree.Element. 14619 14620- bpo-28148: Stop using localtime() and gmtime() in the time module. 14621 Introduced platform independent _PyTime_localtime API that is similar to 14622 POSIX localtime_r, but available on all platforms. Patch by Ed Schouten. 14623 14624- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 14625 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so 14626 that they don't call itermonthdates() which can cause datetime.date 14627 under/overflow. 14628 14629- bpo-28275: Fixed possible use after free in the decompress() methods of 14630 the LZMADecompressor and BZ2Decompressor classes. Original patch by John 14631 Leitch. 14632 14633- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() 14634 if pass invalid string-like object as a name. Patch by Xiang Zhang. 14635 14636- bpo-18844: random.choices() now has k as a keyword-only argument to 14637 improve the readability of common cases and come into line with the 14638 signature used in other languages. 14639 14640- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. 14641 Patch by Madison May. 14642 14643- bpo-27611: Fixed support of default root window in the tkinter.tix module. 14644 Added the master parameter in the DisplayStyle constructor. 14645 14646- bpo-27348: In the traceback module, restore the formatting of exception 14647 messages like "Exception: None". This fixes a regression introduced in 14648 3.5a2. 14649 14650- bpo-25651: Allow falsy values to be used for msg parameter of subTest(). 14651 14652- bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is 14653 interrupted by a signal and a signal handler raises a Python exception. 14654 14655- bpo-28200: Fix memory leak on Windows in the os module (fix 14656 path_converter() function). 14657 14658- bpo-25400: RobotFileParser now correctly returns default values for 14659 crawl_delay and request_rate. Initial patch by Peter Wirtz. 14660 14661- bpo-27932: Prevent memory leak in win32_ver(). 14662 14663- Fix UnboundLocalError in socket._sendfile_use_sendfile. 14664 14665- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of 14666 os.stat(). Patch by Eryk Sun. 14667 14668- bpo-22493: Warning message emitted by using inline flags in the middle of 14669 regular expression now contains a (truncated) regex pattern. Patch by Tim 14670 Graham. 14671 14672- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an 14673 empty bytestring is passed. 14674 14675- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. 14676 14677- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by 14678 Gergely Imreh and Markus Holtermann. 14679 14680- bpo-28114: Fix a crash in parse_envlist() when env contains byte strings. 14681 Patch by Eryk Sun. 14682 14683- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and 14684 binascii.a2b_qp(). 14685 14686- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by 14687 Kevin Conway. 14688 14689- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by 14690 Seth Michael Larson. 14691 14692- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by 14693 iceboy. 14694 14695- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki. 14696 14697- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect. 14698 14699- bpo-27759: Fix selectors incorrectly retain invalid file descriptors. 14700 Patch by Mark Williams. 14701 14702- bpo-28325: Remove vestigial MacOS 9 macurl2path module and its tests. 14703 14704- bpo-28368: Refuse monitoring processes if the child watcher has no loop 14705 attached. Patch by Vincent Michel. 14706 14707- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader, 14708 add_writer, etc. 14709 14710- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг 14711 Марк. 14712 14713- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor. 14714 14715- bpo-28372: Fix asyncio to support formatting of non-python coroutines. 14716 14717- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг 14718 Марк. 14719 14720- bpo-27972: Prohibit Tasks to await on themselves. 14721 14722- bpo-24142: Reading a corrupt config file left configparser in an invalid 14723 state. Original patch by Florian Höch. 14724 14725- bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract 14726 base classes to use keyword parameters in __init_subclass__. Patch by Nate 14727 Soares. 14728 14729- bpo-25532: inspect.unwrap() will now only try to unwrap an object 14730 sys.getrecursionlimit() times, to protect against objects which create a 14731 new object on every attribute access. 14732 14733- bpo-30177: path.resolve(strict=False) no longer cuts the path after the 14734 first element not present in the filesystem. Patch by Antoine Pietri. 14735 14736Documentation 14737------------- 14738 14739- bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and 14740 ZeroMQSocketHandler examples and adapt them to Python 3. 14741 14742- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL 14743 documentation. 14744 14745- bpo-31128: Allow the pydoc server to bind to arbitrary hostnames. 14746 14747- bpo-30803: Clarify doc on truth value testing. Original patch by Peter 14748 Thomassen. 14749 14750- bpo-30176: Add missing attribute related constants in curses 14751 documentation. 14752 14753- bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are 14754 now their respective type definitions, rather than the corresponding 14755 builtin function entries. Use :ref:`bytes <func-bytes>` and 14756 :ref:`bytearray <func-bytearray>` to reference the latter. In order to 14757 ensure this and future cross-reference updates are applied automatically, 14758 the daily documentation builds now disable the default output caching 14759 features in Sphinx. 14760 14761- bpo-26985: Add missing info of code object in inspect documentation. 14762 14763- bpo-19824: Improve the documentation for, and links to, template strings 14764 by emphasizing their utility for internationalization, and by clarifying 14765 some usage constraints. (See also: bpo-20314, bpo-12518) 14766 14767- bpo-28929: Link the documentation to its source file on GitHub. 14768 14769- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer 14770 to aiosmtpd, a third-party asyncio-based replacement. 14771 14772- bpo-26355: Add canonical header link on each page to corresponding major 14773 version of the documentation. Patch by Matthias Bussonnier. 14774 14775- bpo-29349: Fix Python 2 syntax in code for building the documentation. 14776 14777- bpo-23722: The data model reference and the porting section in the 3.6 14778 What's New guide now cover the additional ``__classcell__`` handling 14779 needed for custom metaclasses to fully support :pep:`487` and 14780 zero-argument ``super()``. 14781 14782- bpo-28513: Documented command-line interface of zipfile. 14783 14784Tests 14785----- 14786 14787- bpo-29639: test.support.HOST is now "localhost", a new HOSTv4 constant has 14788 been added for your ``127.0.0.1`` needs, similar to the existing HOSTv6 14789 constant. 14790 14791- bpo-31320: Silence traceback in test_ssl 14792 14793- bpo-31346: Prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER protocols 14794 for SSLContext. 14795 14796- bpo-25674: Remove sha256.tbs-internet.com ssl test 14797 14798- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest 14799 version behaves like OpenSSL 1.0.2 and no longer aborts handshake. 14800 14801- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the 14802 test suite using --use=all / -u all, exclude tzdata since it makes 14803 test_datetime too slow (15-20 min on some buildbots) which then times out 14804 on some buildbots. Fix also regrtest command line parser to allow passing 14805 -u extralargefile to run test_zipfile64. 14806 14807- bpo-30695: Add the `set_nomemory(start, stop)` and `remove_mem_hooks()` 14808 functions to the _testcapi module. 14809 14810- bpo-30357: test_thread: setUp() now uses support.threading_setup() and 14811 support.threading_cleanup() to wait until threads complete to avoid random 14812 side effects on following tests. Initial patch written by Grzegorz 14813 Grzywacz. 14814 14815- bpo-30197: Enhanced functions swap_attr() and swap_item() in the 14816 test.support module. They now work when delete replaced attribute or item 14817 inside the with statement. The old value of the attribute or item (or 14818 None if it doesn't exist) now will be assigned to the target of the "as" 14819 clause, if there is one. 14820 14821- bpo-24932: Use proper command line parsing in _testembed 14822 14823- bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line 14824 arguments. 14825 14826- bpo-28683: Fix the tests that bind() a unix socket and raise 14827 PermissionError on Android for a non-root user. 14828 14829- bpo-26936: Fix the test_socket failures on Android - getservbyname(), 14830 getservbyport() and getaddrinfo() are broken on some Android API levels. 14831 14832- bpo-28666: Now test.support.rmtree is able to remove unwritable or 14833 unreadable directories. 14834 14835- bpo-23839: Various caches now are cleared before running every test file. 14836 14837- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or 14838 missing the effective gid. 14839 14840- bpo-28409: regrtest: fix the parser of command line arguments. 14841 14842- bpo-28217: Adds _testconsole module to test console input. 14843 14844- bpo-26939: Add the support.setswitchinterval() function to fix 14845 test_functools hanging on the Android armv7 qemu emulator. 14846 14847Build 14848----- 14849 14850- bpo-31354: Allow --with-lto to be used on all builds, not just `make 14851 profile-opt`. 14852 14853- bpo-31370: Remove support for building --without-threads. This option is 14854 not really useful anymore in the 21st century. Removing lots of 14855 conditional paths allows us to simplify the code base, including in 14856 difficult to maintain low-level internal code. 14857 14858- bpo-31341: Per :pep:`11`, support for the IRIX operating system was 14859 removed. 14860 14861- bpo-30854: Fix compile error when compiling --without-threads. Patch by 14862 Masayuki Yamamoto. 14863 14864- bpo-30687: Locate msbuild.exe on Windows when building rather than 14865 vcvarsall.bat 14866 14867- bpo-20210: Support the *disabled* marker in Setup files. Extension modules 14868 listed after this marker are not built at all, neither by the Makefile nor 14869 by setup.py. 14870 14871- bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C 14872 ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies 14873 ``--with-assertions``. 14874 14875- bpo-28787: Fix out-of-tree builds of Python when configured with 14876 ``--with--dtrace``. 14877 14878- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``, 14879 ``make install`` and some other make targets when configured with 14880 ``--enable-optimizations``. 14881 14882- bpo-23404: Don't regenerate generated files based on file modification 14883 time anymore: the action is now explicit. Replace ``make touch`` with 14884 ``make regen-all``. 14885 14886- bpo-29643: Fix ``--enable-optimization`` didn't work. 14887 14888- bpo-27593: sys.version and the platform module python_build(), 14889 python_branch(), and python_revision() functions now use git information 14890 rather than hg when building from a repo. 14891 14892- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k. 14893 14894- bpo-27659: Prohibit implicit C function declarations: use 14895 ``-Werror=implicit-function-declaration`` when possible (GCC and Clang, 14896 but it depends on the compiler version). Patch written by Chi Hsuan Yen. 14897 14898- bpo-29384: Remove old Be OS helper scripts. 14899 14900- bpo-26851: Set Android compilation and link flags. 14901 14902- bpo-28768: Fix implicit declaration of function _setmode. Patch by 14903 Masayuki Yamamoto 14904 14905- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat 14906 14907- bpo-23903: Added missed names to PC/python3.def. 14908 14909- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK 14910 macro is not defined in android-ndk-r13. 14911 14912- bpo-28538: Fix the compilation error that occurs because if_nameindex() is 14913 available on Android API level 24, but the if_nameindex structure is not 14914 defined. 14915 14916- bpo-20211: Do not add the directory for installing C header files and the 14917 directory for installing object code libraries to the cross compilation 14918 search paths. Original patch by Thomas Petazzoni. 14919 14920- bpo-28849: Do not define sys.implementation._multiarch on Android. 14921 14922- bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and 14923 Michael Haubenwallner. 14924 14925- bpo-26359: Rename --with-optimiations to --enable-optimizations. 14926 14927- bpo-28444: Fix missing extensions modules when cross compiling. 14928 14929- bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2. 14930 14931- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. 14932 14933- bpo-21124: Fix building the _struct module on Cygwin by passing ``NULL`` 14934 instead of ``&PyType_Type`` to PyVarObject_HEAD_INIT. Patch by Masayuki 14935 Yamamoto. 14936 14937- bpo-13756: Fix building extensions modules on Cygwin. Patch by Roumen 14938 Petrov, based on original patch by Jason Tishler. 14939 14940- bpo-21085: Add configure check for siginfo_t.si_band, which Cygwin does 14941 not provide. Patch by Masayuki Yamamoto with review and rebase by Erik 14942 Bray. 14943 14944- bpo-28258: Fixed build with Estonian locale (python-config and distclean 14945 targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. 14946 14947- bpo-26661: setup.py now detects system libffi with multiarch wrapper. 14948 14949- bpo-27979: A full copy of libffi is no longer bundled for use when 14950 building _ctypes on non-OSX UNIX platforms. An installed copy of libffi 14951 is now required when building _ctypes on such platforms. 14952 14953- bpo-15819: Remove redundant include search directory option for building 14954 outside the source tree. 14955 14956- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS. 14957 Patch by Gareth Rees. 14958 14959Windows 14960------- 14961 14962- bpo-31392: Update Windows build to use OpenSSL 1.1.0f 14963 14964- bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows. 14965 14966- bpo-31358: zlib is no longer bundled in the CPython source, instead it is 14967 downloaded on demand just like bz2, lzma, OpenSSL, Tcl/Tk, and SQLite. 14968 14969- bpo-31340: Change to building with MSVC v141 (included with Visual Studio 14970 2017) 14971 14972- bpo-30581: os.cpu_count() now returns the correct number of processors on 14973 Windows when the number of logical processors is greater than 64. 14974 14975- bpo-30916: Pre-build OpenSSL, Tcl and Tk and include the binaries in the 14976 build. 14977 14978- bpo-30731: Add a missing xmlns to python.manifest so that it matches the 14979 schema. 14980 14981- bpo-30291: Allow requiring 64-bit interpreters from py.exe using -64 14982 suffix. Contributed by Steve (Gadget) Barnes. 14983 14984- bpo-30362: Adds list options (-0, -0p) to py.exe launcher. Contributed by 14985 Steve Barnes. 14986 14987- bpo-23451: Fix socket deprecation warnings in socketmodule.c. Patch by 14988 Segev Finer. 14989 14990- bpo-30450: The build process on Windows no longer depends on Subversion, 14991 instead pulling external code from GitHub via a Python script. If Python 14992 3.6 is not found on the system (via ``py -3.6``), NuGet is used to 14993 download a copy of 32-bit Python. 14994 14995- bpo-29579: Removes readme.txt from the installer. 14996 14997- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun) 14998 14999- bpo-28896: Deprecate WindowsRegistryFinder and disable it by default 15000 15001- bpo-28522: Fixes mishandled buffer reallocation in getpathp.c 15002 15003- bpo-28402: Adds signed catalog files for stdlib on Windows. 15004 15005- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk 15006 Sun) 15007 15008- bpo-28251: Improvements to help manuals on Windows. 15009 15010- bpo-28110: launcher.msi has different product codes between 32-bit and 15011 64-bit 15012 15013- bpo-28161: Opening CON for write access fails 15014 15015- bpo-28162: WindowsConsoleIO readall() fails if first line starts with 15016 Ctrl+Z 15017 15018- bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle 15019 15020- bpo-28164: _PyIO_get_console_type fails for various paths 15021 15022- bpo-28137: Renames Windows path file to ._pth 15023 15024- bpo-28138: Windows ._pth file should allow import site 15025 15026IDLE 15027---- 15028 15029- bpo-31493: IDLE code context -- fix code update and font update timers. 15030 Canceling timers prevents a warning message when test_idle completes. 15031 15032- bpo-31488: IDLE - Update non-key options in former extension classes. When 15033 applying configdialog changes, call .reload for each feature class. Change 15034 ParenMatch so updated options affect existing instances attached to 15035 existing editor windows. 15036 15037- bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace 15038 strips more than blank spaces. Multiline string literals are not skipped. 15039 15040- bpo-31480: IDLE - make tests pass with zzdummy extension disabled by 15041 default. 15042 15043- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk 15044 update in the background in order to make live interaction and 15045 experimentation with tkinter applications much easier. 15046 15047- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an 15048 int entry is not the same as deleting and inserting because int('') will 15049 fail. 15050 15051- bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and 15052 Help sections. 15053 15054- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor. 15055 Move some data and functions from the class to module level. Patch by 15056 Cheryl Sabella. 15057 15058- bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog. 15059 15060- bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About 15061 10 IDLE features were implemented as supposedly optional extensions. Their 15062 different behavior could be confusing or worse for users and not good for 15063 maintenance. Hence the conversion. The main difference for users is that 15064 user configurable key bindings for builtin features are now handled 15065 uniformly. Now, editing a binding in a keyset only affects its value in 15066 the keyset. All bindings are defined together in the system-specific 15067 default keysets in config-extensions.def. All custom keysets are saved as 15068 a whole in config-extension.cfg. All take effect as soon as one clicks 15069 Apply or Ok. The affected events are '<<force-open-completions>>', 15070 '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', 15071 '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and 15072 '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not 15073 affect their keyset-specific customization after 3.6.3. and vice versa. 15074 Initial patch by Charles Wohlganger. 15075 15076- bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by 15077 Cheryl Sabella. 15078 15079- bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl 15080 Sabella. 15081 15082- bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The 15083 slightly modified tests continue to pass. Patch by Cheryl Sabella. 15084 15085- bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by 15086 Victor Stinner. 15087 15088- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella. 15089 15090- bpo-19903: IDLE: Calltips use `inspect.signature` instead of 15091 `inspect.getfullargspec`. This improves calltips for builtins converted to 15092 use Argument Clinic. Patch by Louie Lu. 15093 15094- bpo-31083: IDLE - Add an outline of a TabPage class in configdialog. 15095 Update existing classes to match outline. Initial patch by Cheryl Sabella. 15096 15097- bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly 15098 modified tests continue to pass. Patch by Cheryl Sabella. 15099 15100- bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly 15101 modified tests continue to pass. Fix General tests. Patch mostly by Cheryl 15102 Sabella. 15103 15104- bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan 15105 Reedy and Cheryl Sabella. 15106 15107- bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping 15108 methods pertaining to each tab and the buttons will aid writing tests and 15109 improving the tabs and will enable splitting the groups into classes. 15110 15111- bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance 15112 tracers manages pairs consisting of a tk variable and a callback function. 15113 When tracing is turned on, setting the variable calls the function. Test 15114 coverage for the new class is 100%. 15115 15116- bpo-31003: IDLE: Add more tests for General tab. 15117 15118- bpo-30993: IDLE - Improve configdialog font page and tests. In 15119 configdialog: Document causal pathways in create_font_tab docstring. 15120 Simplify some attribute names. Move set_samples calls to var_changed_font 15121 (idea from Cheryl Sabella). Move related functions to positions after the 15122 create widgets function. In test_configdialog: Fix test_font_set so not 15123 order dependent. Fix renamed test_indent_scale so it tests the widget. 15124 Adjust tests for movement of set_samples call. Add tests for load 15125 functions. Put all font tests in one class and tab indent tests in 15126 another. Except for two lines, these tests completely cover the related 15127 functions. 15128 15129- bpo-30981: IDLE -- Add more configdialog font page tests. 15130 15131- bpo-28523: IDLE: replace 'colour' with 'color' in configdialog. 15132 15133- bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from 15134 46% to 96%. Patch by Louie Lu. 15135 15136- bpo-30934: Document coverage details for idlelib tests. Add section to 15137 idlelib/idle-test/README.txt. Include check that branches are taken both 15138 ways. Exclude IDLE-specific code that does not run during unit tests. 15139 15140- bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in 15141 docstrings This will facilitate improving the dialog and splitting up the 15142 class. Original patch by Cheryl Sabella. 15143 15144- bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by 15145 Louie Lu. 15146 15147- bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella. 15148 15149- bpo-30851: IDLE: Remove unused variables in configdialog. One is a 15150 duplicate, one is set but cannot be altered by users. Patch by Cheryl 15151 Sabella. 15152 15153- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as 15154 well as mouse. Initial patch by Louie Lu. 15155 15156- bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once. 15157 15158- bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in 15159 config; test. * In config, put dump test code in a function; run it and 15160 unittest in 'if __name__ == '__main__'. * Add class config.ConfigChanges 15161 based on changes_class_v4.py on bpo issue. * Add class 15162 test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise 15163 configdialog to use ConfigChanges; see tracker msg297804. * Revise 15164 test_configdialog to match configdialog changes. * Remove configdialog 15165 functions unused or moved to ConfigChanges. Cheryl Sabella contributed 15166 parts of the patch. 15167 15168- bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by 15169 Cheryl Sabella. 15170 15171- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more 15172 tests. Patch by Cheryl Sabella. 15173 15174- bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens' 15175 style to highlight both opener and closer. Make 'default' style, which is 15176 not default, a synonym for 'opener'. Make time-delay work the same with 15177 all styles. Add help for config dialog extensions tab, including help for 15178 parenmatch. Add new tests. Original patch by Charles Wohlganger. 15179 15180- bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella 15181 15182- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates 15183 properly. Original patch by Saimadhav Heblikar. 15184 15185- bpo-29910: IDLE no longer deletes a character after commenting out a 15186 region by a key shortcut. Add ``return 'break'`` for this and other 15187 potential conflicts between IDLE and default key bindings. 15188 15189- bpo-30728: Review and change idlelib.configdialog names. Lowercase method 15190 and attribute names. Replace 'colour' with 'color', expand overly cryptic 15191 names, delete unneeded underscores. Replace ``import *`` with specific 15192 imports. Patches by Cheryl Sabella. 15193 15194- bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them 15195 with tk. Add tests for all 3 validation functions. Original patch by G 15196 Polo. Tests added by Cheryl Sabella. 15197 15198- bpo-15786: Fix several problems with IDLE's autocompletion box. The 15199 following should now work: clicking on selection box items; using the 15200 scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no 15201 longer happen. Patch by Louie Lu. 15202 15203- bpo-25514: Add doc subsubsection about IDLE failure to start. Popup 15204 no-connection message directs users to this section. 15205 15206- bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and 15207 Terry Jan Reedy. 15208 15209- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by 15210 Cheryl Sabella and Terry Jan Reedy. 15211 15212- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to 15213 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy. 15214 15215- bpo-30303: Add _utest option to textview; add new tests. Increase coverage 15216 to 100%. Patches by Louie Lu and Terry Jan Reedy. 15217 15218- bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes). 15219 15220- bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and 15221 augment description of the configuration system. 15222 15223Tools/Demos 15224----------- 15225 15226- bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared 15227 builds now, too. :pep:`523` introduced _PyEval_EvalFrameDefault which 15228 inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the 15229 ability to use py-bt, py-up, and a few other Python-specific gdb 15230 integrations. The problem is fixed by only looking for 15231 _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno 15232 "Polaco" Penteado. 15233 15234- bpo-29748: Added the slice index converter in Argument Clinic. 15235 15236- bpo-24037: Argument Clinic now uses the converter `bool(accept={int})` 15237 rather than `int` for semantical booleans. This avoids repeating the 15238 default value for Python and C and will help in converting to `bool` in 15239 future. 15240 15241- bpo-29367: python-gdb.py now supports also ``method-wrapper`` 15242 (``wrapperobject``) objects. 15243 15244- bpo-28023: Fix python-gdb.py didn't support new dict implementation. 15245 15246- bpo-15369: The pybench and pystone microbenchmark have been removed from 15247 Tools. Please use the new Python benchmark suite 15248 https://github.com/python/performance which is more reliable and includes 15249 a portable version of pybench working on Python 2 and Python 3. 15250 15251- bpo-28102: The zipfile module CLI now prints usage to stderr. Patch by 15252 Stephen J. Turnbull. 15253 15254C API 15255----- 15256 15257- bpo-31338: Added the ``Py_UNREACHABLE()`` macro for code paths which are 15258 never expected to be reached. This and a few other useful macros are now 15259 documented in the C API manual. 15260 15261- bpo-30832: Remove own implementation for thread-local storage. CPython has 15262 provided the own implementation for thread-local storage (TLS) on 15263 Python/thread.c, it's used in the case which a platform has not supplied 15264 native TLS. However, currently all supported platforms (Windows and 15265 pthreads) have provided native TLS and defined the Py_HAVE_NATIVE_TLS 15266 macro with unconditional in any case. 15267 15268- bpo-30708: PyUnicode_AsWideCharString() now raises a ValueError if the 15269 second argument is NULL and the wchar_t\* string contains null characters. 15270 15271- bpo-16500: Deprecate PyOS_AfterFork() and add PyOS_BeforeFork(), 15272 PyOS_AfterFork_Parent() and PyOS_AfterFork_Child(). 15273 15274- bpo-6532: The type of results of PyThread_start_new_thread() and 15275 PyThread_get_thread_ident(), and the id parameter of 15276 PyThreadState_SetAsyncExc() changed from "long" to "unsigned long". 15277 15278- bpo-27867: Function PySlice_GetIndicesEx() is deprecated and replaced with 15279 a macro if Py_LIMITED_API is not set or set to the value between 15280 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher. Added 15281 functions PySlice_Unpack() and PySlice_AdjustIndices(). 15282 15283- bpo-29083: Fixed the declaration of some public API functions. 15284 PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in 15285 limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and 15286 Py_BuildValue() were not available in limited API of version < 3.3 when 15287 PY_SSIZE_T_CLEAN is defined. 15288 15289- bpo-28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8() 15290 is now of type ``const char *`` rather of ``char *``. 15291 15292- bpo-29058: All stable API extensions added after Python 3.2 are now 15293 available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of 15294 the minimum Python version supporting this API. 15295 15296- bpo-28822: The index parameters *start* and *end* of PyUnicode_FindChar() 15297 are now adjusted to behave like ``str[start:end]``. 15298 15299- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 15300 15301- bpo-28761: The fields name and doc of structures PyMemberDef, PyGetSetDef, 15302 PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of 15303 type ``const char *`` rather of ``char *``. 15304 15305- bpo-28748: Private variable _Py_PackageContext is now of type ``const char 15306 *`` rather of ``char *``. 15307 15308- bpo-19569: Compiler warnings are now emitted if use most of deprecated 15309 functions. 15310 15311- bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(), 15312 PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and 15313 PyUnicode_AsEncodedUnicode(). 15314 15315 15316What's New in Python 3.6.6 final? 15317================================= 15318 15319*Release date: 2018-06-27* 15320 15321There were no new changes in version 3.6.6. 15322 15323 15324 15325What's New in Python 3.6.6 release candidate 1? 15326=============================================== 15327 15328*Release date: 2018-06-11* 15329 15330Core and Builtins 15331----------------- 15332 15333- bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 15334 correctly 15335 15336- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter 15337 shutdown even when there was a custom handler set previously. Patch by 15338 Philipp Kerling. 15339 15340- bpo-33622: Fixed a leak when the garbage collector fails to add an object 15341 with the ``__del__`` method or referenced by it into the 15342 :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an 15343 exception is set and preserves it. 15344 15345- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c. 15346 15347- bpo-33391: Fix a leak in set_symmetric_difference(). 15348 15349- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer. 15350 15351- bpo-33231: Fix potential memory leak in ``normalizestring()``. 15352 15353- bpo-29922: Improved error messages in 'async with' when ``__aenter__()`` 15354 or ``__aexit__()`` return non-awaitable object. 15355 15356- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized 15357 when copying from key-sharing dict. 15358 15359- bpo-33041: Fixed jumping when the function contains an ``async for`` loop. 15360 15361- bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in 15362 socketmodule on Windows. 15363 15364- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a 15365 ctypes structured data type. Patch by Eryk Sun and Oren Milman. 15366 15367Library 15368------- 15369 15370- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by 15371 Steve Weber. 15372 15373- bpo-33812: Datetime instance d with non-None tzinfo, but with 15374 d.tzinfo.utcoffset(d) returning None is now treated as naive by the 15375 astimezone() method. 15376 15377- bpo-30805: Avoid race condition with debug logging 15378 15379- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence 15380 operations now raise :exc:`TypeError` instead of :exc:`SystemError` when 15381 performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz. 15382 15383- bpo-32684: Fix gather to propagate cancellation of itself even with 15384 return_exceptions. 15385 15386- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of 15387 asyncio.sslproto: start immediately the handshake instead of using 15388 call_soon(). Previously, data_received() could be called before the 15389 handshake started, causing the handshake to hang or fail. 15390 15391- bpo-31647: Fixed bug where calling write_eof() on a 15392 _SelectorSocketTransport after it's already closed raises AttributeError. 15393 15394- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines 15395 15396- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor 15397 15398- bpo-11874: Use a better regex when breaking usage into wrappable parts. 15399 Avoids bogus assertion errors from custom metavar strings. 15400 15401- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder 15402 that prevented the cache of parsed strings from clearing after finishing 15403 the decoding. Based on patch by c-fos. 15404 15405- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP 15406 locations 15407 15408- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on 15409 Windows. Patch by Zvi Effron 15410 15411- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in 15412 Windows proactor event loop. 15413 15414- bpo-28556: Minor fixes in typing module: add annotations to 15415 ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in 15416 ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova. 15417 15418- bpo-20087: Updated alias mapping with glibc 2.27 supported locales. 15419 15420- bpo-33422: Fix trailing quotation marks getting deleted when looking up 15421 byte/string literals on pydoc. Patch by Andrés Delfino. 15422 15423- bpo-33197: Update error message when constructing invalid 15424 inspect.Parameters Patch by Dong-hee Na. 15425 15426- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database 15427 object when it is called with a single argument. 15428 15429- bpo-33329: Fix multiprocessing regression on newer glibcs 15430 15431- bpo-991266: Fix quoting of the ``Comment`` attribute of 15432 :class:`http.cookies.SimpleCookie`. 15433 15434- bpo-33131: Upgrade bundled version of pip to 10.0.1. 15435 15436- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST 15437 object to a tree of tuples or lists with ``line_info=False`` and 15438 ``col_info=True``. 15439 15440- bpo-33263: Fix FD leak in `_SelectorSocketTransport` Patch by Vlad 15441 Starostin. 15442 15443- bpo-33256: Fix display of ``<module>`` call in the html produced by 15444 ``cgitb.html()``. Patch by Stéphane Blondon. 15445 15446- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty 15447 sequences consistently even when called from subclasses without a 15448 ``getrandbits()`` implementation. 15449 15450- bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught 15451 StopIteration in a generator into a return-statement. 15452 15453- bpo-33209: End framing at the end of C implementation of 15454 :func:`pickle.Pickler.dump`. 15455 15456- bpo-32861: The urllib.robotparser's ``__str__`` representation now 15457 includes wildcard entries and the "Crawl-delay" and "Request-rate" fields. 15458 Patch by Michael Lazar. 15459 15460- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false 15461 boolean value. Note iid=0 and iid=False would be same. Patch by Garvit 15462 Khatri. 15463 15464- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1. 15465 15466- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all 15467 threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch 15468 by Nir Soffer. 15469 15470- bpo-27683: Fix a regression in :mod:`ipaddress` that result of 15471 :meth:`hosts` is empty when the network is constructed by a tuple 15472 containing an integer mask and only 1 bit left for addresses. 15473 15474- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in 15475 subprocess if another low descriptor is closed. 15476 15477- bpo-31908: Fix output of cover files for ``trace`` module command-line 15478 tool. Previously emitted cover files only when ``--missing`` option was 15479 used. Patch by Michael Selik. 15480 15481- bpo-31457: If nested log adapters are used, the inner ``process()`` 15482 methods are no longer omitted. 15483 15484- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer. 15485 15486- bpo-31238: pydoc: the stop() method of the private ServerThread class now 15487 waits until DocServer.serve_until_quit() completes and then explicitly 15488 sets its docserver attribute to None to break a reference cycle. 15489 15490Documentation 15491------------- 15492 15493- bpo-33503: Fix broken pypi link 15494 15495- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``. 15496 15497- bpo-33378: Add Korean language switcher for https://docs.python.org/3/ 15498 15499- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be 15500 just any value. 15501 15502- bpo-33201: Modernize documentation for writing C extension types. 15503 15504- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document. 15505 ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is 15506 missed in the document. 15507 15508- bpo-33126: Document PyBuffer_ToContiguous(). 15509 15510- bpo-27212: Modify documentation for the :func:`islice` recipe to consume 15511 initial values up to the start index. 15512 15513- bpo-28247: Update :mod:`zipapp` documentation to describe how to make 15514 standalone applications. 15515 15516- bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and 15517 Berker Peksag. 15518 15519- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder`` 15520 implements ``MetaPathFinder``. (Patch by Himanshu Lakhara) 15521 15522- bpo-8243: Add a note about curses.addch and curses.addstr exception 15523 behavior when writing outside a window, or pad. 15524 15525- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED 15526 flags for ssl.SSLContext.verify_mode. 15527 15528Tests 15529----- 15530 15531- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that 15532 might be due to running on ZFS. 15533 15534- bpo-19417: Add test_bdb.py. 15535 15536Build 15537----- 15538 15539- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from 15540 ``OPT``. This option emitted annoying warnings when building extension 15541 modules written in C++. 15542 15543- bpo-33614: Ensures module definition files for the stable ABI on Windows 15544 are correctly regenerated. 15545 15546- bpo-33522: Enable CI builds on Visual Studio Team Services at 15547 https://python.visualstudio.com/cpython 15548 15549- bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing 15550 warnings about function casts like casting to PyCFunction in method 15551 definition lists. 15552 15553- bpo-33394: Enable the verbose build for extension modules, when GNU make 15554 is passed macros on the command line. 15555 15556Windows 15557------- 15558 15559- bpo-33184: Update Windows installer to OpenSSL 1.0.2o. 15560 15561macOS 15562----- 15563 15564- bpo-33184: Update macOS installer build to use OpenSSL 1.0.2o. 15565 15566IDLE 15567---- 15568 15569- bpo-33656: On Windows, add API call saying that tk scales for DPI. On 15570 Windows 8.1+ or 10, with DPI compatibility properties of the Python binary 15571 unchanged, and a monitor resolution greater than 96 DPI, this should make 15572 text and lines sharper. It should otherwise have no effect. 15573 15574- bpo-33768: Clicking on a context line moves that line to the top of the 15575 editor window. 15576 15577- bpo-33763: IDLE: Use read-only text widget for code context instead of 15578 label widget. 15579 15580- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel 15581 and scrollbar slider moved text by a fixed number of pixels, resulting in 15582 partial lines at the top of the editor box. The change also applies to 15583 the shell and grep output windows, but not to read-only text views. 15584 15585- bpo-33679: Enable theme-specific color configuration for Code Context. Use 15586 the Highlights tab to see the setting for built-in themes or add settings 15587 to custom themes. 15588 15589- bpo-33642: Display up to maxlines non-blank lines for Code Context. If 15590 there is no current context, show a single blank line. 15591 15592- bpo-33628: IDLE: Cleanup codecontext.py and its test. 15593 15594- bpo-33564: IDLE's code context now recognizes async as a block opener. 15595 15596- bpo-29706: IDLE now colors async and await as keywords in 3.6. They become 15597 full keywords in 3.7. 15598 15599- bpo-21474: Update word/identifier definition from ascii to unicode. In 15600 text and entry boxes, this affects selection by double-click, movement 15601 left/right by control-left/right, and deletion left/right by 15602 control-BACKSPACE/DEL. 15603 15604- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string 15605 prefix cannot be paired with either 'r' or 'f'. Consistently color as much 15606 of the prefix, starting at the right, as is valid. Revise and extend 15607 colorizer test. 15608 15609- bpo-32831: Add docstrings and tests for codecontext. 15610 15611Tools/Demos 15612----------- 15613 15614- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as 15615 docstrings and translatable strings, and rejects bytes literals and 15616 f-string expressions. 15617 15618- bpo-31920: Fixed handling directories as arguments in the ``pygettext`` 15619 script. Based on patch by Oleg Krasnikov. 15620 15621- bpo-29673: Fix pystackv and pystack gdbinit macros. 15622 15623- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable 15624 automatic backup creation (files with ``~`` suffix). 15625 15626- bpo-31583: Fix 2to3 for using with --add-suffix option but without 15627 --output-dir option for relative path to files in current directory. 15628 15629C API 15630----- 15631 15632- bpo-32374: Document that m_traverse for multi-phase initialized modules 15633 can be called with m_state=NULL, and add a sanity check 15634 15635 15636What's New in Python 3.6.5 final? 15637================================= 15638 15639*Release date: 2018-03-28* 15640 15641Tests 15642----- 15643 15644- bpo-32872: Avoid regrtest compatibility issue with namespace packages. 15645 15646Build 15647----- 15648 15649- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. 15650 15651 15652What's New in Python 3.6.5 release candidate 1? 15653=============================================== 15654 15655*Release date: 2018-03-13* 15656 15657Security 15658-------- 15659 15660- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows 15661 15662- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic 15663 backtracking. These regexes formed potential DOS vectors (REDOS). They 15664 have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch 15665 by Jamie Davis. 15666 15667Core and Builtins 15668----------------- 15669 15670- bpo-33026: Fixed jumping out of "with" block by setting f_lineno. 15671 15672- bpo-17288: Prevent jumps from 'return' and 'exception' trace events. 15673 15674- bpo-32889: Update Valgrind suppression list to account for the rename of 15675 ``Py_ADDRESS_IN_RANG`` to ``address_in_range``. 15676 15677- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step 15678 over (next command) native coroutines. Patch by Pablo Galindo. 15679 15680- bpo-32685: Improve suggestion when the Python 2 form of print statement is 15681 either present on the same line as the header of a compound statement or 15682 else terminated by a semi-colon instead of a newline. Patch by Nitish 15683 Chandra. 15684 15685- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by 15686 write out-of-bound errors when using customized decode error handlers. 15687 15688- bpo-26163: Improved frozenset() hash to create more distinct hash values 15689 when faced with datasets containing many similar values. 15690 15691- bpo-27169: The ``__debug__`` constant is now optimized out at compile 15692 time. This fixes also bpo-22091. 15693 15694- bpo-32329: ``sys.flags.hash_randomization`` is now properly set to 0 when 15695 hash randomization is turned off by ``PYTHONHASHSEED=0``. 15696 15697- bpo-30416: The optimizer is now protected from spending much time doing 15698 complex calculations and consuming much memory for creating large 15699 constants in constant folding. 15700 15701- bpo-18533: ``repr()`` on a dict containing its own ``values()`` or 15702 ``items()`` no longer raises ``RecursionError``; OrderedDict similarly. 15703 Instead, use ``...``, as for other recursive structures. Patch by Ben 15704 North. 15705 15706- bpo-32028: Leading whitespace is now correctly ignored when generating 15707 suggestions for converting Py2 print statements to Py3 builtin print 15708 function calls. Patch by Sanyam Khurana. 15709 15710- bpo-32137: The repr of deeply nested dict now raises a RecursionError 15711 instead of crashing due to a stack overflow. 15712 15713Library 15714------- 15715 15716- bpo-33064: lib2to3 now properly supports trailing commas after ``*args`` 15717 and ``**kwargs`` in function signatures. 15718 15719- bpo-31804: Avoid failing in multiprocessing.Process if the standard 15720 streams are closed or None at exit. 15721 15722- bpo-33037: Skip sending/receiving data after SSL transport closing. 15723 15724- bpo-30353: Fix ctypes pass-by-value for structs on 64-bit Cygwin/MinGW. 15725 15726- bpo-33009: Fix inspect.signature() for single-parameter partialmethods. 15727 15728- bpo-32969: Expose several missing constants in zlib and fix corresponding 15729 documentation. 15730 15731- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch 15732 by Joffrey Fuhrer. 15733 15734- bpo-30622: The ssl module now detects missing NPN support in LibreSSL. 15735 15736- bpo-32922: dbm.open() now encodes filename with the filesystem encoding 15737 rather than default encoding. 15738 15739- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3`` 15740 syscall exists or not. 15741 15742- bpo-21060: Rewrite confusing message from setup.py upload from "No dist 15743 file created in earlier command" to the more helpful "Must create and 15744 upload files in one command". 15745 15746- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a 15747 :exc:`ValueError` instead of canceling the first scheduled function. 15748 Patch by Cheryl Sabella. 15749 15750- bpo-32852: Make sure sys.argv remains as a list when running trace. 15751 15752- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored 15753 cancellation after notifying and cancelling a conditional lock. Patch by 15754 Bar Harel. 15755 15756- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules. 15757 (Contributed by Oren Milman) 15758 15759- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when 15760 only the last field is quoted. Patch by Jake Davis. 15761 15762- bpo-32394: socket: Remove TCP_FASTOPEN, TCP_KEEPCNT flags on older version 15763 Windows during run-time. 15764 15765- bpo-32777: Fix a rare but potential pre-exec child process deadlock in 15766 subprocess on POSIX systems when marking file descriptors inheritable on 15767 exec in the child process. This bug appears to have been introduced in 15768 3.4. 15769 15770- bpo-32647: The ctypes module used to depend on indirect linking for 15771 dlopen. The shared extension is now explicitly linked against libdl on 15772 platforms with dl. 15773 15774- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring 15775 and locking the same lock multiple times, without it being free. Patch by 15776 Bar Harel. 15777 15778- bpo-32727: Do not include name field in SMTP envelope from address. Patch 15779 by Stéphane Wirtel 15780 15781- bpo-27931: Fix email address header parsing error when the username is an 15782 empty quoted string. Patch by Xiang Zhang. 15783 15784- bpo-32304: distutils' upload command no longer corrupts tar files ending 15785 with a CR byte, and no longer tries to convert CR to CRLF in any of the 15786 upload text fields. 15787 15788- bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware 15789 address is encountered. 15790 15791- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND 15792 chunk is not found. Patch by Zackery Spytz. 15793 15794- bpo-32555: On FreeBSD and Solaris, os.strerror() now always decode the 15795 byte string from the current locale encoding, rather than using 15796 ASCII/surrogateescape in some cases. 15797 15798- bpo-32521: The nis module is now compatible with new libnsl and headers 15799 location. 15800 15801- bpo-32473: Improve ABCMeta._dump_registry() output readability 15802 15803- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and 15804 library in nis module. 15805 15806- bpo-32228: Ensure that ``truncate()`` preserves the file position (as 15807 reported by ``tell()``) after writes longer than the buffer size. 15808 15809- bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on 15810 interpreter shutdown. 15811 15812- bpo-32185: The SSL module no longer sends IP addresses in SNI TLS 15813 extension on platforms with OpenSSL 1.0.2+ or inet_pton. 15814 15815- bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id 15816 (scope) to lower case for scoped IPv6 addresses in hostnames now. 15817 15818- bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary 15819 compatible with CRT v140. 15820 15821- bpo-32255: A single empty field is now always quoted when written into a 15822 CSV file. This allows to distinguish an empty row from a row consisting of 15823 a single empty field. Patch by Licht Takeuchi. 15824 15825- bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on 15826 platforms where ``chmod(..., follow_symlinks=False)`` is not supported. 15827 Patch by Anthony Sottile. 15828 15829- bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link 15830 list'. 15831 15832- bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner. 15833 15834- bpo-31900: The :func:`locale.localeconv` function now sets temporarily the 15835 ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode 15836 ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII 15837 or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the 15838 ``LC_CTYPE`` locale. This temporary change affects other threads. Same 15839 change for the :meth:`str.format` method when formatting a number 15840 (:class:`int`, :class:`float`, :class:`float` and subclasses) with the 15841 ``n`` type (ex: ``'{:n}'.format(1234)``). 15842 15843- bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now 15844 works even if the ``os`` module still is not imported. 15845 15846Documentation 15847------------- 15848 15849- bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy. 15850 15851- bpo-32800: Update link to w3c doc for xml default namespaces. 15852 15853- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get` 15854 method raises :exc:`AttributeError`. 15855 15856- bpo-32614: Modify RE examples in documentation to use raw strings to 15857 prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight 15858 the deprecation. 15859 15860- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses. 15861 15862- bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and 15863 their C-API counterparts regarding which type of events are received in 15864 each function. Patch by Pablo Galindo Salgado. 15865 15866Tests 15867----- 15868 15869- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport 15870 of ``KqueueSelector`` loop was not being closed. 15871 15872- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built. 15873 15874- bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core 15875 dump files when testing crashes. getrlimit() returns zero on success. 15876 15877- bpo-31518: Debian Unstable has disabled TLS 1.0 and 1.1 for 15878 SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or 15879 PROTOCOL_TLSv1_2 to make them pass on Debian. 15880 15881Build 15882----- 15883 15884- bpo-32635: Fix segfault of the crypt module when libxcrypt is provided 15885 instead of libcrypt at the system. 15886 15887Windows 15888------- 15889 15890- bpo-33016: Fix potential use of uninitialized memory in 15891 nt._getfinalpathname 15892 15893- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current 15894 directory is set to a UNC path. 15895 15896- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. 15897 15898- bpo-32409: Ensures activate.bat can handle Unicode contents. 15899 15900- bpo-32457: Improves handling of denormalized executable path when 15901 launching Python. 15902 15903- bpo-32370: Use the correct encoding for ipconfig output in the uuid 15904 module. Patch by Segev Finer. 15905 15906- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly 15907 treating the ``PrintNameOffset`` field of the reparse data buffer as a 15908 number of characters instead of bytes. Patch by Craig Holmquist and SSE4. 15909 15910- bpo-32588: Create standalone _distutils_findvs module. 15911 15912macOS 15913----- 15914 15915- bpo-32726: Provide an additional, more modern macOS installer variant that 15916 supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied 15917 third-party libraries to OpenSSL 1.0.2n, XZ 5.2.3, and SQLite 3.22.0. The 15918 10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.8. 15919 15920IDLE 15921---- 15922 15923- bpo-32984: Set ``__file__`` while running a startup file. Like Python, 15924 IDLE optionally runs one startup file in the Shell window before 15925 presenting the first interactive input prompt. For IDLE, ``-s`` runs a 15926 file named in environmental variable :envvar:`IDLESTARTUP` or 15927 :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets 15928 ``__file__`` to the startup file name before running the file and unsets 15929 it before the first prompt. IDLE now does the same when run normally, 15930 without the ``-n`` option. 15931 15932- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse. 15933 15934- bpo-32916: Change ``str`` to ``code`` in pyparse. 15935 15936- bpo-32905: Remove unused code in pyparse module. 15937 15938- bpo-32874: Add tests for pyparse. 15939 15940- bpo-32837: Using the system and place-dependent default encoding for 15941 open() is a bad idea for IDLE's system and location-independent files. 15942 15943- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI 15944 test test_file_buttons() only looks at initial ascii-only lines, but 15945 failed on systems where open() defaults to 'ascii' because readline() 15946 internally reads and decodes far enough ahead to encounter a non-ascii 15947 character in CREDITS.txt. 15948 15949- bpo-32765: Update configdialog General tab docstring to add new widgets to 15950 the widget list. 15951 15952Tools/Demos 15953----------- 15954 15955- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using 15956 pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and 15957 lib2to3 work when run from a zipfile. 15958 15959- bpo-32222: Fix pygettext not extracting docstrings for functions with type 15960 annotated arguments. Patch by Toby Harradine. 15961 15962C API 15963----- 15964 15965- bpo-29084: Undocumented C API for OrderedDict has been excluded from the 15966 limited C API. It was added by mistake and actually never worked in the 15967 limited C API. 15968 15969 15970What's New in Python 3.6.4 final? 15971================================= 15972 15973*Release date: 2017-12-18* 15974 15975There were no new code changes in version 3.6.4 since v3.6.4rc1. 15976 15977 15978 15979What's New in Python 3.6.4 release candidate 1? 15980=============================================== 15981 15982*Release date: 2017-12-05* 15983 15984Core and Builtins 15985----------------- 15986 15987- bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code 15988 object constructor based on freevars and cellvars, rather than needing to 15989 be set correctly by the caller. This ensures it will be cleared 15990 automatically when additional cell references are injected into a modified 15991 code object and function. 15992 15993- bpo-31949: Fixed several issues in printing tracebacks 15994 (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now 15995 suppresses printing tracebacks. Setting sys.tracebacklimit to None now 15996 causes using the default limit. Setting sys.tracebacklimit to an integer 15997 larger than LONG_MAX now means using the limit LONG_MAX rather than the 15998 default limit. Fixed integer overflows in the case of more than 2**31 15999 traceback items on Windows. Fixed output errors handling. 16000 16001- bpo-30696: Fix the interactive interpreter looping endlessly when no 16002 memory. 16003 16004- bpo-20047: Bytearray methods partition() and rpartition() now accept only 16005 bytes-like objects as separator, as documented. In particular they now 16006 raise TypeError rather of returning a bogus result when an integer is 16007 passed as a separator. 16008 16009- bpo-31852: Fix a segmentation fault caused by a combination of the async 16010 soft keyword and continuation lines. 16011 16012- bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of 16013 ``__import__()`` or the ``__all__`` attribute of the module contain bytes 16014 instances. 16015 16016- bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in 16017 codecs.escape_decode() when decode an escaped non-ascii byte. 16018 16019- bpo-28603: Print the full context/cause chain of exceptions on interpreter 16020 exit, even if an exception in the chain is unhashable or compares equal to 16021 later ones. Patch by Zane Bitter. 16022 16023- bpo-31786: Fix timeout rounding in the select module to round correctly 16024 negative timeouts between -1.0 and 0.0. The functions now block waiting 16025 for events as expected. Previously, the call was incorrectly non-blocking. 16026 Patch by Pablo Galindo. 16027 16028- bpo-31642: Restored blocking "from package import module" by setting 16029 sys.modules["package.module"] to None. 16030 16031- bpo-31626: Fixed a bug in debug memory allocator. There was a write to 16032 freed memory after shrinking a memory block. 16033 16034- bpo-31619: Fixed a ValueError when convert a string with large number of 16035 underscores to integer with binary base. 16036 16037- bpo-31592: Fixed an assertion failure in Python parser in case of a bad 16038 `unicodedata.normalize()`. Patch by Oren Milman. 16039 16040- bpo-31588: Raise a `TypeError` with a helpful error message when class 16041 creation fails due to a metaclass with a bad ``__prepare__()`` method. 16042 Patch by Oren Milman. 16043 16044- bpo-31566: Fix an assertion failure in `_warnings.warn()` in case of a bad 16045 ``__name__`` global. Patch by Oren Milman. 16046 16047- bpo-31505: Fix an assertion failure in `json`, in case 16048 `_json.make_encoder()` received a bad `encoder()` argument. Patch by Oren 16049 Milman. 16050 16051- bpo-31492: Fix assertion failures in case of failing to import from a 16052 module with a bad ``__name__`` attribute, and in case of failing to access 16053 an attribute of such a module. Patch by Oren Milman. 16054 16055- bpo-31490: Fix an assertion failure in `ctypes` class definition, in case 16056 the class has an attribute whose name is specified in ``_anonymous_`` but 16057 not in ``_fields_``. Patch by Oren Milman. 16058 16059- bpo-31478: Fix an assertion failure in `_random.Random.seed()` in case the 16060 argument has a bad ``__abs__()`` method. Patch by Oren Milman. 16061 16062- bpo-31315: Fix an assertion failure in imp.create_dynamic(), when 16063 spec.name is not a string. Patch by Oren Milman. 16064 16065- bpo-31311: Fix a crash in the ``__setstate__()`` method of 16066 `ctypes._CData`, in case of a bad ``__dict__``. Patch by Oren Milman. 16067 16068- bpo-31293: Fix crashes in true division and multiplication of a timedelta 16069 object by a float with a bad as_integer_ratio() method. Patch by Oren 16070 Milman. 16071 16072- bpo-31285: Fix an assertion failure in `warnings.warn_explicit`, when the 16073 return value of the received loader's get_source() has a bad splitlines() 16074 method. Patch by Oren Milman. 16075 16076- bpo-30817: `PyErr_PrintEx()` clears now the ignored exception that may be 16077 raised by `_PySys_SetObjectId()`, for example when no memory. 16078 16079Library 16080------- 16081 16082- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying 16083 instances of generic classes, improve interaction of ``__init_subclass__`` 16084 with generics. Original PRs by Ivan Levkivskyi. 16085 16086- bpo-27240: The header folding algorithm for the new email policies has 16087 been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In 16088 particular, RFC2231 folding is now done correctly. 16089 16090- bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL 16091 when getting the file size. Fixed hang of all threads with inaccessible 16092 NFS server. Patch by Nir Soffer. 16093 16094- bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return 16095 ``None`` when the value of property is ``VT_EMPTY``. Initial patch by 16096 Mark Mc Mahon. 16097 16098- bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the 16099 :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>` 16100 method. Initial patch by Robin Wellner. 16101 16102- bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception 16103 message when it couldn't open or create an MSI file. Initial patch by 16104 William Tisäter. 16105 16106- bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n* 16107 characters/bytes for non-negative *n*. This makes it compatible with 16108 ``read()`` methods of other file-like objects. 16109 16110- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays. 16111 Identical objects will be saved only once. Equal references will be load 16112 as identical objects. Added support for saving and loading recursive data 16113 structures. 16114 16115- bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError 16116 pickleable. 16117 16118- bpo-32015: Fixed the looping of asyncio in the case of reconnection the 16119 socket during waiting async read/write from/to the socket. 16120 16121- bpo-32011: Restored support of loading marshal files with the TYPE_INT64 16122 code. These files can be produced in Python 2.7. 16123 16124- bpo-31970: Reduce performance overhead of asyncio debug mode. 16125 16126- bpo-9678: Fixed determining the MAC address in the uuid module: Using 16127 ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and 16128 OpenBSD. Based on patch by Takayuki Shimizukawa. 16129 16130- bpo-30057: Fix potential missed signal in signal.signal(). 16131 16132- bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian 16133 platforms. Patch by Jack O'Connor. 16134 16135- bpo-31927: Fixed compilation of the socket module on NetBSD 8. Fixed 16136 assertion failure or reading arbitrary data when parse a AF_BLUETOOTH 16137 address on NetBSD and DragonFly BSD. 16138 16139- bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse() 16140 when the size of types chtype or mmask_t is less than the size of C long. 16141 curses.box() now accepts characters as arguments. Based on patch by Steve 16142 Fink. 16143 16144- bpo-31897: plistlib now catches more errors when read binary plists and 16145 raises InvalidFileException instead of unexpected exceptions. 16146 16147- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch 16148 by Masayuki Yamamoto. 16149 16150- bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and 16151 NetBSD. Fixed the comparison of the kqueue_event objects. 16152 16153- bpo-31891: Fixed building the curses module on NetBSD. 16154 16155- bpo-28416: Instances of pickle.Pickler subclass with the persistent_id() 16156 method and pickle.Unpickler subclass with the persistent_load() method no 16157 longer create reference cycles. 16158 16159- bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed 16160 or None. 16161 16162- bpo-31457: If nested log adapters are used, the inner ``process()`` 16163 methods are no longer omitted. 16164 16165- bpo-31457: The ``manager`` property on LoggerAdapter objects is now 16166 properly settable. 16167 16168- bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire() 16169 and socket.socket.settimeout() to round correctly negative timeouts 16170 between -1.0 and 0.0. The functions now block waiting for events as 16171 expected. Previously, the call was incorrectly non-blocking. Patch by 16172 Pablo Galindo. 16173 16174- bpo-28603: traceback: Fix a TypeError that occurred during printing of 16175 exception tracebacks when either the current exception or an exception in 16176 its context/cause chain is unhashable. Patch by Zane Bitter. 16177 16178- bpo-30058: Fixed buffer overflow in select.kqueue.control(). 16179 16180- bpo-31770: Prevent a crash when calling the ``__init__()`` method of a 16181 ``sqlite3.Cursor`` object more than once. Patch by Oren Milman. 16182 16183- bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII 16184 characters. Now it uses ``-i`` regular expression local flag to avoid 16185 non-ASCII characters. 16186 16187- bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the 16188 ``Cursor`` object is uninitialized. Patch by Oren Milman. 16189 16190- bpo-31752: Fix possible crash in timedelta constructor called with custom 16191 integers. 16192 16193- bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM 16194 exceptions. 16195 16196- bpo-31728: Prevent crashes in `_elementtree` due to unsafe cleanup of 16197 `Element.text` and `Element.tail`. Patch by Oren Milman. 16198 16199- bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get 16200 pollers timeout 16201 16202- bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in 16203 asyncio module. This method was previously modifying a wrong reference to 16204 the protocol. 16205 16206- bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split() 16207 when pass a string larger than 2 GiB. 16208 16209- bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo(). 16210 16211- bpo-30806: Fix the string representation of a netrc object. 16212 16213- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and 16214 earlier. 16215 16216- bpo-25351: Avoid venv activate failures with undefined variables 16217 16218- bpo-25532: inspect.unwrap() will now only try to unwrap an object 16219 sys.getrecursionlimit() times, to protect against objects which create a 16220 new object on every attribute access. 16221 16222- bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() 16223 iterators. 16224 16225- bpo-31516: ``threading.current_thread()`` should not return a dummy thread 16226 at shutdown. 16227 16228- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip 16229 bootstrapping has failed. 16230 16231- bpo-31482: ``random.seed()`` now works with bytes in version=1 16232 16233- bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for 16234 arbitrary negative timeouts on all OSes where it can only be a 16235 non-negative integer or -1. Patch by Riccardo Coccioli. 16236 16237- bpo-31310: multiprocessing's semaphore tracker should be launched again if 16238 crashed. 16239 16240- bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and 16241 other user interruptions. If it crashes, restart it when necessary. 16242 16243Documentation 16244------------- 16245 16246- bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket 16247 versionadded marker. 16248 16249- bpo-31537: Fix incorrect usage of ``get_history_length`` in readline 16250 documentation example code. Patch by Brad Smith. 16251 16252- bpo-30085: The operator functions without double underscores are preferred 16253 for clarity. The one with underscores are only kept for 16254 back-compatibility. 16255 16256Tests 16257----- 16258 16259- bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on 16260 APFS. 16261 16262- bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5. 16263 The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged 16264 into the kernel 4.5. 16265 16266- bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the 16267 names sample to always test the same files. It prevents false alarms when 16268 hunting reference leaks. 16269 16270- bpo-30695: Add the `set_nomemory(start, stop)` and `remove_mem_hooks()` 16271 functions to the _testcapi module. 16272 16273Build 16274----- 16275 16276- bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the 16277 sysroot paths when cross-compiling. 16278 16279- bpo-31957: Fixes Windows SDK version detection when building for Windows. 16280 16281- bpo-31609: Fixes quotes in PCbuild/clean.bat 16282 16283- bpo-31934: Abort the build when building out of a not clean source tree. 16284 16285- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when 16286 there was more than one function and/or method in a .c file with the same 16287 name. 16288 16289- bpo-28791: Update Windows builds to use SQLite 3.21.0. 16290 16291- bpo-28791: Update OS X installer to use SQLite 3.21.0. 16292 16293- bpo-22140: Prevent double substitution of prefix in python-config.sh. 16294 16295- bpo-31536: Avoid wholesale rebuild after `make regen-all` if nothing 16296 changed. 16297 16298Windows 16299------- 16300 16301- bpo-1102: Return ``None`` when ``View.Fetch()`` returns 16302 ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by 16303 Anthony Tuininga. 16304 16305- bpo-31944: Fixes Modify button in Apps and Features dialog. 16306 16307macOS 16308----- 16309 16310- bpo-31392: Update macOS installer to use OpenSSL 1.0.2m 16311 16312IDLE 16313---- 16314 16315- bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event 16316 handling is driven by IDLE's run loop, a confusing and distracting 16317 queue.EMPTY traceback context is no longer added to tk event exception 16318 tracebacks. The traceback is now the same as when event handling is 16319 driven by user code. Patch based on a suggestion by Serhiy Storchaka. 16320 16321- bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet 16322 in configdialog was replaced by ttk.Notebook. 16323 16324- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch 16325 mostly by Cheryl Sabella. 16326 16327- bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor 16328 and output windows only see an empty last prompt line. This simplifies 16329 the code and fixes a minor bug when newline is inserted. Sys.ps1, if 16330 present, is read on Shell start-up, but is not set or changed. 16331 16332- bpo-31860: The font sample in the IDLE configuration dialog is now 16333 editable. Changes persist while IDLE remains open 16334 16335- bpo-31836: Test_code_module now passes if run after test_idle, which sets 16336 ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not. 16337 Test_code_module now properly tests both behaviors. Ditto for ps2. 16338 16339- bpo-28603: Fix a TypeError that caused a shell restart when printing a 16340 traceback that includes an exception that is unhashable. Patch by Zane 16341 Bitter. 16342 16343- bpo-13802: Use non-Latin characters in the IDLE's Font settings sample. 16344 Even if one selects a font that defines a limited subset of the unicode 16345 Basic Multilingual Plane, tcl/tk will use other fonts that define a 16346 character. The expanded example give users of non-Latin characters a 16347 better idea of what they might see in IDLE's shell and editors. To make 16348 room for the expanded sample, frames on the Font tab are re-arranged. The 16349 Font/Tabs help explains a bit about the additions. 16350 16351- bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget 16352 instead of an flist with a root widget opens the option of creating a 16353 browser frame that is only part of a window. Passing a full file name 16354 instead of pieces assumed to come from a .py file opens the possibility of 16355 browsing python files that do not end in .py. 16356 16357- bpo-31649: IDLE - Make _htest, _utest parameters keyword only. 16358 16359- bpo-31559: Remove test order dependence in idle_test.test_browser. 16360 16361- bpo-31459: Rename IDLE's module browser from Class Browser to Module 16362 Browser. The original module-level class and method browser became a 16363 module browser, with the addition of module-level functions, years ago. 16364 Nested classes and functions were added yesterday. For 16365 back-compatibility, the virtual event <<open-class-browser>>, which 16366 appears on the Keys tab of the Settings dialog, is not changed. Patch by 16367 Cheryl Sabella. 16368 16369- bpo-31500: Default fonts now are scaled on HiDPI displays. 16370 16371- bpo-1612262: IDLE module browser now shows nested classes and functions. 16372 Original patches for code and tests by Guilherme Polo and Cheryl Sabella, 16373 respectively. 16374 16375Tools/Demos 16376----------- 16377 16378- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also, 16379 remove the ``LOCALE`` option since it doesn't work with string patterns in 16380 Python 3. Patch by Christoph Sarnowski. 16381 16382C API 16383----- 16384 16385- bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in 16386 a non-Python thread before PyEval_InitThreads(), only call 16387 PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. 16388 16389- bpo-31532: Fix memory corruption due to allocator mix in getpath.c between 16390 Py_GetPath() and Py_SetPath() 16391 16392- bpo-30697: The `PyExc_RecursionErrorInst` singleton is removed and 16393 `PyErr_NormalizeException()` does not use it anymore. This singleton is 16394 persistent and its members being never cleared may cause a segfault during 16395 finalization of the interpreter. See also issue #22898. 16396 16397 16398What's New in Python 3.6.3 final? 16399================================= 16400 16401*Release date: 2017-10-03* 16402 16403Library 16404------- 16405 16406- bpo-31641: Re-allow arbitrary iterables in 16407 `concurrent.futures.as_completed()`. Fixes regression in 3.6.3rc1. 16408 16409Build 16410----- 16411 16412- bpo-31662: Fix typos in Windows ``uploadrelease.bat`` script. Fix Windows 16413 Doc build issues in ``Doc/make.bat``. 16414 16415- bpo-31423: Fix building the PDF documentation with newer versions of 16416 Sphinx. 16417 16418 16419What's New in Python 3.6.3 release candidate 1? 16420=============================================== 16421 16422*Release date: 2017-09-18* 16423 16424Security 16425-------- 16426 16427- bpo-29781: SSLObject.version() now correctly returns None when handshake 16428 over BIO has not been performed yet. 16429 16430- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to 16431 get security fixes. 16432 16433Core and Builtins 16434----------------- 16435 16436- bpo-31471: Fix an assertion failure in `subprocess.Popen()` on Windows, in 16437 case the env argument has a bad keys() method. Patch by Oren Milman. 16438 16439- bpo-31418: Fix an assertion failure in `PyErr_WriteUnraisable()` in case 16440 of an exception with a bad ``__module__`` attribute. Patch by Oren Milman. 16441 16442- bpo-31416: Fix assertion failures in case of a bad warnings.filters or 16443 warnings.defaultaction. Patch by Oren Milman. 16444 16445- bpo-31411: Raise a TypeError instead of SystemError in case 16446 warnings.onceregistry is not a dictionary. Patch by Oren Milman. 16447 16448- bpo-31373: Fix several possible instances of undefined behavior due to 16449 floating-point demotions. 16450 16451- bpo-30465: Location information (``lineno`` and ``col_offset``) in 16452 f-strings is now (mostly) correct. This fixes tools like flake8 from 16453 showing warnings on the wrong line (typically the first line of the file). 16454 16455- bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev(). 16456 GNU C libray plans to remove the functions from sys/types.h. 16457 16458- bpo-31291: Fix an assertion failure in `zipimport.zipimporter.get_data` on 16459 Windows, when the return value of ``pathname.replace('/','\\')`` isn't a 16460 string. Patch by Oren Milman. 16461 16462- bpo-31271: Fix an assertion failure in the write() method of 16463 `io.TextIOWrapper`, when the encoder doesn't return a bytes object. Patch 16464 by Oren Milman. 16465 16466- bpo-31243: Fix a crash in some methods of `io.TextIOWrapper`, when the 16467 decoder's state is invalid. Patch by Oren Milman. 16468 16469- bpo-30721: ``print`` now shows correct usage hint for using Python 2 16470 redirection syntax. Patch by Sanyam Khurana. 16471 16472- bpo-31070: Fix a race condition in importlib _get_module_lock(). 16473 16474- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which 16475 doesn't call ``PyObject_GC_UnTrack()``. 16476 16477- bpo-31071: Avoid masking original TypeError in call with * unpacking when 16478 other arguments are passed. 16479 16480- bpo-30978: str.format_map() now passes key lookup exceptions through. 16481 Previously any exception was replaced with a KeyError exception. 16482 16483- bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state. 16484 16485- bpo-30876: Relative import from unloaded package now reimports the package 16486 instead of failing with SystemError. Relative import from non-package now 16487 fails with ImportError rather than SystemError. 16488 16489- bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from 16490 signal handler, to avoid calling signal-unsafe functions. The tests I'm 16491 adding here fail without the rest of the patch, on Linux and OS X. This 16492 means our signal delivery logic had defects (some signals could be lost). 16493 16494- bpo-30765: Avoid blocking in pthread_mutex_lock() when 16495 PyThread_acquire_lock() is asked not to block. 16496 16497- bpo-31161: Make sure the 'Missing parentheses' syntax error message is 16498 only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters. 16499 16500- bpo-30814: Fixed a race condition when import a submodule from a package. 16501 16502- bpo-30597: ``print`` now shows expected input in custom error message when 16503 used as a Python 2 statement. Patch by Sanyam Khurana. 16504 16505Library 16506------- 16507 16508- bpo-31499: xml.etree: Fix a crash when a parser is part of a reference 16509 cycle. 16510 16511- bpo-28556: typing.get_type_hints now finds the right globalns for classes 16512 and modules by default (when no ``globalns`` was specified by the caller). 16513 16514- bpo-28556: Speed improvements to the ``typing`` module. Original PRs by 16515 Ivan Levkivskyi and Mitar. 16516 16517- bpo-31544: The C accelerator module of ElementTree ignored exceptions 16518 raised when looking up TreeBuilder target methods in XMLParser(). 16519 16520- bpo-31234: socket.create_connection() now fixes manually a reference 16521 cycle: clear the variable storing the last exception on success. 16522 16523- bpo-31457: LoggerAdapter objects can now be nested. 16524 16525- bpo-31400: Improves SSL error handling to avoid losing error numbers. 16526 16527- bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a 16528 context cannot be instantiated. 16529 16530- bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of 16531 data. This fixes support for all bytes-like object. It is also more 16532 efficient and avoids costly copies. 16533 16534- bpo-31178: Fix string concatenation bug in rare error path in the 16535 subprocess module 16536 16537- bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up 16538 to 10% faster. 16539 16540- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of 16541 partial characters for UTF-8 input (libexpat bug 115): 16542 https://github.com/libexpat/libexpat/issues/115 16543 16544- bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3. 16545 16546- bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to 16547 have a non repr() based thread name by default when no thread_name_prefix 16548 is supplied. They will now identify themselves as 16549 "ThreadPoolExecutor-y_n". 16550 16551- bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash 16552 functions such as md5 are not available in the linked OpenSSL library. As 16553 in some special FIPS-140 build environments. 16554 16555- bpo-27144: The ``map()`` and ``as_completed()`` iterators in 16556 ``concurrent.futures`` now avoid keeping a reference to yielded objects. 16557 16558- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer 16559 types. 16560 16561- bpo-22536: The subprocess module now sets the filename when 16562 FileNotFoundError is raised on POSIX systems due to the executable or cwd 16563 not being found. 16564 16565- bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor 16566 now breaks a reference cycle between an exception object and the WorkItem 16567 object. 16568 16569- bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using 16570 sys.exc_info() in code handling exceptions. 16571 16572- bpo-30102: The ssl and hashlib modules now call 16573 OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function 16574 detects CPU features and enables optimizations on some CPU architectures 16575 such as POWER8. Patch is based on research from Gustavo Serra Scalet. 16576 16577- bpo-31185: Fixed miscellaneous errors in asyncio speedup module. 16578 16579- bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu 16580 classes. Call the parent destroy() method even if the used attribute 16581 doesn't exist. The LabeledScale.destroy() method now also explicitly 16582 clears label and scale attributes to help the garbage collector to destroy 16583 all widgets. 16584 16585- bpo-31107: Fix `copyreg._slotnames()` mangled attribute calculation for 16586 classes whose name begins with an underscore. Patch by Shane Harvey. 16587 16588- bpo-31061: Fixed a crash when using asyncio and threads. 16589 16590- bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian 16591 Heimes. 16592 16593- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that 16594 contains CR or LF. Patch by Dong-hee Na. 16595 16596- bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader 16597 in non-blocking mode if it succeeded to acquire the lock but the acquire 16598 took longer than the timeout. 16599 16600- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound 16601 builtin functions. Patch by Aaron Gallagher. 16602 16603- bpo-30961: Fix decrementing a borrowed reference in tracemalloc. 16604 16605- bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across 16606 instances of ``OptionMenu``. 16607 16608- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the 16609 thread completes, even if the thread was started by the same process which 16610 created the queue. 16611 16612- bpo-29854: Fix segfault in readline when using readline's history-size 16613 option. Patch by Nir Soffer. 16614 16615- bpo-30319: socket.close() now ignores ECONNRESET error. 16616 16617- bpo-30828: Fix out of bounds write in 16618 `asyncio.CFuture.remove_done_callback()`. 16619 16620- bpo-30807: signal.setitimer() may disable the timer when passed a tiny 16621 value. Tiny values (such as 1e-6) are valid non-zero values for 16622 setitimer(), which is specified as taking microsecond-resolution 16623 intervals. However, on some platform, our conversion routine could convert 16624 1e-6 into a zero interval, therefore disabling the timer instead of 16625 (re-)scheduling it. 16626 16627- bpo-30441: Fix bug when modifying os.environ while iterating over it 16628 16629- bpo-30532: Fix email header value parser dropping folding white space in 16630 certain cases. 16631 16632- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called 16633 with bytes-like argument. 16634 16635- bpo-30746: Prohibited the '=' character in environment variable names in 16636 ``os.putenv()`` and ``os.spawn*()``. 16637 16638- bpo-29755: Fixed the lgettext() family of functions in the gettext module. 16639 They now always return bytes. 16640 16641Documentation 16642------------- 16643 16644- bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and 16645 ZeroMQSocketHandler examples and adapt them to Python 3. 16646 16647- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL 16648 documentation. 16649 16650- bpo-30803: Clarify doc on truth value testing. Original patch by Peter 16651 Thomassen. 16652 16653Tests 16654----- 16655 16656- bpo-31320: Silence traceback in test_ssl 16657 16658- bpo-25674: Remove sha256.tbs-internet.com ssl test 16659 16660- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest 16661 version behaves like OpenSSL 1.0.2 and no longer aborts handshake. 16662 16663- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the 16664 test suite using --use=all / -u all, exclude tzdata since it makes 16665 test_datetime too slow (15-20 min on some buildbots) which then times out 16666 on some buildbots. Fix also regrtest command line parser to allow passing 16667 -u extralargefile to run test_zipfile64. 16668 16669Build 16670----- 16671 16672- bpo-30854: Fix compile error when compiling --without-threads. Patch by 16673 Masayuki Yamamoto. 16674 16675Windows 16676------- 16677 16678- bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows. 16679 16680- bpo-31340: Change to building with MSVC v141 (included with Visual Studio 16681 2017) 16682 16683- bpo-30581: os.cpu_count() now returns the correct number of processors on 16684 Windows when the number of logical processors is greater than 64. 16685 16686- bpo-30731: Add a missing xmlns to python.manifest so that it matches the 16687 schema. 16688 16689IDLE 16690---- 16691 16692- bpo-31493: IDLE code context -- fix code update and font update timers. 16693 Canceling timers prevents a warning message when test_idle completes. 16694 16695- bpo-31488: IDLE - Update non-key options in former extension classes. When 16696 applying configdialog changes, call .reload for each feature class. Change 16697 ParenMatch so updated options affect existing instances attached to 16698 existing editor windows. 16699 16700- bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace 16701 strips more than blank spaces. Multiline string literals are not skipped. 16702 16703- bpo-31480: IDLE - make tests pass with zzdummy extension disabled by 16704 default. 16705 16706- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk 16707 update in the background in order to make live interaction and 16708 experimentation with tkinter applications much easier. 16709 16710- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an 16711 int entry is not the same as deleting and inserting because int('') will 16712 fail. 16713 16714- bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and 16715 Help sections. 16716 16717- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor. 16718 Move some data and functions from the class to module level. Patch by 16719 Cheryl Sabella. 16720 16721- bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog. 16722 16723- bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About 16724 10 IDLE features were implemented as supposedly optional extensions. Their 16725 different behavior could be confusing or worse for users and not good for 16726 maintenance. Hence the conversion. The main difference for users is that 16727 user configurable key bindings for builtin features are now handled 16728 uniformly. Now, editing a binding in a keyset only affects its value in 16729 the keyset. All bindings are defined together in the system-specific 16730 default keysets in config-extensions.def. All custom keysets are saved as 16731 a whole in config-extension.cfg. All take effect as soon as one clicks 16732 Apply or Ok. The affected events are '<<force-open-completions>>', 16733 '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', 16734 '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and 16735 '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not 16736 affect their keyset-specific customization after 3.6.3. and vice versa. 16737 Initial patch by Charles Wohlganger. 16738 16739- bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by 16740 Cheryl Sabella. 16741 16742- bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl 16743 Sabella. 16744 16745- bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The 16746 slightly modified tests continue to pass. Patch by Cheryl Sabella. 16747 16748- bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by 16749 Victor Stinner. 16750 16751- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella. 16752 16753- bpo-19903: IDLE: Calltips use `inspect.signature` instead of 16754 `inspect.getfullargspec`. This improves calltips for builtins converted to 16755 use Argument Clinic. Patch by Louie Lu. 16756 16757- bpo-31083: IDLE - Add an outline of a TabPage class in configdialog. 16758 Update existing classes to match outline. Initial patch by Cheryl Sabella. 16759 16760- bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly 16761 modified tests continue to pass. Patch by Cheryl Sabella. 16762 16763- bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly 16764 modified tests continue to pass. Fix General tests. Patch mostly by Cheryl 16765 Sabella. 16766 16767- bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan 16768 Reedy and Cheryl Sabella. 16769 16770- bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping 16771 methods pertaining to each tab and the buttons will aid writing tests and 16772 improving the tabs and will enable splitting the groups into classes. 16773 16774- bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance 16775 tracers manages pairs consisting of a tk variable and a callback function. 16776 When tracing is turned on, setting the variable calls the function. Test 16777 coverage for the new class is 100%. 16778 16779- bpo-31003: IDLE: Add more tests for General tab. 16780 16781- bpo-30993: IDLE - Improve configdialog font page and tests. In 16782 configdialog: Document causal pathways in create_font_tab docstring. 16783 Simplify some attribute names. Move set_samples calls to var_changed_font 16784 (idea from Cheryl Sabella). Move related functions to positions after the 16785 create widgets function. In test_configdialog: Fix test_font_set so not 16786 order dependent. Fix renamed test_indent_scale so it tests the widget. 16787 Adjust tests for movement of set_samples call. Add tests for load 16788 functions. Put all font tests in one class and tab indent tests in 16789 another. Except for two lines, these tests completely cover the related 16790 functions. 16791 16792- bpo-30981: IDLE -- Add more configdialog font page tests. 16793 16794- bpo-28523: IDLE: replace 'colour' with 'color' in configdialog. 16795 16796- bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from 16797 46% to 96%. Patch by Louie Lu. 16798 16799- bpo-30934: Document coverage details for idlelib tests. Add section to 16800 idlelib/idle-test/README.txt. Include check that branches are taken both 16801 ways. Exclude IDLE-specific code that does not run during unit tests. 16802 16803- bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in 16804 docstrings This will facilitate improving the dialog and splitting up the 16805 class. Original patch by Cheryl Sabella. 16806 16807- bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by 16808 Louie Lu. 16809 16810- bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella. 16811 16812- bpo-30851: IDLE: Remove unused variables in configdialog. One is a 16813 duplicate, one is set but cannot be altered by users. Patch by Cheryl 16814 Sabella. 16815 16816- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as 16817 well as mouse. Initial patch by Louie Lu. 16818 16819- bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once. 16820 16821- bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in 16822 config; test. * In config, put dump test code in a function; run it and 16823 unittest in 'if __name__ == '__main__'. * Add class config.ConfigChanges 16824 based on changes_class_v4.py on bpo issue. * Add class 16825 test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise 16826 configdialog to use ConfigChanges; see tracker msg297804. * Revise 16827 test_configdialog to match configdialog changes. * Remove configdialog 16828 functions unused or moved to ConfigChanges. Cheryl Sabella contributed 16829 parts of the patch. 16830 16831- bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by 16832 Cheryl Sabella. 16833 16834- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more 16835 tests. Patch by Cheryl Sabella. 16836 16837- bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens' 16838 style to highlight both opener and closer. Make 'default' style, which is 16839 not default, a synonym for 'opener'. Make time-delay work the same with 16840 all styles. Add help for config dialog extensions tab, including help for 16841 parenmatch. Add new tests. Original patch by Charles Wohlganger. 16842 16843- bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella 16844 16845- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates 16846 properly. Original patch by Saimadhav Heblikar. 16847 16848- bpo-29910: IDLE no longer deletes a character after commenting out a 16849 region by a key shortcut. Add ``return 'break'`` for this and other 16850 potential conflicts between IDLE and default key bindings. 16851 16852- bpo-30728: Review and change idlelib.configdialog names. Lowercase method 16853 and attribute names. Replace 'colour' with 'color', expand overly cryptic 16854 names, delete unneeded underscores. Replace ``import *`` with specific 16855 imports. Patches by Cheryl Sabella. 16856 16857- bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them 16858 with tk. Add tests for all 3 validation functions. Original patch by G 16859 Polo. Tests added by Cheryl Sabella. 16860 16861Tools/Demos 16862----------- 16863 16864- bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared 16865 builds now, too. :pep:`523` introduced _PyEval_EvalFrameDefault which 16866 inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the 16867 ability to use py-bt, py-up, and a few other Python-specific gdb 16868 integrations. The problem is fixed by only looking for 16869 _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno 16870 "Polaco" Penteado. 16871 16872 16873What's New in Python 3.6.2 final? 16874================================= 16875 16876*Release date: 2017-07-17* 16877 16878No changes since release candidate 2 16879 16880 16881 16882What's New in Python 3.6.2 release candidate 2? 16883=============================================== 16884 16885*Release date: 2017-07-07* 16886 16887Security 16888-------- 16889 16890- bpo-30730: Prevent environment variables injection in subprocess on 16891 Windows. Prevent passing other environment variables and command 16892 arguments. 16893 16894- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple 16895 security vulnerabilities including: CVE-2017-9233 (External entity 16896 infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), 16897 CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and 16898 CVE-2012-0876 (Counter hash flooding with SipHash). Note: the 16899 CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't 16900 impact Python, since Python already gets entropy from the OS to set the 16901 expat secret using ``XML_SetHashSalt()``. 16902 16903- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For 16904 example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the 16905 ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an 16906 authentication (``login@host``). 16907 16908 16909What's New in Python 3.6.2 release candidate 1? 16910=============================================== 16911 16912*Release date: 2017-06-17* 16913 16914Core and Builtins 16915----------------- 16916 16917- bpo-30682: Removed a too-strict assertion that failed for certain 16918 f-strings, such as eval("f'\\\n'") and eval("f'\\\r'"). 16919 16920- bpo-30604: Move co_extra_freefuncs to not be per-thread to avoid crashes 16921 16922- bpo-29104: Fixed parsing backslashes in f-strings. 16923 16924- bpo-27945: Fixed various segfaults with dict when input collections are 16925 mutated during searching, inserting or comparing. Based on patches by 16926 Duane Griffin and Tim Mitchell. 16927 16928- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for 16929 non-interned attribute names. Based on patch by Eryk Sun. 16930 16931- bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the 16932 middle of resuming a chain of nested 'yield from' or 'await' calls, it's 16933 now correctly delivered to the innermost frame. 16934 16935- bpo-12414: sys.getsizeof() on a code object now returns the sizes which 16936 includes the code struct and sizes of objects which it references. Patch 16937 by Dong-hee Na. 16938 16939- bpo-29949: Fix memory usage regression of set and frozenset object. 16940 16941- bpo-29935: Fixed error messages in the index() method of tuple, list and 16942 deque when pass indices of wrong type. 16943 16944- bpo-29859: Show correct error messages when any of the pthread_* calls in 16945 thread_pthread.h fails. 16946 16947- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises 16948 :exc:`OverflowError`. 16949 16950- bpo-29600: Fix wrapping coroutine return values in StopIteration. 16951 16952- bpo-28856: Fix an oversight that %b format for bytes should support 16953 objects follow the buffer protocol. 16954 16955- bpo-29714: Fix a regression that bytes format may fail when containing 16956 zero bytes inside. 16957 16958- bpo-29478: If max_line_length=None is specified while using the Compat32 16959 policy, it is no longer ignored. Patch by Mircea Cosbuc. 16960 16961Library 16962------- 16963 16964- bpo-30616: Functional API of enum allows to create empty enums. Patched by 16965 Dong-hee Na 16966 16967- bpo-30038: Fix race condition between signal delivery and wakeup file 16968 descriptor. Patch by Nathaniel Smith. 16969 16970- bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings. 16971 16972- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a 16973 reference cycle to not keep objects alive longer than expected. 16974 16975- bpo-30149: inspect.signature() now supports callables with 16976 variable-argument parameters wrapped with partialmethod. Patch by Dong-hee 16977 Na. 16978 16979- bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases 16980 when a package is only shipped with bytecodes. Patch by Alexandru 16981 Ardelean. 16982 16983- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. 16984 Patch by Sanjay Sundaresan. 16985 16986- bpo-30605: re.compile() no longer raises a BytesWarning when compiling a 16987 bytes instance with misplaced inline modifier. Patch by Roy Williams. 16988 16989Security 16990-------- 16991 16992- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of 16993 CVE-2016-0718 and CVE-2016-4472. See 16994 https://sourceforge.net/p/expat/bugs/537/ for more information. 16995 16996Library 16997------- 16998 16999- bpo-24484: Avoid race condition in multiprocessing cleanup (#2159) 17000 17001- bpo-28994: The traceback no longer displayed for SystemExit raised in a 17002 callback registered by atexit. 17003 17004- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was 17005 called. 17006 17007- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add 17008 support for ContextManager on all versions. Original PRs by Jelle Zijlstra 17009 and Ivan Levkivskyi 17010 17011- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl 17012 implementation. Patch by Michaël Sghaïer. 17013 17014- bpo-29743: Closing transport during handshake process leaks open socket. 17015 Patch by Nikolay Kim 17016 17017- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu 17018 Sornay. 17019 17020- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore 17021 EINVAL on stdin.write() if the child process is still running but closed 17022 the pipe. 17023 17024- bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch 17025 by Nate Soares. 17026 17027- bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract 17028 base classes to use keyword parameters in __init_subclass__. Patch by Nate 17029 Soares. 17030 17031- bpo-30557: faulthandler now correctly filters and displays exception codes 17032 on Windows 17033 17034- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot 17035 handle IPv6 addresses. 17036 17037- bpo-29960: Preserve generator state when _random.Random.setstate() raises 17038 an exception. Patch by Bryan Olson. 17039 17040- bpo-30414: multiprocessing.Queue._feed background running thread do not 17041 break from main loop on exception. 17042 17043- bpo-30003: Fix handling escape characters in HZ codec. Based on patch by 17044 Ma Lin. 17045 17046- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn* 17047 and *forkserver* start methods. 17048 17049- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error 17050 (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. 17051 This error occurs sometimes on SSL connections. 17052 17053- bpo-30375: Warnings emitted when compile a regular expression now always 17054 point to the line in the user code. Previously they could point into 17055 inners of the re module if emitted from inside of groups or conditionals. 17056 17057- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running 17058 coroutine and the coroutine returned without any more ``await``. 17059 17060- bpo-30266: contextlib.AbstractContextManager now supports 17061 anti-registration by setting __enter__ = None or __exit__ = None, 17062 following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra. 17063 17064- bpo-30298: Weaken the condition of deprecation warnings for inline 17065 modifiers. Now allowed several subsequential inline modifiers at the start 17066 of the pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and 17067 comments now are allowed before and between inline modifiers (e.g. ``'(?x) 17068 (?i) (?s)...'``). 17069 17070- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma 17071 Lin. 17072 17073- bpo-26293: Change resulted because of zipfile breakage. (See also: 17074 bpo-29094) 17075 17076- bpo-30243: Removed the __init__ methods of _json's scanner and encoder. 17077 Misusing them could cause memory leaks or crashes. Now scanner and 17078 encoder objects are completely initialized in the __new__ methods. 17079 17080- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process 17081 when Ctrl-C is received. 17082 17083- bpo-28556: Various updates to typing module: add typing.NoReturn type, use 17084 WrapperDescriptorType, minor bug-fixes. Original PRs by Jim 17085 Fasarakis-Hilliard and Ivan Levkivskyi. 17086 17087- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux. 17088 17089- bpo-30070: Fixed leaks and crashes in errors handling in the parser 17090 module. 17091 17092- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when 17093 readline() or __next__() respectively return non-sizeable object. Fixed 17094 possible other errors caused by not checking results of PyObject_Size(), 17095 PySequence_Size(), or PyMapping_Size(). 17096 17097- bpo-30017: Allowed calling the close() method of the zip entry writer 17098 object multiple times. Writing to a closed writer now always produces a 17099 ValueError. 17100 17101- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint 17102 is present. 17103 17104- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. 17105 Patch by Armin Rigo. 17106 17107- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in 17108 contextlib.contextmanager. Patch by Siddharth Velankar. 17109 17110- bpo-29998: Pickling and copying ImportError now preserves name and path 17111 attributes. 17112 17113- bpo-29953: Fixed memory leaks in the replace() method of datetime and time 17114 objects when pass out of bound fold argument. 17115 17116- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering 17117 long runs of empty iterables. 17118 17119- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions 17120 and wrong types. 17121 17122- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an 17123 exception at the very first of an iterable may swallow the exception or 17124 make the program hang. Patch by Davin Potts and Xiang Zhang. 17125 17126- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when 17127 the OS gives priority to errors such as EACCES over EEXIST. 17128 17129- bpo-29861: Release references to tasks, their arguments and their results 17130 as soon as they are finished in multiprocessing.Pool. 17131 17132- bpo-29884: faulthandler: Restore the old sigaltstack during teardown. 17133 Patch by Christophe Zeitouny. 17134 17135- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. 17136 17137- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords 17138 are not strings. Patch by Michael Seifert. 17139 17140- bpo-29742: get_extra_info() raises exception if get called on closed ssl 17141 transport. Patch by Nikolay Kim. 17142 17143- bpo-8256: Fixed possible failing or crashing input() if attributes 17144 "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not 17145 strings. 17146 17147- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting 17148 big intables (objects that have __int__) as elements. Patch by Oren 17149 Milman. 17150 17151- bpo-28231: The zipfile module now accepts path-like objects for external 17152 paths. 17153 17154- bpo-26915: index() and count() methods of collections.abc.Sequence now 17155 check identity before checking equality when do comparisons. 17156 17157- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other 17158 exception) to exception(s) raised in the dispatched methods. Patch by Petr 17159 Motejlek. 17160 17161- bpo-30177: path.resolve(strict=False) no longer cuts the path after the 17162 first element not present in the filesystem. Patch by Antoine Pietri. 17163 17164IDLE 17165---- 17166 17167- bpo-15786: Fix several problems with IDLE's autocompletion box. The 17168 following should now work: clicking on selection box items; using the 17169 scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no 17170 longer happen. Patch by Louie Lu. 17171 17172- bpo-25514: Add doc subsubsection about IDLE failure to start. Popup 17173 no-connection message directs users to this section. 17174 17175- bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and 17176 Terry Jan Reedy. 17177 17178- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by 17179 Cheryl Sabella and Terry Jan Reedy. 17180 17181- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to 17182 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy. 17183 17184- bpo-30303: Add _utest option to textview; add new tests. Increase coverage 17185 to 100%. Patches by Louie Lu and Terry Jan Reedy. 17186 17187C API 17188----- 17189 17190- bpo-27867: Function PySlice_GetIndicesEx() no longer replaced with a macro 17191 if Py_LIMITED_API is not set. 17192 17193Build 17194----- 17195 17196- bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C 17197 ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies 17198 ``--with-assertions``. 17199 17200- bpo-28787: Fix out-of-tree builds of Python when configured with 17201 ``--with--dtrace``. 17202 17203- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``, 17204 ``make install`` and some other make targets when configured with 17205 ``--enable-optimizations``. 17206 17207- bpo-23404: Don't regenerate generated files based on file modification 17208 time anymore: the action is now explicit. Replace ``make touch`` with 17209 ``make regen-all``. 17210 17211- bpo-29643: Fix ``--enable-optimization`` didn't work. 17212 17213Documentation 17214------------- 17215 17216- bpo-30176: Add missing attribute related constants in curses 17217 documentation. 17218 17219- bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are 17220 now their respective type definitions, rather than the corresponding 17221 builtin function entries. Use :ref:`bytes <func-bytes>` and 17222 :ref:`bytearray <func-bytearray>` to reference the latter. In order to 17223 ensure this and future cross-reference updates are applied automatically, 17224 the daily documentation builds now disable the default output caching 17225 features in Sphinx. 17226 17227- bpo-26985: Add missing info of code object in inspect documentation. 17228 17229Tools/Demos 17230----------- 17231 17232- bpo-29367: python-gdb.py now supports also ``method-wrapper`` 17233 (``wrapperobject``) objects. 17234 17235Tests 17236----- 17237 17238- bpo-30357: test_thread: setUp() now uses support.threading_setup() and 17239 support.threading_cleanup() to wait until threads complete to avoid random 17240 side effects on following tests. Initial patch written by Grzegorz 17241 Grzywacz. 17242 17243- bpo-30197: Enhanced functions swap_attr() and swap_item() in the 17244 test.support module. They now work when delete replaced attribute or item 17245 inside the with statement. The old value of the attribute or item (or 17246 None if it doesn't exist) now will be assigned to the target of the "as" 17247 clause, if there is one. 17248 17249Windows 17250------- 17251 17252- bpo-30687: Locate msbuild.exe on Windows when building rather than 17253 vcvarsall.bat 17254 17255- bpo-30450: The build process on Windows no longer depends on Subversion, 17256 instead pulling external code from GitHub via a Python script. If Python 17257 3.6 is not found on the system (via ``py -3.6``), NuGet is used to 17258 download a copy of 32-bit Python. 17259 17260 17261What's New in Python 3.6.1 final? 17262================================= 17263 17264*Release date: 2017-03-21* 17265 17266Core and Builtins 17267----------------- 17268 17269- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused 17270 a regression by revealing an inconsistency in how sys.path is initialized 17271 when executing ``__main__`` from a zipfile, directory, or other import 17272 location. The interpreter now consistently avoids ever adding the import 17273 location's parent directory to ``sys.path``, and ensures no other 17274 ``sys.path`` entries are inadvertently modified when inserting the import 17275 location named on the command line. 17276 17277Build 17278----- 17279 17280- bpo-27593: fix format of git information used in sys.version 17281 17282- Fix incompatible comment in python.h 17283 17284 17285What's New in Python 3.6.1 release candidate 1? 17286=============================================== 17287 17288*Release date: 2017-03-04* 17289 17290Core and Builtins 17291----------------- 17292 17293- bpo-28893: Set correct __cause__ for errors about invalid awaitables 17294 returned from __aiter__ and __anext__. 17295 17296- bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian 17297 Coleman. 17298 17299- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It 17300 should raise TypeError when kwargs is not a dict. But it might cause segv 17301 when args=NULL and kwargs is not a dict. 17302 17303- bpo-28598: Support __rmod__ for subclasses of str being called before 17304 str.__mod__. Patch by Martijn Pieters. 17305 17306- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by 17307 Matthieu Dartiailh. 17308 17309- bpo-29602: Fix incorrect handling of signed zeros in complex constructor 17310 for complex subclasses and for inputs having a __complex__ method. Patch 17311 by Serhiy Storchaka. 17312 17313- bpo-29347: Fixed possibly dereferencing undefined pointers when creating 17314 weakref objects. 17315 17316- bpo-29438: Fixed use-after-free problem in key sharing dict. 17317 17318- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0]. 17319 17320- bpo-29337: Fixed possible BytesWarning when compare the code objects. 17321 Warnings could be emitted at compile time. 17322 17323- bpo-29327: Fixed a crash when pass the iterable keyword argument to 17324 sorted(). 17325 17326- bpo-29034: Fix memory leak and use-after-free in os module 17327 (path_converter). 17328 17329- bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception. 17330 17331- bpo-28932: Do not include <sys/random.h> if it does not exist. 17332 17333- bpo-25677: Correct the positioning of the syntax error caret for indented 17334 blocks. Based on patch by Michael Layzell. 17335 17336- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate 17337 form. 17338 17339- bpo-26919: On Android, operating system data is now always encoded/decoded 17340 to/from UTF-8, instead of the locale encoding to avoid inconsistencies 17341 with os.fsencode() and os.fsdecode() which are already using UTF-8. 17342 17343- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy 17344 bug triggerable by a monkey-patched len() function. 17345 17346- bpo-28739: f-string expressions are no longer accepted as docstrings and 17347 by ast.literal_eval() even if they do not include expressions. 17348 17349- bpo-28512: Fixed setting the offset attribute of SyntaxError by 17350 PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). 17351 17352- bpo-28918: Fix the cross compilation of xxlimited when Python has been 17353 built with Py_DEBUG defined. 17354 17355- bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict. 17356 Improve speed of dict literal with constant keys up to 30%. 17357 17358Library 17359------- 17360 17361- bpo-29169: Update zlib to 1.2.11. 17362 17363- bpo-29623: Allow use of path-like object as a single argument in 17364 ConfigParser.read(). Patch by David Ellis. 17365 17366- bpo-28963: Fix out of bound iteration in 17367 asyncio.Future.remove_done_callback implemented in C. 17368 17369- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes 17370 before all pipes are closed. 17371 17372- bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to 17373 accept None argument as their pure Python implementation. 17374 17375- bpo-29703: Fix asyncio to support instantiation of new event loops in 17376 child processes. 17377 17378- bpo-29376: Fix assertion error in threading._DummyThread.is_alive(). 17379 17380- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts 17381 PathLike objects. Patch by Sayan Chowdhury. 17382 17383- bpo-28518: Start a transaction implicitly before a DML statement. Patch by 17384 Aviv Palivoda. 17385 17386- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no 17387 longer affects a partial object after creation. 17388 17389- bpo-29110: Fix file object leak in aifc.open() when file is given as a 17390 filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. 17391 17392- bpo-28556: Various updates to typing module: typing.Counter, 17393 typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle 17394 Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. 17395 17396- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 17397 3.6.0: check minimum and maximum years. 17398 17399- bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when 17400 used with a rare combination of multiprocessing and custom codecs. 17401 17402- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir 17403 17404- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the 17405 match object. Based on patch by WGH. 17406 17407- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited 17408 to a stopped instead of terminated state (ex: when under ptrace). 17409 17410- bpo-29290: Fix a regression in argparse that help messages would wrap at 17411 non-breaking spaces. 17412 17413- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY. 17414 17415- bpo-29316: Restore the provisional status of typing module, add 17416 corresponding note to documentation. Patch by Ivan L. 17417 17418- bpo-29219: Fixed infinite recursion in the repr of uninitialized 17419 ctypes.CDLL instances. 17420 17421- bpo-29011: Fix an important omission by adding Deque to the typing module. 17422 17423- bpo-28969: Fixed race condition in C implementation of 17424 functools.lru_cache. KeyError could be raised when cached function with 17425 full cache was simultaneously called from different threads with the same 17426 uncached arguments. 17427 17428- bpo-29142: In urllib.request, suffixes in no_proxy environment variable 17429 with leading dots could match related hostnames again (e.g. .b.c matches 17430 a.b.c). Patch by Milan Oberkirch. 17431 17432- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter 17433 anymore. Patch written by Jiajun Huang. 17434 17435- bpo-29203: functools.lru_cache() now respects :pep:`468` and preserves the 17436 order of keyword arguments. f(a=1, b=2) is now cached separately from 17437 f(b=2, a=1) since both calls could potentially give different results. 17438 17439- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a 17440 context. Patch by Sam Breese. 17441 17442- bpo-29094: Offsets in a ZIP file created with extern file object and modes 17443 "w" and "x" now are relative to the start of the file. 17444 17445- bpo-29085: Allow random.Random.seed() to use high quality OS randomness 17446 rather than the pid and time. 17447 17448- bpo-29061: Fixed bug in secrets.randbelow() which would hang when given a 17449 negative input. Patch by Brendan Donegan. 17450 17451- bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows 17452 17453- bpo-13051: Fixed recursion errors in large or resized 17454 curses.textpad.Textbox. Based on patch by Tycho Andersen. 17455 17456- bpo-29119: Fix weakrefs in the pure python version of 17457 collections.OrderedDict move_to_end() method. Contributed by Andra 17458 Bogildea. 17459 17460- bpo-9770: curses.ascii predicates now work correctly with negative 17461 integers. 17462 17463- bpo-28427: old keys should not remove new values from WeakValueDictionary 17464 when collecting from another thread. 17465 17466- bpo-28923: Remove editor artifacts from Tix.py. 17467 17468- bpo-29055: Neaten-up empty population error on random.choice() by 17469 suppressing the upstream exception. 17470 17471- bpo-28871: Fixed a crash when deallocate deep ElementTree. 17472 17473- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and 17474 WeakValueDictionary.pop() when a GC collection happens in another thread. 17475 17476- bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence 17477 that doesn't own its elements as limits. 17478 17479- bpo-28779: multiprocessing.set_forkserver_preload() would crash the 17480 forkserver process if a preloaded module instantiated some multiprocessing 17481 objects such as locks. 17482 17483- bpo-28847: dbm.dumb now supports reading read-only files and no longer 17484 writes the index file when it is not changed. 17485 17486- bpo-26937: The chown() method of the tarfile.TarFile class does not fail 17487 now when the grp module cannot be imported, as for example on Android 17488 platforms. 17489 17490IDLE 17491---- 17492 17493- bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes). 17494 17495- bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and 17496 augment description of the configuration system. 17497 17498Windows 17499------- 17500 17501- bpo-29579: Removes readme.txt from the installer 17502 17503- bpo-29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev) 17504 17505- bpo-28164: Correctly handle special console filenames (patch by Eryk Sun) 17506 17507- bpo-29409: Implement :pep:`529` for io.FileIO (Patch by Eryk Sun) 17508 17509- bpo-29392: Prevent crash when passing invalid arguments into msvcrt 17510 module. 17511 17512- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun) 17513 17514- bpo-28896: Deprecate WindowsRegistryFinder and disable it by default. 17515 17516C API 17517----- 17518 17519- bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if 17520 Py_LIMITED_API is not set or set to the value between 0x03050400 and 17521 0x03060000 (not including) or 0x03060100 or higher. 17522 17523- bpo-29083: Fixed the declaration of some public API functions. 17524 PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in 17525 limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and 17526 Py_BuildValue() were not available in limited API of version < 3.3 when 17527 PY_SSIZE_T_CLEAN is defined. 17528 17529- bpo-29058: All stable API extensions added after Python 3.2 are now 17530 available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of 17531 the minimum Python version supporting this API. 17532 17533Documentation 17534------------- 17535 17536- bpo-28929: Link the documentation to its source file on GitHub. 17537 17538- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer 17539 to aiosmtpd, a third-party asyncio-based replacement. 17540 17541- bpo-26355: Add canonical header link on each page to corresponding major 17542 version of the documentation. Patch by Matthias Bussonnier. 17543 17544- bpo-29349: Fix Python 2 syntax in code for building the documentation. 17545 17546Tests 17547----- 17548 17549- bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip 17550 some tests of select.poll when running on macOS due to unresolved issues 17551 with the underlying system poll function on some macOS versions. 17552 17553- bpo-29571: to match the behaviour of the ``re.LOCALE`` flag, 17554 test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)`` 17555 to determine the candidate encoding for the test regex (allowing it to 17556 correctly skip the test when the default locale encoding is a multi-byte 17557 encoding) 17558 17559- bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line 17560 arguments. 17561 17562- bpo-28683: Fix the tests that bind() a unix socket and raise 17563 PermissionError on Android for a non-root user. 17564 17565- bpo-26939: Add the support.setswitchinterval() function to fix 17566 test_functools hanging on the Android armv7 qemu emulator. 17567 17568Build 17569----- 17570 17571- bpo-27593: sys.version and the platform module python_build(), 17572 python_branch(), and python_revision() functions now use git information 17573 rather than hg when building from a repo. 17574 17575- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k. 17576 17577- bpo-26851: Set Android compilation and link flags. 17578 17579- bpo-28768: Fix implicit declaration of function _setmode. Patch by 17580 Masayuki Yamamoto 17581 17582- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat 17583 17584- bpo-23903: Added missed names to PC/python3.def. 17585 17586- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK 17587 macro is not defined in android-ndk-r13. 17588 17589- bpo-28538: Fix the compilation error that occurs because if_nameindex() is 17590 available on Android API level 24, but the if_nameindex structure is not 17591 defined. 17592 17593- bpo-20211: Do not add the directory for installing C header files and the 17594 directory for installing object code libraries to the cross compilation 17595 search paths. Original patch by Thomas Petazzoni. 17596 17597- bpo-28849: Do not define sys.implementation._multiarch on Android. 17598 17599 17600What's New in Python 3.6.0 final? 17601================================= 17602 17603*Release date: 2016-12-23* 17604 17605No changes since release candidate 2 17606 17607 17608 17609What's New in Python 3.6.0 release candidate 2? 17610=============================================== 17611 17612*Release date: 2016-12-16* 17613 17614Core and Builtins 17615----------------- 17616 17617- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must 17618 not convert combined table into split table. Patch written by INADA Naoki. 17619 17620- bpo-28990: Fix asyncio SSL hanging if connection is closed before 17621 handshake is completed. (Patch by HoHo-Ho) 17622 17623Tools/Demos 17624----------- 17625 17626- bpo-28770: Fix python-gdb.py for fastcalls. 17627 17628Windows 17629------- 17630 17631- bpo-28896: Deprecate WindowsRegistryFinder. 17632 17633Build 17634----- 17635 17636- bpo-28898: Prevent gdb build errors due to HAVE_LONG_LONG redefinition. 17637 17638 17639What's New in Python 3.6.0 release candidate 1? 17640=============================================== 17641 17642*Release date: 2016-12-06* 17643 17644Core and Builtins 17645----------------- 17646 17647- bpo-23722: Rather than silently producing a class that doesn't support 17648 zero-argument ``super()`` in methods, failing to pass the new 17649 ``__classcell__`` namespace entry up to ``type.__new__`` now results in a 17650 ``DeprecationWarning`` and a class that supports zero-argument 17651 ``super()``. 17652 17653- bpo-28797: Modifying the class __dict__ inside the __set_name__ method of 17654 a descriptor that is used inside that class no longer prevents calling the 17655 __set_name__ method of other descriptors. 17656 17657- bpo-28782: Fix a bug in the implementation ``yield from`` when checking if 17658 the next instruction is YIELD_FROM. Regression introduced by WORDCODE 17659 (issue #26647). 17660 17661Library 17662------- 17663 17664- bpo-27030: Unknown escapes in re.sub() replacement template are allowed 17665 again. But they still are deprecated and will be disabled in 3.7. 17666 17667- bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call 17668 warnings.showwarning() if it was overridden inside the context manager. 17669 17670- bpo-27172: To assist with upgrades from 2.7, the previously documented 17671 deprecation of ``inspect.getfullargspec()`` has been reversed. This 17672 decision may be revisited again after the Python 2.7 branch is no longer 17673 officially supported. 17674 17675- bpo-26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and 17676 :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by 17677 Omar Sandoval. 17678 17679- bpo-24142: Reading a corrupt config file left configparser in an invalid 17680 state. Original patch by Florian Höch. 17681 17682- bpo-28843: Fix asyncio C Task to handle exceptions __traceback__. 17683 17684C API 17685----- 17686 17687- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 17688 17689Documentation 17690------------- 17691 17692- bpo-23722: The data model reference and the porting section in the What's 17693 New guide now cover the additional ``__classcell__`` handling needed for 17694 custom metaclasses to fully support :pep:`487` and zero-argument 17695 ``super()``. 17696 17697Tools/Demos 17698----------- 17699 17700- bpo-28023: Fix python-gdb.py didn't support new dict implementation. 17701 17702 17703What's New in Python 3.6.0 beta 4? 17704================================== 17705 17706*Release date: 2016-11-21* 17707 17708Core and Builtins 17709----------------- 17710 17711- bpo-28532: Show sys.version when -V option is supplied twice. 17712 17713- bpo-27100: The with-statement now checks for __enter__ before it checks 17714 for __exit__. This gives less confusing error messages when both methods 17715 are missing. Patch by Jonathan Ellington. 17716 17717- bpo-28746: Fix the set_inheritable() file descriptor method on platforms 17718 that do not have the ioctl FIOCLEX and FIONCLEX commands. 17719 17720- bpo-26920: Fix not getting the locale's charset upon initializing the 17721 interpreter, on platforms that do not have langinfo. 17722 17723- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X 17724 when decode astral characters. Patch by Xiang Zhang. 17725 17726- bpo-19398: Extra slash no longer added to sys.path components in case of 17727 empty compile-time PYTHONPATH components. 17728 17729- bpo-28665: Improve speed of the STORE_DEREF opcode by 40%. 17730 17731- bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch 17732 by Xiang Zhang. 17733 17734- bpo-27243: Change PendingDeprecationWarning -> DeprecationWarning. As it 17735 was agreed in the issue, __aiter__ returning an awaitable should result in 17736 PendingDeprecationWarning in 3.5 and in DeprecationWarning in 3.6. 17737 17738- bpo-26182: Fix a refleak in code that raises DeprecationWarning. 17739 17740- bpo-28721: Fix asynchronous generators aclose() and athrow() to handle 17741 StopAsyncIteration propagation properly. 17742 17743Library 17744------- 17745 17746- bpo-28752: Restored the __reduce__() methods of datetime objects. 17747 17748- bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created 17749 by re.compile(), become comparable (only x==y and x!=y operators). This 17750 change should fix the issue #18383: don't duplicate warning filters when 17751 the warnings module is reloaded (thing usually only done in unit tests). 17752 17753- bpo-20572: The subprocess.Popen.wait method's undocumented endtime 17754 parameter now raises a DeprecationWarning. 17755 17756- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and 17757 from_buffer_copy() methods on abstract classes like Array. 17758 17759- bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch 17760 by Vajrasky Kok 17761 17762- bpo-28563: Fixed possible DoS and arbitrary code execution when handle 17763 plural form selections in the gettext module. The expression parser now 17764 supports exact syntax supported by GNU gettext. 17765 17766- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the 17767 garbage collector is invoked in other thread. Based on patch by Sebastian 17768 Cufre. 17769 17770- bpo-28600: Optimize loop.call_soon. 17771 17772- bpo-28613: Fix get_event_loop() return the current loop if called from 17773 coroutines/callbacks. 17774 17775- bpo-28634: Fix asyncio.isfuture() to support unittest.Mock. 17776 17777- bpo-26081: Fix refleak in _asyncio.Future.__iter__().throw. 17778 17779- bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin 17780 Mayfield. 17781 17782- bpo-28652: Make loop methods reject socket kinds they do not support. 17783 17784- bpo-28653: Fix a refleak in functools.lru_cache. 17785 17786- bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects. 17787 17788- bpo-28704: Fix create_unix_server to support Path-like objects (PEP 519). 17789 17790- bpo-28720: Add collections.abc.AsyncGenerator. 17791 17792Documentation 17793------------- 17794 17795- bpo-28513: Documented command-line interface of zipfile. 17796 17797Tests 17798----- 17799 17800- bpo-28666: Now test.support.rmtree is able to remove unwritable or 17801 unreadable directories. 17802 17803- bpo-23839: Various caches now are cleared before running every test file. 17804 17805Build 17806----- 17807 17808- bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and 17809 Michael Haubenwallner. 17810 17811- bpo-26359: Rename --with-optimiations to --enable-optimizations. 17812 17813- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS. 17814 Patch by Gareth Rees. 17815 17816 17817What's New in Python 3.6.0 beta 3? 17818================================== 17819 17820*Release date: 2016-10-31* 17821 17822Core and Builtins 17823----------------- 17824 17825- bpo-28128: Deprecation warning for invalid str and byte escape sequences 17826 now prints better information about where the error occurs. Patch by 17827 Serhiy Storchaka and Eric Smith. 17828 17829- bpo-28509: dict.update() no longer allocate unnecessary large memory. 17830 17831- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug 17832 build. 17833 17834- bpo-28517: Fixed of-by-one error in the peephole optimizer that caused 17835 keeping unreachable code. 17836 17837- bpo-28214: Improved exception reporting for problematic __set_name__ 17838 attributes. 17839 17840- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception 17841 loss in PyTraceBack_Here(). 17842 17843- bpo-28471: Fix "Python memory allocator called without holding the GIL" 17844 crash in socket.setblocking. 17845 17846Library 17847------- 17848 17849- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if 17850 given empty data twice. Patch by Benjamin Fogle. 17851 17852- bpo-28549: Fixed segfault in curses's addch() with ncurses6. 17853 17854- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar 17855 file with compression before trying to open it without compression. 17856 Otherwise it had 50% chance failed with ignore_zeros=True. 17857 17858- bpo-23262: The webbrowser module now supports Firefox 36+ and derived 17859 browsers. Based on patch by Oleg Broytman. 17860 17861- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused 17862 by representing the scale as float value internally in Tk. tkinter.IntVar 17863 now works if float value is set to underlying Tk variable. 17864 17865- bpo-18844: The various ways of specifying weights for random.choices() now 17866 produce the same result sequences. 17867 17868- bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at 17869 the start of new line after printing a month's calendar. Patch by Xiang 17870 Zhang. 17871 17872- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. 17873 Based on patch by Kaarle Ritvanen. 17874 17875- bpo-28353: os.fwalk() no longer fails on broken links. 17876 17877- bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept 17878 non-None value is passed to it.send(val). 17879 17880- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix 17881 for readability. 17882 17883- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a 17884 workaround to Tix library bug. 17885 17886- bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive. 17887 17888- bpo-25953: re.sub() now raises an error for invalid numerical group 17889 reference in replacement template even if the pattern is not found in the 17890 string. Error message for invalid group reference now includes the group 17891 index and the position of the reference. Based on patch by SilentGhost. 17892 17893- bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by 17894 Mariatta Wijaya. 17895 17896- bpo-28448: Fix C implemented asyncio.Future didn't work on Windows. 17897 17898- bpo-28480: Fix error building socket module when multithreading is 17899 disabled. 17900 17901- bpo-24452: Make webbrowser support Chrome on Mac OS X. 17902 17903- bpo-20766: Fix references leaked by pdb in the handling of SIGINT 17904 handlers. 17905 17906- bpo-28492: Fix how StopIteration exception is raised in _asyncio.Future. 17907 17908- bpo-28500: Fix asyncio to handle async gens GC from another thread. 17909 17910- bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children 17911 are done. Patch by Johannes Ebke. 17912 17913- bpo-26796: Don't configure the number of workers for default threadpool 17914 executor. Initial patch by Hans Lawrenz. 17915 17916- bpo-28544: Implement asyncio.Task in C. 17917 17918Windows 17919------- 17920 17921- bpo-28522: Fixes mishandled buffer reallocation in getpathp.c 17922 17923Build 17924----- 17925 17926- bpo-28444: Fix missing extensions modules when cross compiling. 17927 17928- bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2. 17929 17930- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. 17931 17932Tests 17933----- 17934 17935- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or 17936 missing the effective gid. 17937 17938- bpo-28409: regrtest: fix the parser of command line arguments. 17939 17940 17941What's New in Python 3.6.0 beta 2? 17942================================== 17943 17944*Release date: 2016-10-10* 17945 17946Core and Builtins 17947----------------- 17948 17949- bpo-28183: Optimize and cleanup dict iteration. 17950 17951- bpo-26081: Added C implementation of asyncio.Future. Original patch by 17952 Yury Selivanov. 17953 17954- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). 17955 Patch by Xiang Zhang. 17956 17957- bpo-28376: The type of long range iterator is now registered as Iterator. 17958 Patch by Oren Milman. 17959 17960- bpo-28376: Creating instances of range_iterator by calling range_iterator 17961 type now is deprecated. Patch by Oren Milman. 17962 17963- bpo-28376: The constructor of range_iterator now checks that step is not 17964 0. Patch by Oren Milman. 17965 17966- bpo-26906: Resolving special methods of uninitialized type now causes 17967 implicit initialization of the type instead of a fail. 17968 17969- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original 17970 patch by Niklas Koep. 17971 17972- bpo-24098: Fixed possible crash when AST is changed in process of 17973 compiling it. 17974 17975- bpo-28201: Dict reduces possibility of 2nd conflict in hash table when 17976 hashes have same lower bits. 17977 17978- bpo-28350: String constants with null character no longer interned. 17979 17980- bpo-26617: Fix crash when GC runs during weakref callbacks. 17981 17982- bpo-27942: String constants now interned recursively in tuples and 17983 frozensets. 17984 17985- bpo-21578: Fixed misleading error message when ImportError called with 17986 invalid keyword args. 17987 17988- bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch 17989 by Soumya Sharma. 17990 17991- bpo-28086: Single var-positional argument of tuple subtype was passed 17992 unscathed to the C-defined function. Now it is converted to exact tuple. 17993 17994- bpo-28214: Now __set_name__ is looked up on the class instead of the 17995 instance. 17996 17997- bpo-27955: Fallback on reading /dev/urandom device when the getrandom() 17998 syscall fails with EPERM, for example when blocked by SECCOMP. 17999 18000- bpo-28192: Don't import readline in isolated mode. 18001 18002- Upgrade internal unicode databases to Unicode version 9.0.0. 18003 18004- bpo-28131: Fix a regression in zipimport's compile_source(). zipimport 18005 should use the same optimization level as the interpreter. 18006 18007- bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly 18008 optimize memcpy(). 18009 18010- bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a 18011 "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. 18012 18013- bpo-26182: Raise DeprecationWarning when async and await keywords are used 18014 as variable/attribute/class/function name. 18015 18016Library 18017------- 18018 18019- bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by 18020 Eryk Sun. 18021 18022- bpo-28317: The disassembler now decodes FORMAT_VALUE argument. 18023 18024- bpo-26293: Fixed writing ZIP files that starts not from the start of the 18025 file. Offsets in ZIP file now are relative to the start of the archive in 18026 conforming to the specification. 18027 18028- bpo-28380: unittest.mock Mock autospec functions now properly support 18029 assert_called, assert_not_called, and assert_called_once. 18030 18031- bpo-27181: remove statistics.geometric_mean and defer until 3.7. 18032 18033- bpo-28229: lzma module now supports pathlib. 18034 18035- bpo-28321: Fixed writing non-BMP characters with binary format in 18036 plistlib. 18037 18038- bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan 18039 Furman. 18040 18041- bpo-28227: gzip now supports pathlib. Patch by Ethan Furman. 18042 18043- bpo-27358: Optimized merging var-keyword arguments and improved error 18044 message when passing a non-mapping as a var-keyword argument. 18045 18046- bpo-28257: Improved error message when passing a non-iterable as a 18047 var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. 18048 18049- bpo-28322: Fixed possible crashes when unpickle itertools objects from 18050 incorrect pickle data. Based on patch by John Leitch. 18051 18052- bpo-28228: imghdr now supports pathlib. 18053 18054- bpo-28226: compileall now supports pathlib. 18055 18056- bpo-28314: Fix function declaration (C flags) for the getiterator() method 18057 of xml.etree.ElementTree.Element. 18058 18059- bpo-28148: Stop using localtime() and gmtime() in the time module. 18060 Introduced platform independent _PyTime_localtime API that is similar to 18061 POSIX localtime_r, but available on all platforms. Patch by Ed Schouten. 18062 18063- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 18064 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so 18065 that they don't call itermonthdates() which can cause datetime.date 18066 under/overflow. 18067 18068- bpo-28275: Fixed possible use after free in the decompress() methods of 18069 the LZMADecompressor and BZ2Decompressor classes. Original patch by John 18070 Leitch. 18071 18072- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() 18073 if pass invalid string-like object as a name. Patch by Xiang Zhang. 18074 18075- bpo-18844: random.choices() now has k as a keyword-only argument to 18076 improve the readability of common cases and come into line with the 18077 signature used in other languages. 18078 18079- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. 18080 Patch by Madison May. 18081 18082- bpo-27611: Fixed support of default root window in the tkinter.tix module. 18083 Added the master parameter in the DisplayStyle constructor. 18084 18085- bpo-27348: In the traceback module, restore the formatting of exception 18086 messages like "Exception: None". This fixes a regression introduced in 18087 3.5a2. 18088 18089- bpo-25651: Allow falsy values to be used for msg parameter of subTest(). 18090 18091- bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is 18092 interrupted by a signal and a signal handler raises a Python exception. 18093 18094- bpo-28200: Fix memory leak on Windows in the os module (fix 18095 path_converter() function). 18096 18097- bpo-25400: RobotFileParser now correctly returns default values for 18098 crawl_delay and request_rate. Initial patch by Peter Wirtz. 18099 18100- bpo-27932: Prevent memory leak in win32_ver(). 18101 18102- Fix UnboundLocalError in socket._sendfile_use_sendfile. 18103 18104- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of 18105 os.stat(). Patch by Eryk Sun. 18106 18107- bpo-22493: Warning message emitted by using inline flags in the middle of 18108 regular expression now contains a (truncated) regex pattern. Patch by Tim 18109 Graham. 18110 18111- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an 18112 empty bytestring is passed. 18113 18114- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. 18115 18116- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by 18117 Gergely Imreh and Markus Holtermann. 18118 18119- bpo-28114: Fix a crash in parse_envlist() when env contains byte strings. 18120 Patch by Eryk Sun. 18121 18122- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and 18123 binascii.a2b_qp(). 18124 18125- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by 18126 Kevin Conway. 18127 18128- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by 18129 Seth Michael Larson. 18130 18131- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by 18132 iceboy. 18133 18134- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki. 18135 18136- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect. 18137 18138- bpo-27759: Fix selectors incorrectly retain invalid file descriptors. 18139 Patch by Mark Williams. 18140 18141- bpo-28368: Refuse monitoring processes if the child watcher has no loop 18142 attached. Patch by Vincent Michel. 18143 18144- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader, 18145 add_writer, etc. 18146 18147- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг 18148 Марк. 18149 18150- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor. 18151 18152- bpo-28372: Fix asyncio to support formatting of non-python coroutines. 18153 18154- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг 18155 Марк. 18156 18157- bpo-27972: Prohibit Tasks to await on themselves. 18158 18159Windows 18160------- 18161 18162- bpo-28402: Adds signed catalog files for stdlib on Windows. 18163 18164- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk 18165 Sun) 18166 18167- bpo-28251: Improvements to help manuals on Windows. 18168 18169- bpo-28110: launcher.msi has different product codes between 32-bit and 18170 64-bit 18171 18172- bpo-28161: Opening CON for write access fails 18173 18174- bpo-28162: WindowsConsoleIO readall() fails if first line starts with 18175 Ctrl+Z 18176 18177- bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle 18178 18179- bpo-28164: _PyIO_get_console_type fails for various paths 18180 18181- bpo-28137: Renames Windows path file to ._pth 18182 18183- bpo-28138: Windows ._pth file should allow import site 18184 18185C API 18186----- 18187 18188- bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(), 18189 PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and 18190 PyUnicode_AsEncodedUnicode(). 18191 18192Build 18193----- 18194 18195- bpo-28258: Fixed build with Estonian locale (python-config and distclean 18196 targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. 18197 18198- bpo-26661: setup.py now detects system libffi with multiarch wrapper. 18199 18200- bpo-15819: Remove redundant include search directory option for building 18201 outside the source tree. 18202 18203Tests 18204----- 18205 18206- bpo-28217: Adds _testconsole module to test console input. 18207 18208 18209What's New in Python 3.6.0 beta 1? 18210================================== 18211 18212*Release date: 2016-09-12* 18213 18214Core and Builtins 18215----------------- 18216 18217- bpo-23722: The __class__ cell used by zero-argument super() is now 18218 initialized from type.__new__ rather than __build_class__, so class 18219 methods relying on that will now work correctly when called from metaclass 18220 methods during class creation. Patch by Martin Teichmann. 18221 18222- bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is 18223 compiled with NSMALLPOSINTS = 0. 18224 18225- bpo-27080: Implement formatting support for :pep:`515`. Initial patch by 18226 Chris Angelico. 18227 18228- bpo-27199: In tarfile, expose copyfileobj bufsize to improve throughput. 18229 Patch by Jason Fried. 18230 18231- bpo-27948: In f-strings, only allow backslashes inside the braces (where 18232 the expressions are). This is a breaking change from the 3.6 alpha 18233 releases, where backslashes are allowed anywhere in an f-string. Also, 18234 require that expressions inside f-strings be enclosed within literal 18235 braces, and not escapes like ``f'\x7b"hi"\x7d'``. 18236 18237- bpo-28046: Remove platform-specific directories from sys.path. 18238 18239- bpo-28071: Add early-out for differencing from an empty set. 18240 18241- bpo-25758: Prevents zipimport from unnecessarily encoding a filename 18242 (patch by Eryk Sun) 18243 18244- bpo-25856: The __module__ attribute of extension classes and functions now 18245 is interned. This leads to more compact pickle data with protocol 4. 18246 18247- bpo-27213: Rework CALL_FUNCTION* opcodes to produce shorter and more 18248 efficient bytecode. Patch by Demur Rumed, design by Serhiy Storchaka, 18249 reviewed by Serhiy Storchaka and Victor Stinner. 18250 18251- bpo-26331: Implement tokenizing support for :pep:`515`. Patch by Georg 18252 Brandl. 18253 18254- bpo-27999: Make "global after use" a SyntaxError, and ditto for nonlocal. 18255 Patch by Ivan Levkivskyi. 18256 18257- bpo-28003: Implement :pep:`525` -- Asynchronous Generators. 18258 18259- bpo-27985: Implement :pep:`526` -- Syntax for Variable Annotations. Patch 18260 by Ivan Levkivskyi. 18261 18262- bpo-26058: Add a new private version to the builtin dict type, incremented 18263 at each dictionary creation and at each dictionary change. Implementation 18264 of the PEP 509. 18265 18266- bpo-27364: A backslash-character pair that is not a valid escape sequence 18267 now generates a DeprecationWarning. Patch by Emanuel Barry. 18268 18269- bpo-27350: `dict` implementation is changed like PyPy. It is more compact 18270 and preserves insertion order. (Concept developed by Raymond Hettinger and 18271 patch by Inada Naoki.) 18272 18273- bpo-27911: Remove unnecessary error checks in 18274 ``exec_builtin_or_dynamic()``. 18275 18276- bpo-27078: Added BUILD_STRING opcode. Optimized f-strings evaluation. 18277 18278- bpo-17884: Python now requires systems with inttypes.h and stdint.h 18279 18280- bpo-27961: Require platforms to support ``long long``. Python hasn't 18281 compiled without ``long long`` for years, so this is basically a 18282 formality. 18283 18284- bpo-27355: Removed support for Windows CE. It was never finished, and 18285 Windows CE is no longer a relevant platform for Python. 18286 18287- Implement :pep:`523`. 18288 18289- bpo-27870: A left shift of zero by a large integer no longer attempts to 18290 allocate large amounts of memory. 18291 18292- bpo-25402: In int-to-decimal-string conversion, improve the estimate of 18293 the intermediate memory required, and remove an unnecessarily strict 18294 overflow check. Patch by Serhiy Storchaka. 18295 18296- bpo-27214: In long_invert, be more careful about modifying object returned 18297 by long_add, and remove an unnecessary check for small longs. Thanks Oren 18298 Milman for analysis and patch. 18299 18300- bpo-27506: Support passing the bytes/bytearray.translate() "delete" 18301 argument by keyword. 18302 18303- bpo-27812: Properly clear out a generator's frame's backreference to the 18304 generator to prevent crashes in frame.clear(). 18305 18306- bpo-27811: Fix a crash when a coroutine that has not been awaited is 18307 finalized with warnings-as-errors enabled. 18308 18309- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after 18310 use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes. 18311 18312- bpo-27792: The modulo operation applied to ``bool`` and other ``int`` 18313 subclasses now always returns an ``int``. Previously the return type 18314 depended on the input values. Patch by Xiang Zhang. 18315 18316- bpo-26984: int() now always returns an instance of exact int. 18317 18318- bpo-25604: Fix a minor bug in integer true division; this bug could 18319 potentially have caused off-by-one-ulp results on platforms with 18320 unreliable ldexp implementations. 18321 18322- bpo-24254: Make class definition namespace ordered by default. 18323 18324- bpo-27662: Fix an overflow check in ``List_New``: the original code was 18325 checking against ``Py_SIZE_MAX`` instead of the correct upper bound of 18326 ``Py_SSIZE_T_MAX``. Patch by Xiang Zhang. 18327 18328- bpo-27782: Multi-phase extension module import now correctly allows the 18329 ``m_methods`` field to be used to add module level functions to instances 18330 of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang. 18331 18332- bpo-27936: The round() function accepted a second None argument for some 18333 types but not for others. Fixed the inconsistency by accepting None for 18334 all numeric types. 18335 18336- bpo-27487: Warn if a submodule argument to "python -m" or 18337 runpy.run_module() is found in sys.modules after parent packages are 18338 imported, but before the submodule is executed. 18339 18340- bpo-27157: Make only type() itself accept the one-argument form. Patch by 18341 Eryk Sun and Emanuel Barry. 18342 18343- bpo-27558: Fix a SystemError in the implementation of "raise" statement. 18344 In a brand new thread, raise a RuntimeError since there is no active 18345 exception to reraise. Patch written by Xiang Zhang. 18346 18347- bpo-28008: Implement :pep:`530` -- asynchronous comprehensions. 18348 18349- bpo-27942: Fix memory leak in codeobject.c 18350 18351Library 18352------- 18353 18354- bpo-28732: Fix crash in os.spawnv() with no elements in args 18355 18356- bpo-28485: Always raise ValueError for negative 18357 compileall.compile_dir(workers=...) parameter, even when multithreading is 18358 unavailable. 18359 18360- bpo-28037: Use sqlite3_get_autocommit() instead of setting 18361 Connection->inTransaction manually. 18362 18363- bpo-25283: Attributes tm_gmtoff and tm_zone are now available on all 18364 platforms in the return values of time.localtime() and time.gmtime(). 18365 18366- bpo-24454: Regular expression match object groups are now accessible using 18367 __getitem__. "mo[x]" is equivalent to "mo.group(x)". 18368 18369- bpo-10740: sqlite3 no longer implicitly commit an open transaction before 18370 DDL statements. 18371 18372- bpo-17941: Add a *module* parameter to collections.namedtuple(). 18373 18374- bpo-22493: Inline flags now should be used only at the start of the 18375 regular expression. Deprecation warning is emitted if uses them in the 18376 middle of the regular expression. 18377 18378- bpo-26885: xmlrpc now supports unmarshalling additional data types used by 18379 Apache XML-RPC implementation for numerics and None. 18380 18381- bpo-28070: Fixed parsing inline verbose flag in regular expressions. 18382 18383- bpo-19500: Add client-side SSL session resumption to the ssl module. 18384 18385- bpo-28022: Deprecate ssl-related arguments in favor of SSLContext. The 18386 deprecation include manual creation of SSLSocket and certfile/keyfile (or 18387 similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. 18388 18389- bpo-28043: SSLContext has improved default settings: OP_NO_SSLv2, 18390 OP_NO_SSLv3, OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE, 18391 OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE and HIGH ciphers without MD5. 18392 18393- bpo-24693: Changed some RuntimeError's in the zipfile module to more 18394 appropriate types. Improved some error messages and debugging output. 18395 18396- bpo-17909: ``json.load`` and ``json.loads`` now support binary input 18397 encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka. 18398 18399- bpo-27137: the pure Python fallback implementation of 18400 ``functools.partial`` now matches the behaviour of its accelerated C 18401 counterpart for subclassing, pickling and text representation purposes. 18402 Patch by Emanuel Barry and Serhiy Storchaka. 18403 18404- Fix possible integer overflows and crashes in the mmap module with unusual 18405 usage patterns. 18406 18407- bpo-1703178: Fix the ability to pass the --link-objects option to the 18408 distutils build_ext command. 18409 18410- bpo-28019: itertools.count() no longer rounds non-integer step in range 18411 between 1.0 and 2.0 to 1. 18412 18413- bpo-18401: Pdb now supports the 'readrc' keyword argument to control 18414 whether .pdbrc files should be read. Patch by Martin Matusiak and Sam 18415 Kimbrel. 18416 18417- bpo-25969: Update the lib2to3 grammar to handle the unpacking 18418 generalizations added in 3.5. 18419 18420- bpo-14977: mailcap now respects the order of the lines in the mailcap 18421 files ("first match"), as required by RFC 1542. Patch by Michael Lazar. 18422 18423- bpo-28082: Convert re flag constants to IntFlag. 18424 18425- bpo-28025: Convert all ssl module constants to IntEnum and IntFlags. 18426 SSLContext properties now return flags and enums. 18427 18428- bpo-23591: Add Flag, IntFlag, and auto() to enum module. 18429 18430- bpo-433028: Added support of modifier spans in regular expressions. 18431 18432- bpo-24594: Validates persist parameter when opening MSI database 18433 18434- bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes 18435 (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.) 18436 18437- bpo-28047: Fixed calculation of line length used for the base64 CTE in the 18438 new email policies. 18439 18440- bpo-27576: Fix call order in OrderedDict.__init__(). 18441 18442- email.generator.DecodedGenerator now supports the policy keyword. 18443 18444- bpo-28027: Remove undocumented modules from ``Lib/plat-*``: IN, CDROM, 18445 DLFCN, TYPES, CDIO, and STROPTS. 18446 18447- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by 18448 Claude Paroz. 18449 18450- bpo-24277: The new email API is no longer provisional, and the docs have 18451 been reorganized and rewritten to emphasize the new API. 18452 18453- bpo-22450: urllib now includes an ``Accept: */*`` header among the default 18454 headers. This makes the results of REST API requests more consistent and 18455 predictable especially when proxy servers are involved. 18456 18457- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file 18458 between runs given the same Grammar.txt input regardless of the hash 18459 randomization setting. 18460 18461- bpo-28005: Allow ImportErrors in encoding implementation to propagate. 18462 18463- bpo-26667: Support path-like objects in importlib.util. 18464 18465- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers 18466 in the "ctypes" and "array" modules. 18467 18468- bpo-22233: Break email header lines *only* on the RFC specified CR and LF 18469 characters, not on arbitrary unicode line breaks. This also fixes a bug 18470 in HTTP header parsing. 18471 18472- bpo-27331: The email.mime classes now all accept an optional policy 18473 keyword. 18474 18475- bpo-27988: Fix email iter_attachments incorrect mutation of payload list. 18476 18477- bpo-16113: Add SHA-3 and SHAKE support to hashlib module. 18478 18479- Eliminate a tautological-pointer-compare warning in _scproxy.c. 18480 18481- bpo-27776: The :func:`os.urandom` function does now block on Linux 3.17 18482 and newer until the system urandom entropy pool is initialized to increase 18483 the security. This change is part of the :pep:`524`. 18484 18485- bpo-27778: Expose the Linux ``getrandom()`` syscall as a new 18486 :func:`os.getrandom` function. This change is part of the :pep:`524`. 18487 18488- bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name 18489 fields in X.509 certs. 18490 18491- bpo-18844: Add random.choices(). 18492 18493- bpo-25761: Improved error reporting about truncated pickle data in C 18494 implementation of unpickler. UnpicklingError is now raised instead of 18495 AttributeError and ValueError in some cases. 18496 18497- bpo-26798: Add BLAKE2 (blake2b and blake2s) to hashlib. 18498 18499- bpo-26032: Optimized globbing in pathlib by using os.scandir(); it is now 18500 about 1.5--4 times faster. 18501 18502- bpo-25596: Optimized glob() and iglob() functions in the glob module; they 18503 are now about 3--6 times faster. 18504 18505- bpo-27928: Add scrypt (password-based key derivation function) to hashlib 18506 module (requires OpenSSL 1.1.0). 18507 18508- bpo-27850: Remove 3DES from ssl module's default cipher list to counter 18509 measure sweet32 attack (CVE-2016-2183). 18510 18511- bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list. 18512 (Required OpenSSL 1.1.0 or LibreSSL). 18513 18514- bpo-25387: Check return value of winsound.MessageBeep. 18515 18516- bpo-27866: Add SSLContext.get_ciphers() method to get a list of all 18517 enabled ciphers. 18518 18519- bpo-27744: Add AF_ALG (Linux Kernel crypto) to socket module. 18520 18521- bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0. 18522 18523- bpo-11620: Fix support for SND_MEMORY in winsound.PlaySound. Based on a 18524 patch by Tim Lesher. 18525 18526- bpo-11734: Add support for IEEE 754 half-precision floats to the struct 18527 module. Based on a patch by Eli Stevens. 18528 18529- bpo-27919: Deprecated ``extra_path`` distribution option in distutils 18530 packaging. 18531 18532- bpo-23229: Add new ``cmath`` constants: ``cmath.inf`` and ``cmath.nan`` to 18533 match ``math.inf`` and ``math.nan``, and also ``cmath.infj`` and 18534 ``cmath.nanj`` to match the format used by complex repr. 18535 18536- bpo-27842: The csv.DictReader now returns rows of type OrderedDict. 18537 (Contributed by Steve Holden.) 18538 18539- Remove support for passing a file descriptor to os.access. It never worked 18540 but previously didn't raise. 18541 18542- bpo-12885: Fix error when distutils encounters symlink. 18543 18544- bpo-27881: Fixed possible bugs when setting 18545 sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang. 18546 18547- bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory 18548 creates not a cursor. Patch by Xiang Zhang. 18549 18550- bpo-19884: Avoid spurious output on OS X with Gnu Readline. 18551 18552- bpo-27706: Restore deterministic behavior of random.Random().seed() for 18553 string seeds using seeding version 1. Allows sequences of calls to 18554 random() to exactly match those obtained in Python 2. Patch by Nofar 18555 Schnider. 18556 18557- bpo-10513: Fix a regression in Connection.commit(). Statements should not 18558 be reset after a commit. 18559 18560- bpo-12319: Chunked transfer encoding support added to 18561 http.client.HTTPConnection requests. The 18562 urllib.request.AbstractHTTPHandler class does not enforce a Content-Length 18563 header any more. If a HTTP request has a file or iterable body, but no 18564 Content-Length header, the library now falls back to use chunked 18565 transfer-encoding. 18566 18567- A new version of typing.py from https://github.com/python/typing: - 18568 Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__ 18569 (upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove 18570 the dict constraint in ForwardRef._eval_type (upstream #252) 18571 18572- bpo-27832: Make ``_normalize`` parameter to ``Fraction`` constructor 18573 keyword-only, so that ``Fraction(2, 3, 4)`` now raises ``TypeError``. 18574 18575- bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of 18576 negative exponent and negative base. 18577 18578- bpo-21718: cursor.description is now available for queries using CTEs. 18579 18580- bpo-27819: In distutils sdists, simply produce the "gztar" (gzipped tar 18581 format) distributions on all platforms unless "formats" is supplied. 18582 18583- bpo-2466: posixpath.ismount now correctly recognizes mount points which 18584 the user does not have permission to access. 18585 18586- bpo-9998: On Linux, ctypes.util.find_library now looks in LD_LIBRARY_PATH 18587 for shared libraries. 18588 18589- bpo-27573: exit message for code.interact is now configurable. 18590 18591- bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to 18592 Paulo Andrade and Petr Viktorin for the analysis and patch. 18593 18594- bpo-6766: Distributed reference counting added to multiprocessing to 18595 support nesting of shared values / proxy objects. 18596 18597- bpo-21201: Improves readability of multiprocessing error message. Thanks 18598 to Wojciech Walczak for patch. 18599 18600- asyncio: Add set_protocol / get_protocol to Transports. 18601 18602- bpo-27456: asyncio: Set TCP_NODELAY by default. 18603 18604IDLE 18605---- 18606 18607- bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger 18608 Serwy, updated by Bayard Randel. 18609 18610- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen. 18611 18612- bpo-27891: Consistently group and sort imports within idlelib modules. 18613 18614- bpo-17642: add larger font sizes for classroom projection. 18615 18616- Add version to title of IDLE help window. 18617 18618- bpo-25564: In section on IDLE -- console differences, mention that using 18619 exec means that __builtins__ is defined for each statement. 18620 18621- bpo-27821: Fix 3.6.0a3 regression that prevented custom key sets from 18622 being selected when no custom theme was defined. 18623 18624C API 18625----- 18626 18627- bpo-26900: Excluded underscored names and other private API from limited 18628 API. 18629 18630- bpo-26027: Add support for path-like objects in PyUnicode_FSConverter() & 18631 PyUnicode_FSDecoder(). 18632 18633Tests 18634----- 18635 18636- bpo-27427: Additional tests for the math module. Patch by Francisco Couzo. 18637 18638- bpo-27953: Skip math and cmath tests that fail on OS X 10.4 due to a poor 18639 libm implementation of tan. 18640 18641- bpo-26040: Improve test_math and test_cmath coverage and rigour. Patch by 18642 Jeff Allen. 18643 18644- bpo-27787: Call gc.collect() before checking each test for "dangling 18645 threads", since the dangling threads are weak references. 18646 18647Build 18648----- 18649 18650- bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach) 18651 18652- bpo-27705: Update message in validate_ucrtbase.py 18653 18654- bpo-27976: Deprecate building _ctypes with the bundled copy of libffi on 18655 non-OSX UNIX platforms. 18656 18657- bpo-27983: Cause lack of llvm-profdata tool when using clang as required 18658 for PGO linking to be a configure time error rather than make time when 18659 ``--with-optimizations`` is enabled. Also improve our ability to find the 18660 llvm-profdata tool on MacOS and some Linuxes. 18661 18662- bpo-21590: Support for DTrace and SystemTap probes. 18663 18664- bpo-26307: The profile-opt build now applies PGO to the built-in modules. 18665 18666- bpo-26359: Add the --with-optimizations flag to turn on LTO and PGO build 18667 support when available. 18668 18669- bpo-27917: Set platform triplets for Android builds. 18670 18671- bpo-25825: Update references to the $(LIBPL) installation path on AIX. 18672 This path was changed in 3.2a4. 18673 18674- Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2. 18675 18676- bpo-21122: Fix LTO builds on OS X. 18677 18678- bpo-17128: Build OS X installer with a private copy of OpenSSL. Also 18679 provide a sample Install Certificates command script to install a set of 18680 root certificates from the third-party certifi module. 18681 18682Tools/Demos 18683----------- 18684 18685- bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the 18686 current "re" module, avoid invalid Python backslash escapes, and fix a bug 18687 parsing escaped C quote signs. 18688 18689Windows 18690------- 18691 18692- bpo-28065: Update xz dependency to 5.2.2 and build it from source. 18693 18694- bpo-25144: Ensures TargetDir is set before continuing with custom install. 18695 18696- bpo-1602: Windows console doesn't input or print Unicode (PEP 528) 18697 18698- bpo-27781: Change file system encoding on Windows to UTF-8 (PEP 529) 18699 18700- bpo-27731: Opt-out of MAX_PATH on Windows 10 18701 18702- bpo-6135: Adds encoding and errors parameters to subprocess. 18703 18704- bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec 18705 lookup. 18706 18707- bpo-27982: The functions of the winsound module now accept keyword 18708 arguments. 18709 18710- bpo-20366: Build full text search support into SQLite on Windows. 18711 18712- bpo-27756: Adds new icons for Python files and processes on Windows. 18713 Designs by Cherry Wang. 18714 18715- bpo-27883: Update sqlite to 3.14.1.0 on Windows. 18716 18717 18718What's New in Python 3.6.0 alpha 4? 18719=================================== 18720 18721*Release date: 2016-08-15* 18722 18723Core and Builtins 18724----------------- 18725 18726- bpo-27704: Optimized creating bytes and bytearray from byte-like objects 18727 and iterables. Speed up to 3 times for short objects. Original patch by 18728 Naoki Inada. 18729 18730- bpo-26823: Large sections of repeated lines in tracebacks are now 18731 abbreviated as "[Previous line repeated {count} more times]" by the 18732 builtin traceback rendering. Patch by Emanuel Barry. 18733 18734- bpo-27574: Decreased an overhead of parsing keyword arguments in functions 18735 implemented with using Argument Clinic. 18736 18737- bpo-22557: Now importing already imported modules is up to 2.5 times 18738 faster. 18739 18740- bpo-17596: Include <wincrypt.h> to help with Min GW building. 18741 18742- bpo-17599: On Windows, rename the privately defined REPARSE_DATA_BUFFER 18743 structure to avoid conflicting with the definition from Min GW. 18744 18745- bpo-27507: Add integer overflow check in bytearray.extend(). Patch by 18746 Xiang Zhang. 18747 18748- bpo-27581: Don't rely on wrapping for overflow check in 18749 PySequence_Tuple(). Patch by Xiang Zhang. 18750 18751- bpo-1621: Avoid signed integer overflow in list and tuple operations. 18752 Patch by Xiang Zhang. 18753 18754- bpo-27419: Standard __import__() no longer look up "__import__" in globals 18755 or builtins for importing submodules or "from import". Fixed a crash if 18756 raise a warning about unabling to resolve package from __spec__ or 18757 __package__. 18758 18759- bpo-27083: Respect the PYTHONCASEOK environment variable under Windows. 18760 18761- bpo-27514: Make having too many statically nested blocks a SyntaxError 18762 instead of SystemError. 18763 18764- bpo-27366: Implemented :pep:`487` (Simpler customization of class 18765 creation). Upon subclassing, the __init_subclass__ classmethod is called 18766 on the base class. Descriptors are initialized with __set_name__ after 18767 class creation. 18768 18769Library 18770------- 18771 18772- bpo-26027: Add :pep:`519`/__fspath__() support to the os and os.path 18773 modules. Includes code from Jelle Zijlstra. (See also: bpo-27524) 18774 18775- bpo-27598: Add Collections to collections.abc. Patch by Ivan Levkivskyi, 18776 docs by Neil Girdhar. 18777 18778- bpo-25958: Support "anti-registration" of special methods from various 18779 ABCs, like __hash__, __iter__ or __len__. All these (and several more) 18780 can be set to None in an implementation class and the behavior will be as 18781 if the method is not defined at all. (Previously, this mechanism existed 18782 only for __hash__, to make mutable classes unhashable.) Code contributed 18783 by Andrew Barnert and Ivan Levkivskyi. 18784 18785- bpo-16764: Support keyword arguments to zlib.decompress(). Patch by Xiang 18786 Zhang. 18787 18788- bpo-27736: Prevent segfault after interpreter re-initialization due to ref 18789 count problem introduced in code for Issue #27038 in 3.6.0a3. Patch by 18790 Xiang Zhang. 18791 18792- bpo-25628: The *verbose* and *rename* parameters for 18793 collections.namedtuple are now keyword-only. 18794 18795- bpo-12345: Add mathematical constant tau to math and cmath. See also 18796 :pep:`628`. 18797 18798- bpo-26823: traceback.StackSummary.format now abbreviates large sections of 18799 repeated lines as "[Previous line repeated {count} more times]" (this 18800 change then further affects other traceback display operations in the 18801 module). Patch by Emanuel Barry. 18802 18803- bpo-27664: Add to concurrent.futures.thread.ThreadPoolExecutor() the 18804 ability to specify a thread name prefix. 18805 18806- bpo-27181: Add geometric_mean and harmonic_mean to statistics module. 18807 18808- bpo-27573: code.interact now prints an message when exiting. 18809 18810- bpo-6422: Add autorange method to timeit.Timer objects. 18811 18812- bpo-27773: Correct some memory management errors server_hostname in 18813 _ssl.wrap_socket(). 18814 18815- bpo-26750: unittest.mock.create_autospec() now works properly for 18816 subclasses of property() and other data descriptors. Removes the never 18817 publicly used, never documented unittest.mock.DescriptorTypes tuple. 18818 18819- bpo-26754: Undocumented support of general bytes-like objects as path in 18820 compile() and similar functions is now deprecated. 18821 18822- bpo-26800: Undocumented support of general bytes-like objects as paths in 18823 os functions is now deprecated. 18824 18825- bpo-26981: Add _order_ compatibility shim to enum.Enum for Python 2/3 code 18826 bases. 18827 18828- bpo-27661: Added tzinfo keyword argument to datetime.combine. 18829 18830- In the curses module, raise an error if window.getstr() or window.instr() 18831 is passed a negative value. 18832 18833- bpo-27783: Fix possible usage of uninitialized memory in 18834 operator.methodcaller. 18835 18836- bpo-27774: Fix possible Py_DECREF on unowned object in _sre. 18837 18838- bpo-27760: Fix possible integer overflow in binascii.b2a_qp. 18839 18840- bpo-27758: Fix possible integer overflow in the _csv module for large 18841 record lengths. 18842 18843- bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the 18844 HTTP_PROXY variable when REQUEST_METHOD environment is set, which 18845 indicates that the script is in CGI mode. 18846 18847- bpo-7063: Remove dead code from the "array" module's slice handling. Patch 18848 by Chuck. 18849 18850- bpo-27656: Do not assume sched.h defines any SCHED_* constants. 18851 18852- bpo-27130: In the "zlib" module, fix handling of large buffers (typically 18853 4 GiB) when compressing and decompressing. Previously, inputs were 18854 limited to 4 GiB, and compression and decompression operations did not 18855 properly handle results of 4 GiB. 18856 18857- bpo-24773: Implemented :pep:`495` (Local Time Disambiguation). 18858 18859- Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select 18860 module. 18861 18862- bpo-27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select 18863 module. 18864 18865- bpo-1621: Avoid signed int negation overflow in the "audioop" module. 18866 18867- bpo-27533: Release GIL in nt._isdir 18868 18869- bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original 18870 patch by Alexandre Vassalotti. 18871 18872- bpo-27522: Avoid an unintentional reference cycle in email.feedparser. 18873 18874- bpo-27512: Fix a segfault when os.fspath() called an __fspath__() method 18875 that raised an exception. Patch by Xiang Zhang. 18876 18877IDLE 18878---- 18879 18880- bpo-27714: text_textview and test_autocomplete now pass when re-run in the 18881 same process. This occurs when test_idle fails when run with the -w 18882 option but without -jn. Fix warning from test_config. 18883 18884- bpo-27621: Put query response validation error messages in the query box 18885 itself instead of in a separate messagebox. Redo tests to match. Add Mac 18886 OSX refinements. Original patch by Mark Roseman. 18887 18888- bpo-27620: Escape key now closes Query box as cancelled. 18889 18890- bpo-27609: IDLE: tab after initial whitespace should tab, not 18891 autocomplete. This fixes problem with writing docstrings at least twice 18892 indented. 18893 18894- bpo-27609: Explicitly return None when there are also non-None returns. In 18895 a few cases, reverse a condition and eliminate a return. 18896 18897- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports. 18898 Users must include the same imports required to run directly in Python. 18899 18900- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the 18901 default key set depend on the platform. Add tests for the changes to the 18902 config module. 18903 18904- bpo-27452: add line counter and crc to IDLE configHandler test dump. 18905 18906Tests 18907----- 18908 18909- bpo-25805: Skip a test in test_pkgutil as needed that doesn't work when 18910 ``__name__ == __main__``. Patch by SilentGhost. 18911 18912- bpo-27472: Add test.support.unix_shell as the path to the default shell. 18913 18914- bpo-27369: In test_pyexpat, avoid testing an error message detail that 18915 changed in Expat 2.2.0. 18916 18917- bpo-27594: Prevent assertion error when running test_ast with coverage 18918 enabled: ensure code object has a valid first line number. Patch suggested 18919 by Ivan Levkivskyi. 18920 18921Windows 18922------- 18923 18924- bpo-27647: Update bundled Tcl/Tk to 8.6.6. 18925 18926- bpo-27610: Adds :pep:`514` metadata to Windows installer 18927 18928- bpo-27469: Adds a shell extension to the launcher so that drag and drop 18929 works correctly. 18930 18931- bpo-27309: Enables proper Windows styles in python[w].exe manifest. 18932 18933Build 18934----- 18935 18936- bpo-27713: Suppress spurious build warnings when updating importlib's 18937 bootstrap files. Patch by Xiang Zhang 18938 18939- bpo-25825: Correct the references to Modules/python.exp, which is required 18940 on AIX. The references were accidentally changed in 3.5.0a1. 18941 18942- bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi 18943 Hsuan Yen. 18944 18945- bpo-27641: The configure script now inserts comments into the makefile to 18946 prevent the pgen and _freeze_importlib executables from being 18947 cross-compiled. 18948 18949- bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be 18950 used for file generation during the build. 18951 18952- bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update 18953 FreedBSD version checks for the original ctype UTF-8 workaround. 18954 18955 18956What's New in Python 3.6.0 alpha 3? 18957=================================== 18958 18959*Release date: 2016-07-11* 18960 18961Core and Builtins 18962----------------- 18963 18964- bpo-27473: Fixed possible integer overflow in bytes and bytearray 18965 concatenations. Patch by Xiang Zhang. 18966 18967- bpo-23034: The output of a special Python build with defined COUNT_ALLOCS, 18968 SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It 18969 can be re-enabled using the "-X showalloccount" option. It now outputs to 18970 stderr instead of stdout. 18971 18972- bpo-27443: __length_hint__() of bytearray iterators no longer return a 18973 negative integer for a resized bytearray. 18974 18975- bpo-27007: The fromhex() class methods of bytes and bytearray subclasses 18976 now return an instance of corresponding subclass. 18977 18978Library 18979------- 18980 18981- bpo-26844: Fix error message for imp.find_module() to refer to 'path' 18982 instead of 'name'. Patch by Lev Maximov. 18983 18984- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an 18985 error about unclean EOF. 18986 18987- bpo-27466: Change time format returned by http.cookie.time2netscape, 18988 confirming the netscape cookie format and making it consistent with 18989 documentation. 18990 18991- bpo-21708: Deprecated dbm.dumb behavior that differs from common dbm 18992 behavior: creating a database in 'r' and 'w' modes and modifying a 18993 database in 'r' mode. 18994 18995- bpo-26721: Change the socketserver.StreamRequestHandler.wfile attribute to 18996 implement BufferedIOBase. In particular, the write() method no longer does 18997 partial writes. 18998 18999- bpo-22115: Added methods trace_add, trace_remove and trace_info in the 19000 tkinter.Variable class. They replace old methods trace_variable, trace, 19001 trace_vdelete and trace_vinfo that use obsolete Tcl commands and might not 19002 work in future versions of Tcl. Fixed old tracing methods: 19003 trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now 19004 always returns a list of pairs of strings, tracing in the "u" mode now 19005 works. 19006 19007- bpo-26243: Only the level argument to zlib.compress() is keyword argument 19008 now. The first argument is positional-only. 19009 19010- bpo-27038: Expose the DirEntry type as os.DirEntry. Code patch by Jelle 19011 Zijlstra. 19012 19013- bpo-27186: Update os.fspath()/PyOS_FSPath() to check the return value of 19014 __fspath__() to be either str or bytes. 19015 19016- bpo-18726: All optional parameters of the dump(), dumps(), load() and 19017 loads() functions and JSONEncoder and JSONDecoder class constructors in 19018 the json module are now keyword-only. 19019 19020- bpo-27319: Methods selection_set(), selection_add(), selection_remove() 19021 and selection_toggle() of ttk.TreeView now allow passing multiple items as 19022 multiple arguments instead of passing them as a tuple. Deprecated 19023 undocumented ability of calling the selection() method with arguments. 19024 19025- bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and 19026 ispunct(). 19027 19028- bpo-27294: Numerical state in the repr for Tkinter event objects is now 19029 represented as a combination of known flags. 19030 19031- bpo-27177: Match objects in the re module now support index-like objects 19032 as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang. 19033 19034- bpo-26754: Some functions (compile() etc) accepted a filename argument 19035 encoded as an iterable of integers. Now only strings and byte-like objects 19036 are accepted. 19037 19038- bpo-26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by 19039 Daniel Stokes. 19040 19041- bpo-27048: Prevents distutils failing on Windows when environment 19042 variables contain non-ASCII characters 19043 19044- bpo-27330: Fixed possible leaks in the ctypes module. 19045 19046- bpo-27238: Got rid of bare excepts in the turtle module. Original patch 19047 by Jelle Zijlstra. 19048 19049- bpo-27122: When an exception is raised within the context being managed by 19050 a contextlib.ExitStack() and one of the exit stack generators catches and 19051 raises it in a chain, do not re-raise the original exception when exiting, 19052 let the new chained one through. This avoids the :pep:`479` bug described 19053 in issue25782. 19054 19055Security 19056-------- 19057 19058- bpo-27278: Fix os.urandom() implementation using getrandom() on Linux. 19059 Truncate size to INT_MAX and loop until we collected enough random bytes, 19060 instead of casting a directly Py_ssize_t to int. 19061 19062Library 19063------- 19064 19065- bpo-16864: sqlite3.Cursor.lastrowid now supports REPLACE statement. 19066 Initial patch by Alex LordThorsen. 19067 19068- bpo-26386: Fixed ttk.TreeView selection operations with item id's 19069 containing spaces. 19070 19071- bpo-8637: Honor a pager set by the env var MANPAGER (in preference to one 19072 set by the env var PAGER). 19073 19074Security 19075-------- 19076 19077- bpo-22636: Avoid shell injection problems with ctypes.util.find_library(). 19078 19079Library 19080------- 19081 19082- bpo-16182: Fix various functions in the "readline" module to use the 19083 locale encoding, and fix get_begidx() and get_endidx() to return code 19084 point indexes. 19085 19086- bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton. 19087 19088IDLE 19089---- 19090 19091- bpo-27477: IDLE search dialogs now use ttk widgets. 19092 19093- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the 19094 default key set depend on the platform. Add tests for the changes to the 19095 config module. 19096 19097- bpo-27452: make command line "idle-test> python test_help.py" work. 19098 __file__ is relative when python is started in the file's directory. 19099 19100- bpo-27452: add line counter and crc to IDLE configHandler test dump. 19101 19102- bpo-27380: IDLE: add query.py with base Query dialog and ttk widgets. 19103 Module had subclasses SectionName, ModuleName, and HelpSource, which are 19104 used to get information from users by configdialog and file =>Load Module. 19105 Each subclass has itw own validity checks. Using ModuleName allows users 19106 to edit bad module names instead of starting over. Add tests and delete 19107 the two files combined into the new one. 19108 19109- bpo-27372: Test_idle no longer changes the locale. 19110 19111- bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names. 19112 19113- bpo-27245: IDLE: Cleanly delete custom themes and key bindings. 19114 Previously, when IDLE was started from a console or by import, a cascade 19115 of warnings was emitted. Patch by Serhiy Storchaka. 19116 19117- bpo-24137: Run IDLE, test_idle, and htest with tkinter default root 19118 disabled. Fix code and tests that fail with this restriction. Fix htests 19119 to not create a second and redundant root and mainloop. 19120 19121- bpo-27310: Fix IDLE.app failure to launch on OS X due to vestigial import. 19122 19123C API 19124----- 19125 19126- bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as 19127 an iterable of integers. Now only strings and byte-like objects are 19128 accepted. 19129 19130Build 19131----- 19132 19133- bpo-28066: Fix the logic that searches build directories for generated 19134 include files when building outside the source tree. 19135 19136- bpo-27442: Expose the Android API level that python was built against, in 19137 sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'. 19138 19139- bpo-27434: The interpreter that runs the cross-build, found in PATH, must 19140 now be of the same feature version (e.g. 3.6) as the source being built. 19141 19142- bpo-26930: Update Windows builds to use OpenSSL 1.0.2h. 19143 19144- bpo-23968: Rename the platform directory from plat-$(MACHDEP) to 19145 plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from 19146 config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install 19147 the platform specific _sysconfigdata module into the platform directory 19148 and rename it to include the ABIFLAGS. 19149 19150- Don't use largefile support for GNU/Hurd. 19151 19152Tools/Demos 19153----------- 19154 19155- bpo-27332: Fixed the type of the first argument of module-level functions 19156 generated by Argument Clinic. Patch by Petr Viktorin. 19157 19158- bpo-27418: Fixed Tools/importbench/importbench.py. 19159 19160Documentation 19161------------- 19162 19163- bpo-19489: Moved the search box from the sidebar to the header and footer 19164 of each page. Patch by Ammar Askar. 19165 19166- bpo-27285: Update documentation to reflect the deprecation of ``pyvenv`` 19167 and normalize on the term "virtual environment". Patch by Steve Piercy. 19168 19169Tests 19170----- 19171 19172- bpo-27027: Added test.support.is_android that is True when this is an 19173 Android build. 19174 19175 19176What's New in Python 3.6.0 alpha 2? 19177=================================== 19178 19179*Release date: 2016-06-13* 19180 19181Core and Builtins 19182----------------- 19183 19184- bpo-27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes. 19185 Patch by Demur Rumed. 19186 19187- bpo-27190: Raise NotSupportedError if sqlite3 is older than 3.3.1. Patch 19188 by Dave Sawyer. 19189 19190- bpo-27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. Calling 19191 function with generalized unpacking (PEP 448) and conflicting keyword 19192 names could cause undefined behavior. 19193 19194- bpo-27140: Added BUILD_CONST_KEY_MAP opcode. 19195 19196- bpo-27186: Add support for os.PathLike objects to open() (part of 19197 :pep:`519`). 19198 19199- bpo-27066: Fixed SystemError if a custom opener (for open()) returns a 19200 negative number without setting an exception. 19201 19202- bpo-26983: float() now always return an instance of exact float. The 19203 deprecation warning is emitted if __float__ returns an instance of a 19204 strict subclass of float. In a future versions of Python this can be an 19205 error. 19206 19207- bpo-27097: Python interpreter is now about 7% faster due to optimized 19208 instruction decoding. Based on patch by Demur Rumed. 19209 19210- bpo-26647: Python interpreter now uses 16-bit wordcode instead of 19211 bytecode. Patch by Demur Rumed. 19212 19213- bpo-23275: Allow assigning to an empty target list in round brackets: () = 19214 iterable. 19215 19216- bpo-27243: Update the __aiter__ protocol: instead of returning an 19217 awaitable that resolves to an asynchronous iterator, the asynchronous 19218 iterator should be returned directly. Doing the former will trigger a 19219 PendingDeprecationWarning. 19220 19221Library 19222------- 19223 19224- Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants 19225 exposed on the API which are not implemented on GNU/Hurd. They would not 19226 work at runtime anyway. 19227 19228- bpo-27025: Generated names for Tkinter widgets are now more meaningful and 19229 recognizable. 19230 19231- bpo-25455: Fixed crashes in repr of recursive ElementTree.Element and 19232 functools.partial objects. 19233 19234- bpo-27294: Improved repr for Tkinter event objects. 19235 19236- bpo-20508: Improve exception message of IPv{4,6}Network.__getitem__. Patch 19237 by Gareth Rees. 19238 19239Security 19240-------- 19241 19242- bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283. 19243 19244- Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by 19245 Team Oststrom. 19246 19247Library 19248------- 19249 19250- bpo-21386: Implement missing IPv4Address.is_global property. It was 19251 documented since 07a5610bae9d. Initial patch by Roger Luethi. 19252 19253- bpo-27029: Removed deprecated support of universal newlines mode from 19254 ZipFile.open(). 19255 19256- bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in 19257 regular expressions now are errors. The re.LOCALE flag now can be used 19258 only with bytes patterns. 19259 19260- bpo-27186: Add os.PathLike support to DirEntry (part of :pep:`519`). 19261 Initial patch by Jelle Zijlstra. 19262 19263- bpo-20900: distutils register command now decodes HTTP responses 19264 correctly. Initial patch by ingrid. 19265 19266- bpo-27186: Add os.PathLike support to pathlib, removing its provisional 19267 status (part of PEP 519). Initial patch by Dusty Phillips. 19268 19269- bpo-27186: Add support for os.PathLike objects to os.fsencode() and 19270 os.fsdecode() (part of :pep:`519`). 19271 19272- bpo-27186: Introduce os.PathLike and os.fspath() (part of :pep:`519`). 19273 19274- A new version of typing.py provides several new classes and features: 19275 @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, 19276 Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some 19277 of the new features are not yet implemented in mypy or other static 19278 analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable, 19279 AsyncIterator) have been added (in fact they made it into 3.5.1 but were 19280 never mentioned). 19281 19282- bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from 19283 sending a message body for 205 Reset Content. Also, don't send Content 19284 header fields in responses that don't have a body. Patch by Susumu 19285 Koshiba. 19286 19287- bpo-21313: Fix the "platform" module to tolerate when sys.version contains 19288 truncated build information. 19289 19290Security 19291-------- 19292 19293- bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with 19294 ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom 19295 entropy pool is not initialized yet. Patch written by Colm Buckley. 19296 19297Library 19298------- 19299 19300- bpo-23883: Added missing APIs to __all__ to match the documented APIs for 19301 the following modules: cgi, mailbox, mimetypes, plistlib and smtpd. 19302 Patches by Jacek Kołodziej. 19303 19304- bpo-27164: In the zlib module, allow decompressing raw Deflate streams 19305 with a predefined zdict. Based on patch by Xiang Zhang. 19306 19307- bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely 19308 write data to the client. Previously it could do partial writes and 19309 truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout 19310 doing partial writes, but this is deprecated. 19311 19312- bpo-21272: Use _sysconfigdata.py to initialize distutils.sysconfig. 19313 19314- bpo-19611: :mod:`inspect` now reports the implicit ``.0`` parameters 19315 generated by the compiler for comprehension and generator expression 19316 scopes as if they were positional-only parameters called ``implicit0``. 19317 Patch by Jelle Zijlstra. 19318 19319- bpo-26809: Add ``__all__`` to :mod:`string`. Patch by Emanuel Barry. 19320 19321- bpo-26373: subprocess.Popen.communicate now correctly ignores 19322 BrokenPipeError when the child process dies before .communicate() is 19323 called in more/all circumstances. 19324 19325- signal, socket, and ssl module IntEnum constant name lookups now return a 19326 consistent name for values having multiple names. Ex: signal.Signals(6) 19327 now refers to itself as signal.SIGALRM rather than flipping between that 19328 and signal.SIGIOT based on the interpreter's hash randomization seed. 19329 19330- bpo-27167: Clarify the subprocess.CalledProcessError error message text 19331 when the child process died due to a signal. 19332 19333- bpo-25931: Don't define socketserver.Forking* names on platforms such as 19334 Windows that do not support os.fork(). 19335 19336- bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch 19337 by Claudiu Popa. 19338 19339- bpo-26526: Replace custom parse tree validation in the parser module with 19340 a simple DFA validator. 19341 19342- bpo-27114: Fix SSLContext._load_windows_store_certs fails with 19343 PermissionError 19344 19345- bpo-18383: Avoid creating duplicate filters when using filterwarnings and 19346 simplefilter. Based on patch by Alex Shkop. 19347 19348- bpo-23026: winreg.QueryValueEx() now return an integer for REG_QWORD type. 19349 19350- bpo-26741: subprocess.Popen destructor now emits a ResourceWarning warning 19351 if the child process is still running. 19352 19353- bpo-27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to 19354 deserialize a lot of small objects. 19355 19356- bpo-21271: New keyword only parameters in reset_mock call. 19357 19358IDLE 19359---- 19360 19361- bpo-5124: Paste with text selected now replaces the selection on X11. This 19362 matches how paste works on Windows, Mac, most modern Linux apps, and ttk 19363 widgets. Original patch by Serhiy Storchaka. 19364 19365- bpo-24750: Switch all scrollbars in IDLE to ttk versions. Where needed, 19366 minimal tests are added to cover changes. 19367 19368- bpo-24759: IDLE requires tk 8.5 and availability ttk widgets. Delete now 19369 unneeded tk version tests and code for older versions. Add test for IDLE 19370 syntax colorizer. 19371 19372- bpo-27239: idlelib.macosx.isXyzTk functions initialize as needed. 19373 19374- bpo-27262: move Aqua unbinding code, which enable context menus, to 19375 macosx. 19376 19377- bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is 19378 a private implementation of test.test_idle and tool for maintainers. 19379 19380- bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These 19381 persisted after other warnings were suppressed in #20567. Apply Serhiy 19382 Storchaka's update_idletasks solution to four test files. Record this 19383 additional advice in idle_test/README.txt 19384 19385- bpo-20567: Revise idle_test/README.txt with advice about avoiding tk 19386 warning messages from tests. Apply advice to several IDLE tests. 19387 19388- bpo-24225: Update idlelib/README.txt with new file names and event 19389 handlers. 19390 19391- bpo-27156: Remove obsolete code not used by IDLE. 19392 19393- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move 19394 code for configuring text widget colors to a new function. 19395 19396- bpo-24225: Rename many `idlelib/*.py` and `idle_test/test_*.py` files. 19397 Edit files to replace old names with new names when the old name referred 19398 to the module rather than the class it contained. See the issue and IDLE 19399 section in What's New in 3.6 for more. 19400 19401- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts 19402 on Linux prevented the configuration dialog from opening. 19403 19404- bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav 19405 Heblikar. 19406 19407- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav 19408 Heblikar. 19409 19410- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley 19411 Martínez. 19412 19413- bpo-21703: Add test for undo delegator. Patch mostly by Saimadhav 19414 Heblikar . 19415 19416- bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. 19417 19418- bpo-23977: Add more asserts to test_delegator. 19419 19420Documentation 19421------------- 19422 19423- bpo-16484: Change the default PYTHONDOCS URL to "https:", and fix the 19424 resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik 19425 Nadikuditi. 19426 19427- bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5. 19428 19429- bpo-22558: Add remaining doc links to source code for Python-coded 19430 modules. Patch by Yoni Lavi. 19431 19432Tests 19433----- 19434 19435- bpo-25285: regrtest now uses subprocesses when the -j1 command line option 19436 is used: each test file runs in a fresh child process. Before, the -j1 19437 option was ignored. 19438 19439- bpo-25285: Tools/buildbot/test.bat script now uses -j1 by default to run 19440 each test file in fresh child process. 19441 19442Windows 19443------- 19444 19445- bpo-27064: The py.exe launcher now defaults to Python 3. The Windows 19446 launcher ``py.exe`` no longer prefers an installed Python 2 version over 19447 Python 3 by default when used interactively. 19448 19449Build 19450----- 19451 19452- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by 19453 Xavier de Gaye. 19454 19455- bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with 19456 OpenSSL 1.0.2h. 19457 19458Windows 19459------- 19460 19461- bpo-17500: Remove unused and outdated icons. (See also: 19462 https://github.com/python/pythondotorg/issues/945) 19463 19464C API 19465----- 19466 19467- bpo-27186: Add the PyOS_FSPath() function (part of :pep:`519`). 19468 19469- bpo-26282: PyArg_ParseTupleAndKeywords() now supports positional-only 19470 parameters. 19471 19472Tools/Demos 19473----------- 19474 19475- bpo-26282: Argument Clinic now supports positional-only and keyword 19476 parameters in the same function. 19477 19478 19479What's New in Python 3.6.0 alpha 1? 19480=================================== 19481 19482*Release date: 2016-05-16* 19483 19484Core and Builtins 19485----------------- 19486 19487- bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by 19488 Xavier de Gaye. 19489 19490- bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" 19491 format unit. 19492 19493- bpo-26991: Fix possible refleak when creating a function with annotations. 19494 19495- bpo-27039: Fixed bytearray.remove() for values greater than 127. Based on 19496 patch by Joe Jevnik. 19497 19498- bpo-23640: int.from_bytes() no longer bypasses constructors for 19499 subclasses. 19500 19501- bpo-27005: Optimized the float.fromhex() class method for exact float. It 19502 is now 2 times faster. 19503 19504- bpo-18531: Single var-keyword argument of dict subtype was passed 19505 unscathed to the C-defined function. Now it is converted to exact dict. 19506 19507- bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL 19508 pointer. 19509 19510- bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for 19511 interpolation unintentionally added with move to Python 3. Behavior no 19512 longer does any interpolation in .pypirc files, matching behavior in 19513 Python 2.7 and Setuptools 19.0. 19514 19515- bpo-26249: Memory functions of the :c:func:`PyMem_Malloc` domain 19516 (:c:data:`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc allocator 19517 <pymalloc>` rather than system :c:func:`malloc`. Applications calling 19518 :c:func:`PyMem_Malloc` without holding the GIL can now crash: use 19519 ``PYTHONMALLOC=debug`` environment variable to validate the usage of 19520 memory allocators in your application. 19521 19522- bpo-26802: Optimize function calls only using unpacking like 19523 ``func(*tuple)`` (no other positional argument, no keyword): avoid copying 19524 the tuple. Patch written by Joe Jevnik. 19525 19526- bpo-26659: Make the builtin slice type support cycle collection. 19527 19528- bpo-26718: super.__init__ no longer leaks memory if called multiple times. 19529 NOTE: A direct call of super.__init__ is not endorsed! 19530 19531- bpo-27138: Fix the doc comment for FileFinder.find_spec(). 19532 19533- bpo-27147: Mention :pep:`420` in the importlib docs. 19534 19535- bpo-25339: PYTHONIOENCODING now has priority over locale in setting the 19536 error handler for stdin and stdout. 19537 19538- bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes 19539 are generic sequence iterators, iterators of str, bytes, bytearray, list, 19540 tuple, set, frozenset, dict, OrderedDict, corresponding views and 19541 os.scandir() iterator. 19542 19543- bpo-26574: Optimize ``bytes.replace(b'', b'.')`` and 19544 ``bytearray.replace(b'', b'.')``. Patch written by Josh Snider. 19545 19546- bpo-26581: If coding cookie is specified multiple times on a line in 19547 Python source code file, only the first one is taken to account. 19548 19549- bpo-19711: Add tests for reloading namespace packages. 19550 19551- bpo-21099: Switch applicable importlib tests to use :pep:`451` API. 19552 19553- bpo-26563: Debug hooks on Python memory allocators now raise a fatal error 19554 if functions of the :c:func:`PyMem_Malloc` family are called without 19555 holding the GIL. 19556 19557- bpo-26564: On error, the debug hooks on Python memory allocators now use 19558 the :mod:`tracemalloc` module to get the traceback where a memory block 19559 was allocated. 19560 19561- bpo-26558: The debug hooks on Python memory allocator 19562 :c:func:`PyObject_Malloc` now detect when functions are called without 19563 holding the GIL. 19564 19565- bpo-26516: Add :envvar:`PYTHONMALLOC` environment variable to set the 19566 Python memory allocators and/or install debug hooks. 19567 19568- bpo-26516: The :c:func:`PyMem_SetupDebugHooks` function can now also be 19569 used on Python compiled in release mode. 19570 19571- bpo-26516: The :envvar:`PYTHONMALLOCSTATS` environment variable can now 19572 also be used on Python compiled in release mode. It now has no effect if 19573 set to an empty string. 19574 19575- bpo-26516: In debug mode, debug hooks are now also installed on Python 19576 memory allocators when Python is configured without pymalloc. 19577 19578- bpo-26464: Fix str.translate() when string is ASCII and first replacements 19579 removes character, but next replacement uses a non-ASCII character or a 19580 string longer than 1 character. Regression introduced in Python 3.5.0. 19581 19582- bpo-22836: Ensure exception reports from PyErr_Display() and 19583 PyErr_WriteUnraisable() are sensible even when formatting them produces 19584 secondary errors. This affects the reports produced by 19585 sys.__excepthook__() and when __del__() raises an exception. 19586 19587- bpo-26302: Correct behavior to reject comma as a legal character for 19588 cookie names. 19589 19590- bpo-26136: Upgrade the warning when a generator raises StopIteration from 19591 PendingDeprecationWarning to DeprecationWarning. Patch by Anish Shah. 19592 19593- bpo-26204: The compiler now ignores all constant statements: bytes, str, 19594 int, float, complex, name constants (None, False, True), Ellipsis and 19595 ast.Constant; not only str and int. For example, ``1.0`` is now ignored in 19596 ``def f(): 1.0``. 19597 19598- bpo-4806: Avoid masking the original TypeError exception when using star 19599 (``*``) unpacking in function calls. Based on patch by Hagen Fürstenau 19600 and Daniel Urban. 19601 19602- bpo-26146: Add a new kind of AST node: ``ast.Constant``. It can be used by 19603 external AST optimizers, but the compiler does not emit directly such 19604 node. 19605 19606- bpo-23601: Sped-up allocation of dict key objects by using Python's small 19607 object allocator. (Contributed by Julian Taylor.) 19608 19609- bpo-18018: Import raises ImportError instead of SystemError if a relative 19610 import is attempted without a known parent package. 19611 19612- bpo-25843: When compiling code, don't merge constants if they are equal 19613 but have a different types. For example, ``f1, f2 = lambda: 1, lambda: 19614 1.0`` is now correctly compiled to two different functions: ``f1()`` 19615 returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``float``), even if 19616 ``1`` and ``1.0`` are equal. 19617 19618- bpo-26107: The format of the ``co_lnotab`` attribute of code objects 19619 changes to support negative line number delta. 19620 19621- bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get 19622 the current Python thread state, but don't issue a fatal error if it is 19623 NULL. This new function must be used instead of accessing directly the 19624 _PyThreadState_Current variable. The variable is no more exposed since 19625 Python 3.5.1 to hide the exact implementation of atomic C types, to avoid 19626 compiler issues. 19627 19628- bpo-25791: If __package__ != __spec__.parent or if neither __package__ or 19629 __spec__ are defined then ImportWarning is raised. 19630 19631- bpo-22995: [UPDATE] Comment out the one of the pickleability tests in 19632 _PyObject_GetState() due to regressions observed in Cython-based projects. 19633 19634- bpo-25961: Disallowed null characters in the type name. 19635 19636- bpo-25973: Fix segfault when an invalid nonlocal statement binds a name 19637 starting with two underscores. 19638 19639- bpo-22995: Instances of extension types with a state that aren't 19640 subclasses of list or dict and haven't implemented any pickle-related 19641 methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or 19642 __getstate__), can no longer be pickled. Including memoryview. 19643 19644- bpo-20440: Massive replacing unsafe attribute setting code with special 19645 macro Py_SETREF. 19646 19647- bpo-25766: Special method __bytes__() now works in str subclasses. 19648 19649- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size. 19650 This allows sys.getsize() to work correctly with their subclasses with 19651 __slots__ defined. 19652 19653- bpo-25709: Fixed problem with in-place string concatenation and utf-8 19654 cache. 19655 19656- bpo-5319: New Py_FinalizeEx() API allowing Python to set an exit status of 19657 120 on failure to flush buffered streams. 19658 19659- bpo-25485: telnetlib.Telnet is now a context manager. 19660 19661- bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside 19662 __getattr__. 19663 19664- bpo-24731: Fixed crash on converting objects with special methods 19665 __bytes__, __trunc__, and __float__ returning instances of subclasses of 19666 bytes, int, and float to subclasses of bytes, int, and float 19667 correspondingly. 19668 19669- bpo-25630: Fix a possible segfault during argument parsing in functions 19670 that accept filesystem paths. 19671 19672- bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess 19673 internals regarding how fds_to_pass were passed to the child. The bug had 19674 no actual impact as subprocess.py already avoided it. 19675 19676- bpo-25388: Fixed tokenizer crash when processing undecodable source code 19677 with a null byte. 19678 19679- bpo-25462: The hash of the key now is calculated only once in most 19680 operations in C implementation of OrderedDict. 19681 19682- bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now 19683 rejects builtin types with not defined __new__. 19684 19685- bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec() 19686 and eval() are passed bytes-like objects. These objects are not 19687 necessarily terminated by a null byte, but the functions assumed they 19688 were. 19689 19690- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node 19691 when compiling AST from Python objects. 19692 19693- bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that 19694 was mutated by direct calls of dict methods. 19695 19696- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises 19697 KeyError in C implementations as well as in Python implementation. 19698 19699- bpo-25395: Fixed crash when highly nested OrderedDict structures were 19700 garbage collected. 19701 19702- bpo-25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now 19703 between 2x and 3.5x faster. 19704 19705- bpo-25399: Optimize bytearray % args using the new private _PyBytesWriter 19706 API. Formatting is now between 2.5 and 5 times faster. 19707 19708- bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new 19709 recursion limit is too low depending at the current recursion depth. 19710 Modify also the "lower-water mark" formula to make it monotonic. This mark 19711 is used to decide when the overflowed flag of the thread state is reset. 19712 19713- bpo-24402: Fix input() to prompt to the redirected stdout when 19714 sys.stdout.fileno() fails. 19715 19716- bpo-25349: Optimize bytes % args using the new private _PyBytesWriter API. 19717 Formatting is now up to 2 times faster. 19718 19719- bpo-24806: Prevent builtin types that are not allowed to be subclassed 19720 from being subclassed through multiple inheritance. 19721 19722- bpo-25301: The UTF-8 decoder is now up to 15 times as fast for error 19723 handlers: ``ignore``, ``replace`` and ``surrogateescape``. 19724 19725- bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data. 19726 19727- bpo-25267: The UTF-8 encoder is now up to 75 times as fast for error 19728 handlers: ``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass``. 19729 Patch co-written with Serhiy Storchaka. 19730 19731- bpo-25280: Import trace messages emitted in verbose (-v) mode are no 19732 longer formatted twice. 19733 19734- bpo-25227: Optimize ASCII and latin1 encoders with the ``surrogateescape`` 19735 error handler: the encoders are now up to 3 times as fast. Initial patch 19736 written by Serhiy Storchaka. 19737 19738- bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom() 19739 function instead of the getentropy() function. The getentropy() function 19740 is blocking to generate very good quality entropy, os.urandom() doesn't 19741 need such high-quality entropy. 19742 19743- bpo-9232: Modify Python's grammar to allow trailing commas in the argument 19744 list of a function declaration. For example, "def f(\*, a = 3,): pass" is 19745 now legal. Patch from Mark Dickinson. 19746 19747- bpo-24965: Implement :pep:`498` "Literal String Interpolation". This 19748 allows you to embed expressions inside f-strings, which are converted to 19749 normal strings at run time. Given x=3, then f'value={x}' == 'value=3'. 19750 Patch by Eric V. Smith. 19751 19752- bpo-26478: Fix semantic bugs when using binary operators with dictionary 19753 views and tuples. 19754 19755- bpo-26171: Fix possible integer overflow and heap corruption in 19756 zipimporter.get_data(). 19757 19758- bpo-25660: Fix TAB key behaviour in REPL with readline. 19759 19760- bpo-26288: Optimize PyLong_AsDouble. 19761 19762- bpo-26289: Optimize floor and modulo division for single-digit longs. 19763 Microbenchmarks show 2-2.5x improvement. Built-in 'divmod' function is 19764 now also ~10% faster. (See also: bpo-26315) 19765 19766- bpo-25887: Raise a RuntimeError when a coroutine object is awaited more 19767 than once. 19768 19769Library 19770------- 19771 19772- bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by 19773 SELinux and fails with EACCESS. The function now falls back to fcntl(). 19774 Patch written by Michał Bednarski. 19775 19776- bpo-27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure! 19777 19778- bpo-27031: Removed dummy methods in Tkinter widget classes: tk_menuBar() 19779 and tk_bindForTraversal(). 19780 19781- bpo-14132: Fix urllib.request redirect handling when the target only has a 19782 query string. Original fix by Ján Janech. 19783 19784- bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes 19785 found in redirect target URLs. Some servers send Location header fields 19786 with non-ASCII bytes, but "http.client" requires the request target to be 19787 ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch 19788 by Christian Heimes. 19789 19790- bpo-27033: The default value of the decode_data parameter for 19791 smtpd.SMTPChannel and smtpd.SMTPServer constructors is changed to False. 19792 19793- bpo-27034: Removed deprecated class asynchat.fifo. 19794 19795- bpo-26870: Added readline.set_auto_history(), which can stop entries being 19796 automatically added to the history list. Based on patch by Tyler 19797 Crompton. 19798 19799- bpo-26039: zipfile.ZipFile.open() can now be used to write data into a ZIP 19800 file, as well as for extracting data. Patch by Thomas Kluyver. 19801 19802- bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch 19803 contributed by Chi Hsuan Yen. 19804 19805- bpo-22274: In the subprocess module, allow stderr to be redirected to 19806 stdout even when stdout is not redirected. Patch by Akira Li. 19807 19808- bpo-26807: mock_open 'files' no longer error on readline at end of file. 19809 Patch from Yolanda Robla. 19810 19811- bpo-25745: Fixed leaking a userptr in curses panel destructor. 19812 19813- bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper 19814 in statistics.pvariance. 19815 19816- bpo-26002: Use bisect in statistics.median instead of a linear search. 19817 Patch by Upendra Kuma. 19818 19819- bpo-25974: Make use of new Decimal.as_integer_ratio() method in statistics 19820 module. Patch by Stefan Krah. 19821 19822- bpo-26996: Add secrets module as described in :pep:`506`. 19823 19824- bpo-26881: The modulefinder module now supports extended opcode arguments. 19825 19826- bpo-23815: Fixed crashes related to directly created instances of types in 19827 _tkinter and curses.panel modules. 19828 19829- bpo-17765: weakref.ref() no longer silently ignores keyword arguments. 19830 Patch by Georg Brandl. 19831 19832- bpo-26873: xmlrpc now raises ResponseError on unsupported type tags 19833 instead of silently return incorrect result. 19834 19835- bpo-26915: The __contains__ methods in the collections ABCs now check for 19836 identity before checking equality. This better matches the behavior of 19837 the concrete classes, allows sensible handling of NaNs, and makes it 19838 easier to reason about container invariants. 19839 19840- bpo-26711: Fixed the comparison of plistlib.Data with other types. 19841 19842- bpo-24114: Fix an uninitialized variable in `ctypes.util`. The bug only 19843 occurs on SunOS when the ctypes implementation searches for the `crle` 19844 program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos. 19845 19846- bpo-26864: In urllib.request, change the proxy bypass host checking 19847 against no_proxy to be case-insensitive, and to not match unrelated host 19848 names that happen to have a bypassed hostname as a suffix. Patch by Xiang 19849 Zhang. 19850 19851- bpo-24902: Print server URL on http.server startup. Initial patch by 19852 Felix Kaiser. 19853 19854- bpo-25788: fileinput.hook_encoded() now supports an "errors" argument for 19855 passing to open. Original patch by Joseph Hackman. 19856 19857- bpo-26634: recursive_repr() now sets __qualname__ of wrapper. Patch by 19858 Xiang Zhang. 19859 19860- bpo-26804: urllib.request will prefer lower_case proxy environment 19861 variables over UPPER_CASE or Mixed_Case ones. Patch contributed by 19862 Hans-Peter Jansen. 19863 19864- bpo-26837: assertSequenceEqual() now correctly outputs non-stringified 19865 differing items (like bytes in the -b mode). This affects 19866 assertListEqual() and assertTupleEqual(). 19867 19868- bpo-26041: Remove "will be removed in Python 3.7" from deprecation 19869 messages of platform.dist() and platform.linux_distribution(). Patch by 19870 Kumaripaba Miyurusara Athukorala. 19871 19872- bpo-26822: itemgetter, attrgetter and methodcaller objects no longer 19873 silently ignore keyword arguments. 19874 19875- bpo-26733: Disassembling a class now disassembles class and static 19876 methods. Patch by Xiang Zhang. 19877 19878- bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch 19879 :exc:`AttributeError` instead of :exc:`NameError`. Patch written by 19880 Emanuel Barry. 19881 19882- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name 19883 and link field limits for multibyte character encodings like utf-8. 19884 19885Security 19886-------- 19887 19888- bpo-26657: Fix directory traversal vulnerability with http.server on 19889 Windows. This fixes a regression that was introduced in 3.3.4rc1 and 19890 3.4.0rc1. Based on patch by Philipp Hagemeister. 19891 19892Library 19893------- 19894 19895- bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by 19896 Anthony Sottile. 19897 19898- bpo-26782: Add STARTUPINFO to subprocess.__all__ on Windows. 19899 19900- bpo-26404: Add context manager to socketserver. Patch by Aviv Palivoda. 19901 19902- bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading 19903 more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of 19904 1024 bytes per call. 19905 19906- bpo-26585: Eliminate http.server._quote_html() and use 19907 html.escape(quote=False). Patch by Xiang Zhang. 19908 19909- bpo-26685: Raise OSError if closing a socket fails. 19910 19911- bpo-16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'. 19912 19913- bpo-13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson. 19914 19915- bpo-26587: the site module now allows .pth files to specify files to be 19916 added to sys.path (e.g. zip files). 19917 19918- bpo-25609: Introduce contextlib.AbstractContextManager and 19919 typing.ContextManager. 19920 19921- bpo-26709: Fixed Y2038 problem in loading binary PLists. 19922 19923- bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our 19924 own SIGWINCH handler. Patch by Eric Price. 19925 19926- bpo-25951: Change SSLSocket.sendall() to return None, as explicitly 19927 documented for plain socket objects. Patch by Aviv Palivoda. 19928 19929- bpo-26586: In http.server, respond with "413 Request header fields too 19930 large" if there are too many header fields to parse, rather than killing 19931 the connection and raising an unhandled exception. Patch by Xiang Zhang. 19932 19933- bpo-26676: Added missing XMLPullParser to ElementTree.__all__. 19934 19935- bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable() 19936 to always return False. 19937 19938- bpo-26492: Exhausted iterator of array.array now conforms with the 19939 behavior of iterators of other mutable sequences: it lefts exhausted even 19940 if iterated array is extended. 19941 19942- bpo-26641: doctest.DocFileTest and doctest.testfile() now support packages 19943 (module splitted into multiple directories) for the package parameter. 19944 19945- bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of 19946 tuple (changeset 3603bae63c13 only works for classes) so we need to 19947 implement __ne__ ourselves. Patch by Andrew Plummer. 19948 19949- bpo-26644: Raise ValueError rather than SystemError when a negative length 19950 is passed to SSLSocket.recv() or read(). 19951 19952- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes 19953 instead of up to 1024. 19954 19955- bpo-26616: Fixed a bug in datetime.astimezone() method. 19956 19957- bpo-26637: The :mod:`importlib` module now emits an :exc:`ImportError` 19958 rather than a :exc:`TypeError` if :func:`__import__` is tried during the 19959 Python shutdown process but :data:`sys.path` is already cleared (set to 19960 ``None``). 19961 19962- bpo-21925: :func:`warnings.formatwarning` now catches exceptions when 19963 calling :func:`linecache.getline` and 19964 :func:`tracemalloc.get_object_traceback` to be able to log 19965 :exc:`ResourceWarning` emitted late during the Python shutdown process. 19966 19967- bpo-23848: On Windows, faulthandler.enable() now also installs an 19968 exception handler to dump the traceback of all Python threads on any 19969 Windows exception, not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT). 19970 19971- bpo-26530: Add C functions :c:func:`_PyTraceMalloc_Track` and 19972 :c:func:`_PyTraceMalloc_Untrack` to track memory blocks using the 19973 :mod:`tracemalloc` module. Add :c:func:`_PyTraceMalloc_GetTraceback` to 19974 get the traceback of an object. 19975 19976- bpo-26588: The _tracemalloc now supports tracing memory allocations of 19977 multiple address spaces (domains). 19978 19979- bpo-24266: Ctrl+C during Readline history search now cancels the search 19980 mode when compiled with Readline 7. 19981 19982- bpo-26590: Implement a safe finalizer for the _socket.socket type. It now 19983 releases the GIL to close the socket. 19984 19985- bpo-18787: spwd.getspnam() now raises a PermissionError if the user 19986 doesn't have privileges. 19987 19988- bpo-26560: Avoid potential ValueError in BaseHandler.start_response. 19989 Initial patch by Peter Inglesby. 19990 19991- bpo-26567: Add a new function :c:func:`PyErr_ResourceWarning` function to 19992 pass the destroyed object. Add a *source* attribute to 19993 :class:`warnings.WarningMessage`. Add warnings._showwarnmsg() which uses 19994 tracemalloc to get the traceback where source object was allocated. 19995 19996Security 19997-------- 19998 19999- bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is 20000 empty. Patch by Baji. 20001 20002Library 20003------- 20004 20005- bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex` 20006 to support importing packages. 20007 20008- bpo-26499: Account for remaining Content-Length in HTTPResponse.readline() 20009 and read1(). Based on patch by Silent Ghost. Also document that 20010 HTTPResponse now supports these methods. 20011 20012- bpo-25320: Handle sockets in directories unittest discovery is scanning. 20013 Patch from Victor van den Elzen. 20014 20015- bpo-16181: cookiejar.http2time() now returns None if year is higher than 20016 datetime.MAXYEAR. 20017 20018- bpo-26513: Fixes platform module detection of Windows Server 20019 20020- bpo-23718: Fixed parsing time in week 0 before Jan 1. Original patch by 20021 Tamás Bence Gedai. 20022 20023- bpo-26323: Add Mock.assert_called() and Mock.assert_called_once() methods 20024 to unittest.mock. Patch written by Amit Saha. 20025 20026- bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise 20027 NotImplementedError instead of ImportError. 20028 20029- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets. 20030 20031- bpo-15068: Got rid of excessive buffering in fileinput. The bufsize 20032 parameter is now deprecated and ignored. 20033 20034- bpo-19475: Added an optional argument timespec to the datetime isoformat() 20035 method to choose the precision of the time component. 20036 20037- bpo-2202: Fix UnboundLocalError in 20038 AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu 20039 Dupuy. 20040 20041- bpo-26167: Minimized overhead in copy.copy() and copy.deepcopy(). 20042 Optimized copying and deepcopying bytearrays, NotImplemented, slices, 20043 short lists, tuples, dicts, sets. 20044 20045- bpo-25718: Fixed pickling and copying the accumulate() iterator with total 20046 is None. 20047 20048- bpo-26475: Fixed debugging output for regular expressions with the (?x) 20049 flag. 20050 20051- bpo-26482: Allowed pickling recursive dequeues. 20052 20053- bpo-26335: Make mmap.write() return the number of bytes written like other 20054 write methods. Patch by Jakub Stasiak. 20055 20056- bpo-26457: Fixed the subnets() methods in IP network classes for the case 20057 when resulting prefix length is equal to maximal prefix length. Based on 20058 patch by Xiang Zhang. 20059 20060- bpo-26385: Remove the file if the internal open() call in 20061 NamedTemporaryFile() fails. Patch by Silent Ghost. 20062 20063- bpo-26402: Fix XML-RPC client to retry when the server shuts down a 20064 persistent connection. This was a regression related to the new 20065 http.client.RemoteDisconnected exception in 3.5.0a4. 20066 20067- bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with 20068 adobe=True. Patch by Swati Jaiswal. 20069 20070- bpo-26186: Remove an invalid type check in importlib.util.LazyLoader. 20071 20072- bpo-26367: importlib.__import__() raises ImportError like 20073 builtins.__import__() when ``level`` is specified but without an 20074 accompanying package specified. 20075 20076- bpo-26309: In the "socketserver" module, shut down the request (closing 20077 the connected socket) when verify_request() returns false. Patch by Aviv 20078 Palivoda. 20079 20080- bpo-23430: Change the socketserver module to only catch exceptions raised 20081 from a request handler that are derived from Exception (instead of 20082 BaseException). Therefore SystemExit and KeyboardInterrupt no longer 20083 trigger the handle_error() method, and will now to stop a single-threaded 20084 server. 20085 20086Security 20087-------- 20088 20089- bpo-25939: On Windows open the cert store readonly in 20090 ssl.enum_certificates. 20091 20092Library 20093------- 20094 20095- bpo-25995: os.walk() no longer uses FDs proportional to the tree depth. 20096 20097- bpo-25994: Added the close() method and the support of the context manager 20098 protocol for the os.scandir() iterator. 20099 20100- bpo-23992: multiprocessing: make MapResult not fail-fast upon exception. 20101 20102- bpo-26243: Support keyword arguments to zlib.compress(). Patch by Aviv 20103 Palivoda. 20104 20105- bpo-26117: The os.scandir() iterator now closes file descriptor not only 20106 when the iteration is finished, but when it was failed with error. 20107 20108- bpo-25949: __dict__ for an OrderedDict instance is now created only when 20109 needed. 20110 20111- bpo-25911: Restored support of bytes paths in os.walk() on Windows. 20112 20113- bpo-26045: Add UTF-8 suggestion to error message when posting a 20114 non-Latin-1 string with http.client. 20115 20116- bpo-26039: Added zipfile.ZipInfo.from_file() and zipinfo.ZipInfo.is_dir(). 20117 Patch by Thomas Kluyver. 20118 20119- bpo-12923: Reset FancyURLopener's redirect counter even if there is an 20120 exception. Based on patches by Brian Brazil and Daniel Rocco. 20121 20122- bpo-25945: Fixed a crash when unpickle the functools.partial object with 20123 wrong state. Fixed a leak in failed functools.partial constructor. "args" 20124 and "keywords" attributes of functools.partial have now always types tuple 20125 and dict correspondingly. 20126 20127- bpo-26202: copy.deepcopy() now correctly copies range() objects with 20128 non-atomic attributes. 20129 20130- bpo-23076: Path.glob() now raises a ValueError if it's called with an 20131 invalid pattern. Patch by Thomas Nyberg. 20132 20133- bpo-19883: Fixed possible integer overflows in zipimport. 20134 20135- bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and 20136 gethostbyname_ex() functions of the socket module now decode the hostname 20137 from the ANSI code page rather than UTF-8. 20138 20139- bpo-26099: The site module now writes an error into stderr if 20140 sitecustomize module can be imported but executing the module raise an 20141 ImportError. Same change for usercustomize. 20142 20143- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8 20144 encoding. 20145 20146- bpo-25935: Garbage collector now breaks reference loops with OrderedDict. 20147 20148- bpo-16620: Fixed AttributeError in msilib.Directory.glob(). 20149 20150- bpo-26013: Added compatibility with broken protocol 2 pickles created in 20151 old Python 3 versions (3.4.3 and lower). 20152 20153- bpo-26129: Deprecated accepting non-integers in grp.getgrgid(). 20154 20155- bpo-25850: Use cross-compilation by default for 64-bit Windows. 20156 20157- bpo-25822: Add docstrings to the fields of urllib.parse results. Patch 20158 contributed by Swati Jaiswal. 20159 20160- bpo-22642: Convert trace module option parsing mechanism to argparse. 20161 Patch contributed by SilentGhost. 20162 20163- bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing 20164 before $() vars. 20165 20166- bpo-26069: Remove the deprecated apis in the trace module. 20167 20168- bpo-22138: Fix mock.patch behavior when patching descriptors. Restore 20169 original values after patching. Patch contributed by Sean McCully. 20170 20171- bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode 20172 option if it is safe to do so. 20173 20174- bpo-26012: Don't traverse into symlinks for ``**`` pattern in 20175 pathlib.Path.[r]glob(). 20176 20177- bpo-24120: Ignore PermissionError when traversing a tree with 20178 pathlib.Path.[r]glob(). Patch by Ulrich Petri. 20179 20180- bpo-21815: Accept ] characters in the data portion of imap responses, in 20181 order to handle the flags with square brackets accepted and produced by 20182 servers such as gmail. 20183 20184- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer 20185 attribute (restores backward compatibility). 20186 20187- bpo-25971: Optimized creating Fractions from floats by 2 times and from 20188 Decimals by 3 times. 20189 20190- bpo-25802: Document as deprecated the remaining implementations of 20191 importlib.abc.Loader.load_module(). 20192 20193- bpo-25928: Add Decimal.as_integer_ratio(). 20194 20195- bpo-25447: Copying the lru_cache() wrapper object now always works, 20196 independently from the type of the wrapped object (by returning the 20197 original object unchanged). 20198 20199- bpo-25768: Have the functions in compileall return booleans instead of 20200 ints and add proper documentation and tests for the return values. 20201 20202- bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser. 20203 20204- bpo-25860: os.fwalk() no longer skips remaining directories when error 20205 occurs. Original patch by Samson Lee. 20206 20207- bpo-25914: Fixed and simplified OrderedDict.__sizeof__. 20208 20209- bpo-25869: Optimized deepcopying ElementTree; it is now 20 times faster. 20210 20211- bpo-25873: Optimized iterating ElementTree. Iterating elements 20212 Element.iter() is now 40% faster, iterating text Element.itertext() is now 20213 up to 2.5 times faster. 20214 20215- bpo-25902: Fixed various refcount issues in ElementTree iteration. 20216 20217- bpo-22227: The TarFile iterator is reimplemented using generator. This 20218 implementation is simpler that using class. 20219 20220- bpo-25638: Optimized ElementTree.iterparse(); it is now 2x faster. 20221 Optimized ElementTree parsing; it is now 10% faster. 20222 20223- bpo-25761: Improved detecting errors in broken pickle data. 20224 20225- bpo-25717: Restore the previous behaviour of tolerating most fstat() 20226 errors when opening files. This was a regression in 3.5a1, and stopped 20227 anonymous temporary files from working in special cases. 20228 20229- bpo-24903: Fix regression in number of arguments compileall accepts when 20230 '-d' is specified. The check on the number of arguments has been dropped 20231 completely as it never worked correctly anyway. 20232 20233- bpo-25764: In the subprocess module, preserve any exception caused by 20234 fork() failure when preexec_fn is used. 20235 20236- bpo-25771: Tweak the exception message for importlib.util.resolve_name() 20237 when 'package' isn't specified but necessary. 20238 20239- bpo-6478: _strptime's regexp cache now is reset after changing timezone 20240 with time.tzset(). 20241 20242- bpo-14285: When executing a package with the "python -m package" option, 20243 and package initialization fails, a proper traceback is now reported. The 20244 "runpy" module now lets exceptions from package initialization pass back 20245 to the caller, rather than raising ImportError. 20246 20247- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message 20248 ". . . is a package and cannot be directly executed" if the package could 20249 not even be initialized (e.g. due to a bad ``*.pyc`` file). 20250 20251- bpo-25177: Fixed problem with the mean of very small and very large 20252 numbers. As a side effect, statistics.mean and statistics.variance should 20253 be significantly faster. 20254 20255- bpo-25718: Fixed copying object with state with boolean value is false. 20256 20257- bpo-10131: Fixed deep copying of minidom documents. Based on patch by 20258 Marian Ganisin. 20259 20260- bpo-7990: dir() on ElementTree.Element now lists properties: "tag", 20261 "text", "tail" and "attrib". Original patch by Santoso Wijaya. 20262 20263- bpo-25725: Fixed a reference leak in pickle.loads() when unpickling 20264 invalid data including tuple instructions. 20265 20266- bpo-25663: In the Readline completer, avoid listing duplicate global 20267 names, and search the global namespace before searching builtins. 20268 20269- bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error. 20270 20271- bpo-23914: Fixed SystemError raised by unpickler on broken pickle data. 20272 20273- bpo-25691: Fixed crash on deleting ElementTree.Element attributes. 20274 20275- bpo-25624: ZipFile now always writes a ZIP_STORED header for directory 20276 entries. Patch by Dingyuan Wang. 20277 20278- bpo-25626: Change three zlib functions to accept sizes that fit in 20279 Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a 20280 regression in 3.5 where GzipFile.read() failed to read chunks larger than 20281 2 or 4 GiB. The change affects the zlib.Decompress.decompress() 20282 max_length parameter, the zlib.decompress() bufsize parameter, and the 20283 zlib.Decompress.flush() length parameter. 20284 20285- bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True) 20286 when the OS gives priority to errors such as EACCES over EEXIST. 20287 20288- bpo-25593: Change semantics of EventLoop.stop() in asyncio. 20289 20290- bpo-6973: When we know a subprocess.Popen process has died, do not allow 20291 the send_signal(), terminate(), or kill() methods to do anything as they 20292 could potentially signal a different process. 20293 20294- bpo-23883: Added missing APIs to __all__ to match the documented APIs for 20295 the following modules: calendar, csv, enum, fileinput, ftplib, logging, 20296 optparse, tarfile, threading and wave. Also added a 20297 test.support.check__all__() helper. Patches by Jacek Kołodziej, Mauro S. 20298 M. Rodrigues and Joel Taddei. 20299 20300- bpo-25590: In the Readline completer, only call getattr() once per 20301 attribute. Also complete names of attributes such as properties and slots 20302 which are listed by dir() but not yet created on an instance. 20303 20304- bpo-25498: Fix a crash when garbage-collecting ctypes objects created by 20305 wrapping a memoryview. This was a regression made in 3.5a1. Based on 20306 patch by Eryksun. 20307 20308- bpo-25584: Added "escape" to the __all__ list in the glob module. 20309 20310- bpo-25584: Fixed recursive glob() with patterns starting with ``**``. 20311 20312- bpo-25446: Fix regression in smtplib's AUTH LOGIN support. 20313 20314- bpo-18010: Fix the pydoc web server's module search function to handle 20315 exceptions from importing packages. 20316 20317- bpo-25554: Got rid of circular references in regular expression parsing. 20318 20319- bpo-18973: Command-line interface of the calendar module now uses argparse 20320 instead of optparse. 20321 20322- bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at 20323 the end if the FileInput was opened with binary mode. Patch by Ryosuke 20324 Ito. 20325 20326- bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties. 20327 Original patch by John Mark Vandenberg. 20328 20329- bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4. 20330 20331- bpo-21827: Fixed textwrap.dedent() for the case when largest common 20332 whitespace is a substring of smallest leading whitespace. Based on patch 20333 by Robert Li. 20334 20335- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled 20336 (by returning the original object unchanged). 20337 20338- bpo-25390: typing: Don't crash on Union[str, Pattern]. 20339 20340- bpo-25441: asyncio: Raise error from drain() when socket is closed. 20341 20342- bpo-25410: Cleaned up and fixed minor bugs in C implementation of 20343 OrderedDict. 20344 20345- bpo-25411: Improved Unicode support in SMTPHandler through better use of 20346 the email package. Thanks to user simon04 for the patch. 20347 20348- Move the imp module from a PendingDeprecationWarning to 20349 DeprecationWarning. 20350 20351- bpo-25407: Remove mentions of the formatter module being removed in Python 20352 3.6. 20353 20354- bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end() 20355 that caused segmentation fault or hang in iterating after moving several 20356 items to the start of ordered dict. 20357 20358- bpo-25382: pickletools.dis() now outputs implicit memo index for the 20359 MEMOIZE opcode. 20360 20361- bpo-25357: Add an optional newline parameter to binascii.b2a_base64(). 20362 base64.b64encode() uses it to avoid a memory copy. 20363 20364- bpo-24164: Objects that need calling ``__new__`` with keyword arguments, 20365 can now be pickled using pickle protocols older than protocol version 4. 20366 20367- bpo-25364: zipfile now works in threads disabled builds. 20368 20369- bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both 20370 decode_data and enable_SMTPUTF8 are set to true. 20371 20372- bpo-16099: RobotFileParser now supports Crawl-delay and Request-rate 20373 extensions. Patch by Nikolay Bogoychev. 20374 20375- bpo-25316: distutils raises OSError instead of DistutilsPlatformError when 20376 MSVC is not installed. 20377 20378- bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in 20379 pickletools.opcodes. 20380 20381- bpo-23972: Updates asyncio datagram create method allowing reuseport and 20382 reuseaddr socket options to be set prior to binding the socket. Mirroring 20383 the existing asyncio create_server method the reuseaddr option for 20384 datagram sockets defaults to True if the O/S is 'posix' (except if the 20385 platform is Cygwin). Patch by Chris Laws. 20386 20387- bpo-25304: Add asyncio.run_coroutine_threadsafe(). This lets you submit a 20388 coroutine to a loop from another thread, returning a 20389 concurrent.futures.Future. By Vincent Michel. 20390 20391- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the 20392 first question mark (?) rather than the last. Patch from Xiang Zhang. 20393 20394- bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query 20395 part of the URL as if it were a path. Patch from Xiang Zhang. 20396 20397- bpo-25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not 20398 supported. Check if it is supported, it may not be supported on OpenBSD 20399 for example. 20400 20401- bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong 20402 results in some cases. 20403 20404- bpo-25203: Failed readline.set_completer_delims() no longer left the 20405 module in inconsistent state. 20406 20407- bpo-25011: rlcompleter now omits private and special attribute names 20408 unless the prefix starts with underscores. 20409 20410- bpo-25209: rlcompleter now can add a space or a colon after completed 20411 keyword. 20412 20413- bpo-22241: timezone.utc name is now plain 'UTC', not 'UTC-00:00'. 20414 20415- bpo-23517: fromtimestamp() and utcfromtimestamp() methods of 20416 datetime.datetime now round microseconds to nearest with ties going to 20417 nearest even integer (ROUND_HALF_EVEN), as round(float), instead of 20418 rounding towards -Infinity (ROUND_FLOOR). 20419 20420- bpo-23552: Timeit now warns when there is substantial (4x) variance 20421 between best and worst times. Patch from Serhiy Storchaka. 20422 20423- bpo-24633: site-packages/README -> README.txt. 20424 20425- bpo-24879: help() and pydoc can now list named tuple fields in the order 20426 they were defined rather than alphabetically. The ordering is determined 20427 by the _fields attribute if present. 20428 20429- bpo-24874: Improve speed of itertools.cycle() and make its pickle more 20430 compact. 20431 20432- Fix crash in itertools.cycle.__setstate__() when the first argument wasn't 20433 a list. 20434 20435- bpo-20059: urllib.parse raises ValueError on all invalid ports. Patch by 20436 Martin Panter. 20437 20438- bpo-24360: Improve __repr__ of argparse.Namespace() for invalid 20439 identifiers. Patch by Matthias Bussonnier. 20440 20441- bpo-23426: run_setup was broken in distutils. Patch from Alexander 20442 Belopolsky. 20443 20444- bpo-13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. 20445 20446- bpo-2091: open() accepted a 'U' mode string containing '+', but 'U' can 20447 only be used with 'r'. Patch from Jeff Balogh and John O'Connor. 20448 20449- bpo-8585: improved tests for zipimporter2. Patch from Mark Lawrence. 20450 20451- bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely. 20452 Patch from Nicola Palumbo and Laurent De Buyst. 20453 20454- bpo-24426: Fast searching optimization in regular expressions now works 20455 for patterns that starts with capturing groups. Fast searching 20456 optimization now can't be disabled at compile time. 20457 20458- bpo-23661: unittest.mock side_effects can now be exceptions again. This 20459 was a regression vs Python 3.4. Patch from Ignacio Rossi 20460 20461- bpo-13248: Remove deprecated inspect.getmoduleinfo function. 20462 20463- bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer(). 20464 20465- bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating 20466 ssl.SSLContext. 20467 20468- bpo-25569: Fix memory leak in SSLSocket.getpeercert(). 20469 20470- bpo-25471: Sockets returned from accept() shouldn't appear to be 20471 nonblocking. 20472 20473- bpo-25319: When threading.Event is reinitialized, the underlying condition 20474 should use a regular lock rather than a recursive lock. 20475 20476- Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu 20477 Davis. 20478 20479- bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк 20480 Коренберг. 20481 20482- bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X 20483 versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis. 20484 20485- bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on 20486 current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. 20487 20488- bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input. 20489 Patch by Jack O'Connor. 20490 20491- bpo-27040: Add loop.get_exception_handler method 20492 20493- bpo-27041: asyncio: Add loop.create_future method 20494 20495IDLE 20496---- 20497 20498- bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav 20499 Heblikar. 20500 20501- In the 'IDLE-console differences' section of the IDLE doc, clarify how 20502 running with IDLE affects sys.modules and the standard streams. 20503 20504- bpo-25507: fix incorrect change in IOBinding that prevented printing. 20505 Augment IOBinding htest to include all major IOBinding functions. 20506 20507- bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION 20508 MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode 20509 CREDITS.txt to utf-8 and open it with 'utf-8'. 20510 20511- bpo-15348: Stop the debugger engine (normally in a user process) before 20512 closing the debugger window (running in the IDLE process). This prevents 20513 the RuntimeErrors that were being caught and ignored. 20514 20515- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the 20516 debugger is active (15347); b) closing the debugger with the [X] button 20517 (15348); and c) activating the debugger when already active (24455). The 20518 patch by Mark Roseman does this by making two changes. 1. Suspend and 20519 resume the gui.interaction method with the tcl vwait mechanism intended 20520 for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow 20521 any existing interaction to terminate first. 20522 20523- Change 'The program' to 'Your program' in an IDLE 'kill program?' message 20524 to make it clearer that the program referred to is the currently running 20525 user program, not IDLE itself. 20526 20527- bpo-24750: Improve the appearance of the IDLE editor window status bar. 20528 Patch by Mark Roseman. 20529 20530- bpo-25313: Change the handling of new built-in text color themes to better 20531 address the compatibility problem introduced by the addition of IDLE Dark. 20532 Consistently use the revised idleConf.CurrentTheme everywhere in idlelib. 20533 20534- bpo-24782: Extension configuration is now a tab in the IDLE Preferences 20535 dialog rather than a separate dialog. The former tabs are now a sorted 20536 list. Patch by Mark Roseman. 20537 20538- bpo-22726: Re-activate the config dialog help button with some content 20539 about the other buttons and the new IDLE Dark theme. 20540 20541- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is 20542 more or less IDLE Classic inverted, with a cobalt blue background. 20543 Strings, comments, keywords, ... are still green, red, orange, ... . To 20544 use it with IDLEs released before November 2015, hit the 'Save as New 20545 Custom Theme' button and enter a new name, such as 'Custom Dark'. The 20546 custom theme will work with any IDLE release, and can be modified. 20547 20548- bpo-25224: README.txt is now an idlelib index for IDLE developers and 20549 curious users. The previous user content is now in the IDLE doc chapter. 20550 'IDLE' now means 'Integrated Development and Learning Environment'. 20551 20552- bpo-24820: Users can now set breakpoint colors in Settings -> Custom 20553 Highlighting. Original patch by Mark Roseman. 20554 20555- bpo-24972: Inactive selection background now matches active selection 20556 background, as configured by users, on all systems. Found items are now 20557 always highlighted on Windows. Initial patch by Mark Roseman. 20558 20559- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected 20560 by a tk regression. Initial patch by Mark Roseman. 20561 20562- bpo-24988: Idle ScrolledList context menus (used in debugger) now work on 20563 Mac Aqua. Patch by Mark Roseman. 20564 20565- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by 20566 Mark Roseman. 20567 20568- bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac 20569 OSX, make them a 'sheet'. Patch by Mark Roseman. 20570 20571- bpo-25198: Enhance the initial html viewer now used for Idle Help. 20572 Properly indent fixed-pitch text (patch by Mark Roseman). Give code 20573 snippet a very Sphinx-like light blueish-gray background. Re-use initial 20574 width and height set by users for shell and editor. When the Table of 20575 Contents (TOC) menu is used, put the section header at the top of the 20576 screen. 20577 20578- bpo-25225: Condense and rewrite Idle doc section on text colors. 20579 20580- bpo-21995: Explain some differences between IDLE and console Python. 20581 20582- bpo-22820: Explain need for *print* when running file from Idle editor. 20583 20584- bpo-25224: Doc: augment Idle feature list and no-subprocess section. 20585 20586- bpo-25219: Update doc for Idle command line options. Some were missing and 20587 notes were not correct. 20588 20589- bpo-24861: Most of idlelib is private and subject to change. Use 20590 idleib.idle.* to start Idle. See idlelib.__init__.__doc__. 20591 20592- bpo-25199: Idle: add synchronization comments for future maintainers. 20593 20594- bpo-16893: Replace help.txt with help.html for Idle doc display. The new 20595 idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks 20596 better than help.txt and will better document Idle as released. The 20597 tkinter html viewer that works for this file was written by Rose Roseman. 20598 The now unused EditorWindow.HelpDialog class and helt.txt file are 20599 deprecated. 20600 20601- bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6. 20602 20603- bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts). 20604 20605Documentation 20606------------- 20607 20608- bpo-26736: Used HTTPS for external links in the documentation if possible. 20609 20610- bpo-6953: Rework the Readline module documentation to group related 20611 functions together, and add more details such as what underlying Readline 20612 functions and variables are accessed. 20613 20614- bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt. 20615 20616- bpo-24952: Clarify the default size argument of stack_size() in the 20617 "threading" and "_thread" modules. Patch from Mattip. 20618 20619- bpo-26014: Update 3.x packaging documentation: * "See also" links to the 20620 new docs are now provided in the legacy pages * links to setuptools 20621 documentation have been updated 20622 20623Tests 20624----- 20625 20626- bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory 20627 Loyse and Jelle Zijlstra. 20628 20629- bpo-26295: When using "python3 -m test --testdir=TESTDIR", regrtest 20630 doesn't add "test." prefix to test module names. 20631 20632- bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) 20633 was untested. 20634 20635- bpo-26015: Added new tests for pickling iterators of mutable sequences. 20636 20637- bpo-26325: Added test.support.check_no_resource_warning() to check that no 20638 ResourceWarning is emitted. 20639 20640- bpo-25940: Changed test_ssl to use its internal local server more. This 20641 avoids relying on svn.python.org, which recently changed root certificate. 20642 20643- bpo-25616: Tests for OrderedDict are extracted from test_collections into 20644 separate file test_ordered_dict. 20645 20646- bpo-25449: Added tests for OrderedDict subclasses. 20647 20648- bpo-25188: Add -P/--pgo to test.regrtest to suppress error output when 20649 running the test suite for the purposes of a PGO build. Initial patch by 20650 Alecsandru Patrascu. 20651 20652- bpo-22806: Add ``python -m test --list-tests`` command to list tests. 20653 20654- bpo-18174: ``python -m test --huntrleaks ...`` now also checks for leak of 20655 file descriptors. Patch written by Richard Oudkerk. 20656 20657- bpo-25260: Fix ``python -m test --coverage`` on Windows. Remove the list 20658 of ignored directories. 20659 20660- ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass 20661 along to regrtest.py. Previously there was a limit of 9. 20662 20663- bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files 20664 cannot be written. 20665 20666Build 20667----- 20668 20669- bpo-21277: Don't try to link _ctypes with a ffi_convenience library. 20670 20671- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier 20672 de Gaye. 20673 20674- bpo-26932: Fixed support of RTLD_* constants defined as enum values, not 20675 via macros (in particular on Android). Patch by Chi Hsuan Yen. 20676 20677- bpo-22359: Disable the rules for running _freeze_importlib and pgen when 20678 cross-compiling. The output of these programs is normally saved with the 20679 source code anyway, and is still regenerated when doing a native build. 20680 Patch by Xavier de Gaye. 20681 20682- bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except 20683 on Mac OS X. Patch written by Chi Hsuan Yen. 20684 20685- bpo-25702: A --with-lto configure option has been added that will enable 20686 link time optimizations at build time during a make profile-opt. Some 20687 compilers and toolchains are known to not produce stable code when using 20688 LTO, be sure to test things thoroughly before relying on it. It can 20689 provide a few % speed up over profile-opt alone. 20690 20691- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old 20692 versions. 20693 20694- bpo-17603: Avoid error about nonexistent fileblocks.o file by using a 20695 lower-level check for st_blocks in struct stat. 20696 20697- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern 20698 Thiel. 20699 20700- bpo-26465: Update Windows builds to use OpenSSL 1.0.2g. 20701 20702- bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to 20703 ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The 20704 old ``PCbuild\build_pgo.bat`` script is removed. 20705 20706- bpo-25827: Add support for building with ICC to ``configure``, including a 20707 new ``--with-icc`` flag. 20708 20709- bpo-25696: Fix installation of Python on UNIX with make -j9. 20710 20711- bpo-24986: It is now possible to build Python on Windows without errors 20712 when external libraries are not available. 20713 20714- bpo-24421: Compile Modules/_math.c once, before building extensions. 20715 Previously it could fail to compile properly if the math and cmath builds 20716 were concurrent. 20717 20718- bpo-26465: Update OS X 10.5+ 32-bit-only installer to build and link with 20719 OpenSSL 1.0.2g. 20720 20721- bpo-26268: Update Windows builds to use OpenSSL 1.0.2f. 20722 20723- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries. 20724 20725- bpo-24324: Do not enable unreachable code warnings when using gcc as the 20726 option does not work correctly in older versions of gcc and has been 20727 silently removed as of gcc-4.5. 20728 20729Windows 20730------- 20731 20732- bpo-27053: Updates make_zip.py to correctly generate library ZIP file. 20733 20734- bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases 20735 that don't include the contents of the include directory (that is, 1.0.2e 20736 and later). 20737 20738- bpo-26071: bdist_wininst created binaries fail to start and find 32bit 20739 Python 20740 20741- bpo-26073: Update the list of magic numbers in launcher 20742 20743- bpo-26065: Excludes venv from library when generating embeddable distro. 20744 20745- bpo-25022: Removed very outdated PC/example_nt/ directory. 20746 20747Tools/Demos 20748----------- 20749 20750- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code 20751 is loaded, but get C types on demand. The C types can change if 20752 python-gdb.py is loaded before the Python executable. Patch written by 20753 Thomas Ilsche. 20754 20755- bpo-26271: Fix the Freeze tool to properly use flags passed through 20756 configure. Patch by Daniel Shaulov. 20757 20758- bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py. 20759 Patch by Guo Ci Teo. 20760 20761- bpo-26316: Fix variable name typo in Argument Clinic. 20762 20763- bpo-25440: Fix output of python-config --extension-suffix. 20764 20765- bpo-25154: The pyvenv script has been deprecated in favour of `python3 -m 20766 venv`. 20767 20768C API 20769----- 20770 20771- bpo-26312: SystemError is now raised in all programming bugs with using 20772 PyArg_ParseTupleAndKeywords(). RuntimeError did raised before in some 20773 programming bugs. 20774 20775- bpo-26198: ValueError is now raised instead of TypeError on buffer 20776 overflow in parsing "es#" and "et#" format units. SystemError is now 20777 raised instead of TypeError on programmatical error in parsing format 20778 string. 20779 20780 20781What's New in Python 3.5.5 final? 20782================================= 20783 20784*Release date: 2018-02-04* 20785 20786There were no new changes in version 3.5.5. 20787 20788 20789 20790What's New in Python 3.5.5 release candidate 1? 20791=============================================== 20792 20793*Release date: 2018-01-23* 20794 20795Security 20796-------- 20797 20798- bpo-32551: The ``sys.path[0]`` initialization change for bpo-29139 caused 20799 a regression by revealing an inconsistency in how sys.path is initialized 20800 when executing ``__main__`` from a zipfile, directory, or other import 20801 location. This is considered a potential security issue, as it may lead to 20802 privileged processes unexpectedly loading code from user controlled 20803 directories in situations where that was not previously the case. The 20804 interpreter now consistently avoids ever adding the import location's 20805 parent directory to ``sys.path``, and ensures no other ``sys.path`` 20806 entries are inadvertently modified when inserting the import location 20807 named on the command line. (Originally reported as bpo-29723 against 20808 Python 3.6rc1, but it was missed at the time that the then upcoming Python 20809 3.5.4 release would also be affected) 20810 20811- bpo-30657: Fixed possible integer overflow in PyBytes_DecodeEscape, 20812 CVE-2017-1000158. Original patch by Jay Bosamiya; rebased to Python 3 by 20813 Miro Hrončok. 20814 20815- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to 20816 get security fixes. 20817 20818Core and Builtins 20819----------------- 20820 20821- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which 20822 doesn't call ``PyObject_GC_UnTrack()``. 20823 20824Library 20825------- 20826 20827- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays. 20828 Identical objects will be saved only once. Equal references will be load 20829 as identical objects. Added support for saving and loading recursive data 20830 structures. 20831 20832- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of 20833 partial characters for UTF-8 input (libexpat bug 115): 20834 https://github.com/libexpat/libexpat/issues/115 20835 20836 20837What's New in Python 3.5.4 final? 20838================================= 20839 20840*Release date: 2017-08-07* 20841 20842Library 20843------- 20844 20845- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that 20846 contains CR or LF. Patch by Dong-hee Na. 20847 20848 20849What's New in Python 3.5.4 release candidate 1? 20850=============================================== 20851 20852*Release date: 2017-07-23* 20853 20854Security 20855-------- 20856 20857- bpo-30730: Prevent environment variables injection in subprocess on 20858 Windows. Prevent passing other environment variables and command 20859 arguments. 20860 20861- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple 20862 security vulnerabilities including: CVE-2017-9233 (External entity 20863 infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), 20864 CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and 20865 CVE-2012-0876 (Counter hash flooding with SipHash). Note: the 20866 CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't 20867 impact Python, since Python already gets entropy from the OS to set the 20868 expat secret using ``XML_SetHashSalt()``. 20869 20870- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For 20871 example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the 20872 ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an 20873 authentication (``login@host``). 20874 20875- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of 20876 CVE-2016-0718 and CVE-2016-4472. See 20877 https://sourceforge.net/p/expat/bugs/537/ for more information. 20878 20879Core and Builtins 20880----------------- 20881 20882- bpo-30876: Relative import from unloaded package now reimports the package 20883 instead of failing with SystemError. Relative import from non-package now 20884 fails with ImportError rather than SystemError. 20885 20886- bpo-30765: Avoid blocking in pthread_mutex_lock() when 20887 PyThread_acquire_lock() is asked not to block. 20888 20889- bpo-27945: Fixed various segfaults with dict when input collections are 20890 mutated during searching, inserting or comparing. Based on patches by 20891 Duane Griffin and Tim Mitchell. 20892 20893- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for 20894 non-interned attribute names. Based on patch by Eryk Sun. 20895 20896- bpo-29935: Fixed error messages in the index() method of tuple, list and 20897 deque when pass indices of wrong type. 20898 20899- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises 20900 :exc:`OverflowError`. 20901 20902- bpo-29600: Fix wrapping coroutine return values in StopIteration. 20903 20904- bpo-29537: Restore runtime compatibility with bytecode files generated by 20905 CPython 3.5.0 to 3.5.2, and adjust the eval loop to avoid the problems 20906 that could be caused by the malformed variant of the 20907 BUILD_MAP_UNPACK_WITH_CALL opcode that they may contain. Patch by Petr 20908 Viktorin, Serhiy Storchaka, and Nick Coghlan. 20909 20910- bpo-28598: Support __rmod__ for subclasses of str being called before 20911 str.__mod__. Patch by Martijn Pieters. 20912 20913- bpo-29602: Fix incorrect handling of signed zeros in complex constructor 20914 for complex subclasses and for inputs having a __complex__ method. Patch 20915 by Serhiy Storchaka. 20916 20917- bpo-29347: Fixed possibly dereferencing undefined pointers when creating 20918 weakref objects. 20919 20920- bpo-29438: Fixed use-after-free problem in key sharing dict. 20921 20922- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0]. 20923 20924- bpo-29337: Fixed possible BytesWarning when compare the code objects. 20925 Warnings could be emitted at compile time. 20926 20927- bpo-29478: If max_line_length=None is specified while using the Compat32 20928 policy, it is no longer ignored. Patch by Mircea Cosbuc. 20929 20930Library 20931------- 20932 20933- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound 20934 builtin functions. Patch by Aaron Gallagher. 20935 20936- bpo-30961: Fix decrementing a borrowed reference in tracemalloc. 20937 20938- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the 20939 thread completes, even if the thread was started by the same process which 20940 created the queue. 20941 20942- bpo-29854: Fix segfault in readline when using readline's history-size 20943 option. Patch by Nir Soffer. 20944 20945- bpo-30807: signal.setitimer() may disable the timer when passed a tiny 20946 value. Tiny values (such as 1e-6) are valid non-zero values for 20947 setitimer(), which is specified as taking microsecond-resolution 20948 intervals. However, on some platform, our conversion routine could convert 20949 1e-6 into a zero interval, therefore disabling the timer instead of 20950 (re-)scheduling it. 20951 20952- bpo-30441: Fix bug when modifying os.environ while iterating over it 20953 20954- bpo-30532: Fix email header value parser dropping folding white space in 20955 certain cases. 20956 20957- bpo-29169: Update zlib to 1.2.11. 20958 20959- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called 20960 with bytes-like argument. 20961 20962- bpo-30746: Prohibited the '=' character in environment variable names in 20963 ``os.putenv()`` and ``os.spawn*()``. 20964 20965- bpo-29755: Fixed the lgettext() family of functions in the gettext module. 20966 They now always return bytes. 20967 20968- bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases 20969 when a package is only shipped with bytecodes. Patch by Alexandru 20970 Ardelean. 20971 20972- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a 20973 reference cycle to not keep objects alive longer than expected. 20974 20975- bpo-30149: inspect.signature() now supports callables with 20976 variable-argument parameters wrapped with partialmethod. Patch by Dong-hee 20977 Na. 20978 20979- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. 20980 Patch by Sanjay Sundaresan. 20981 20982- bpo-24484: Avoid race condition in multiprocessing cleanup. 20983 20984- bpo-28994: The traceback no longer displayed for SystemExit raised in a 20985 callback registered by atexit. 20986 20987- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was 20988 called. 20989 20990- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add 20991 support for ContextManager on all versions. Original PRs by Jelle Zijlstra 20992 and Ivan Levkivskyi 20993 20994- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl 20995 implementation. Patch by Michaël Sghaïer. 20996 20997- bpo-29743: Closing transport during handshake process leaks open socket. 20998 Patch by Nikolay Kim 20999 21000- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu 21001 Sornay. 21002 21003- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore 21004 EINVAL on stdin.write() if the child process is still running but closed 21005 the pipe. 21006 21007- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot 21008 handle IPv6 addresses. 21009 21010- bpo-29960: Preserve generator state when _random.Random.setstate() raises 21011 an exception. Patch by Bryan Olson. 21012 21013- bpo-30414: multiprocessing.Queue._feed background running thread do not 21014 break from main loop on exception. 21015 21016- bpo-30003: Fix handling escape characters in HZ codec. Based on patch by 21017 Ma Lin. 21018 21019- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn* 21020 and *forkserver* start methods. 21021 21022- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error 21023 (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. 21024 This error occurs sometimes on SSL connections. 21025 21026- bpo-30375: Warnings emitted when compile a regular expression now always 21027 point to the line in the user code. Previously they could point into 21028 inners of the re module if emitted from inside of groups or conditionals. 21029 21030- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running 21031 coroutine and the coroutine returned without any more ``await``. 21032 21033- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma 21034 Lin. 21035 21036- bpo-26293: Change resulted because of zipfile breakage. (See also: 21037 bpo-29094) 21038 21039- bpo-30243: Removed the __init__ methods of _json's scanner and encoder. 21040 Misusing them could cause memory leaks or crashes. Now scanner and 21041 encoder objects are completely initialized in the __new__ methods. 21042 21043- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process 21044 when Ctrl-C is received. 21045 21046- bpo-28556: Various updates to typing module: add typing.NoReturn type, use 21047 WrapperDescriptorType, minor bug-fixes. Original PRs by Jim 21048 Fasarakis-Hilliard and Ivan Levkivskyi. 21049 21050- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux. 21051 21052- bpo-30070: Fixed leaks and crashes in errors handling in the parser 21053 module. 21054 21055- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when 21056 readline() or __next__() respectively return non-sizeable object. Fixed 21057 possible other errors caused by not checking results of PyObject_Size(), 21058 PySequence_Size(), or PyMapping_Size(). 21059 21060- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint 21061 is present. 21062 21063- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. 21064 Patch by Armin Rigo. 21065 21066- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in 21067 contextlib.contextmanager. Patch by Siddharth Velankar. 21068 21069- bpo-29998: Pickling and copying ImportError now preserves name and path 21070 attributes. 21071 21072- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering 21073 long runs of empty iterables. 21074 21075- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions 21076 and wrong types. 21077 21078- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an 21079 exception at the very first of an iterable may swallow the exception or 21080 make the program hang. Patch by Davin Potts and Xiang Zhang. 21081 21082- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when 21083 the OS gives priority to errors such as EACCES over EEXIST. 21084 21085- bpo-29861: Release references to tasks, their arguments and their results 21086 as soon as they are finished in multiprocessing.Pool. 21087 21088- bpo-29884: faulthandler: Restore the old sigaltstack during teardown. 21089 Patch by Christophe Zeitouny. 21090 21091- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. 21092 21093- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords 21094 are not strings. Patch by Michael Seifert. 21095 21096- bpo-29742: get_extra_info() raises exception if get called on closed ssl 21097 transport. Patch by Nikolay Kim. 21098 21099- bpo-8256: Fixed possible failing or crashing input() if attributes 21100 "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not 21101 strings. 21102 21103- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting 21104 big intables (objects that have __int__) as elements. Patch by Oren 21105 Milman. 21106 21107- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other 21108 exception) to exception(s) raised in the dispatched methods. Patch by Petr 21109 Motejlek. 21110 21111- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes 21112 before all pipes are closed. 21113 21114- bpo-29703: Fix asyncio to support instantiation of new event loops in 21115 child processes. 21116 21117- bpo-29376: Fix assertion error in threading._DummyThread.is_alive(). 21118 21119- bpo-29110: Fix file object leak in aifc.open() when file is given as a 21120 filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. 21121 21122- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter 21123 anymore. Patch written by Jiajun Huang. 21124 21125- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no 21126 longer affects a partial object after creation. 21127 21128- bpo-28556: Various updates to typing module: typing.Counter, 21129 typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle 21130 Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. 21131 21132- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 21133 3.6.0: check minimum and maximum years. 21134 21135- bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when 21136 used with a rare combination of multiprocessing and custom codecs. 21137 21138- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir 21139 21140- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the 21141 match object. Based on patch by WGH. 21142 21143- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited 21144 to a stopped instead of terminated state (ex: when under ptrace). 21145 21146- bpo-29290: Fix a regression in argparse that help messages would wrap at 21147 non-breaking spaces. 21148 21149- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY. 21150 21151- bpo-29011: Fix an important omission by adding Deque to the typing module. 21152 21153- bpo-29219: Fixed infinite recursion in the repr of uninitialized 21154 ctypes.CDLL instances. 21155 21156- bpo-28969: Fixed race condition in C implementation of 21157 functools.lru_cache. KeyError could be raised when cached function with 21158 full cache was simultaneously called from different threads with the same 21159 uncached arguments. 21160 21161- bpo-29142: In urllib.request, suffixes in no_proxy environment variable 21162 with leading dots could match related hostnames again (e.g. .b.c matches 21163 a.b.c). Patch by Milan Oberkirch. 21164 21165Documentation 21166------------- 21167 21168- bpo-30176: Add missing attribute related constants in curses 21169 documentation. 21170 21171- bpo-26985: Add missing info of code object in inspect documentation. 21172 21173- bpo-28929: Link the documentation to its source file on GitHub. 21174 21175- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer 21176 to aiosmtpd, a third-party asyncio-based replacement. 21177 21178- bpo-26355: Add canonical header link on each page to corresponding major 21179 version of the documentation. Patch by Matthias Bussonnier. 21180 21181- bpo-29349: Fix Python 2 syntax in code for building the documentation. 21182 21183Tests 21184----- 21185 21186- bpo-30822: Fix regrtest command line parser to allow passing -u 21187 extralargefile to run test_zipfile64. 21188 21189- bpo-30383: regrtest: Enhance regrtest and backport features from the 21190 master branch. Add options: --coverage, --testdir, --list-tests (list test 21191 files, don't run them), --list-cases (list test identifiers, don't run 21192 them, :issue:`30523`), --matchfile (load a list of test filters from a 21193 text file, :issue:`30540`), --slowest (alias to --slow). Enhance output: 21194 add timestamp, test result, currently running tests, "Tests result: xxx" 21195 summary with total duration, etc. Fix reference leak hunting in regrtest, 21196 --huntrleaks: regrtest now warms up caches, create explicitly all internal 21197 singletons which are created on demand to prevent false positives when 21198 checking for reference leaks. (:issue:`30675`). 21199 21200- bpo-30357: test_thread: setUp() now uses support.threading_setup() and 21201 support.threading_cleanup() to wait until threads complete to avoid random 21202 side effects on following tests. Initial patch written by Grzegorz 21203 Grzywacz. 21204 21205- bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip 21206 some tests of select.poll when running on macOS due to unresolved issues 21207 with the underlying system poll function on some macOS versions. 21208 21209- bpo-30197: Enhanced functions swap_attr() and swap_item() in the 21210 test.support module. They now work when delete replaced attribute or item 21211 inside the with statement. The old value of the attribute or item (or 21212 None if it doesn't exist) now will be assigned to the target of the "as" 21213 clause, if there is one. 21214 21215- bpo-29571: to match the behaviour of the ``re.LOCALE`` flag, 21216 test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)`` 21217 to determine the candidate encoding for the test regex (allowing it to 21218 correctly skip the test when the default locale encoding is a multi-byte 21219 encoding) 21220 21221Build 21222----- 21223 21224- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``, 21225 ``make install`` and some other make targets when configured with 21226 ``--enable-optimizations``. 21227 21228- bpo-23404: Don't regenerate generated files based on file modification 21229 time anymore: the action is now explicit. Replace ``make touch`` with 21230 ``make regen-all``. 21231 21232- bpo-29643: Fix ``--enable-optimization`` didn't work. 21233 21234Windows 21235------- 21236 21237- bpo-30687: Locate msbuild.exe on Windows when building rather than 21238 vcvarsall.bat 21239 21240- bpo-29392: Prevent crash when passing invalid arguments into msvcrt 21241 module. 21242 21243C API 21244----- 21245 21246- bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if 21247 Py_LIMITED_API is set to the value between 0x03050400 and 0x03060000 (not 21248 including) or 0x03060100 or higher. 21249 21250- bpo-29083: Fixed the declaration of some public API functions. 21251 PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in 21252 limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and 21253 Py_BuildValue() were not available in limited API of version < 3.3 when 21254 PY_SSIZE_T_CLEAN is defined. 21255 21256 21257What's New in Python 3.5.3 final? 21258================================= 21259 21260*Release date: 2017-01-17* 21261 21262There were no code changes between 3.5.3rc1 and 3.5.3 final. 21263 21264 21265 21266What's New in Python 3.5.3 release candidate 1? 21267=============================================== 21268 21269*Release date: 2017-01-02* 21270 21271Core and Builtins 21272----------------- 21273 21274- bpo-29073: bytearray formatting no longer truncates on first null byte. 21275 21276- bpo-28932: Do not include <sys/random.h> if it does not exist. 21277 21278- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must 21279 not convert combined table into split table. 21280 21281- bpo-25677: Correct the positioning of the syntax error caret for indented 21282 blocks. Based on patch by Michael Layzell. 21283 21284- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate 21285 form. 21286 21287- bpo-28512: Fixed setting the offset attribute of SyntaxError by 21288 PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). 21289 21290- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy 21291 bug caused by a monkey-patched len() function. 21292 21293- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X 21294 when decode astral characters. Patch by Xiang Zhang. 21295 21296- bpo-19398: Extra slash no longer added to sys.path components in case of 21297 empty compile-time PYTHONPATH components. 21298 21299- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug 21300 build. 21301 21302- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception 21303 loss in PyTraceBack_Here(). 21304 21305- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). 21306 Patch by Xiang Zhang. 21307 21308- bpo-28376: The type of long range iterator is now registered as Iterator. 21309 Patch by Oren Milman. 21310 21311- bpo-28376: The constructor of range_iterator now checks that step is not 21312 0. Patch by Oren Milman. 21313 21314- bpo-26906: Resolving special methods of uninitialized type now causes 21315 implicit initialization of the type instead of a fail. 21316 21317- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original 21318 patch by Niklas Koep. 21319 21320- bpo-24098: Fixed possible crash when AST is changed in process of 21321 compiling it. 21322 21323- bpo-28350: String constants with null character no longer interned. 21324 21325- bpo-26617: Fix crash when GC runs during weakref callbacks. 21326 21327- bpo-27942: String constants now interned recursively in tuples and 21328 frozensets. 21329 21330- bpo-21578: Fixed misleading error message when ImportError called with 21331 invalid keyword args. 21332 21333- bpo-28203: Fix incorrect type in error message from ``complex(1.0, 21334 {2:3})``. Patch by Soumya Sharma. 21335 21336- bpo-27955: Fallback on reading /dev/urandom device when the getrandom() 21337 syscall fails with EPERM, for example when blocked by SECCOMP. 21338 21339- bpo-28131: Fix a regression in zipimport's compile_source(). zipimport 21340 should use the same optimization level as the interpreter. 21341 21342- bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is 21343 compiled with NSMALLPOSINTS = 0. 21344 21345- bpo-25758: Prevents zipimport from unnecessarily encoding a filename 21346 (patch by Eryk Sun) 21347 21348- bpo-28189: dictitems_contains no longer swallows compare errors. (Patch by 21349 Xiang Zhang) 21350 21351- bpo-27812: Properly clear out a generator's frame's backreference to the 21352 generator to prevent crashes in frame.clear(). 21353 21354- bpo-27811: Fix a crash when a coroutine that has not been awaited is 21355 finalized with warnings-as-errors enabled. 21356 21357- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after 21358 use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes. 21359 21360- bpo-26020: set literal evaluation order did not match documented 21361 behaviour. 21362 21363- bpo-27782: Multi-phase extension module import now correctly allows the 21364 ``m_methods`` field to be used to add module level functions to instances 21365 of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang. 21366 21367- bpo-27936: The round() function accepted a second None argument for some 21368 types but not for others. Fixed the inconsistency by accepting None for 21369 all numeric types. 21370 21371- bpo-27487: Warn if a submodule argument to "python -m" or 21372 runpy.run_module() is found in sys.modules after parent packages are 21373 imported, but before the submodule is executed. 21374 21375- bpo-27558: Fix a SystemError in the implementation of "raise" statement. 21376 In a brand new thread, raise a RuntimeError since there is no active 21377 exception to reraise. Patch written by Xiang Zhang. 21378 21379- bpo-27419: Standard __import__() no longer look up "__import__" in globals 21380 or builtins for importing submodules or "from import". Fixed handling an 21381 error of non-string package name. 21382 21383- bpo-27083: Respect the PYTHONCASEOK environment variable under Windows. 21384 21385- bpo-27514: Make having too many statically nested blocks a SyntaxError 21386 instead of SystemError. 21387 21388- bpo-27473: Fixed possible integer overflow in bytes and bytearray 21389 concatenations. Patch by Xiang Zhang. 21390 21391- bpo-27507: Add integer overflow check in bytearray.extend(). Patch by 21392 Xiang Zhang. 21393 21394- bpo-27581: Don't rely on wrapping for overflow check in 21395 PySequence_Tuple(). Patch by Xiang Zhang. 21396 21397- bpo-27443: __length_hint__() of bytearray iterators no longer return a 21398 negative integer for a resized bytearray. 21399 21400- bpo-27942: Fix memory leak in codeobject.c 21401 21402Library 21403------- 21404 21405- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a 21406 context. Patch by Sam Breese. 21407 21408- bpo-29094: Offsets in a ZIP file created with extern file object and modes 21409 "w" and "x" now are relative to the start of the file. 21410 21411- bpo-13051: Fixed recursion errors in large or resized 21412 curses.textpad.Textbox. Based on patch by Tycho Andersen. 21413 21414- bpo-29119: Fix weakrefs in the pure python version of 21415 collections.OrderedDict move_to_end() method. Contributed by Andra 21416 Bogildea. 21417 21418- bpo-9770: curses.ascii predicates now work correctly with negative 21419 integers. 21420 21421- bpo-28427: old keys should not remove new values from WeakValueDictionary 21422 when collecting from another thread. 21423 21424- bpo-28923: Remove editor artifacts from Tix.py. 21425 21426- bpo-28871: Fixed a crash when deallocate deep ElementTree. 21427 21428- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and 21429 WeakValueDictionary.pop() when a GC collection happens in another thread. 21430 21431- bpo-20191: Fixed a crash in resource.prlimit() when pass a sequence that 21432 doesn't own its elements as limits. 21433 21434- bpo-28779: multiprocessing.set_forkserver_preload() would crash the 21435 forkserver process if a preloaded module instantiated some multiprocessing 21436 objects such as locks. 21437 21438- bpo-28847: dbm.dumb now supports reading read-only files and no longer 21439 writes the index file when it is not changed. 21440 21441- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and 21442 from_buffer_copy() methods on abstract classes like Array. 21443 21444- bpo-28732: Fix crash in os.spawnv() with no elements in args 21445 21446- bpo-28485: Always raise ValueError for negative 21447 compileall.compile_dir(workers=...) parameter, even when multithreading is 21448 unavailable. 21449 21450- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the 21451 garbage collector is invoked in other thread. Based on patch by Sebastian 21452 Cufre. 21453 21454- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if 21455 given empty data twice. Patch by Benjamin Fogle. 21456 21457- bpo-28549: Fixed segfault in curses's addch() with ncurses6. 21458 21459- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar 21460 file with compression before trying to open it without compression. 21461 Otherwise it had 50% chance failed with ignore_zeros=True. 21462 21463- bpo-23262: The webbrowser module now supports Firefox 36+ and derived 21464 browsers. Based on patch by Oleg Broytman. 21465 21466- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused 21467 by representing the scale as float value internally in Tk. tkinter.IntVar 21468 now works if float value is set to underlying Tk variable. 21469 21470- bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at 21471 the start of new line after printing a month's calendar. Patch by Xiang 21472 Zhang. 21473 21474- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. 21475 Based on patch by Kaarle Ritvanen. 21476 21477- bpo-28353: os.fwalk() no longer fails on broken links. 21478 21479- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a 21480 workaround to Tix library bug. 21481 21482- bpo-28488: shutil.make_archive() no longer add entry "./" to ZIP archive. 21483 21484- bpo-24452: Make webbrowser support Chrome on Mac OS X. 21485 21486- bpo-20766: Fix references leaked by pdb in the handling of SIGINT 21487 handlers. 21488 21489- bpo-26293: Fixed writing ZIP files that starts not from the start of the 21490 file. Offsets in ZIP file now are relative to the start of the archive in 21491 conforming to the specification. 21492 21493- bpo-28321: Fixed writing non-BMP characters with binary format in 21494 plistlib. 21495 21496- bpo-28322: Fixed possible crashes when unpickle itertools objects from 21497 incorrect pickle data. Based on patch by John Leitch. 21498 21499- Fix possible integer overflows and crashes in the mmap module with unusual 21500 usage patterns. 21501 21502- bpo-1703178: Fix the ability to pass the --link-objects option to the 21503 distutils build_ext command. 21504 21505- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 21506 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so 21507 that they don't call itermonthdates() which can cause datetime.date 21508 under/overflow. 21509 21510- bpo-28275: Fixed possible use after free in the decompress() methods of 21511 the LZMADecompressor and BZ2Decompressor classes. Original patch by John 21512 Leitch. 21513 21514- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() 21515 if pass invalid string-like object as a name. Patch by Xiang Zhang. 21516 21517- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. 21518 Patch by Madison May. 21519 21520- bpo-27611: Fixed support of default root window in the tkinter.tix module. 21521 21522- bpo-27348: In the traceback module, restore the formatting of exception 21523 messages like "Exception: None". This fixes a regression introduced in 21524 3.5a2. 21525 21526- bpo-25651: Allow falsy values to be used for msg parameter of subTest(). 21527 21528- bpo-27932: Prevent memory leak in win32_ver(). 21529 21530- Fix UnboundLocalError in socket._sendfile_use_sendfile. 21531 21532- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of 21533 os.stat(). Patch by Eryk Sun. 21534 21535- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an 21536 empty bytestring is passed. 21537 21538- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. 21539 21540- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by 21541 Gergely Imreh and Markus Holtermann. 21542 21543- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and 21544 binascii.a2b_qp(). 21545 21546- bpo-19003: m email.generator now replaces only ``\r`` and/or ``\n`` line 21547 endings, per the RFC, instead of all unicode line endings. 21548 21549- bpo-28019: itertools.count() no longer rounds non-integer step in range 21550 between 1.0 and 2.0 to 1. 21551 21552- bpo-25969: Update the lib2to3 grammar to handle the unpacking 21553 generalizations added in 3.5. 21554 21555- bpo-14977: mailcap now respects the order of the lines in the mailcap 21556 files ("first match"), as required by RFC 1542. Patch by Michael Lazar. 21557 21558- bpo-24594: Validates persist parameter when opening MSI database 21559 21560- bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes 21561 (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.) 21562 21563- bpo-28047: Fixed calculation of line length used for the base64 CTE in the 21564 new email policies. 21565 21566- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by 21567 Claude Paroz. 21568 21569- bpo-22450: urllib now includes an ``Accept: */*`` header among the default 21570 headers. This makes the results of REST API requests more consistent and 21571 predictable especially when proxy servers are involved. 21572 21573- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file 21574 between runs given the same Grammar.txt input regardless of the hash 21575 randomization setting. 21576 21577- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers 21578 in the "ctypes" and "array" modules. 21579 21580- bpo-22233: Break email header lines *only* on the RFC specified CR and LF 21581 characters, not on arbitrary unicode line breaks. This also fixes a bug 21582 in HTTP header parsing. 21583 21584- bpo-27988: Fix email iter_attachments incorrect mutation of payload list. 21585 21586- bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name 21587 fields in X.509 certs. 21588 21589- bpo-27850: Remove 3DES from ssl module's default cipher list to counter 21590 measure sweet32 attack (CVE-2016-2183). 21591 21592- bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list. 21593 (Required OpenSSL 1.1.0 or LibreSSL). 21594 21595- bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0. 21596 21597- Remove support for passing a file descriptor to os.access. It never worked 21598 but previously didn't raise. 21599 21600- bpo-12885: Fix error when distutils encounters symlink. 21601 21602- bpo-27881: Fixed possible bugs when setting 21603 sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang. 21604 21605- bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory 21606 creates not a cursor. Patch by Xiang Zhang. 21607 21608- bpo-19884: Avoid spurious output on OS X with Gnu Readline. 21609 21610- bpo-27706: Restore deterministic behavior of random.Random().seed() for 21611 string seeds using seeding version 1. Allows sequences of calls to 21612 random() to exactly match those obtained in Python 2. Patch by Nofar 21613 Schnider. 21614 21615- bpo-10513: Fix a regression in Connection.commit(). Statements should not 21616 be reset after a commit. 21617 21618- A new version of typing.py from https://github.com/python/typing: 21619 Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__ 21620 (upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the 21621 dict constraint in ForwardRef._eval_type (upstream #252). 21622 21623- bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of 21624 negative exponent and negative base. 21625 21626- bpo-21718: cursor.description is now available for queries using CTEs. 21627 21628- bpo-2466: posixpath.ismount now correctly recognizes mount points which 21629 the user does not have permission to access. 21630 21631- bpo-27773: Correct some memory management errors server_hostname in 21632 _ssl.wrap_socket(). 21633 21634- bpo-26750: unittest.mock.create_autospec() now works properly for 21635 subclasses of property() and other data descriptors. 21636 21637- In the curses module, raise an error if window.getstr() or window.instr() 21638 is passed a negative value. 21639 21640- bpo-27783: Fix possible usage of uninitialized memory in 21641 operator.methodcaller. 21642 21643- bpo-27774: Fix possible Py_DECREF on unowned object in _sre. 21644 21645- bpo-27760: Fix possible integer overflow in binascii.b2a_qp. 21646 21647- bpo-27758: Fix possible integer overflow in the _csv module for large 21648 record lengths. 21649 21650- bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the 21651 HTTP_PROXY variable when REQUEST_METHOD environment is set, which 21652 indicates that the script is in CGI mode. 21653 21654- bpo-27656: Do not assume sched.h defines any SCHED_* constants. 21655 21656- bpo-27130: In the "zlib" module, fix handling of large buffers (typically 21657 4 GiB) when compressing and decompressing. Previously, inputs were 21658 limited to 4 GiB, and compression and decompression operations did not 21659 properly handle results of 4 GiB. 21660 21661- bpo-27533: Release GIL in nt._isdir 21662 21663- bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original 21664 patch by Alexandre Vassalotti. 21665 21666- bpo-27522: Avoid an unintentional reference cycle in email.feedparser. 21667 21668- bpo-26844: Fix error message for imp.find_module() to refer to 'path' 21669 instead of 'name'. Patch by Lev Maximov. 21670 21671- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an 21672 error about unclean EOF. 21673 21674- bpo-27466: Change time format returned by http.cookie.time2netscape, 21675 confirming the netscape cookie format and making it consistent with 21676 documentation. 21677 21678- bpo-26664: Fix activate.fish by removing mis-use of ``$``. 21679 21680- bpo-22115: Fixed tracing Tkinter variables: trace_vdelete() with wrong 21681 mode no longer break tracing, trace_vinfo() now always returns a list of 21682 pairs of strings, tracing in the "u" mode now works. 21683 21684- Fix a scoping issue in importlib.util.LazyLoader which triggered an 21685 UnboundLocalError when lazy-loading a module that was already put into 21686 sys.modules. 21687 21688- bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and 21689 ispunct(). 21690 21691- bpo-26754: Some functions (compile() etc) accepted a filename argument 21692 encoded as an iterable of integers. Now only strings and byte-like objects 21693 are accepted. 21694 21695- bpo-27048: Prevents distutils failing on Windows when environment 21696 variables contain non-ASCII characters 21697 21698- bpo-27330: Fixed possible leaks in the ctypes module. 21699 21700- bpo-27238: Got rid of bare excepts in the turtle module. Original patch 21701 by Jelle Zijlstra. 21702 21703- bpo-27122: When an exception is raised within the context being managed by 21704 a contextlib.ExitStack() and one of the exit stack generators catches and 21705 raises it in a chain, do not re-raise the original exception when exiting, 21706 let the new chained one through. This avoids the :pep:`479` bug described 21707 in issue25782. 21708 21709Security 21710-------- 21711 21712- bpo-27278: Fix os.urandom() implementation using getrandom() on Linux. 21713 Truncate size to INT_MAX and loop until we collected enough random bytes, 21714 instead of casting a directly Py_ssize_t to int. 21715 21716Library 21717------- 21718 21719- bpo-26386: Fixed ttk.TreeView selection operations with item id's 21720 containing spaces. 21721 21722Security 21723-------- 21724 21725- bpo-22636: Avoid shell injection problems with ctypes.util.find_library(). 21726 21727Library 21728------- 21729 21730- bpo-16182: Fix various functions in the "readline" module to use the 21731 locale encoding, and fix get_begidx() and get_endidx() to return code 21732 point indexes. 21733 21734- bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton. 21735 21736- bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to 21737 Paulo Andrade and Petr Viktorin for the analysis and patch. 21738 21739- bpo-21201: Improves readability of multiprocessing error message. Thanks 21740 to Wojciech Walczak for patch. 21741 21742- bpo-27456: asyncio: Set TCP_NODELAY by default. 21743 21744- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by 21745 Kevin Conway. 21746 21747- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by 21748 Seth Michael Larson. 21749 21750- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by 21751 iceboy. 21752 21753- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki. 21754 21755- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect. 21756 21757- bpo-27759: Fix selectors incorrectly retain invalid file descriptors. 21758 Patch by Mark Williams. 21759 21760- bpo-28368: Refuse monitoring processes if the child watcher has no loop 21761 attached. Patch by Vincent Michel. 21762 21763- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader, 21764 add_writer, etc. 21765 21766- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг 21767 Марк. 21768 21769- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor. 21770 21771- bpo-28372: Fix asyncio to support formatting of non-python coroutines. 21772 21773- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг 21774 Марк. 21775 21776- bpo-27972: Prohibit Tasks to await on themselves. 21777 21778- bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children 21779 are done. Patch by Johannes Ebke. 21780 21781- bpo-26796: Don't configure the number of workers for default threadpool 21782 executor. Initial patch by Hans Lawrenz. 21783 21784- bpo-28600: Optimize loop.call_soon(). 21785 21786- bpo-28613: Fix get_event_loop() return the current loop if called from 21787 coroutines/callbacks. 21788 21789- bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin 21790 Mayfield. 21791 21792- bpo-28652: Make loop methods reject socket kinds they do not support. 21793 21794- bpo-28653: Fix a refleak in functools.lru_cache. 21795 21796- bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects. 21797 21798- bpo-24142: Reading a corrupt config file left the parser in an invalid 21799 state. Original patch by Florian Höch. 21800 21801- bpo-28990: Fix SSL hanging if connection is closed before handshake 21802 completed. (Patch by HoHo-Ho) 21803 21804IDLE 21805---- 21806 21807- bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger 21808 Serwy, updated by Bayard Randel. 21809 21810- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen. 21811 21812- Add version to title of IDLE help window. 21813 21814- bpo-25564: In section on IDLE -- console differences, mention that using 21815 exec means that __builtins__ is defined for each statement. 21816 21817- bpo-27714: text_textview and test_autocomplete now pass when re-run in the 21818 same process. This occurs when test_idle fails when run with the -w 21819 option but without -jn. Fix warning from test_config. 21820 21821- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports. 21822 Users must include the same imports required to run directly in Python. 21823 21824- bpo-27452: add line counter and crc to IDLE configHandler test dump. 21825 21826- bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names. 21827 21828- bpo-27245: IDLE: Cleanly delete custom themes and key bindings. 21829 Previously, when IDLE was started from a console or by import, a cascade 21830 of warnings was emitted. Patch by Serhiy Storchaka. 21831 21832C API 21833----- 21834 21835- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 21836 21837- bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as 21838 an iterable of integers. Now only strings and bytes-like objects are 21839 accepted. 21840 21841Documentation 21842------------- 21843 21844- bpo-28513: Documented command-line interface of zipfile. 21845 21846Tests 21847----- 21848 21849- bpo-28950: Disallow -j0 to be combined with -T/-l/-M in regrtest command 21850 line arguments. 21851 21852- bpo-28666: Now test.support.rmtree is able to remove unwritable or 21853 unreadable directories. 21854 21855- bpo-23839: Various caches now are cleared before running every test file. 21856 21857- bpo-28409: regrtest: fix the parser of command line arguments. 21858 21859- bpo-27787: Call gc.collect() before checking each test for "dangling 21860 threads", since the dangling threads are weak references. 21861 21862- bpo-27369: In test_pyexpat, avoid testing an error message detail that 21863 changed in Expat 2.2.0. 21864 21865Tools/Demos 21866----------- 21867 21868- bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the 21869 current "re" module, avoid invalid Python backslash escapes, and fix a bug 21870 parsing escaped C quote signs. 21871 21872- bpo-27332: Fixed the type of the first argument of module-level functions 21873 generated by Argument Clinic. Patch by Petr Viktorin. 21874 21875- bpo-27418: Fixed Tools/importbench/importbench.py. 21876 21877Windows 21878------- 21879 21880- bpo-28251: Improvements to help manuals on Windows. 21881 21882- bpo-28110: launcher.msi has different product codes between 32-bit and 21883 64-bit 21884 21885- bpo-25144: Ensures TargetDir is set before continuing with custom install. 21886 21887- bpo-27469: Adds a shell extension to the launcher so that drag and drop 21888 works correctly. 21889 21890- bpo-27309: Enabled proper Windows styles in python[w].exe manifest. 21891 21892Build 21893----- 21894 21895- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat 21896 21897- bpo-23903: Added missed names to PC/python3.def. 21898 21899- bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and 21900 Michael Haubenwallner. 21901 21902- bpo-26359: Rename --with-optimiations to --enable-optimizations. 21903 21904- bpo-28444: Fix missing extensions modules when cross compiling. 21905 21906- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. 21907 21908- bpo-28258: Fixed build with Estonian locale (python-config and distclean 21909 targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. 21910 21911- bpo-26661: setup.py now detects system libffi with multiarch wrapper. 21912 21913- bpo-28066: Fix the logic that searches build directories for generated 21914 include files when building outside the source tree. 21915 21916- bpo-15819: Remove redundant include search directory option for building 21917 outside the source tree. 21918 21919- bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach) 21920 21921- bpo-27705: Update message in validate_ucrtbase.py 21922 21923- bpo-27983: Cause lack of llvm-profdata tool when using clang as required 21924 for PGO linking to be a configure time error rather than make time when 21925 --with-optimizations is enabled. Also improve our ability to find the 21926 llvm-profdata tool on MacOS and some Linuxes. 21927 21928- bpo-26307: The profile-opt build now applies PGO to the built-in modules. 21929 21930- bpo-26359: Add the --with-optimizations configure flag. 21931 21932- bpo-27713: Suppress spurious build warnings when updating importlib's 21933 bootstrap files. Patch by Xiang Zhang 21934 21935- bpo-25825: Correct the references to Modules/python.exp and ld_so_aix, 21936 which are required on AIX. This updates references to an installation 21937 path that was changed in 3.2a4, and undoes changed references to the build 21938 tree that were made in 3.5.0a1. 21939 21940- bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi 21941 Hsuan Yen. 21942 21943- bpo-27641: The configure script now inserts comments into the makefile to 21944 prevent the pgen and _freeze_importlib executables from being 21945 cross-compiled. 21946 21947- bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be 21948 used for file generation during the build. 21949 21950- bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update 21951 FreedBSD version checks for the original ctype UTF-8 workaround. 21952 21953- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS. 21954 Patch by Gareth Rees. 21955 21956 21957What's New in Python 3.5.2 final? 21958================================= 21959 21960*Release date: 2016-06-26* 21961 21962Core and Builtins 21963----------------- 21964 21965- bpo-26930: Update Windows builds to use OpenSSL 1.0.2h. 21966 21967Tests 21968----- 21969 21970- bpo-26867: Ubuntu's openssl OP_NO_SSLv3 is forced on by default; fix test. 21971 21972IDLE 21973---- 21974 21975- bpo-27365: Allow non-ascii in idlelib/NEWS.txt - minimal part for 3.5.2. 21976 21977 21978What's New in Python 3.5.2 release candidate 1? 21979=============================================== 21980 21981*Release date: 2016-06-12* 21982 21983Core and Builtins 21984----------------- 21985 21986- bpo-27066: Fixed SystemError if a custom opener (for open()) returns a 21987 negative number without setting an exception. 21988 21989- bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by 21990 Xavier de Gaye. 21991 21992- bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" 21993 format unit. 21994 21995- bpo-26991: Fix possible refleak when creating a function with annotations. 21996 21997- bpo-27039: Fixed bytearray.remove() for values greater than 127. Patch by 21998 Joe Jevnik. 21999 22000- bpo-23640: int.from_bytes() no longer bypasses constructors for 22001 subclasses. 22002 22003- bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL 22004 pointer. 22005 22006- bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for 22007 interpolation unintentionally added with move to Python 3. Behavior no 22008 longer does any interpolation in .pypirc files, matching behavior in 22009 Python 2.7 and Setuptools 19.0. 22010 22011- bpo-26659: Make the builtin slice type support cycle collection. 22012 22013- bpo-26718: super.__init__ no longer leaks memory if called multiple times. 22014 NOTE: A direct call of super.__init__ is not endorsed! 22015 22016- bpo-25339: PYTHONIOENCODING now has priority over locale in setting the 22017 error handler for stdin and stdout. 22018 22019- bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes 22020 are generic sequence iterators, iterators of str, bytes, bytearray, list, 22021 tuple, set, frozenset, dict, OrderedDict, corresponding views and 22022 os.scandir() iterator. 22023 22024- bpo-26581: If coding cookie is specified multiple times on a line in 22025 Python source code file, only the first one is taken to account. 22026 22027- bpo-26464: Fix str.translate() when string is ASCII and first replacements 22028 removes character, but next replacement uses a non-ASCII character or a 22029 string longer than 1 character. Regression introduced in Python 3.5.0. 22030 22031- bpo-22836: Ensure exception reports from PyErr_Display() and 22032 PyErr_WriteUnraisable() are sensible even when formatting them produces 22033 secondary errors. This affects the reports produced by 22034 sys.__excepthook__() and when __del__() raises an exception. 22035 22036- bpo-26302: Correct behavior to reject comma as a legal character for 22037 cookie names. 22038 22039- bpo-4806: Avoid masking the original TypeError exception when using star 22040 (``*``) unpacking in function calls. Based on patch by Hagen Fürstenau 22041 and Daniel Urban. 22042 22043- bpo-27138: Fix the doc comment for FileFinder.find_spec(). 22044 22045- bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get 22046 the current Python thread state, but don't issue a fatal error if it is 22047 NULL. This new function must be used instead of accessing directly the 22048 _PyThreadState_Current variable. The variable is no more exposed since 22049 Python 3.5.1 to hide the exact implementation of atomic C types, to avoid 22050 compiler issues. 22051 22052- bpo-26194: Deque.insert() gave odd results for bounded deques that had 22053 reached their maximum size. Now an IndexError will be raised when 22054 attempting to insert into a full deque. 22055 22056- bpo-25843: When compiling code, don't merge constants if they are equal 22057 but have a different types. For example, ``f1, f2 = lambda: 1, lambda: 22058 1.0`` is now correctly compiled to two different functions: ``f1()`` 22059 returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``int``), even if 22060 ``1`` and ``1.0`` are equal. 22061 22062- bpo-22995: [UPDATE] Comment out the one of the pickleability tests in 22063 _PyObject_GetState() due to regressions observed in Cython-based projects. 22064 22065- bpo-25961: Disallowed null characters in the type name. 22066 22067- bpo-25973: Fix segfault when an invalid nonlocal statement binds a name 22068 starting with two underscores. 22069 22070- bpo-22995: Instances of extension types with a state that aren't 22071 subclasses of list or dict and haven't implemented any pickle-related 22072 methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or 22073 __getstate__), can no longer be pickled. Including memoryview. 22074 22075- bpo-20440: Massive replacing unsafe attribute setting code with special 22076 macro Py_SETREF. 22077 22078- bpo-25766: Special method __bytes__() now works in str subclasses. 22079 22080- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size. 22081 This allows sys.getsize() to work correctly with their subclasses with 22082 __slots__ defined. 22083 22084- bpo-25709: Fixed problem with in-place string concatenation and utf-8 22085 cache. 22086 22087- bpo-27147: Mention :pep:`420` in the importlib docs. 22088 22089- bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside 22090 __getattr__. 22091 22092- bpo-24731: Fixed crash on converting objects with special methods 22093 __bytes__, __trunc__, and __float__ returning instances of subclasses of 22094 bytes, int, and float to subclasses of bytes, int, and float 22095 correspondingly. 22096 22097- bpo-26478: Fix semantic bugs when using binary operators with dictionary 22098 views and tuples. 22099 22100- bpo-26171: Fix possible integer overflow and heap corruption in 22101 zipimporter.get_data(). 22102 22103- bpo-25660: Fix TAB key behaviour in REPL with readline. 22104 22105- bpo-25887: Raise a RuntimeError when a coroutine object is awaited more 22106 than once. 22107 22108- bpo-27243: Update the __aiter__ protocol: instead of returning an 22109 awaitable that resolves to an asynchronous iterator, the asynchronous 22110 iterator should be returned directly. Doing the former will trigger a 22111 PendingDeprecationWarning. 22112 22113Security 22114-------- 22115 22116- bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283. 22117 22118- Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by 22119 Team Oststrom 22120 22121Library 22122------- 22123 22124- bpo-21386: Implement missing IPv4Address.is_global property. It was 22125 documented since 07a5610bae9d. Initial patch by Roger Luethi. 22126 22127- bpo-20900: distutils register command now decodes HTTP responses 22128 correctly. Initial patch by ingrid. 22129 22130- A new version of typing.py provides several new classes and features: 22131 @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, 22132 Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some 22133 of the new features are not yet implemented in mypy or other static 22134 analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable, 22135 AsyncIterator) have been added (in fact they made it into 3.5.1 but were 22136 never mentioned). 22137 22138- bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from 22139 sending a message body for 205 Reset Content. Also, don't send Content 22140 header fields in responses that don't have a body. Patch by Susumu 22141 Koshiba. 22142 22143- bpo-21313: Fix the "platform" module to tolerate when sys.version contains 22144 truncated build information. 22145 22146Security 22147-------- 22148 22149- bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with 22150 ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom 22151 entropy pool is not initialized yet. Patch written by Colm Buckley. 22152 22153Library 22154------- 22155 22156- bpo-27164: In the zlib module, allow decompressing raw Deflate streams 22157 with a predefined zdict. Based on patch by Xiang Zhang. 22158 22159- bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely 22160 write data to the client. Previously it could do partial writes and 22161 truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout 22162 doing partial writes, but this is deprecated. 22163 22164- bpo-26809: Add ``__all__`` to :mod:`string`. Patch by Emanuel Barry. 22165 22166- bpo-26373: subprocess.Popen.communicate now correctly ignores 22167 BrokenPipeError when the child process dies before .communicate() is 22168 called in more/all circumstances. 22169 22170- bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch 22171 by Claudiu Popa. 22172 22173- bpo-27114: Fix SSLContext._load_windows_store_certs fails with 22174 PermissionError 22175 22176- bpo-18383: Avoid creating duplicate filters when using filterwarnings and 22177 simplefilter. Based on patch by Alex Shkop. 22178 22179- bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by 22180 SELinux and fails with EACCESS. The function now falls back to fcntl(). 22181 Patch written by Michał Bednarski. 22182 22183- bpo-27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure! 22184 22185- bpo-14132: Fix urllib.request redirect handling when the target only has a 22186 query string. Original fix by Ján Janech. 22187 22188- bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes 22189 found in redirect target URLs. Some servers send Location header fields 22190 with non-ASCII bytes, but "http.client" requires the request target to be 22191 ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch 22192 by Christian Heimes. 22193 22194- bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch 22195 contributed by Chi Hsuan Yen. 22196 22197- bpo-22274: In the subprocess module, allow stderr to be redirected to 22198 stdout even when stdout is not redirected. Patch by Akira Li. 22199 22200- bpo-26807: mock_open 'files' no longer error on readline at end of file. 22201 Patch from Yolanda Robla. 22202 22203- bpo-25745: Fixed leaking a userptr in curses panel destructor. 22204 22205- bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper 22206 in statistics.pvariance. 22207 22208- bpo-26881: The modulefinder module now supports extended opcode arguments. 22209 22210- bpo-23815: Fixed crashes related to directly created instances of types in 22211 _tkinter and curses.panel modules. 22212 22213- bpo-17765: weakref.ref() no longer silently ignores keyword arguments. 22214 Patch by Georg Brandl. 22215 22216- bpo-26873: xmlrpc now raises ResponseError on unsupported type tags 22217 instead of silently return incorrect result. 22218 22219- bpo-26711: Fixed the comparison of plistlib.Data with other types. 22220 22221- bpo-24114: Fix an uninitialized variable in `ctypes.util`. The bug only 22222 occurs on SunOS when the ctypes implementation searches for the `crle` 22223 program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos. 22224 22225- bpo-26864: In urllib.request, change the proxy bypass host checking 22226 against no_proxy to be case-insensitive, and to not match unrelated host 22227 names that happen to have a bypassed hostname as a suffix. Patch by Xiang 22228 Zhang. 22229 22230- bpo-26634: recursive_repr() now sets __qualname__ of wrapper. Patch by 22231 Xiang Zhang. 22232 22233- bpo-26804: urllib.request will prefer lower_case proxy environment 22234 variables over UPPER_CASE or Mixed_Case ones. Patch contributed by 22235 Hans-Peter Jansen. 22236 22237- bpo-26837: assertSequenceEqual() now correctly outputs non-stringified 22238 differing items (like bytes in the -b mode). This affects 22239 assertListEqual() and assertTupleEqual(). 22240 22241- bpo-26041: Remove "will be removed in Python 3.7" from deprecation 22242 messages of platform.dist() and platform.linux_distribution(). Patch by 22243 Kumaripaba Miyurusara Athukorala. 22244 22245- bpo-26822: itemgetter, attrgetter and methodcaller objects no longer 22246 silently ignore keyword arguments. 22247 22248- bpo-26733: Disassembling a class now disassembles class and static 22249 methods. Patch by Xiang Zhang. 22250 22251- bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch 22252 :exc:`AttributeError` instead of :exc:`NameError`. Patch written by 22253 Emanuel Barry. 22254 22255- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name 22256 and link field limits for multibyte character encodings like utf-8. 22257 22258Security 22259-------- 22260 22261- bpo-26657: Fix directory traversal vulnerability with http.server on 22262 Windows. This fixes a regression that was introduced in 3.3.4rc1 and 22263 3.4.0rc1. Based on patch by Philipp Hagemeister. 22264 22265Library 22266------- 22267 22268- bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by 22269 Anthony Sottile. 22270 22271- bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading 22272 more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of 22273 1024 bytes per call. 22274 22275- bpo-16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'. 22276 22277- bpo-13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson. 22278 22279- bpo-26709: Fixed Y2038 problem in loading binary PLists. 22280 22281- bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our 22282 own SIGWINCH handler. Patch by Eric Price. 22283 22284- bpo-26586: In http.server, respond with "413 Request header fields too 22285 large" if there are too many header fields to parse, rather than killing 22286 the connection and raising an unhandled exception. Patch by Xiang Zhang. 22287 22288- bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable() 22289 to always return False. 22290 22291- bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of 22292 tuple (changeset 3603bae63c13 only works for classes) so we need to 22293 implement __ne__ ourselves. Patch by Andrew Plummer. 22294 22295- bpo-26644: Raise ValueError rather than SystemError when a negative length 22296 is passed to SSLSocket.recv() or read(). 22297 22298- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes 22299 instead of up to 1024. 22300 22301- bpo-26616: Fixed a bug in datetime.astimezone() method. 22302 22303- bpo-21925: :func:`warnings.formatwarning` now catches exceptions on 22304 ``linecache.getline(...)`` to be able to log :exc:`ResourceWarning` 22305 emitted late during the Python shutdown process. 22306 22307- bpo-24266: Ctrl+C during Readline history search now cancels the search 22308 mode when compiled with Readline 7. 22309 22310- bpo-26560: Avoid potential ValueError in BaseHandler.start_response. 22311 Initial patch by Peter Inglesby. 22312 22313Security 22314-------- 22315 22316- bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is 22317 empty. Patch by Baji. 22318 22319Library 22320------- 22321 22322- bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex` 22323 to support importing packages. 22324 22325- bpo-26499: Account for remaining Content-Length in HTTPResponse.readline() 22326 and read1(). Based on patch by Silent Ghost. Also document that 22327 HTTPResponse now supports these methods. 22328 22329- bpo-25320: Handle sockets in directories unittest discovery is scanning. 22330 Patch from Victor van den Elzen. 22331 22332- bpo-16181: cookiejar.http2time() now returns None if year is higher than 22333 datetime.MAXYEAR. 22334 22335- bpo-26513: Fixes platform module detection of Windows Server 22336 22337- bpo-23718: Fixed parsing time in week 0 before Jan 1. Original patch by 22338 Tamás Bence Gedai. 22339 22340- bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise 22341 NotImplementedError instead of ImportError. 22342 22343- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets. 22344 22345- bpo-15068: Got rid of excessive buffering in the fileinput module. The 22346 bufsize parameter is no longer used. 22347 22348- bpo-2202: Fix UnboundLocalError in 22349 AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu 22350 Dupuy. 22351 22352- bpo-25718: Fixed pickling and copying the accumulate() iterator with total 22353 is None. 22354 22355- bpo-26475: Fixed debugging output for regular expressions with the (?x) 22356 flag. 22357 22358- bpo-26457: Fixed the subnets() methods in IP network classes for the case 22359 when resulting prefix length is equal to maximal prefix length. Based on 22360 patch by Xiang Zhang. 22361 22362- bpo-26385: Remove the file if the internal open() call in 22363 NamedTemporaryFile() fails. Patch by Silent Ghost. 22364 22365- bpo-26402: Fix XML-RPC client to retry when the server shuts down a 22366 persistent connection. This was a regression related to the new 22367 http.client.RemoteDisconnected exception in 3.5.0a4. 22368 22369- bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with 22370 adobe=True. Patch by Swati Jaiswal. 22371 22372- bpo-26186: Remove an invalid type check in importlib.util.LazyLoader. 22373 22374- bpo-26367: importlib.__import__() raises SystemError like 22375 builtins.__import__() when ``level`` is specified but without an 22376 accompanying package specified. 22377 22378- bpo-26309: In the "socketserver" module, shut down the request (closing 22379 the connected socket) when verify_request() returns false. Patch by Aviv 22380 Palivoda. 22381 22382Security 22383-------- 22384 22385- bpo-25939: On Windows open the cert store readonly in 22386 ssl.enum_certificates. 22387 22388Library 22389------- 22390 22391- bpo-25995: os.walk() no longer uses FDs proportional to the tree depth. 22392 22393- bpo-26117: The os.scandir() iterator now closes file descriptor not only 22394 when the iteration is finished, but when it was failed with error. 22395 22396- bpo-25911: Restored support of bytes paths in os.walk() on Windows. 22397 22398- bpo-26045: Add UTF-8 suggestion to error message when posting a 22399 non-Latin-1 string with http.client. 22400 22401- bpo-12923: Reset FancyURLopener's redirect counter even if there is an 22402 exception. Based on patches by Brian Brazil and Daniel Rocco. 22403 22404- bpo-25945: Fixed a crash when unpickle the functools.partial object with 22405 wrong state. Fixed a leak in failed functools.partial constructor. "args" 22406 and "keywords" attributes of functools.partial have now always types tuple 22407 and dict correspondingly. 22408 22409- bpo-26202: copy.deepcopy() now correctly copies range() objects with 22410 non-atomic attributes. 22411 22412- bpo-23076: Path.glob() now raises a ValueError if it's called with an 22413 invalid pattern. Patch by Thomas Nyberg. 22414 22415- bpo-19883: Fixed possible integer overflows in zipimport. 22416 22417- bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and 22418 gethostbyname_ex() functions of the socket module now decode the hostname 22419 from the ANSI code page rather than UTF-8. 22420 22421- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8 22422 encoding. 22423 22424- bpo-25935: Garbage collector now breaks reference loops with OrderedDict. 22425 22426- bpo-16620: Fixed AttributeError in msilib.Directory.glob(). 22427 22428- bpo-26013: Added compatibility with broken protocol 2 pickles created in 22429 old Python 3 versions (3.4.3 and lower). 22430 22431- bpo-25850: Use cross-compilation by default for 64-bit Windows. 22432 22433- bpo-17633: Improve zipimport's support for namespace packages. 22434 22435- bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing 22436 before $() vars. 22437 22438- bpo-22138: Fix mock.patch behavior when patching descriptors. Restore 22439 original values after patching. Patch contributed by Sean McCully. 22440 22441- bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode 22442 option if it is safe to do so. 22443 22444- bpo-26012: Don't traverse into symlinks for ``**`` pattern in 22445 pathlib.Path.[r]glob(). 22446 22447- bpo-24120: Ignore PermissionError when traversing a tree with 22448 pathlib.Path.[r]glob(). Patch by Ulrich Petri. 22449 22450- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer 22451 attribute (restores backward compatibility). 22452 22453- bpo-25447: Copying the lru_cache() wrapper object now always works, 22454 independently from the type of the wrapped object (by returning the 22455 original object unchanged). 22456 22457- bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser. 22458 22459- bpo-25860: os.fwalk() no longer skips remaining directories when error 22460 occurs. Original patch by Samson Lee. 22461 22462- bpo-25914: Fixed and simplified OrderedDict.__sizeof__. 22463 22464- bpo-25902: Fixed various refcount issues in ElementTree iteration. 22465 22466- bpo-25717: Restore the previous behaviour of tolerating most fstat() 22467 errors when opening files. This was a regression in 3.5a1, and stopped 22468 anonymous temporary files from working in special cases. 22469 22470- bpo-24903: Fix regression in number of arguments compileall accepts when 22471 '-d' is specified. The check on the number of arguments has been dropped 22472 completely as it never worked correctly anyway. 22473 22474- bpo-25764: In the subprocess module, preserve any exception caused by 22475 fork() failure when preexec_fn is used. 22476 22477- bpo-6478: _strptime's regexp cache now is reset after changing timezone 22478 with time.tzset(). 22479 22480- bpo-14285: When executing a package with the "python -m package" option, 22481 and package initialization fails, a proper traceback is now reported. The 22482 "runpy" module now lets exceptions from package initialization pass back 22483 to the caller, rather than raising ImportError. 22484 22485- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message 22486 ". . . is a package and cannot be directly executed" if the package could 22487 not even be initialized (e.g. due to a bad ``*.pyc`` file). 22488 22489- bpo-25177: Fixed problem with the mean of very small and very large 22490 numbers. As a side effect, statistics.mean and statistics.variance should 22491 be significantly faster. 22492 22493- bpo-25718: Fixed copying object with state with boolean value is false. 22494 22495- bpo-10131: Fixed deep copying of minidom documents. Based on patch by 22496 Marian Ganisin. 22497 22498- bpo-25725: Fixed a reference leak in pickle.loads() when unpickling 22499 invalid data including tuple instructions. 22500 22501- bpo-25663: In the Readline completer, avoid listing duplicate global 22502 names, and search the global namespace before searching builtins. 22503 22504- bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error. 22505 22506- bpo-23914: Fixed SystemError raised by unpickler on broken pickle data. 22507 22508- bpo-25691: Fixed crash on deleting ElementTree.Element attributes. 22509 22510- bpo-25624: ZipFile now always writes a ZIP_STORED header for directory 22511 entries. Patch by Dingyuan Wang. 22512 22513- Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu 22514 Davis. 22515 22516- bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк 22517 Коренберг. 22518 22519- bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X 22520 versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis. 22521 22522- bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on 22523 current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. 22524 22525- bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input. 22526 Patch by Jack O'Connor. 22527 22528- bpo-27040: Add loop.get_exception_handler method 22529 22530- bpo-27041: asyncio: Add loop.create_future method 22531 22532- bpo-27223: asyncio: Fix _read_ready and _write_ready to respect 22533 _conn_lost. Patch by Łukasz Langa. 22534 22535- bpo-22970: asyncio: Fix inconsistency cancelling Condition.wait. Patch by 22536 David Coles. 22537 22538IDLE 22539---- 22540 22541- bpo-5124: Paste with text selected now replaces the selection on X11. This 22542 matches how paste works on Windows, Mac, most modern Linux apps, and ttk 22543 widgets. Original patch by Serhiy Storchaka. 22544 22545- bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is 22546 a private implementation of test.test_idle and tool for maintainers. 22547 22548- bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These 22549 persisted after other warnings were suppressed in #20567. Apply Serhiy 22550 Storchaka's update_idletasks solution to four test files. Record this 22551 additional advice in idle_test/README.txt 22552 22553- bpo-20567: Revise idle_test/README.txt with advice about avoiding tk 22554 warning messages from tests. Apply advice to several IDLE tests. 22555 22556- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move 22557 code for configuring text widget colors to a new function. 22558 22559- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts 22560 on Linux prevented the configuration dialog from opening. 22561 22562- bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav 22563 Heblikar. 22564 22565- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav 22566 Heblikar. 22567 22568- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley 22569 Martínez. 22570 22571- bpo-21703: Add test for IDLE's undo delegator. Original patch by Saimadhav 22572 Heblikar . 22573 22574- bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. 22575 22576- bpo-23977: Add more asserts to test_delegator. 22577 22578- bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav 22579 Heblikar. 22580 22581- In the 'IDLE-console differences' section of the IDLE doc, clarify how 22582 running with IDLE affects sys.modules and the standard streams. 22583 22584- bpo-25507: fix incorrect change in IOBinding that prevented printing. 22585 Augment IOBinding htest to include all major IOBinding functions. 22586 22587- bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION 22588 MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode 22589 CREDITS.txt to utf-8 and open it with 'utf-8'. 22590 22591Documentation 22592------------- 22593 22594- bpo-19489: Moved the search box from the sidebar to the header and footer 22595 of each page. Patch by Ammar Askar. 22596 22597- bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5. 22598 22599- bpo-26736: Used HTTPS for external links in the documentation if possible. 22600 22601- bpo-6953: Rework the Readline module documentation to group related 22602 functions together, and add more details such as what underlying Readline 22603 functions and variables are accessed. 22604 22605- bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt. 22606 22607- bpo-25500: Fix documentation to not claim that __import__ is searched for 22608 in the global scope. 22609 22610- bpo-26014: Update 3.x packaging documentation: * "See also" links to the 22611 new docs are now provided in the legacy pages * links to setuptools 22612 documentation have been updated 22613 22614Tests 22615----- 22616 22617- bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory 22618 Loyse and Jelle Zijlstra. 22619 22620- bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) 22621 was untested. 22622 22623- bpo-26015: Added new tests for pickling iterators of mutable sequences. 22624 22625- bpo-26325: Added test.support.check_no_resource_warning() to check that no 22626 ResourceWarning is emitted. 22627 22628- bpo-25940: Changed test_ssl to use self-signed.pythontest.net. This 22629 avoids relying on svn.python.org, which recently changed root certificate. 22630 22631- bpo-25616: Tests for OrderedDict are extracted from test_collections into 22632 separate file test_ordered_dict. 22633 22634- bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files 22635 cannot be written. 22636 22637Build 22638----- 22639 22640- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier 22641 de Gaye. 22642 22643- bpo-22359: Disable the rules for running _freeze_importlib and pgen when 22644 cross-compiling. The output of these programs is normally saved with the 22645 source code anyway, and is still regenerated when doing a native build. 22646 Patch by Xavier de Gaye. 22647 22648- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by 22649 Xavier de Gaye. 22650 22651- bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except 22652 on Mac OS X. Patch written by Xavier de Gaye. 22653 22654- bpo-25702: A --with-lto configure option has been added that will enable 22655 link time optimizations at build time during a make profile-opt. Some 22656 compilers and toolchains are known to not produce stable code when using 22657 LTO, be sure to test things thoroughly before relying on it. It can 22658 provide a few % speed up over profile-opt alone. 22659 22660- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old 22661 versions. 22662 22663- bpo-17603: Avoid error about nonexistent fileblocks.o file by using a 22664 lower-level check for st_blocks in struct stat. 22665 22666- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern 22667 Thiel. 22668 22669- bpo-26465: Update Windows builds to use OpenSSL 1.0.2g. 22670 22671- bpo-24421: Compile Modules/_math.c once, before building extensions. 22672 Previously it could fail to compile properly if the math and cmath builds 22673 were concurrent. 22674 22675- bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to 22676 ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The 22677 old ``PCbuild\build_pgo.bat`` script is now deprecated, and simply calls 22678 ``PCbuild\build.bat --pgo %*``. 22679 22680- bpo-25827: Add support for building with ICC to ``configure``, including a 22681 new ``--with-icc`` flag. 22682 22683- bpo-25696: Fix installation of Python on UNIX with make -j9. 22684 22685- bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with 22686 OpenSSL 1.0.2h. 22687 22688- bpo-26268: Update Windows builds to use OpenSSL 1.0.2f. 22689 22690- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries. 22691 22692- bpo-24324: Do not enable unreachable code warnings when using gcc as the 22693 option does not work correctly in older versions of gcc and has been 22694 silently removed as of gcc-4.5. 22695 22696Windows 22697------- 22698 22699- bpo-27053: Updates make_zip.py to correctly generate library ZIP file. 22700 22701- bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases 22702 that don't include the contents of the include directory (that is, 1.0.2e 22703 and later). 22704 22705- bpo-26071: bdist_wininst created binaries fail to start and find 32bit 22706 Python 22707 22708- bpo-26073: Update the list of magic numbers in launcher 22709 22710- bpo-26065: Excludes venv from library when generating embeddable distro. 22711 22712Tools/Demos 22713----------- 22714 22715- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code 22716 is loaded, but get C types on demand. The C types can change if 22717 python-gdb.py is loaded before the Python executable. Patch written by 22718 Thomas Ilsche. 22719 22720- bpo-26271: Fix the Freeze tool to properly use flags passed through 22721 configure. Patch by Daniel Shaulov. 22722 22723- bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py. 22724 Patch by Guo Ci Teo. 22725 22726- bpo-26316: Fix variable name typo in Argument Clinic. 22727 22728Windows 22729------- 22730 22731- bpo-17500: Remove unused and outdated icons. (See also: 22732 https://github.com/python/pythondotorg/issues/945) 22733 22734 22735What's New in Python 3.5.1 final? 22736================================= 22737 22738*Release date: 2015-12-06* 22739 22740Core and Builtins 22741----------------- 22742 22743- bpo-25709: Fixed problem with in-place string concatenation and utf-8 22744 cache. 22745 22746Windows 22747------- 22748 22749- bpo-25715: Python 3.5.1 installer shows wrong upgrade path and incorrect 22750 logic for launcher detection. 22751 22752 22753What's New in Python 3.5.1 release candidate 1? 22754=============================================== 22755 22756*Release date: 2015-11-22* 22757 22758Core and Builtins 22759----------------- 22760 22761- bpo-25630: Fix a possible segfault during argument parsing in functions 22762 that accept filesystem paths. 22763 22764- bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess 22765 internals regarding how fds_to_pass were passed to the child. The bug had 22766 no actual impact as subprocess.py already avoided it. 22767 22768- bpo-25388: Fixed tokenizer crash when processing undecodable source code 22769 with a null byte. 22770 22771- bpo-25462: The hash of the key now is calculated only once in most 22772 operations in C implementation of OrderedDict. 22773 22774- bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now 22775 rejects builtin types with not defined __new__. 22776 22777- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node 22778 when compiling AST from Python objects. 22779 22780- bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec() 22781 and eval() are passed bytes-like objects. These objects are not 22782 necessarily terminated by a null byte, but the functions assumed they 22783 were. 22784 22785- bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that 22786 was mutated by direct calls of dict methods. 22787 22788- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises 22789 KeyError in C implementations as well as in Python implementation. 22790 22791- bpo-25395: Fixed crash when highly nested OrderedDict structures were 22792 garbage collected. 22793 22794- bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new 22795 recursion limit is too low depending at the current recursion depth. 22796 Modify also the "lower-water mark" formula to make it monotonic. This mark 22797 is used to decide when the overflowed flag of the thread state is reset. 22798 22799- bpo-24402: Fix input() to prompt to the redirected stdout when 22800 sys.stdout.fileno() fails. 22801 22802- bpo-24806: Prevent builtin types that are not allowed to be subclassed 22803 from being subclassed through multiple inheritance. 22804 22805- bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data. 22806 22807- bpo-25280: Import trace messages emitted in verbose (-v) mode are no 22808 longer formatted twice. 22809 22810- bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom() 22811 function instead of the getentropy() function. The getentropy() function 22812 is blocking to generate very good quality entropy, os.urandom() doesn't 22813 need such high-quality entropy. 22814 22815- bpo-25182: The stdprinter (used as sys.stderr before the io module is 22816 imported at startup) now uses the backslashreplace error handler. 22817 22818- bpo-25131: Make the line number and column offset of set/dict literals and 22819 comprehensions correspond to the opening brace. 22820 22821- bpo-25150: Hide the private _Py_atomic_xxx symbols from the public 22822 Python.h header to fix a compilation error with OpenMP. 22823 PyThreadState_GET() becomes an alias to PyThreadState_Get() to avoid ABI 22824 incompatibilities. 22825 22826Library 22827------- 22828 22829- bpo-25626: Change three zlib functions to accept sizes that fit in 22830 Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a 22831 regression in 3.5 where GzipFile.read() failed to read chunks larger than 22832 2 or 4 GiB. The change affects the zlib.Decompress.decompress() 22833 max_length parameter, the zlib.decompress() bufsize parameter, and the 22834 zlib.Decompress.flush() length parameter. 22835 22836- bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True) 22837 when the OS gives priority to errors such as EACCES over EEXIST. 22838 22839- bpo-25593: Change semantics of EventLoop.stop() in asyncio. 22840 22841- bpo-6973: When we know a subprocess.Popen process has died, do not allow 22842 the send_signal(), terminate(), or kill() methods to do anything as they 22843 could potentially signal a different process. 22844 22845- bpo-25590: In the Readline completer, only call getattr() once per 22846 attribute. 22847 22848- bpo-25498: Fix a crash when garbage-collecting ctypes objects created by 22849 wrapping a memoryview. This was a regression made in 3.5a1. Based on 22850 patch by Eryksun. 22851 22852- bpo-25584: Added "escape" to the __all__ list in the glob module. 22853 22854- bpo-25584: Fixed recursive glob() with patterns starting with ``**``. 22855 22856- bpo-25446: Fix regression in smtplib's AUTH LOGIN support. 22857 22858- bpo-18010: Fix the pydoc web server's module search function to handle 22859 exceptions from importing packages. 22860 22861- bpo-25554: Got rid of circular references in regular expression parsing. 22862 22863- bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at 22864 the end if the FileInput was opened with binary mode. Patch by Ryosuke 22865 Ito. 22866 22867- bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties. 22868 Original patch by John Mark Vandenberg. 22869 22870- bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4. 22871 22872- bpo-21827: Fixed textwrap.dedent() for the case when largest common 22873 whitespace is a substring of smallest leading whitespace. Based on patch 22874 by Robert Li. 22875 22876- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled 22877 (by returning the original object unchanged). 22878 22879- bpo-25390: typing: Don't crash on Union[str, Pattern]. 22880 22881- bpo-25441: asyncio: Raise error from drain() when socket is closed. 22882 22883- bpo-25410: Cleaned up and fixed minor bugs in C implementation of 22884 OrderedDict. 22885 22886- bpo-25411: Improved Unicode support in SMTPHandler through better use of 22887 the email package. Thanks to user simon04 for the patch. 22888 22889- bpo-25407: Remove mentions of the formatter module being removed in Python 22890 3.6. 22891 22892- bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end() 22893 that caused segmentation fault or hang in iterating after moving several 22894 items to the start of ordered dict. 22895 22896- bpo-25364: zipfile now works in threads disabled builds. 22897 22898- bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both 22899 decode_data and enable_SMTPUTF8 are set to true. 22900 22901- bpo-25316: distutils raises OSError instead of DistutilsPlatformError when 22902 MSVC is not installed. 22903 22904- bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in 22905 pickletools.opcodes. 22906 22907- bpo-23972: Updates asyncio datagram create method allowing reuseport and 22908 reuseaddr socket options to be set prior to binding the socket. Mirroring 22909 the existing asyncio create_server method the reuseaddr option for 22910 datagram sockets defaults to True if the O/S is 'posix' (except if the 22911 platform is Cygwin). Patch by Chris Laws. 22912 22913- bpo-25304: Add asyncio.run_coroutine_threadsafe(). This lets you submit a 22914 coroutine to a loop from another thread, returning a 22915 concurrent.futures.Future. By Vincent Michel. 22916 22917- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the 22918 first question mark (?) rather than the last. Patch from Xiang Zhang. 22919 22920- bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query 22921 part of the URL as if it were a path. Patch from Xiang Zhang. 22922 22923- bpo-24483: C implementation of functools.lru_cache() now calculates key's 22924 hash only once. 22925 22926- bpo-22958: Constructor and update method of weakref.WeakValueDictionary 22927 now accept the self and the dict keyword arguments. 22928 22929- bpo-22609: Constructor of collections.UserDict now accepts the self 22930 keyword argument. 22931 22932- bpo-25111: Fixed comparison of traceback.FrameSummary. 22933 22934- bpo-25262: Added support for BINBYTES8 opcode in Python implementation of 22935 unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8 22936 opcodes no longer silently ignored on 32-bit platforms in C 22937 implementation. 22938 22939- bpo-25034: Fix string.Formatter problem with auto-numbering and nested 22940 format_specs. Patch by Anthon van der Neut. 22941 22942- bpo-25233: Rewrite the guts of asyncio.Queue and asyncio.Semaphore to be 22943 more understandable and correct. 22944 22945- bpo-25203: Failed readline.set_completer_delims() no longer left the 22946 module in inconsistent state. 22947 22948- bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong 22949 results in some cases. 22950 22951- bpo-23329: Allow the ssl module to be built with older versions of 22952 LibreSSL. 22953 22954- Prevent overflow in _Unpickler_Read. 22955 22956- bpo-25047: The XML encoding declaration written by Element Tree now 22957 respects the letter case given by the user. This restores the ability to 22958 write encoding names in uppercase like "UTF-8", which worked in Python 2. 22959 22960- bpo-25135: Make deque_clear() safer by emptying the deque before clearing. 22961 This helps avoid possible reentrancy issues. 22962 22963- bpo-19143: platform module now reads Windows version from kernel32.dll to 22964 avoid compatibility shims. 22965 22966- bpo-25092: Fix datetime.strftime() failure when errno was already set to 22967 EINVAL. 22968 22969- bpo-23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods 22970 of datetime.datetime: microseconds are now rounded to nearest with ties 22971 going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding 22972 towards minus infinity (ROUND_FLOOR). It's important that these methods 22973 use the same rounding mode than datetime.timedelta to keep the property: 22974 (datetime(1970,1,1) + timedelta(seconds=t)) == 22975 datetime.utcfromtimestamp(t). It also the rounding mode used by 22976 round(float) for example. 22977 22978- bpo-25155: Fix datetime.datetime.now() and datetime.datetime.utcnow() on 22979 Windows to support date after year 2038. It was a regression introduced in 22980 Python 3.5.0. 22981 22982- bpo-25108: Omitted internal frames in traceback functions print_stack(), 22983 format_stack(), and extract_stack() called without arguments. 22984 22985- bpo-25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows. 22986 22987- bpo-24684: socket.socket.getaddrinfo() now calls 22988 PyUnicode_AsEncodedString() instead of calling the encode() method of the 22989 host, to handle correctly custom string with an encode() method which 22990 doesn't return a byte string. The encoder of the IDNA codec is now called 22991 directly instead of calling the encode() method of the string. 22992 22993- bpo-25060: Correctly compute stack usage of the BUILD_MAP opcode. 22994 22995- bpo-24857: Comparing call_args to a long sequence now correctly returns a 22996 boolean result instead of raising an exception. Patch by A Kaptur. 22997 22998- bpo-23144: Make sure that HTMLParser.feed() returns all the data, even 22999 when convert_charrefs is True. 23000 23001- bpo-24982: shutil.make_archive() with the "zip" format now adds entries 23002 for directories (including empty directories) in ZIP file. 23003 23004- bpo-25019: Fixed a crash caused by setting non-string key of expat parser. 23005 Based on patch by John Leitch. 23006 23007- bpo-16180: Exit pdb if file has syntax error, instead of trapping user in 23008 an infinite loop. Patch by Xavier de Gaye. 23009 23010- bpo-24891: Fix a race condition at Python startup if the file descriptor 23011 of stdin (0), stdout (1) or stderr (2) is closed while Python is creating 23012 sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set 23013 to None if the creation of the object failed, instead of raising an 23014 OSError exception. Initial patch written by Marco Paolini. 23015 23016- bpo-24992: Fix error handling and a race condition (related to garbage 23017 collection) in collections.OrderedDict constructor. 23018 23019- bpo-24881: Fixed setting binary mode in Python implementation of FileIO on 23020 Windows and Cygwin. Patch from Akira Li. 23021 23022- bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer(). 23023 23024- bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating 23025 ssl.SSLContext. 23026 23027- bpo-25569: Fix memory leak in SSLSocket.getpeercert(). 23028 23029- bpo-25471: Sockets returned from accept() shouldn't appear to be 23030 nonblocking. 23031 23032- bpo-25319: When threading.Event is reinitialized, the underlying condition 23033 should use a regular lock rather than a recursive lock. 23034 23035- bpo-21112: Fix regression in unittest.expectedFailure on subclasses. Patch 23036 from Berker Peksag. 23037 23038- bpo-24764: cgi.FieldStorage.read_multi() now ignores the Content-Length 23039 header in part headers. Patch written by Peter Landry and reviewed by 23040 Pierre Quentel. 23041 23042- bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and 23043 Bryce Darling. 23044 23045- bpo-24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu. 23046 23047- bpo-21159: Improve message in 23048 configparser.InterpolationMissingOptionError. Patch from Łukasz Langa. 23049 23050- bpo-20362: Honour TestCase.longMessage correctly in assertRegex. Patch 23051 from Ilia Kurenkov. 23052 23053- bpo-23572: Fixed functools.singledispatch on classes with falsy 23054 metaclasses. Patch by Ethan Furman. 23055 23056- asyncio: ensure_future() now accepts awaitable objects. 23057 23058IDLE 23059---- 23060 23061- bpo-15348: Stop the debugger engine (normally in a user process) before 23062 closing the debugger window (running in the IDLE process). This prevents 23063 the RuntimeErrors that were being caught and ignored. 23064 23065- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the 23066 debugger is active (15347); b) closing the debugger with the [X] button 23067 (15348); and c) activating the debugger when already active (24455). The 23068 patch by Mark Roseman does this by making two changes. 1. Suspend and 23069 resume the gui.interaction method with the tcl vwait mechanism intended 23070 for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow 23071 any existing interaction to terminate first. 23072 23073- Change 'The program' to 'Your program' in an IDLE 'kill program?' message 23074 to make it clearer that the program referred to is the currently running 23075 user program, not IDLE itself. 23076 23077- bpo-24750: Improve the appearance of the IDLE editor window status bar. 23078 Patch by Mark Roseman. 23079 23080- bpo-25313: Change the handling of new built-in text color themes to better 23081 address the compatibility problem introduced by the addition of IDLE Dark. 23082 Consistently use the revised idleConf.CurrentTheme everywhere in idlelib. 23083 23084- bpo-24782: Extension configuration is now a tab in the IDLE Preferences 23085 dialog rather than a separate dialog. The former tabs are now a sorted 23086 list. Patch by Mark Roseman. 23087 23088- bpo-22726: Re-activate the config dialog help button with some content 23089 about the other buttons and the new IDLE Dark theme. 23090 23091- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is 23092 more or less IDLE Classic inverted, with a cobalt blue background. 23093 Strings, comments, keywords, ... are still green, red, orange, ... . To 23094 use it with IDLEs released before November 2015, hit the 'Save as New 23095 Custom Theme' button and enter a new name, such as 'Custom Dark'. The 23096 custom theme will work with any IDLE release, and can be modified. 23097 23098- bpo-25224: README.txt is now an idlelib index for IDLE developers and 23099 curious users. The previous user content is now in the IDLE doc chapter. 23100 'IDLE' now means 'Integrated Development and Learning Environment'. 23101 23102- bpo-24820: Users can now set breakpoint colors in Settings -> Custom 23103 Highlighting. Original patch by Mark Roseman. 23104 23105- bpo-24972: Inactive selection background now matches active selection 23106 background, as configured by users, on all systems. Found items are now 23107 always highlighted on Windows. Initial patch by Mark Roseman. 23108 23109- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected 23110 by a tk regression. Initial patch by Mark Roseman. 23111 23112- bpo-24988: Idle ScrolledList context menus (used in debugger) now work on 23113 Mac Aqua. Patch by Mark Roseman. 23114 23115- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by 23116 Mark Roseman. 23117 23118- bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac 23119 OSX, make them a 'sheet'. Patch by Mark Roseman. 23120 23121- bpo-25198: Enhance the initial html viewer now used for Idle Help. 23122 Properly indent fixed-pitch text (patch by Mark Roseman). Give code 23123 snippet a very Sphinx-like light blueish-gray background. Re-use initial 23124 width and height set by users for shell and editor. When the Table of 23125 Contents (TOC) menu is used, put the section header at the top of the 23126 screen. 23127 23128- bpo-25225: Condense and rewrite Idle doc section on text colors. 23129 23130- bpo-21995: Explain some differences between IDLE and console Python. 23131 23132- bpo-22820: Explain need for *print* when running file from Idle editor. 23133 23134- bpo-25224: Doc: augment Idle feature list and no-subprocess section. 23135 23136- bpo-25219: Update doc for Idle command line options. Some were missing and 23137 notes were not correct. 23138 23139- bpo-24861: Most of idlelib is private and subject to change. Use 23140 idleib.idle.* to start Idle. See idlelib.__init__.__doc__. 23141 23142- bpo-25199: Idle: add synchronization comments for future maintainers. 23143 23144- bpo-16893: Replace help.txt with help.html for Idle doc display. The new 23145 idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks 23146 better than help.txt and will better document Idle as released. The 23147 tkinter html viewer that works for this file was written by Mark Roseman. 23148 The now unused EditorWindow.HelpDialog class and helt.txt file are 23149 deprecated. 23150 23151- bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6. 23152 23153- bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts). 23154 23155Documentation 23156------------- 23157 23158- bpo-22558: Add remaining doc links to source code for Python-coded 23159 modules. Patch by Yoni Lavi. 23160 23161- bpo-12067: Rewrite Comparisons section in the Expressions chapter of the 23162 language reference. Some of the details of comparing mixed types were 23163 incorrect or ambiguous. NotImplemented is only relevant at a lower level 23164 than the Expressions chapter. Added details of comparing range() objects, 23165 and default behaviour and consistency suggestions for user-defined 23166 classes. Patch from Andy Maier. 23167 23168- bpo-24952: Clarify the default size argument of stack_size() in the 23169 "threading" and "_thread" modules. Patch from Mattip. 23170 23171- bpo-23725: Overhaul tempfile docs. Note deprecated status of mktemp. Patch 23172 from Zbigniew Jędrzejewski-Szmek. 23173 23174- bpo-24808: Update the types of some PyTypeObject fields. Patch by Joseph 23175 Weston. 23176 23177- bpo-22812: Fix unittest discovery examples. Patch from Pam McA'Nulty. 23178 23179Tests 23180----- 23181 23182- bpo-25449: Added tests for OrderedDict subclasses. 23183 23184- bpo-25099: Make test_compileall not fail when an entry on sys.path cannot 23185 be written to (commonly seen in administrative installs on Windows). 23186 23187- bpo-23919: Prevents assert dialogs appearing in the test suite. 23188 23189- ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass 23190 along to regrtest.py. Previously there was a limit of 9. 23191 23192Build 23193----- 23194 23195- bpo-24915: Add LLVM support for PGO builds and use the test suite to 23196 generate the profile data. Initial patch by Alecsandru Patrascu of Intel. 23197 23198- bpo-24910: Windows MSIs now have unique display names. 23199 23200- bpo-24986: It is now possible to build Python on Windows without errors 23201 when external libraries are not available. 23202 23203Windows 23204------- 23205 23206- bpo-25450: Updates shortcuts to start Python in installation directory. 23207 23208- bpo-25164: Changes default all-users install directory to match per-user 23209 directory. 23210 23211- bpo-25143: Improves installer error messages for unsupported platforms. 23212 23213- bpo-25163: Display correct directory in installer when using non-default 23214 settings. 23215 23216- bpo-25361: Disables use of SSE2 instructions in Windows 32-bit build 23217 23218- bpo-25089: Adds logging to installer for case where launcher is not 23219 selected on upgrade. 23220 23221- bpo-25165: Windows uninstallation should not remove launcher if other 23222 versions remain 23223 23224- bpo-25112: py.exe launcher is missing icons 23225 23226- bpo-25102: Windows installer does not precompile for -O or -OO. 23227 23228- bpo-25081: Makes Back button in installer go back to upgrade page when 23229 upgrading. 23230 23231- bpo-25091: Increases font size of the installer. 23232 23233- bpo-25126: Clarifies that the non-web installer will download some 23234 components. 23235 23236- bpo-25213: Restores requestedExecutionLevel to manifest to disable UAC 23237 virtualization. 23238 23239- bpo-25022: Removed very outdated PC/example_nt/ directory. 23240 23241Tools/Demos 23242----------- 23243 23244- bpo-25440: Fix output of python-config --extension-suffix. 23245 23246 23247What's New in Python 3.5.0 final? 23248================================= 23249 23250*Release date: 2015-09-13* 23251 23252Build 23253----- 23254 23255- bpo-25071: Windows installer should not require TargetDir parameter when 23256 installing quietly. 23257 23258 23259What's New in Python 3.5.0 release candidate 4? 23260=============================================== 23261 23262*Release date: 2015-09-09* 23263 23264Library 23265------- 23266 23267- bpo-25029: Fixes MemoryError in test_strptime. 23268 23269Build 23270----- 23271 23272- bpo-25027: Reverts partial-static build options and adds vcruntime140.dll 23273 to Windows installation. 23274 23275 23276What's New in Python 3.5.0 release candidate 3? 23277=============================================== 23278 23279*Release date: 2015-09-07* 23280 23281Core and Builtins 23282----------------- 23283 23284- bpo-24305: Prevent import subsystem stack frames from being counted by the 23285 warnings.warn(stacklevel=) parameter. 23286 23287- bpo-24912: Prevent __class__ assignment to immutable built-in objects. 23288 23289- bpo-24975: Fix AST compilation for :pep:`448` syntax. 23290 23291Library 23292------- 23293 23294- bpo-24917: time_strftime() buffer over-read. 23295 23296- bpo-24748: To resolve a compatibility problem found with py2exe and 23297 pywin32, imp.load_dynamic() once again ignores previously loaded modules 23298 to support Python modules replacing themselves with extension modules. 23299 Patch by Petr Viktorin. 23300 23301- bpo-24635: Fixed a bug in typing.py where isinstance([], typing.Iterable) 23302 would return True once, then False on subsequent calls. 23303 23304- bpo-24989: Fixed buffer overread in BytesIO.readline() if a position is 23305 set beyond size. Based on patch by John Leitch. 23306 23307- bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and 23308 Bryce Darling. 23309 23310 23311What's New in Python 3.5.0 release candidate 2? 23312=============================================== 23313 23314*Release date: 2015-08-25* 23315 23316Core and Builtins 23317----------------- 23318 23319- bpo-24769: Interpreter now starts properly when dynamic loading is 23320 disabled. Patch by Petr Viktorin. 23321 23322- bpo-21167: NAN operations are now handled correctly when python is 23323 compiled with ICC even if -fp-model strict is not specified. 23324 23325- bpo-24492: A "package" lacking a __name__ attribute when trying to perform 23326 a ``from .. import ...`` statement will trigger an ImportError instead of 23327 an AttributeError. 23328 23329Library 23330------- 23331 23332- bpo-24847: Removes vcruntime140.dll dependency from Tcl/Tk. 23333 23334- bpo-24839: platform._syscmd_ver raises DeprecationWarning 23335 23336- bpo-24867: Fix Task.get_stack() for 'async def' coroutines 23337 23338 23339What's New in Python 3.5.0 release candidate 1? 23340=============================================== 23341 23342*Release date: 2015-08-09* 23343 23344Core and Builtins 23345----------------- 23346 23347- bpo-24667: Resize odict in all cases that the underlying dict resizes. 23348 23349Library 23350------- 23351 23352- bpo-24824: Signatures of codecs.encode() and codecs.decode() now are 23353 compatible with pydoc. 23354 23355- bpo-24634: Importing uuid should not try to load libc on Windows 23356 23357- bpo-24798: _msvccompiler.py doesn't properly support manifests 23358 23359- bpo-4395: Better testing and documentation of binary operators. Patch by 23360 Martin Panter. 23361 23362- bpo-23973: Update typing.py from GitHub repo. 23363 23364- bpo-23004: mock_open() now reads binary data correctly when the type of 23365 read_data is bytes. Initial patch by Aaron Hill. 23366 23367- bpo-23888: Handle fractional time in cookie expiry. Patch by ssh. 23368 23369- bpo-23652: Make it possible to compile the select module against the libc 23370 headers from the Linux Standard Base, which do not include some EPOLL 23371 macros. Patch by Matt Frank. 23372 23373- bpo-22932: Fix timezones in email.utils.formatdate. Patch from Dmitry 23374 Shachnev. 23375 23376- bpo-23779: imaplib raises TypeError if authenticator tries to abort. Patch 23377 from Craig Holmquist. 23378 23379- bpo-23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch 23380 written by Matthieu Gautier. 23381 23382- bpo-23254: Document how to close the TCPServer listening socket. Patch 23383 from Martin Panter. 23384 23385- bpo-19450: Update Windows and OS X installer builds to use SQLite 3.8.11. 23386 23387- bpo-17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella. 23388 23389- bpo-24791: Fix grammar regression for call syntax: 'g(\*a or b)'. 23390 23391IDLE 23392---- 23393 23394- bpo-23672: Allow Idle to edit and run files with astral chars in name. 23395 Patch by Mohd Sanad Zaki Rizvi. 23396 23397- bpo-24745: Idle editor default font. Switch from Courier to 23398 platform-sensitive TkFixedFont. This should not affect current customized 23399 font selections. If there is a problem, edit 23400 $HOME/.idlerc/config-main.cfg and remove 'fontxxx' entries from [Editor 23401 Window]. Patch by Mark Roseman. 23402 23403- bpo-21192: Idle editor. When a file is run, put its name in the restart 23404 bar. Do not print false prompts. Original patch by Adnan Umer. 23405 23406- bpo-13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy. 23407 23408Documentation 23409------------- 23410 23411- bpo-24129: Clarify the reference documentation for name resolution. This 23412 includes removing the assumption that readers will be familiar with the 23413 name resolution scheme Python used prior to the introduction of lexical 23414 scoping for function namespaces. Patch by Ivan Levkivskyi. 23415 23416- bpo-20769: Improve reload() docs. Patch by Dorian Pula. 23417 23418- bpo-23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan. 23419 23420- bpo-24729: Correct IO tutorial to match implementation regarding encoding 23421 parameter to open function. 23422 23423Tests 23424----- 23425 23426- bpo-24751: When running regrtest with the ``-w`` command line option, a 23427 test run is no longer marked as a failure if all tests succeed when 23428 re-run. 23429 23430 23431What's New in Python 3.5.0 beta 4? 23432================================== 23433 23434*Release date: 2015-07-26* 23435 23436Core and Builtins 23437----------------- 23438 23439- bpo-23573: Restored optimization of bytes.rfind() and bytearray.rfind() 23440 for single-byte argument on Linux. 23441 23442- bpo-24569: Make :pep:`448` dictionary evaluation more consistent. 23443 23444- bpo-24583: Fix crash when set is mutated while being updated. 23445 23446- bpo-24407: Fix crash when dict is mutated while being updated. 23447 23448- bpo-24619: New approach for tokenizing async/await. As a consequence, it 23449 is now possible to have one-line 'async def foo(): await ..' functions. 23450 23451- bpo-24687: Plug refleak on SyntaxError in function parameters annotations. 23452 23453- bpo-15944: memoryview: Allow arbitrary formats when casting to bytes. 23454 Patch by Martin Panter. 23455 23456Library 23457------- 23458 23459- bpo-23441: rcompleter now prints a tab character instead of displaying 23460 possible completions for an empty word. Initial patch by Martin Sekera. 23461 23462- bpo-24683: Fixed crashes in _json functions called with arguments of 23463 inappropriate type. 23464 23465- bpo-21697: shutil.copytree() now correctly handles symbolic links that 23466 point to directories. Patch by Eduardo Seabra and Thomas Kluyver. 23467 23468- bpo-14373: Fixed segmentation fault when gc.collect() is called during 23469 constructing lru_cache (C implementation). 23470 23471- bpo-24695: Fix a regression in traceback.print_exception(). If 23472 exc_traceback is None we shouldn't print a traceback header like described 23473 in the documentation. 23474 23475- bpo-24620: Random.setstate() now validates the value of state last 23476 element. 23477 23478- bpo-22485: Fixed an issue that caused `inspect.getsource` to return 23479 incorrect results on nested functions. 23480 23481- bpo-22153: Improve unittest docs. Patch from Martin Panter and evilzero. 23482 23483- bpo-24580: Symbolic group references to open group in re patterns now are 23484 explicitly forbidden as well as numeric group references. 23485 23486- bpo-24206: Fixed __eq__ and __ne__ methods of inspect classes. 23487 23488- bpo-24631: Fixed regression in the timeit module with multiline setup. 23489 23490- bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely. 23491 Patch from Nicola Palumbo and Laurent De Buyst. 23492 23493- bpo-23661: unittest.mock side_effects can now be exceptions again. This 23494 was a regression vs Python 3.4. Patch from Ignacio Rossi 23495 23496- bpo-24608: chunk.Chunk.read() now always returns bytes, not str. 23497 23498- bpo-18684: Fixed reading out of the buffer in the re module. 23499 23500- bpo-24259: tarfile now raises a ReadError if an archive is truncated 23501 inside a data segment. 23502 23503- bpo-15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional 23504 initial-response argument to the SMTP AUTH command. 23505 23506- bpo-24669: Fix inspect.getsource() for 'async def' functions. Patch by Kai 23507 Groner. 23508 23509- bpo-24688: ast.get_docstring() for 'async def' functions. 23510 23511Build 23512----- 23513 23514- bpo-24603: Update Windows builds and OS X 10.5 installer to use OpenSSL 23515 1.0.2d. 23516 23517 23518What's New in Python 3.5.0 beta 3? 23519================================== 23520 23521*Release date: 2015-07-05* 23522 23523Core and Builtins 23524----------------- 23525 23526- bpo-24467: Fixed possible buffer over-read in bytearray. The bytearray 23527 object now always allocates place for trailing null byte and it's buffer 23528 now is always null-terminated. 23529 23530- Upgrade to Unicode 8.0.0. 23531 23532- bpo-24345: Add Py_tp_finalize slot for the stable ABI. 23533 23534- bpo-24400: Introduce a distinct type for :pep:`492` coroutines; add 23535 types.CoroutineType, inspect.getcoroutinestate, 23536 inspect.getcoroutinelocals; coroutines no longer use CO_GENERATOR flag; 23537 sys.set_coroutine_wrapper works only for 'async def' coroutines; 23538 inspect.iscoroutine no longer uses collections.abc.Coroutine, it's 23539 intended to test for pure 'async def' coroutines only; add new opcode: 23540 GET_YIELD_FROM_ITER; fix generators wrapper used in types.coroutine to be 23541 instance of collections.abc.Generator; collections.abc.Awaitable and 23542 collections.abc.Coroutine can no longer be used to detect generator-based 23543 coroutines--use inspect.isawaitable instead. 23544 23545- bpo-24450: Add gi_yieldfrom to generators and cr_await to coroutines. 23546 Contributed by Benno Leslie and Yury Selivanov. 23547 23548- bpo-19235: Add new RecursionError exception. Patch by Georg Brandl. 23549 23550Library 23551------- 23552 23553- bpo-21750: mock_open.read_data can now be read from each instance, as it 23554 could in Python 3.3. 23555 23556- bpo-24552: Fix use after free in an error case of the _pickle module. 23557 23558- bpo-24514: tarfile now tolerates number fields consisting of only 23559 whitespace. 23560 23561- bpo-19176: Fixed doctype() related bugs in C implementation of 23562 ElementTree. A deprecation warning no longer issued by XMLParser subclass 23563 with default doctype() method. Direct call of doctype() now issues a 23564 warning. Parser's doctype() now is not called if target's doctype() is 23565 called. Based on patch by Martin Panter. 23566 23567- bpo-20387: Restore semantic round-trip correctness in tokenize/untokenize 23568 for tab-indented blocks. 23569 23570- bpo-24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm() 23571 functions of the audioop module. 23572 23573- bpo-24336: The contextmanager decorator now works with functions with 23574 keyword arguments called "func" and "self". Patch by Martin Panter. 23575 23576- bpo-24522: Fix possible integer overflow in json accelerator module. 23577 23578- bpo-24489: ensure a previously set C errno doesn't disturb cmath.polar(). 23579 23580- bpo-24408: Fixed AttributeError in measure() and metrics() methods of 23581 tkinter.Font. 23582 23583- bpo-14373: C implementation of functools.lru_cache() now can be used with 23584 methods. 23585 23586- bpo-24347: Set KeyError if PyDict_GetItemWithError returns NULL. 23587 23588- bpo-24348: Drop superfluous incref/decref. 23589 23590- bpo-24359: Check for changed OrderedDict size during iteration. 23591 23592- bpo-24368: Support keyword arguments in OrderedDict methods. 23593 23594- bpo-24362: Simplify the C OrderedDict fast nodes resize logic. 23595 23596- bpo-24377: Fix a ref leak in OrderedDict.__repr__. 23597 23598- bpo-24369: Defend against key-changes during iteration. 23599 23600Tests 23601----- 23602 23603- bpo-24373: _testmultiphase and xxlimited now use tp_traverse and 23604 tp_finalize to avoid reference leaks encountered when combining tp_dealloc 23605 with PyType_FromSpec (see issue #16690 for details) 23606 23607Documentation 23608------------- 23609 23610- bpo-24458: Update documentation to cover multi-phase initialization for 23611 extension modules (PEP 489). Patch by Petr Viktorin. 23612 23613- bpo-24351: Clarify what is meant by "identifier" in the context of 23614 string.Template instances. 23615 23616Build 23617----- 23618 23619- bpo-24432: Update Windows builds and OS X 10.5 installer to use OpenSSL 23620 1.0.2c. 23621 23622 23623What's New in Python 3.5.0 beta 2? 23624================================== 23625 23626*Release date: 2015-05-31* 23627 23628Core and Builtins 23629----------------- 23630 23631- bpo-24284: The startswith and endswith methods of the str class no longer 23632 return True when finding the empty string and the indexes are completely 23633 out of range. 23634 23635- bpo-24115: Update uses of PyObject_IsTrue(), PyObject_Not(), 23636 PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() 23637 to check for and handle errors correctly. 23638 23639- bpo-24328: Fix importing one character extension modules. 23640 23641- bpo-11205: In dictionary displays, evaluate the key before the value. 23642 23643- bpo-24285: Fixed regression that prevented importing extension modules 23644 from inside packages. Patch by Petr Viktorin. 23645 23646Library 23647------- 23648 23649- bpo-23247: Fix a crash in the StreamWriter.reset() of CJK codecs. 23650 23651- bpo-24270: Add math.isclose() and cmath.isclose() functions as per 23652 :pep:`485`. Contributed by Chris Barker and Tal Einat. 23653 23654- bpo-5633: Fixed timeit when the statement is a string and the setup is 23655 not. 23656 23657- bpo-24326: Fixed audioop.ratecv() with non-default weightB argument. 23658 Original patch by David Moore. 23659 23660- bpo-16991: Add a C implementation of OrderedDict. 23661 23662- bpo-23934: Fix inspect.signature to fail correctly for builtin types 23663 lacking signature information. Initial patch by James Powell. 23664 23665 23666What's New in Python 3.5.0 beta 1? 23667================================== 23668 23669*Release date: 2015-05-24* 23670 23671Core and Builtins 23672----------------- 23673 23674- bpo-24276: Fixed optimization of property descriptor getter. 23675 23676- bpo-24268: PEP 489: Multi-phase extension module initialization. Patch by 23677 Petr Viktorin. 23678 23679- bpo-23955: Add pyvenv.cfg option to suppress registry/environment lookup 23680 for generating sys.path on Windows. 23681 23682- bpo-24257: Fixed system error in the comparison of faked 23683 types.SimpleNamespace. 23684 23685- bpo-22939: Fixed integer overflow in iterator object. Patch by Clement 23686 Rouault. 23687 23688- bpo-23985: Fix a possible buffer overrun when deleting a slice from the 23689 front of a bytearray and then appending some other bytes data. 23690 23691- bpo-24102: Fixed exception type checking in standard error handlers. 23692 23693- bpo-15027: The UTF-32 encoder is now 3x to 7x faster. 23694 23695- bpo-23290: Optimize set_merge() for cases where the target is empty. 23696 (Contributed by Serhiy Storchaka.) 23697 23698- bpo-2292: PEP 448: Additional Unpacking Generalizations. 23699 23700- bpo-24096: Make warnings.warn_explicit more robust against mutation of the 23701 warnings.filters list. 23702 23703- bpo-23996: Avoid a crash when a delegated generator raises an unnormalized 23704 StopIteration exception. Patch by Stefan Behnel. 23705 23706- bpo-23910: Optimize property() getter calls. Patch by Joe Jevnik. 23707 23708- bpo-23911: Move path-based importlib bootstrap code to a separate frozen 23709 module. 23710 23711- bpo-24192: Fix namespace package imports. 23712 23713- bpo-24022: Fix tokenizer crash when processing undecodable source code. 23714 23715- bpo-9951: Added a hex() method to bytes, bytearray, and memoryview. 23716 23717- bpo-22906: PEP 479: Change StopIteration handling inside generators. 23718 23719- bpo-24017: PEP 492: Coroutines with async and await syntax. 23720 23721Library 23722------- 23723 23724- bpo-14373: Added C implementation of functools.lru_cache(). Based on 23725 patches by Matt Joiner and Alexey Kachayev. 23726 23727- bpo-24230: The tempfile module now accepts bytes for prefix, suffix and 23728 dir parameters and returns bytes in such situations (matching the os 23729 module APIs). 23730 23731- bpo-22189: collections.UserString now supports __getnewargs__(), 23732 __rmod__(), casefold(), format_map(), isprintable(), and maketrans(). 23733 Patch by Joe Jevnik. 23734 23735- bpo-24244: Prevents termination when an invalid format string is 23736 encountered on Windows in strftime. 23737 23738- bpo-23973: PEP 484: Add the typing module. 23739 23740- bpo-23086: The collections.abc.Sequence() abstract base class added 23741 *start* and *stop* parameters to the index() mixin. Patch by Devin 23742 Jeanpierre. 23743 23744- bpo-20035: Replaced the ``tkinter._fix`` module used for setting up the 23745 Tcl/Tk environment on Windows with a private function in the ``_tkinter`` 23746 module that makes no permanent changes to the environment. 23747 23748- bpo-24257: Fixed segmentation fault in sqlite3.Row constructor with faked 23749 cursor type. 23750 23751- bpo-15836: assertRaises(), assertRaisesRegex(), assertWarns() and 23752 assertWarnsRegex() assertments now check the type of the first argument to 23753 prevent possible user error. Based on patch by Daniel Wagner-Hall. 23754 23755- bpo-9858: Add missing method stubs to _io.RawIOBase. Patch by Laura 23756 Rupprecht. 23757 23758- bpo-22955: attrgetter, itemgetter and methodcaller objects in the operator 23759 module now support pickling. Added readable and evaluable repr for these 23760 objects. Based on patch by Josh Rosenberg. 23761 23762- bpo-22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again when 23763 a directory with the chosen name already exists on Windows as well as on 23764 Unix. tempfile.mkstemp() now fails early if parent directory is not valid 23765 (not exists or is a file) on Windows. 23766 23767- bpo-23780: Improved error message in os.path.join() with single argument. 23768 23769- bpo-6598: Increased time precision and random number range in 23770 email.utils.make_msgid() to strengthen the uniqueness of the message ID. 23771 23772- bpo-24091: Fixed various crashes in corner cases in C implementation of 23773 ElementTree. 23774 23775- bpo-21931: msilib.FCICreate() now raises TypeError in the case of a bad 23776 argument instead of a ValueError with a bogus FCI error number. Patch by 23777 Jeffrey Armstrong. 23778 23779- bpo-13866: *quote_via* argument added to urllib.parse.urlencode. 23780 23781- bpo-20098: New mangle_from policy option for email, default True for 23782 compat32, but False for all other policies. 23783 23784- bpo-24211: The email library now supports RFC 6532: it can generate 23785 headers using utf-8 instead of encoded words. 23786 23787- bpo-16314: Added support for the LZMA compression in distutils. 23788 23789- bpo-21804: poplib now supports RFC 6856 (UTF8). 23790 23791- bpo-18682: Optimized pprint functions for builtin scalar types. 23792 23793- bpo-22027: smtplib now supports RFC 6531 (SMTPUTF8). 23794 23795- bpo-23488: Random generator objects now consume 2x less memory on 64-bit. 23796 23797- bpo-1322: platform.dist() and platform.linux_distribution() functions are 23798 now deprecated. Initial patch by Vajrasky Kok. 23799 23800- bpo-22486: Added the math.gcd() function. The fractions.gcd() function 23801 now is deprecated. Based on patch by Mark Dickinson. 23802 23803- bpo-24064: Property() docstrings are now writeable. (Patch by Berker 23804 Peksag.) 23805 23806- bpo-22681: Added support for the koi8_t encoding. 23807 23808- bpo-22682: Added support for the kz1048 encoding. 23809 23810- bpo-23796: peek and read1 methods of BufferedReader now raise ValueError 23811 if they called on a closed object. Patch by John Hergenroeder. 23812 23813- bpo-21795: smtpd now supports the 8BITMIME extension whenever the new 23814 *decode_data* constructor argument is set to False. 23815 23816- bpo-24155: optimize heapq.heapify() for better cache performance when 23817 heapifying large lists. 23818 23819- bpo-21800: imaplib now supports RFC 5161 (enable), RFC 6855 23820 (utf8/internationalized email) and automatically encodes non-ASCII 23821 usernames and passwords to UTF8. 23822 23823- bpo-20274: When calling a _sqlite.Connection, it now complains if passed 23824 any keyword arguments. Previously it silently ignored them. 23825 23826- bpo-20274: Remove ignored and erroneous "kwargs" parameters from three 23827 METH_VARARGS methods on _sqlite.Connection. 23828 23829- bpo-24134: assertRaises(), assertRaisesRegex(), assertWarns() and 23830 assertWarnsRegex() checks now emits a deprecation warning when callable is 23831 None or keyword arguments except msg is passed in the context manager 23832 mode. 23833 23834- bpo-24018: Add a collections.abc.Generator abstract base class. 23835 Contributed by Stefan Behnel. 23836 23837- bpo-23880: Tkinter's getint() and getdouble() now support Tcl_Obj. 23838 Tkinter's getdouble() now supports any numbers (in particular int). 23839 23840- bpo-22619: Added negative limit support in the traceback module. Based on 23841 patch by Dmitry Kazakov. 23842 23843- bpo-24094: Fix possible crash in json.encode with poorly behaved dict 23844 subclasses. 23845 23846- bpo-9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes. 23847 Patch written by William Orr. 23848 23849- bpo-17445: add difflib.diff_bytes() to support comparison of byte strings 23850 (fixes a regression from Python 2). 23851 23852- bpo-23917: Fall back to sequential compilation when ProcessPoolExecutor 23853 doesn't exist. Patch by Claudiu Popa. 23854 23855- bpo-23008: Fixed resolving attributes with boolean value is False in 23856 pydoc. 23857 23858- Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't increment 23859 unfinished tasks (this bug was introduced when JoinableQueue was merged 23860 with Queue). 23861 23862- bpo-23908: os functions now reject paths with embedded null character on 23863 Windows instead of silently truncating them. 23864 23865- bpo-23728: binascii.crc_hqx() could return an integer outside of the range 23866 0-0xffff for empty data. 23867 23868- bpo-23887: urllib.error.HTTPError now has a proper repr() representation. 23869 Patch by Berker Peksag. 23870 23871- asyncio: New event loop APIs: set_task_factory() and get_task_factory(). 23872 23873- asyncio: async() function is deprecated in favour of ensure_future(). 23874 23875- bpo-24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore 23876 support new 'async with' syntax. Contributed by Yury Selivanov. 23877 23878- bpo-24179: Support 'async for' for asyncio.StreamReader. Contributed by 23879 Yury Selivanov. 23880 23881- bpo-24184: Add AsyncIterator and AsyncIterable ABCs to collections.abc. 23882 Contributed by Yury Selivanov. 23883 23884- bpo-22547: Implement informative __repr__ for inspect.BoundArguments. 23885 Contributed by Yury Selivanov. 23886 23887- bpo-24190: Implement inspect.BoundArgument.apply_defaults() method. 23888 Contributed by Yury Selivanov. 23889 23890- bpo-20691: Add 'follow_wrapped' argument to 23891 inspect.Signature.from_callable() and inspect.signature(). Contributed by 23892 Yury Selivanov. 23893 23894- bpo-24248: Deprecate inspect.Signature.from_function() and 23895 inspect.Signature.from_builtin(). 23896 23897- bpo-23898: Fix inspect.classify_class_attrs() to support attributes with 23898 overloaded __eq__ and __bool__. Patch by Mike Bayer. 23899 23900- bpo-24298: Fix inspect.signature() to correctly unwrap wrappers around 23901 bound methods. 23902 23903IDLE 23904---- 23905 23906- bpo-23184: remove unused names and imports in idlelib. Initial patch by Al 23907 Sweigart. 23908 23909Tests 23910----- 23911 23912- bpo-21520: test_zipfile no longer fails if the word 'bad' appears anywhere 23913 in the name of the current directory. 23914 23915- bpo-9517: Move script_helper into the support package. Patch by Christie 23916 Wilson. 23917 23918Documentation 23919------------- 23920 23921- bpo-22155: Add File Handlers subsection with createfilehandler to tkinter 23922 doc. Remove obsolete example from FAQ. Patch by Martin Panter. 23923 23924- bpo-24029: Document the name binding behavior for submodule imports. 23925 23926- bpo-24077: Fix typo in man page for -I command option: -s, not -S 23927 23928Tools/Demos 23929----------- 23930 23931- bpo-24000: Improved Argument Clinic's mapping of converters to legacy 23932 "format units". Updated the documentation to match. 23933 23934- bpo-24001: Argument Clinic converters now use accept={type} instead of 23935 types={'type'} to specify the types the converter accepts. 23936 23937- bpo-23330: h2py now supports arbitrary filenames in #include. 23938 23939- bpo-24031: make patchcheck now supports git checkouts, too. 23940 23941 23942What's New in Python 3.5.0 alpha 4? 23943=================================== 23944 23945*Release date: 2015-04-19* 23946 23947Core and Builtins 23948----------------- 23949 23950- bpo-22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now 23951 include the architecture triplet in the extension name, to make it easy to 23952 test builds for different ABIs in the same working tree. Under OS X, the 23953 extension name now includes :pep:`3149`-style information. 23954 23955- bpo-22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. Patch 23956 courtesy of Joe Jevnik. 23957 23958- bpo-23731: Implement :pep:`488`: removal of .pyo files. 23959 23960- bpo-23726: Don't enable GC for user subclasses of non-GC types that don't 23961 add any new fields. Patch by Eugene Toder. 23962 23963- bpo-23309: Avoid a deadlock at shutdown if a daemon thread is aborted 23964 while it is holding a lock to a buffered I/O object, and the main thread 23965 tries to use the same I/O object (typically stdout or stderr). A fatal 23966 error is emitted instead. 23967 23968- bpo-22977: Fixed formatting Windows error messages on Wine. Patch by 23969 Martin Panter. 23970 23971- bpo-23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on 23972 non-integer input. 23973 23974- bpo-24044: Fix possible null pointer dereference in list.sort in out of 23975 memory conditions. 23976 23977- bpo-21354: PyCFunction_New function is exposed by python DLL again. 23978 23979Library 23980------- 23981 23982- bpo-23840: tokenize.open() now closes the temporary binary file on error 23983 to fix a resource warning. 23984 23985- bpo-16914: new debuglevel 2 in smtplib adds timestamps to debug output. 23986 23987- bpo-7159: urllib.request now supports sending auth credentials 23988 automatically after the first 401. This enhancement is a superset of the 23989 enhancement from issue #19494 and supersedes that change. 23990 23991- bpo-23703: Fix a regression in urljoin() introduced in 901e4e52b20a. Patch 23992 by Demian Brecht. 23993 23994- bpo-4254: Adds _curses.update_lines_cols(). Patch by Arnon Yaari 23995 23996- bpo-19933: Provide default argument for ndigits in round. Patch by 23997 Vajrasky Kok. 23998 23999- bpo-23193: Add a numeric_owner parameter to tarfile.TarFile.extract and 24000 tarfile.TarFile.extractall. Patch by Michael Vogt and Eric Smith. 24001 24002- bpo-23342: Add a subprocess.run() function than returns a CalledProcess 24003 instance for a more consistent API than the existing call* functions. 24004 24005- bpo-21217: inspect.getsourcelines() now tries to compute the start and end 24006 lines from the code object, fixing an issue when a lambda function is used 24007 as decorator argument. Patch by Thomas Ballinger and Allison Kaptur. 24008 24009- bpo-24521: Fix possible integer overflows in the pickle module. 24010 24011- bpo-22931: Allow '[' and ']' in cookie values. 24012 24013- The keywords attribute of functools.partial is now always a dictionary. 24014 24015- bpo-23811: Add missing newline to the PyCompileError error message. Patch 24016 by Alex Shkop. 24017 24018- bpo-21116: Avoid blowing memory when allocating a multiprocessing shared 24019 array that's larger than 50% of the available RAM. Patch by Médéric 24020 Boquien. 24021 24022- bpo-22982: Improve BOM handling when seeking to multiple positions of a 24023 writable text file. 24024 24025- bpo-23464: Removed deprecated asyncio JoinableQueue. 24026 24027- bpo-23529: Limit the size of decompressed data when reading from GzipFile, 24028 BZ2File or LZMAFile. This defeats denial of service attacks using 24029 compressed bombs (i.e. compressed payloads which decompress to a huge 24030 size). Patch by Martin Panter and Nikolaus Rath. 24031 24032- bpo-21859: Added Python implementation of io.FileIO. 24033 24034- bpo-23865: close() methods in multiple modules now are idempotent and more 24035 robust at shutdown. If they need to release multiple resources, all are 24036 released even if errors occur. 24037 24038- bpo-23400: Raise same exception on both Python 2 and 3 if sem_open is not 24039 available. Patch by Davin Potts. 24040 24041- bpo-10838: The subprocess now module includes SubprocessError and 24042 TimeoutError in its list of exported names for the users wild enough to 24043 use ``from subprocess import *``. 24044 24045- bpo-23411: Added DefragResult, ParseResult, SplitResult, 24046 DefragResultBytes, ParseResultBytes, and SplitResultBytes to 24047 urllib.parse.__all__. Patch by Martin Panter. 24048 24049- bpo-23881: urllib.request.ftpwrapper constructor now closes the socket if 24050 the FTP connection failed to fix a ResourceWarning. 24051 24052- bpo-23853: :meth:`socket.socket.sendall` does no more reset the socket 24053 timeout each time data is sent successfully. The socket timeout is now the 24054 maximum total duration to send all data. 24055 24056- bpo-22721: An order of multiline pprint output of set or dict containing 24057 orderable and non-orderable elements no longer depends on iteration order 24058 of set or dict. 24059 24060- bpo-15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always 24061 returns bool. tkinter.BooleanVar now validates input values (accepted 24062 bool, int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns 24063 bool. 24064 24065- bpo-10590: xml.sax.parseString() now supports string argument. 24066 24067- bpo-23338: Fixed formatting ctypes error messages on Cygwin. Patch by 24068 Makoto Kato. 24069 24070- bpo-15582: inspect.getdoc() now follows inheritance chains. 24071 24072- bpo-2175: SAX parsers now support a character stream of InputSource 24073 object. 24074 24075- bpo-16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and 24076 arbitrary precision integers added in Tcl 8.5. 24077 24078- bpo-23834: Fix socket.sendto(), use the C Py_ssize_t type to store the 24079 result of sendto() instead of the C int type. 24080 24081- bpo-23618: :meth:`socket.socket.connect` now waits until the connection 24082 completes instead of raising :exc:`InterruptedError` if the connection is 24083 interrupted by signals, signal handlers don't raise an exception and the 24084 socket is blocking or has a timeout. :meth:`socket.socket.connect` still 24085 raise :exc:`InterruptedError` for non-blocking sockets. 24086 24087- bpo-21526: Tkinter now supports new boolean type in Tcl 8.5. 24088 24089- bpo-23836: Fix the faulthandler module to handle reentrant calls to its 24090 signal handlers. 24091 24092- bpo-23838: linecache now clears the cache and returns an empty result on 24093 MemoryError. 24094 24095- bpo-10395: Added os.path.commonpath(). Implemented in posixpath and 24096 ntpath. Based on patch by Rafik Draoui. 24097 24098- bpo-23611: Serializing more "lookupable" objects (such as unbound methods 24099 or nested classes) now are supported with pickle protocols < 4. 24100 24101- bpo-13583: sqlite3.Row now supports slice indexing. 24102 24103- bpo-18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed 24104 ambiguous reverse mappings. Added many new mappings. Import mapping is 24105 no longer applied to modules already mapped with full name mapping. 24106 24107- bpo-23485: select.select() is now retried automatically with the 24108 recomputed timeout when interrupted by a signal, except if the signal 24109 handler raises an exception. This change is part of the :pep:`475`. 24110 24111- bpo-23752: When built from an existing file descriptor, io.FileIO() now 24112 only calls fstat() once. Before fstat() was called twice, which was not 24113 necessary. 24114 24115- bpo-23704: collections.deque() objects now support __add__, __mul__, and 24116 __imul__(). 24117 24118- bpo-23171: csv.Writer.writerow() now supports arbitrary iterables. 24119 24120- bpo-23745: The new email header parser now handles duplicate MIME 24121 parameter names without error, similar to how get_param behaves. 24122 24123- bpo-22117: Fix os.utime(), it now rounds the timestamp towards minus 24124 infinity (-inf) instead of rounding towards zero. 24125 24126- bpo-23310: Fix MagicMock's initializer to work with __methods__, just like 24127 configure_mock(). Patch by Kasia Jachim. 24128 24129Build 24130----- 24131 24132- bpo-23817: FreeBSD now uses "1.0" in the SOVERSION as other operating 24133 systems, instead of just "1". 24134 24135- bpo-23501: Argument Clinic now generates code into separate files by 24136 default. 24137 24138Tests 24139----- 24140 24141- bpo-23799: Added test.support.start_threads() for running and cleaning up 24142 multiple threads. 24143 24144- bpo-22390: test.regrtest now emits a warning if temporary files or 24145 directories are left after running a test. 24146 24147Tools/Demos 24148----------- 24149 24150- bpo-18128: pygettext now uses standard +NNNN format in the 24151 POT-Creation-Date header. 24152 24153- bpo-23935: Argument Clinic's understanding of format units accepting 24154 bytes, bytearrays, and buffers is now consistent with both the 24155 documentation and the implementation. 24156 24157- bpo-23944: Argument Clinic now wraps long impl prototypes at column 78. 24158 24159- bpo-20586: Argument Clinic now ensures that functions without docstrings 24160 have signatures. 24161 24162- bpo-23492: Argument Clinic now generates argument parsing code with 24163 PyArg_Parse instead of PyArg_ParseTuple if possible. 24164 24165- bpo-23500: Argument Clinic is now smarter about generating the "#ifndef" 24166 (empty) definition of the methoddef macro: it's only generated once, even 24167 if Argument Clinic processes the same symbol multiple times, and it's 24168 emitted at the end of all processing rather than immediately after the 24169 first use. 24170 24171C API 24172----- 24173 24174- bpo-23998: PyImport_ReInitLock() now checks for lock allocation error 24175 24176 24177What's New in Python 3.5.0 alpha 3? 24178=================================== 24179 24180*Release date: 2015-03-28* 24181 24182Core and Builtins 24183----------------- 24184 24185- bpo-23573: Increased performance of string search operations (str.find, 24186 str.index, str.count, the in operator, str.split, str.partition) with 24187 arguments of different kinds (UCS1, UCS2, UCS4). 24188 24189- bpo-23753: Python doesn't support anymore platforms without stat() or 24190 fstat(), these functions are always required. 24191 24192- bpo-23681: The -b option now affects comparisons of bytes with int. 24193 24194- bpo-23632: Memoryviews now allow tuple indexing (including for 24195 multi-dimensional memoryviews). 24196 24197- bpo-23192: Fixed generator lambdas. Patch by Bruno Cauet. 24198 24199- bpo-23629: Fix the default __sizeof__ implementation for variable-sized 24200 objects. 24201 24202Library 24203------- 24204 24205- bpo-14260: The groupindex attribute of regular expression pattern object 24206 now is non-modifiable mapping. 24207 24208- bpo-23792: Ignore KeyboardInterrupt when the pydoc pager is active. This 24209 mimics the behavior of the standard unix pagers, and prevents pipepager 24210 from shutting down while the pager itself is still running. 24211 24212- bpo-23775: pprint() of OrderedDict now outputs the same representation as 24213 repr(). 24214 24215- bpo-23765: Removed IsBadStringPtr calls in ctypes 24216 24217- bpo-22364: Improved some re error messages using regex for hints. 24218 24219- bpo-23742: ntpath.expandvars() no longer loses unbalanced single quotes. 24220 24221- bpo-21717: The zipfile.ZipFile.open function now supports 'x' (exclusive 24222 creation) mode. 24223 24224- bpo-21802: The reader in BufferedRWPair now is closed even when closing 24225 writer failed in BufferedRWPair.close(). 24226 24227- bpo-23622: Unknown escapes in regular expressions that consist of ``'\'`` 24228 and ASCII letter now raise a deprecation warning and will be forbidden in 24229 Python 3.6. 24230 24231- bpo-23671: string.Template now allows specifying the "self" parameter as a 24232 keyword argument. string.Formatter now allows specifying the "self" and 24233 the "format_string" parameters as keyword arguments. 24234 24235- bpo-23502: The pprint module now supports mapping proxies. 24236 24237- bpo-17530: pprint now wraps long bytes objects and bytearrays. 24238 24239- bpo-22687: Fixed some corner cases in breaking words in tetxtwrap. Got rid 24240 of quadratic complexity in breaking long words. 24241 24242- bpo-4727: The copy module now uses pickle protocol 4 (PEP 3154) and 24243 supports copying of instances of classes whose __new__ method takes 24244 keyword-only arguments. 24245 24246- bpo-23491: Added a zipapp module to support creating executable zip file 24247 archives of Python code. Registered ".pyz" and ".pyzw" extensions on 24248 Windows for these archives (PEP 441). 24249 24250- bpo-23657: Avoid explicit checks for str in zipapp, adding support for 24251 pathlib.Path objects as arguments. 24252 24253- bpo-23688: Added support of arbitrary bytes-like objects and avoided 24254 unnecessary copying of memoryview in gzip.GzipFile.write(). Original patch 24255 by Wolfgang Maier. 24256 24257- bpo-23252: Added support for writing ZIP files to unseekable streams. 24258 24259- bpo-23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. 24260 24261- bpo-23539: If body is None, http.client.HTTPConnection.request now sets 24262 Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors 24263 from some web servers. 24264 24265- bpo-22351: The nntplib.NNTP constructor no longer leaves the connection 24266 and socket open until the garbage collector cleans them up. Patch by 24267 Martin Panter. 24268 24269- bpo-23704: collections.deque() objects now support methods for index(), 24270 insert(), and copy(). This allows deques to be registered as a 24271 MutableSequence and it improves their substitutability for lists. 24272 24273- bpo-23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are 24274 now retried when interrupted by a signal not in the *sigset* parameter, if 24275 the signal handler does not raise an exception. signal.sigtimedwait() 24276 recomputes the timeout with a monotonic clock when it is retried. 24277 24278- bpo-23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and 24279 codecs, that accepted only read-only bytes-like object now accept writable 24280 bytes-like object too. 24281 24282- bpo-23646: If time.sleep() is interrupted by a signal, the sleep is now 24283 retried with the recomputed delay, except if the signal handler raises an 24284 exception (PEP 475). 24285 24286- bpo-23136: _strptime now uniformly handles all days in week 0, including 24287 Dec 30 of previous year. Based on patch by Jim Carroll. 24288 24289- bpo-23700: Iterator of NamedTemporaryFile now keeps a reference to 24290 NamedTemporaryFile instance. Patch by Bohuslav Kabrda. 24291 24292- bpo-22903: The fake test case created by unittest.loader when it fails 24293 importing a test module is now picklable. 24294 24295- bpo-22181: On Linux, os.urandom() now uses the new getrandom() syscall if 24296 available, syscall introduced in the Linux kernel 3.17. It is more 24297 reliable and more secure, because it avoids the need of a file descriptor 24298 and waits until the kernel has enough entropy. 24299 24300- bpo-2211: Updated the implementation of the http.cookies.Morsel class. 24301 Setting attributes key, value and coded_value directly now is deprecated. 24302 update() and setdefault() now transform and check keys. Comparing for 24303 equality now takes into account attributes key, value and coded_value. 24304 copy() now returns a Morsel, not a dict. repr() now contains all 24305 attributes. Optimized checking keys and quoting values. Added new tests. 24306 Original patch by Demian Brecht. 24307 24308- bpo-18983: Allow selection of output units in timeit. Patch by Julian 24309 Gindi. 24310 24311- bpo-23631: Fix traceback.format_list when a traceback has been mutated. 24312 24313- bpo-23568: Add rdivmod support to MagicMock() objects. Patch by Håkan 24314 Lövdahl. 24315 24316- bpo-2052: Add charset parameter to HtmlDiff.make_file(). 24317 24318- bpo-23668: Support os.truncate and os.ftruncate on Windows. 24319 24320- bpo-23138: Fixed parsing cookies with absent keys or values in cookiejar. 24321 Patch by Demian Brecht. 24322 24323- bpo-23051: multiprocessing.Pool methods imap() and imap_unordered() now 24324 handle exceptions raised by an iterator. Patch by Alon Diamant and Davin 24325 Potts. 24326 24327- bpo-23581: Add matmul support to MagicMock. Patch by Håkan Lövdahl. 24328 24329- bpo-23566: enable(), register(), dump_traceback() and 24330 dump_traceback_later() functions of faulthandler now accept file 24331 descriptors. Patch by Wei Wu. 24332 24333- bpo-22928: Disabled HTTP header injections in http.client. Original patch 24334 by Demian Brecht. 24335 24336- bpo-23615: Modules bz2, tarfile and tokenize now can be reloaded with 24337 imp.reload(). Patch by Thomas Kluyver. 24338 24339- bpo-23605: os.walk() now calls os.scandir() instead of os.listdir(). The 24340 usage of os.scandir() reduces the number of calls to os.stat(). Initial 24341 patch written by Ben Hoyt. 24342 24343Build 24344----- 24345 24346- bpo-23585: make patchcheck will ensure the interpreter is built. 24347 24348Tests 24349----- 24350 24351- bpo-23583: Added tests for standard IO streams in IDLE. 24352 24353- bpo-22289: Prevent test_urllib2net failures due to ftp connection timeout. 24354 24355Tools/Demos 24356----------- 24357 24358- bpo-22826: The result of open() in Tools/freeze/bkfile.py is now better 24359 compatible with regular files (in particular it now supports the context 24360 management protocol). 24361 24362 24363What's New in Python 3.5.0 alpha 2? 24364=================================== 24365 24366*Release date: 2015-03-09* 24367 24368Core and Builtins 24369----------------- 24370 24371- bpo-23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError 24372 if a function returns a result and raises an exception. The SystemError is 24373 chained to the previous exception. 24374 24375Library 24376------- 24377 24378- bpo-22524: New os.scandir() function, part of the :pep:`471`: 24379 "os.scandir() function -- a better and faster directory iterator". Patch 24380 written by Ben Hoyt. 24381 24382- bpo-23103: Reduced the memory consumption of IPv4Address and IPv6Address. 24383 24384- bpo-21793: BaseHTTPRequestHandler again logs response code as numeric, not 24385 as stringified enum. Patch by Demian Brecht. 24386 24387- bpo-23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST 24388 flag on certificate stores when it is available. 24389 24390- bpo-23576: Avoid stalling in SSL reads when EOF has been reached in the 24391 SSL layer but the underlying connection hasn't been closed. 24392 24393- bpo-23504: Added an __all__ to the types module. 24394 24395- bpo-23563: Optimized utility functions in urllib.parse. 24396 24397- bpo-7830: Flatten nested functools.partial. 24398 24399- bpo-20204: Added the __module__ attribute to _tkinter classes. 24400 24401- bpo-19980: Improved help() for non-recognized strings. help('') now shows 24402 the help on str. help('help') now shows the help on help(). Original 24403 patch by Mark Lawrence. 24404 24405- bpo-23521: Corrected pure python implementation of timedelta division. 24406 Eliminated OverflowError from ``timedelta * float`` for some floats; 24407 Corrected rounding in timedelta true division. 24408 24409- bpo-21619: Popen objects no longer leave a zombie after exit in the with 24410 statement if the pipe was broken. Patch by Martin Panter. 24411 24412- bpo-22936: Make it possible to show local variables in tracebacks for both 24413 the traceback module and unittest. 24414 24415- bpo-15955: Add an option to limit the output size in bz2.decompress(). 24416 Patch by Nikolaus Rath. 24417 24418- bpo-6639: Module-level turtle functions no longer raise TclError after 24419 closing the window. 24420 24421- bpo-814253: Group references and conditional group references now work in 24422 lookbehind assertions in regular expressions. (See also: bpo-9179) 24423 24424- bpo-23215: Multibyte codecs with custom error handlers that ignores errors 24425 consumed too much memory and raised SystemError or MemoryError. Original 24426 patch by Aleksi Torhamo. 24427 24428- bpo-5700: io.FileIO() called flush() after closing the file. flush() was 24429 not called in close() if closefd=False. 24430 24431- bpo-23374: Fixed pydoc failure with non-ASCII files when stdout encoding 24432 differs from file system encoding (e.g. on Mac OS). 24433 24434- bpo-23481: Remove RC4 from the SSL module's default cipher list. 24435 24436- bpo-21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty 24437 docstrings. 24438 24439- bpo-22885: Fixed arbitrary code execution vulnerability in the dbm.dumb 24440 module. Original patch by Claudiu Popa. 24441 24442- bpo-23239: ssl.match_hostname() now supports matching of IP addresses. 24443 24444- bpo-23146: Fix mishandling of absolute Windows paths with forward slashes 24445 in pathlib. 24446 24447- bpo-23096: Pickle representation of floats with protocol 0 now is the same 24448 for both Python and C implementations. 24449 24450- bpo-19105: pprint now more efficiently uses free space at the right. 24451 24452- bpo-14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by 24453 Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson. 24454 24455- bpo-21717: tarfile.open() now supports 'x' (exclusive creation) mode. 24456 24457- bpo-23344: marshal.dumps() is now 20-25% faster on average. 24458 24459- bpo-20416: marshal.dumps() with protocols 3 and 4 is now 40-50% faster on 24460 average. 24461 24462- bpo-23421: Fixed compression in tarfile CLI. Patch by wdv4758h. 24463 24464- bpo-23367: Fix possible overflows in the unicodedata module. 24465 24466- bpo-23361: Fix possible overflow in Windows subprocess creation code. 24467 24468- logging.handlers.QueueListener now takes a respect_handler_level keyword 24469 argument which, if set to True, will pass messages to handlers taking 24470 handler levels into account. 24471 24472- bpo-19705: turtledemo now has a visual sorting algorithm demo. Original 24473 patch from Jason Yeo. 24474 24475- bpo-23801: Fix issue where cgi.FieldStorage did not always ignore the 24476 entire preamble to a multipart body. 24477 24478Build 24479----- 24480 24481- bpo-23445: pydebug builds now use "gcc -Og" where possible, to make the 24482 resulting executable faster. 24483 24484- bpo-23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a. 24485 24486C API 24487----- 24488 24489- bpo-20204: Deprecation warning is now raised for builtin types without the 24490 __module__ attribute. 24491 24492Windows 24493------- 24494 24495- bpo-23465: Implement :pep:`486` - Make the Python Launcher aware of 24496 virtual environments. Patch by Paul Moore. 24497 24498- bpo-23437: Make user scripts directory versioned on Windows. Patch by Paul 24499 Moore. 24500 24501 24502What's New in Python 3.5.0 alpha 1? 24503=================================== 24504 24505*Release date: 2015-02-08* 24506 24507Core and Builtins 24508----------------- 24509 24510- bpo-23285: PEP 475 - EINTR handling. 24511 24512- bpo-22735: Fix many edge cases (including crashes) involving custom mro() 24513 implementations. 24514 24515- bpo-22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer() 24516 and PyObject_AsWriteBuffer(). 24517 24518- bpo-21295: Revert some changes (issue #16795) to AST line numbers and 24519 column offsets that constituted a regression. 24520 24521- bpo-22986: Allow changing an object's __class__ between a dynamic type and 24522 static type in some cases. 24523 24524- bpo-15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and 24525 PyUnicode_EncodeCodePage() now raise an exception if the object is not a 24526 Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case 24527 on platforms other than Windows. Patch written by Campbell Barton. 24528 24529- bpo-21408: The default __ne__() now returns NotImplemented if __eq__() 24530 returned NotImplemented. Original patch by Martin Panter. 24531 24532- bpo-23321: Fixed a crash in str.decode() when error handler returned 24533 replacement string longer than malformed input data. 24534 24535- bpo-22286: The "backslashreplace" error handlers now works with decoding 24536 and translating. 24537 24538- bpo-23253: Delay-load ShellExecute[AW] in os.startfile for reduced startup 24539 overhead on Windows. 24540 24541- bpo-22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for 24542 atomic memory access if available. Patch written by Vitor de Lima and 24543 Gustavo Temple. 24544 24545- bpo-20284: %-interpolation (aka printf) formatting added for bytes and 24546 bytearray. 24547 24548- bpo-23048: Fix jumping out of an infinite while loop in the pdb. 24549 24550- bpo-20335: bytes constructor now raises TypeError when encoding or errors 24551 is specified with non-string argument. Based on patch by Renaud Blanch. 24552 24553- bpo-22834: If the current working directory ends up being set to a 24554 non-existent directory then import will no longer raise FileNotFoundError. 24555 24556- bpo-22869: Move the interpreter startup & shutdown code to a new dedicated 24557 pylifecycle.c module 24558 24559- bpo-22847: Improve method cache efficiency. 24560 24561- bpo-22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff 24562 bytes on a 32-bit platform. 24563 24564- bpo-22653: Fix an assertion failure in debug mode when doing a reentrant 24565 dict insertion in debug mode. 24566 24567- bpo-22643: Fix integer overflow in Unicode case operations (upper, lower, 24568 title, swapcase, casefold). 24569 24570- bpo-17636: Circular imports involving relative imports are now supported. 24571 24572- bpo-22604: Fix assertion error in debug mode when dividing a complex 24573 number by (nan+0j). 24574 24575- bpo-21052: Do not raise ImportWarning when sys.path_hooks or sys.meta_path 24576 are set to None. 24577 24578- bpo-16518: Use 'bytes-like object required' in error messages that 24579 previously used the far more cryptic "'x' does not support the buffer 24580 protocol. 24581 24582- bpo-22470: Fixed integer overflow issues in "backslashreplace", 24583 "xmlcharrefreplace", and "surrogatepass" error handlers. 24584 24585- bpo-22540: speed up `PyObject_IsInstance` and `PyObject_IsSubclass` in the 24586 common case that the second argument has metaclass `type`. 24587 24588- bpo-18711: Add a new `PyErr_FormatV` function, similar to `PyErr_Format` 24589 but accepting a `va_list` argument. 24590 24591- bpo-22520: Fix overflow checking when generating the repr of a unicode 24592 object. 24593 24594- bpo-22519: Fix overflow checking in PyBytes_Repr. 24595 24596- bpo-22518: Fix integer overflow issues in latin-1 encoding. 24597 24598- bpo-16324: _charset parameter of MIMEText now also accepts 24599 email.charset.Charset instances. Initial patch by Claude Paroz. 24600 24601- bpo-1764286: Fix inspect.getsource() to support decorated functions. Patch 24602 by Claudiu Popa. 24603 24604- bpo-18554: os.__all__ includes posix functions. 24605 24606- bpo-21391: Use os.path.abspath in the shutil module. 24607 24608- bpo-11471: avoid generating a JUMP_FORWARD instruction at the end of an 24609 if-block if there is no else-clause. Original patch by Eugene Toder. 24610 24611- bpo-22215: Now ValueError is raised instead of TypeError when str or bytes 24612 argument contains not permitted null character or byte. 24613 24614- bpo-22258: Fix the internal function set_inheritable() on Illumos. This 24615 platform exposes the function ``ioctl(FIOCLEX)``, but calling it fails 24616 with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable() 24617 now falls back to the slower ``fcntl()`` (``F_GETFD`` and then 24618 ``F_SETFD``). 24619 24620- bpo-21389: Displaying the __qualname__ of the underlying function in the 24621 repr of a bound method. 24622 24623- bpo-22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM 24624 and returns -1 (error) on integer overflow. 24625 24626- bpo-20184: Argument Clinic based signature introspection added for 30 of 24627 the builtin functions. 24628 24629- bpo-22116: C functions and methods (of the 'builtin_function_or_method' 24630 type) can now be weakref'ed. Patch by Wei Wu. 24631 24632- bpo-22077: Improve index error messages for bytearrays, bytes, lists, and 24633 tuples by adding 'or slices'. Added ', not <typename>' for bytearrays. 24634 Original patch by Claudiu Popa. 24635 24636- bpo-20179: Apply Argument Clinic to bytes and bytearray. Patch by Tal 24637 Einat. 24638 24639- bpo-22082: Clear interned strings in slotdefs. 24640 24641- Upgrade Unicode database to Unicode 7.0.0. 24642 24643- bpo-21897: Fix a crash with the f_locals attribute with closure variables 24644 when frame.clear() has been called. 24645 24646- bpo-21205: Add a new ``__qualname__`` attribute to generator, the 24647 qualified name, and use it in the representation of a generator 24648 (``repr(gen)``). The default name of the generator (``__name__`` 24649 attribute) is now get from the function instead of the code. Use 24650 ``gen.gi_code.co_name`` to get the name of the code. 24651 24652- bpo-21669: With the aid of heuristics in SyntaxError.__init__, the parser 24653 now attempts to generate more meaningful (or at least more search engine 24654 friendly) error messages when "exec" and "print" are used as statements. 24655 24656- bpo-21642: In the conditional if-else expression, allow an integer written 24657 with no space between itself and the ``else`` keyword (e.g. ``True if 24658 42else False``) to be valid syntax. 24659 24660- bpo-21523: Fix over-pessimistic computation of the stack effect of some 24661 opcodes in the compiler. This also fixes a quadratic compilation time 24662 issue noticeable when compiling code with a large number of "and" and "or" 24663 operators. 24664 24665- bpo-21418: Fix a crash in the builtin function super() when called without 24666 argument and without current frame (ex: embedded Python). 24667 24668- bpo-21425: Fix flushing of standard streams in the interactive 24669 interpreter. 24670 24671- bpo-21435: In rare cases, when running finalizers on objects in cyclic 24672 trash a bad pointer dereference could occur due to a subtle flaw in 24673 internal iteration logic. 24674 24675- bpo-21377: PyBytes_Concat() now tries to concatenate in-place when the 24676 first argument has a reference count of 1. Patch by Nikolaus Rath. 24677 24678- bpo-20355: -W command line options now have higher priority than the 24679 PYTHONWARNINGS environment variable. Patch by Arfrever. 24680 24681- bpo-21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c. 24682 24683- bpo-20904: Support setting FPU precision on m68k. 24684 24685- bpo-21209: Fix sending tuples to custom generator objects with the yield 24686 from syntax. 24687 24688- bpo-21193: pow(a, b, c) now raises ValueError rather than TypeError when b 24689 is negative. Patch by Josh Rosenberg. 24690 24691- bpo-21176: PEP 465: Add the '@' operator for matrix multiplication. 24692 24693- bpo-21134: Fix segfault when str is called on an uninitialized 24694 UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object. 24695 24696- bpo-19537: Fix PyUnicode_DATA() alignment under m68k. Patch by Andreas 24697 Schwab. 24698 24699- bpo-20929: Add a type cast to avoid shifting a negative number. 24700 24701- bpo-20731: Properly position in source code files even if they are opened 24702 in text mode. Patch by Serhiy Storchaka. 24703 24704- bpo-20637: Key-sharing now also works for instance dictionaries of 24705 subclasses. Patch by Peter Ingebretson. 24706 24707- bpo-8297: Attributes missing from modules now include the module name in 24708 the error text. Original patch by ysj.ray. 24709 24710- bpo-19995: %c, %o, %x, and %X now raise TypeError on non-integer input. 24711 24712- bpo-19655: The ASDL parser - used by the build process to generate code 24713 for managing the Python AST in C - was rewritten. The new parser is self 24714 contained and does not require to carry long the spark.py parser-generator 24715 library; spark.py was removed from the source base. 24716 24717- bpo-12546: Allow ``\x00`` to be used as a fill character when using str, 24718 int, float, and complex __format__ methods. 24719 24720- bpo-20480: Add ipaddress.reverse_pointer. Patch by Leon Weber. 24721 24722- bpo-13598: Modify string.Formatter to support auto-numbering of 24723 replacement fields. It now matches the behavior of str.format() in this 24724 regard. Patches by Phil Elson and Ramchandra Apte. 24725 24726- bpo-8931: Make alternate formatting ('#') for type 'c' raise an exception. 24727 In versions prior to 3.5, '#' with 'c' had no effect. Now specifying it is 24728 an error. Patch by Torsten Landschoff. 24729 24730- bpo-23165: Perform overflow checks before allocating memory in the 24731 _Py_char2wchar function. 24732 24733Library 24734------- 24735 24736- bpo-23399: pyvenv creates relative symlinks where possible. 24737 24738- bpo-20289: cgi.FieldStorage() now supports the context management 24739 protocol. 24740 24741- bpo-13128: Print response headers for CONNECT requests when debuglevel > 24742 0. Patch by Demian Brecht. 24743 24744- bpo-15381: Optimized io.BytesIO to make less allocations and copyings. 24745 24746- bpo-22818: Splitting on a pattern that could match an empty string now 24747 raises a warning. Patterns that can only match empty strings are now 24748 rejected. 24749 24750- bpo-23099: Closing io.BytesIO with exported buffer is rejected now to 24751 prevent corrupting exported buffer. 24752 24753- bpo-23326: Removed __ne__ implementations. Since fixing default __ne__ 24754 implementation in issue #21408 they are redundant. 24755 24756- bpo-23363: Fix possible overflow in itertools.permutations. 24757 24758- bpo-23364: Fix possible overflow in itertools.product. 24759 24760- bpo-23366: Fixed possible integer overflow in itertools.combinations. 24761 24762- bpo-23369: Fixed possible integer overflow in 24763 _json.encode_basestring_ascii. 24764 24765- bpo-23353: Fix the exception handling of generators in 24766 PyEval_EvalFrameEx(). At entry, save or swap the exception state even if 24767 PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception 24768 state is now always restored or swapped, not only if why is WHY_YIELD or 24769 WHY_RETURN. Patch co-written with Antoine Pitrou. 24770 24771- bpo-14099: Restored support of writing ZIP files to tellable but 24772 non-seekable streams. 24773 24774- bpo-14099: Writing to ZipFile and reading multiple ZipExtFiles is 24775 threadsafe now. 24776 24777- bpo-19361: JSON decoder now raises JSONDecodeError instead of ValueError. 24778 24779- bpo-18518: timeit now rejects statements which can't be compiled outside a 24780 function or a loop (e.g. "return" or "break"). 24781 24782- bpo-23094: Fixed readline with frames in Python implementation of pickle. 24783 24784- bpo-23268: Fixed bugs in the comparison of ipaddress classes. 24785 24786- bpo-21408: Removed incorrect implementations of __ne__() which didn't 24787 returned NotImplemented if __eq__() returned NotImplemented. The default 24788 __ne__() now works correctly. 24789 24790- bpo-19996: :class:`email.feedparser.FeedParser` now handles (malformed) 24791 headers with no key rather than assuming the body has started. 24792 24793- bpo-20188: Support Application-Layer Protocol Negotiation (ALPN) in the 24794 ssl module. 24795 24796- bpo-23133: Pickling of ipaddress objects now produces more compact and 24797 portable representation. 24798 24799- bpo-23248: Update ssl error codes from latest OpenSSL git master. 24800 24801- bpo-23266: Much faster implementation of ipaddress.collapse_addresses() 24802 when there are many non-consecutive addresses. 24803 24804- bpo-23098: 64-bit dev_t is now supported in the os module. 24805 24806- bpo-21817: When an exception is raised in a task submitted to a 24807 ProcessPoolExecutor, the remote traceback is now displayed in the parent 24808 process. Patch by Claudiu Popa. 24809 24810- bpo-15955: Add an option to limit output size when decompressing LZMA 24811 data. Patch by Nikolaus Rath and Martin Panter. 24812 24813- bpo-23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" 24814 as they are written in the standard. 24815 24816- bpo-23063: In the distutils' check command, fix parsing of reST with code 24817 or code-block directives. 24818 24819- bpo-23209: selectors.BaseSelector.get_key() now raises a RuntimeError if 24820 the selector is closed. And selectors.BaseSelector.close() now clears its 24821 internal reference to the selector mapping to break a reference cycle. 24822 Initial patch written by Martin Richard. (See also: bpo-23225) 24823 24824- bpo-17911: Provide a way to seed the linecache for a PEP-302 module 24825 without actually loading the code. 24826 24827- bpo-17911: Provide a new object API for traceback, including the ability 24828 to not lookup lines at all until the traceback is actually rendered, 24829 without any trace of the original objects being kept alive. 24830 24831- bpo-19777: Provide a home() classmethod on Path objects. Contributed by 24832 Victor Salgado and Mayank Tripathi. 24833 24834- bpo-23206: Make ``json.dumps(..., ensure_ascii=False)`` as fast as the 24835 default case of ``ensure_ascii=True``. Patch by Naoki Inada. 24836 24837- bpo-23185: Add math.inf and math.nan constants. 24838 24839- bpo-23186: Add ssl.SSLObject.shared_ciphers() and 24840 ssl.SSLSocket.shared_ciphers() to fetch the client's list ciphers sent at 24841 handshake. 24842 24843- bpo-23143: Remove compatibility with OpenSSLs older than 0.9.8. 24844 24845- bpo-23132: Improve performance and introspection support of comparison 24846 methods created by functool.total_ordering. 24847 24848- bpo-19776: Add an expanduser() method on Path objects. 24849 24850- bpo-23112: Fix SimpleHTTPServer to correctly carry the query string and 24851 fragment when it redirects to add a trailing slash. 24852 24853- bpo-21793: Added http.HTTPStatus enums (i.e. HTTPStatus.OK, 24854 HTTPStatus.NOT_FOUND). Patch by Demian Brecht. 24855 24856- bpo-23093: In the io, module allow more operations to work on detached 24857 streams. 24858 24859- bpo-23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol 24860 version. 24861 24862- bpo-22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(), 24863 instead of reading /dev/urandom, to get pseudo-random bytes. 24864 24865- bpo-19104: pprint now produces evaluable output for wrapped strings. 24866 24867- bpo-23071: Added missing names to codecs.__all__. Patch by Martin Panter. 24868 24869- bpo-22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX 24870 opcode if possible. 24871 24872- bpo-15513: Added a __sizeof__ implementation for pickle classes. 24873 24874- bpo-19858: pickletools.optimize() now aware of the MEMOIZE opcode, can 24875 produce more compact result and no longer produces invalid output if input 24876 data contains MEMOIZE opcodes together with PUT or BINPUT opcodes. 24877 24878- bpo-22095: Fixed HTTPConnection.set_tunnel with default port. The port 24879 value in the host header was set to "None". Patch by Demian Brecht. 24880 24881- bpo-23016: A warning no longer produces an AttributeError when the program 24882 is run with pythonw.exe. 24883 24884- bpo-21775: shutil.copytree(): fix crash when copying to VFAT. An exception 24885 handler assumed that OSError objects always have a 'winerror' attribute. 24886 That is not the case, so the exception handler itself raised 24887 AttributeError when run on Linux (and, presumably, any other non-Windows 24888 OS). Patch by Greg Ward. 24889 24890- bpo-1218234: Fix inspect.getsource() to load updated source of reloaded 24891 module. Initial patch by Berker Peksag. 24892 24893- bpo-21740: Support wrapped callables in doctest. Patch by Claudiu Popa. 24894 24895- bpo-23009: Make sure selectors.EpollSelector.select() works when no FD is 24896 registered. 24897 24898- bpo-22959: In the constructor of http.client.HTTPSConnection, prefer the 24899 context's check_hostname attribute over the *check_hostname* parameter. 24900 24901- bpo-22696: Add function :func:`sys.is_finalizing` to know about 24902 interpreter shutdown. 24903 24904- bpo-16043: Add a default limit for the amount of data 24905 xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753. 24906 24907- bpo-14099: ZipFile.open() no longer reopen the underlying file. Objects 24908 returned by ZipFile.open() can now operate independently of the ZipFile 24909 even if the ZipFile was created by passing in a file-like object as the 24910 first argument to the constructor. 24911 24912- bpo-22966: Fix __pycache__ pyc file name clobber when pyc_compile is asked 24913 to compile a source file containing multiple dots in the source file name. 24914 24915- bpo-21971: Update turtledemo doc and add module to the index. 24916 24917- bpo-21032: Fixed socket leak if HTTPConnection.getresponse() fails. 24918 Original patch by Martin Panter. 24919 24920- bpo-22407: Deprecated the use of re.LOCALE flag with str patterns or 24921 re.ASCII. It was newer worked. 24922 24923- bpo-22902: The "ip" command is now used on Linux to determine MAC address 24924 in uuid.getnode(). Pach by Bruno Cauet. 24925 24926- bpo-22960: Add a context argument to xmlrpclib.ServerProxy constructor. 24927 24928- bpo-22389: Add contextlib.redirect_stderr(). 24929 24930- bpo-21356: Make ssl.RAND_egd() optional to support LibreSSL. The 24931 availability of the function is checked during the compilation. Patch 24932 written by Bernard Spil. 24933 24934- bpo-22915: SAX parser now supports files opened with file descriptor or 24935 bytes path. 24936 24937- bpo-22609: Constructors and update methods of mapping classes in the 24938 collections module now accept the self keyword argument. 24939 24940- bpo-22940: Add readline.append_history_file. 24941 24942- bpo-19676: Added the "namereplace" error handler. 24943 24944- bpo-22788: Add *context* parameter to logging.handlers.HTTPHandler. 24945 24946- bpo-22921: Allow SSLContext to take the *hostname* parameter even if 24947 OpenSSL doesn't support SNI. 24948 24949- bpo-22894: TestCase.subTest() would cause the test suite to be stopped 24950 when in failfast mode, even in the absence of failures. 24951 24952- bpo-22796: HTTP cookie parsing is now stricter, in order to protect 24953 against potential injection attacks. 24954 24955- bpo-22370: Windows detection in pathlib is now more robust. 24956 24957- bpo-22841: Reject coroutines in asyncio add_signal_handler(). Patch by 24958 Ludovic.Gasc. 24959 24960- bpo-19494: Added urllib.request.HTTPBasicPriorAuthHandler. Patch by Matej 24961 Cepl. 24962 24963- bpo-22578: Added attributes to the re.error class. 24964 24965- bpo-22849: Fix possible double free in the io.TextIOWrapper constructor. 24966 24967- bpo-12728: Different Unicode characters having the same uppercase but 24968 different lowercase are now matched in case-insensitive regular 24969 expressions. 24970 24971- bpo-22821: Fixed fcntl() with integer argument on 64-bit big-endian 24972 platforms. 24973 24974- bpo-21650: Add an `--sort-keys` option to json.tool CLI. 24975 24976- bpo-22824: Updated reprlib output format for sets to use set literals. 24977 Patch contributed by Berker Peksag. 24978 24979- bpo-22824: Updated reprlib output format for arrays to display empty 24980 arrays without an unnecessary empty list. Suggested by Serhiy Storchaka. 24981 24982- bpo-22406: Fixed the uu_codec codec incorrectly ported to 3.x. Based on 24983 patch by Martin Panter. 24984 24985- bpo-17293: uuid.getnode() now determines MAC address on AIX using netstat. 24986 Based on patch by Aivars Kalvāns. 24987 24988- bpo-22769: Fixed ttk.Treeview.tag_has() when called without arguments. 24989 24990- bpo-22417: Verify certificates by default in httplib (PEP 476). 24991 24992- bpo-22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2 24993 and above. Patch by Tim Graham. 24994 24995- bpo-22776: Brought excluded code into the scope of a try block in 24996 SysLogHandler.emit(). 24997 24998- bpo-22665: Add missing get_terminal_size and SameFileError to 24999 shutil.__all__. 25000 25001- bpo-6623: Remove deprecated Netrc class in the ftplib module. Patch by 25002 Matt Chaput. 25003 25004- bpo-17381: Fixed handling of case-insensitive ranges in regular 25005 expressions. 25006 25007- bpo-22410: Module level functions in the re module now cache compiled 25008 locale-dependent regular expressions taking into account the locale. 25009 25010- bpo-22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.) now 25011 return False when the underlying stat call raises NotADirectoryError. 25012 25013- bpo-8876: distutils now falls back to copying files when hard linking 25014 doesn't work. This allows use with special filesystems such as VirtualBox 25015 shared folders. 25016 25017- bpo-22217: Implemented reprs of classes in the zipfile module. 25018 25019- bpo-22457: Honour load_tests in the start_dir of discovery. 25020 25021- bpo-18216: gettext now raises an error when a .mo file has an unsupported 25022 major version number. Patch by Aaron Hill. 25023 25024- bpo-13918: Provide a locale.delocalize() function which can remove 25025 locale-specific number formatting from a string representing a number, 25026 without then converting it to a specific type. Patch by Cédric Krier. 25027 25028- bpo-22676: Make the pickling of global objects which don't have a 25029 __module__ attribute less slow. 25030 25031- bpo-18853: Fixed ResourceWarning in shlex.__nain__. 25032 25033- bpo-9351: Defaults set with set_defaults on an argparse subparser are no 25034 longer ignored when also set on the parent parser. 25035 25036- bpo-7559: unittest test loading ImportErrors are reported as import errors 25037 with their import exception rather than as attribute errors after the 25038 import has already failed. 25039 25040- bpo-19746: Make it possible to examine the errors from unittest discovery 25041 without executing the test suite. The new `errors` attribute on TestLoader 25042 exposes these non-fatal errors encountered during discovery. 25043 25044- bpo-21991: Make email.headerregistry's header 'params' attributes be 25045 read-only (MappingProxyType). Previously the dictionary was modifiable 25046 but a new one was created on each access of the attribute. 25047 25048- bpo-22638: SSLv3 is now disabled throughout the standard library. It can 25049 still be enabled by instantiating a SSLContext manually. 25050 25051- bpo-22641: In asyncio, the default SSL context for client connections is 25052 now created using ssl.create_default_context(), for stronger security. 25053 25054- bpo-17401: Include closefd in io.FileIO repr. 25055 25056- bpo-21338: Add silent mode for compileall. quiet parameters of 25057 compile_{dir, file, path} functions now have a multilevel value. Also, -q 25058 option of the CLI now have a multilevel value. Patch by Thomas Kluyver. 25059 25060- bpo-20152: Convert the array and cmath modules to Argument Clinic. 25061 25062- bpo-18643: Add socket.socketpair() on Windows. 25063 25064- bpo-22435: Fix a file descriptor leak when socketserver bind fails. 25065 25066- bpo-13096: Fixed segfault in CTypes POINTER handling of large values. 25067 25068- bpo-11694: Raise ConversionError in xdrlib as documented. Patch by Filip 25069 Gruszczyński and Claudiu Popa. 25070 25071- bpo-19380: Optimized parsing of regular expressions. 25072 25073- bpo-1519638: Now unmatched groups are replaced with empty strings in 25074 re.sub() and re.subn(). 25075 25076- bpo-18615: sndhdr.what/whathdr now return a namedtuple. 25077 25078- bpo-22462: Fix pyexpat's creation of a dummy frame to make it appear in 25079 exception tracebacks. 25080 25081- bpo-21965: Add support for in-memory SSL to the ssl module. Patch by 25082 Geert Jansen. 25083 25084- bpo-21173: Fix len() on a WeakKeyDictionary when .clear() was called with 25085 an iterator alive. 25086 25087- bpo-11866: Eliminated race condition in the computation of names for new 25088 threads. 25089 25090- bpo-21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is 25091 mutated while iterating. Patch by Olivier Grisel. 25092 25093- bpo-11271: concurrent.futures.Executor.map() now takes a *chunksize* 25094 argument to allow batching of tasks in child processes and improve 25095 performance of ProcessPoolExecutor. Patch by Dan O'Reilly. 25096 25097- bpo-21883: os.path.join() and os.path.relpath() now raise a TypeError with 25098 more helpful error message for unsupported or mismatched types of 25099 arguments. 25100 25101- bpo-22219: The zipfile module CLI now adds entries for directories 25102 (including empty directories) in ZIP file. 25103 25104- bpo-22449: In the ssl.SSLContext.load_default_certs, consult the 25105 environmental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows. 25106 25107- bpo-22508: The email.__version__ variable has been removed; the email code 25108 is no longer shipped separately from the stdlib, and __version__ hasn't 25109 been updated in several releases. 25110 25111- bpo-20076: Added non derived UTF-8 aliases to locale aliases table. 25112 25113- bpo-20079: Added locales supported in glibc 2.18 to locale alias table. 25114 25115- bpo-20218: Added convenience methods read_text/write_text and read_bytes/ 25116 write_bytes to pathlib.Path objects. 25117 25118- bpo-22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor 25119 os.posix_fallocate() because their prototypes in system headers are wrong. 25120 25121- bpo-22517: When an io.BufferedRWPair object is deallocated, clear its 25122 weakrefs. 25123 25124- bpo-22437: Number of capturing groups in regular expression is no longer 25125 limited by 100. 25126 25127- bpo-17442: InteractiveInterpreter now displays the full chained traceback 25128 in its showtraceback method, to match the built in interactive 25129 interpreter. 25130 25131- bpo-23392: Added tests for marshal C API that works with FILE*. 25132 25133- bpo-10510: distutils register and upload methods now use HTML standards 25134 compliant CRLF line endings. 25135 25136- bpo-9850: Fixed macpath.join() for empty first component. Patch by Oleg 25137 Oshmyan. 25138 25139- bpo-5309: distutils' build and build_ext commands now accept a ``-j`` 25140 option to enable parallel building of extension modules. 25141 25142- bpo-22448: Improve canceled timer handles cleanup to prevent unbound 25143 memory usage. Patch by Joshua Moore-Oliva. 25144 25145- bpo-22427: TemporaryDirectory no longer attempts to clean up twice when 25146 used in the with statement in generator. 25147 25148- bpo-22362: Forbidden ambiguous octal escapes out of range 0-0o377 in 25149 regular expressions. 25150 25151- bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS 25152 directory attributes. 25153 25154- bpo-21866: ZipFile.close() no longer writes ZIP64 central directory 25155 records if allowZip64 is false. 25156 25157- bpo-22278: Fix urljoin problem with relative urls, a regression observed 25158 after changes to issue22118 were submitted. 25159 25160- bpo-22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re 25161 module. Removed trailing spaces in debugging output. 25162 25163- bpo-22423: Unhandled exception in thread no longer causes unhandled 25164 AttributeError when sys.stderr is None. 25165 25166- bpo-21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line 25167 buffering, rather than block buffering. Patch by Akira Li. 25168 25169- bpo-21091: Fix API bug: email.message.EmailMessage.is_attachment is now a 25170 method. 25171 25172- bpo-21079: Fix email.message.EmailMessage.is_attachment to return the 25173 correct result when the header has parameters as well as a value. 25174 25175- bpo-22247: Add NNTPError to nntplib.__all__. 25176 25177- bpo-22366: urllib.request.urlopen will accept a context object 25178 (SSLContext) as an argument which will then be used for HTTPS connection. 25179 Patch by Alex Gaynor. 25180 25181- bpo-4180: The warnings registries are now reset when the filters are 25182 modified. 25183 25184- bpo-22419: Limit the length of incoming HTTP request in wsgiref server to 25185 65536 bytes and send a 414 error code for higher lengths. Patch 25186 contributed by Devin Cook. 25187 25188- Lax cookie parsing in http.cookies could be a security issue when combined 25189 with non-standard cookie handling in some Web browsers. Reported by 25190 Sergey Bobrov. 25191 25192- bpo-20537: logging methods now accept an exception instance as well as a 25193 Boolean value or exception tuple. Thanks to Yury Selivanov for the patch. 25194 25195- bpo-22384: An exception in Tkinter callback no longer crashes the program 25196 when it is run with pythonw.exe. 25197 25198- bpo-22168: Prevent turtle AttributeError with non-default Canvas on OS X. 25199 25200- bpo-21147: sqlite3 now raises an exception if the request contains a null 25201 character instead of truncating it. Based on patch by Victor Stinner. 25202 25203- bpo-13968: The glob module now supports recursive search in subdirectories 25204 using the ``**`` pattern. 25205 25206- bpo-21951: Fixed a crash in Tkinter on AIX when called Tcl command with 25207 empty string or tuple argument. 25208 25209- bpo-21951: Tkinter now most likely raises MemoryError instead of crash if 25210 the memory allocation fails. 25211 25212- bpo-22338: Fix a crash in the json module on memory allocation failure. 25213 25214- bpo-12410: imaplib.IMAP4 now supports the context management protocol. 25215 Original patch by Tarek Ziadé. 25216 25217- bpo-21270: We now override tuple methods in mock.call objects so that they 25218 can be used as normal call attributes. 25219 25220- bpo-16662: load_tests() is now unconditionally run when it is present in a 25221 package's __init__.py. TestLoader.loadTestsFromModule() still accepts 25222 use_load_tests, but it is deprecated and ignored. A new keyword-only 25223 attribute `pattern` is added and documented. Patch given by Robert 25224 Collins, tweaked by Barry Warsaw. 25225 25226- bpo-22226: First letter no longer is stripped from the "status" key in the 25227 result of Treeview.heading(). 25228 25229- bpo-19524: Fixed resource leak in the HTTP connection when an invalid 25230 response is received. Patch by Martin Panter. 25231 25232- bpo-20421: Add a .version() method to SSL sockets exposing the actual 25233 protocol version in use. 25234 25235- bpo-19546: configparser exceptions no longer expose implementation 25236 details. Chained KeyErrors are removed, which leads to cleaner tracebacks. 25237 Patch by Claudiu Popa. 25238 25239- bpo-22051: turtledemo no longer reloads examples to re-run them. 25240 Initialization of variables and gui setup should be done in main(), which 25241 is called each time a demo is run, but not on import. 25242 25243- bpo-21933: Turtledemo users can change the code font size with a menu 25244 selection or control(command) '-' or '+' or control-mousewheel. Original 25245 patch by Lita Cho. 25246 25247- bpo-21597: The separator between the turtledemo text pane and the drawing 25248 canvas can now be grabbed and dragged with a mouse. The code text pane 25249 can be widened to easily view or copy the full width of the text. The 25250 canvas can be widened on small screens. Original patches by Jan Kanis and 25251 Lita Cho. 25252 25253- bpo-18132: Turtledemo buttons no longer disappear when the window is 25254 shrunk. Original patches by Jan Kanis and Lita Cho. 25255 25256- bpo-22043: time.monotonic() is now always available. 25257 ``threading.Lock.acquire()``, ``threading.RLock.acquire()`` and socket 25258 operations now use a monotonic clock, instead of the system clock, when a 25259 timeout is used. 25260 25261- bpo-21527: Add a default number of workers to ThreadPoolExecutor equal to 25262 5 times the number of CPUs. Patch by Claudiu Popa. 25263 25264- bpo-22216: smtplib now resets its state more completely after a quit. The 25265 most obvious consequence of the previous behavior was a STARTTLS failure 25266 during a connect/starttls/quit/connect/starttls sequence. 25267 25268- bpo-22098: ctypes' BigEndianStructure and LittleEndianStructure now define 25269 an empty __slots__ so that subclasses don't always get an instance dict. 25270 Patch by Claudiu Popa. 25271 25272- bpo-22185: Fix an occasional RuntimeError in threading.Condition.wait() 25273 caused by mutation of the waiters queue without holding the lock. Patch 25274 by Doug Zongker. 25275 25276- bpo-22287: On UNIX, _PyTime_gettimeofday() now uses 25277 clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now 25278 depends on the librt library on Solaris and on Linux (only with glibc 25279 older than 2.17). 25280 25281- bpo-22182: Use e.args to unpack exceptions correctly in 25282 distutils.file_util.move_file. Patch by Claudiu Popa. 25283 25284- The webbrowser module now uses subprocess's start_new_session=True rather 25285 than a potentially risky preexec_fn=os.setsid call. 25286 25287- bpo-22042: signal.set_wakeup_fd(fd) now raises an exception if the file 25288 descriptor is in blocking mode. 25289 25290- bpo-16808: inspect.stack() now returns a named tuple instead of a tuple. 25291 Patch by Daniel Shahaf. 25292 25293- bpo-22236: Fixed Tkinter images copying operations in NoDefaultRoot mode. 25294 25295- bpo-2527: Add a *globals* argument to timeit functions, in order to 25296 override the globals namespace in which the timed code is executed. Patch 25297 by Ben Roberts. 25298 25299- bpo-22118: Switch urllib.parse to use RFC 3986 semantics for the 25300 resolution of relative URLs, rather than RFCs 1808 and 2396. Patch by 25301 Demian Brecht. 25302 25303- bpo-21549: Added the "members" parameter to TarFile.list(). 25304 25305- bpo-19628: Allow compileall recursion depth to be specified with a -r 25306 option. 25307 25308- bpo-15696: Add a __sizeof__ implementation for mmap objects on Windows. 25309 25310- bpo-22068: Avoided reference loops with Variables and Fonts in Tkinter. 25311 25312- bpo-22165: SimpleHTTPRequestHandler now supports undecodable file names. 25313 25314- bpo-15381: Optimized line reading in io.BytesIO. 25315 25316- bpo-8797: Raise HTTPError on failed Basic Authentication immediately. 25317 Initial patch by Sam Bull. 25318 25319- bpo-20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() in 25320 the mailbox module. 25321 25322- bpo-21448: Changed FeedParser feed() to avoid O(N**2) behavior when 25323 parsing long line. Original patch by Raymond Hettinger. 25324 25325- bpo-22184: The functools LRU Cache decorator factory now gives an earlier 25326 and clearer error message when the user forgets the required parameters. 25327 25328- bpo-17923: glob() patterns ending with a slash no longer match non-dirs on 25329 AIX. Based on patch by Delhallt. 25330 25331- bpo-21725: Added support for RFC 6531 (SMTPUTF8) in smtpd. 25332 25333- bpo-22176: Update the ctypes module's libffi to v3.1. This release adds 25334 support for the Linux AArch64 and POWERPC ELF ABIv2 little endian 25335 architectures. 25336 25337- bpo-5411: Added support for the "xztar" format in the shutil module. 25338 25339- bpo-21121: Don't force 3rd party C extensions to be built with 25340 -Werror=declaration-after-statement. 25341 25342- bpo-21975: Fixed crash when using uninitialized sqlite3.Row (in particular 25343 when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in 25344 the __new__() method. 25345 25346- bpo-20170: Convert posixmodule to use Argument Clinic. 25347 25348- bpo-21539: Add an *exists_ok* argument to `Pathlib.mkdir()` to mimic 25349 `mkdir -p` and `os.makedirs()` functionality. When true, ignore 25350 FileExistsErrors. Patch by Berker Peksag. 25351 25352- bpo-22127: Bypass IDNA for pure-ASCII host names in the socket module (in 25353 particular for numeric IPs). 25354 25355- bpo-21047: set the default value for the *convert_charrefs* argument of 25356 HTMLParser to True. Patch by Berker Peksag. 25357 25358- Add an __all__ to html.entities. 25359 25360- bpo-15114: the strict mode and argument of HTMLParser, HTMLParser.error, 25361 and the HTMLParserError exception have been removed. 25362 25363- bpo-22085: Dropped support of Tk 8.3 in Tkinter. 25364 25365- bpo-21580: Now Tkinter correctly handles bytes arguments passed to Tk. In 25366 particular this allows initializing images from binary data. 25367 25368- bpo-22003: When initialized from a bytes object, io.BytesIO() now defers 25369 making a copy until it is mutated, improving performance and memory use on 25370 some use cases. Patch by David Wilson. 25371 25372- bpo-22018: On Windows, signal.set_wakeup_fd() now also supports sockets. A 25373 side effect is that Python depends to the WinSock library. 25374 25375- bpo-22054: Add os.get_blocking() and os.set_blocking() functions to get 25376 and set the blocking mode of a file descriptor (False if the O_NONBLOCK 25377 flag is set, True otherwise). These functions are not available on 25378 Windows. 25379 25380- bpo-17172: Make turtledemo start as active on OS X even when run with 25381 subprocess. Patch by Lita Cho. 25382 25383- bpo-21704: Fix build error for _multiprocessing when semaphores are not 25384 available. Patch by Arfrever Frehtes Taifersar Arahesis. 25385 25386- bpo-20173: Convert sha1, sha256, sha512 and md5 to ArgumentClinic. Patch 25387 by Vajrasky Kok. 25388 25389- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError 25390 on closed socket. repr(socket.socket) already works fine. 25391 25392- bpo-22033: Reprs of most Python implemented classes now contain actual 25393 class name instead of hardcoded one. 25394 25395- bpo-21947: The dis module can now disassemble generator-iterator objects 25396 based on their gi_code attribute. Patch by Clement Rouault. 25397 25398- bpo-16133: The asynchat.async_chat.handle_read() method now ignores 25399 BlockingIOError exceptions. 25400 25401- bpo-22044: Fixed premature DECREF in call_tzinfo_method. Patch by Tom 25402 Flanagan. 25403 25404- bpo-19884: readline: Disable the meta modifier key if stdout is not a 25405 terminal to not write the ANSI sequence ``"\033[1034h"`` into stdout. This 25406 sequence is used on some terminal (ex: TERM=xterm-256color") to enable 25407 support of 8 bit characters. 25408 25409- bpo-4350: Removed a number of out-of-dated and non-working for a long time 25410 Tkinter methods. 25411 25412- bpo-6167: Scrollbar.activate() now returns the name of active element if 25413 the argument is not specified. Scrollbar.set() now always accepts only 2 25414 arguments. 25415 25416- bpo-15275: Clean up and speed up the ntpath module. 25417 25418- bpo-21888: plistlib's load() and loads() now work if the fmt parameter is 25419 specified. 25420 25421- bpo-22032: __qualname__ instead of __name__ is now always used to format 25422 fully qualified class names of Python implemented classes. 25423 25424- bpo-22031: Reprs now always use hexadecimal format with the "0x" prefix 25425 when contain an id in form " at 0x...". 25426 25427- bpo-22018: signal.set_wakeup_fd() now raises an OSError instead of a 25428 ValueError on ``fstat()`` failure. 25429 25430- bpo-21044: tarfile.open() now handles fileobj with an integer 'name' 25431 attribute. Based on patch by Antoine Pietri. 25432 25433- bpo-21966: Respect -q command-line option when code module is ran. 25434 25435- bpo-19076: Don't pass the redundant 'file' argument to self.error(). 25436 25437- bpo-16382: Improve exception message of warnings.warn() for bad category. 25438 Initial patch by Phil Elson. 25439 25440- bpo-21932: os.read() now uses a :c:func:`Py_ssize_t` type instead of 25441 :c:type:`int` for the size to support reading more than 2 GB at once. On 25442 Windows, the size is truncated to INT_MAX. As any call to os.read(), the 25443 OS may read less bytes than the number of requested bytes. 25444 25445- bpo-21942: Fixed source file viewing in pydoc's server mode on Windows. 25446 25447- bpo-11259: asynchat.async_chat().set_terminator() now raises a ValueError 25448 if the number of received bytes is negative. 25449 25450- bpo-12523: asynchat.async_chat.push() now raises a TypeError if it doesn't 25451 get a bytes string 25452 25453- bpo-21707: Add missing kwonlyargcount argument to 25454 ModuleFinder.replace_paths_in_code(). 25455 25456- bpo-20639: calling Path.with_suffix('') allows removing the suffix again. 25457 Patch by July Tikhonov. 25458 25459- bpo-21714: Disallow the construction of invalid paths using 25460 Path.with_name(). Original patch by Antony Lee. 25461 25462- bpo-15014: Added 'auth' method to smtplib to make implementing auth 25463 mechanisms simpler, and used it internally in the login method. 25464 25465- bpo-21151: Fixed a segfault in the winreg module when ``None`` is passed 25466 as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman. 25467 25468- bpo-21090: io.FileIO.readall() does not ignore I/O errors anymore. Before, 25469 it ignored I/O errors if at least the first C call read() succeed. 25470 25471- bpo-5800: headers parameter of wsgiref.headers.Headers is now optional. 25472 Initial patch by Pablo Torres Navarrete and SilentGhost. 25473 25474- bpo-21781: ssl.RAND_add() now supports strings longer than 2 GB. 25475 25476- bpo-21679: Prevent extraneous fstat() calls during open(). Patch by 25477 Bohuslav Kabrda. 25478 25479- bpo-21863: cProfile now displays the module name of C extension functions, 25480 in addition to their own name. 25481 25482- bpo-11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper 25483 object is destroyed. The destructor now closes the file if needed. The 25484 close() method can now be called twice: the second call does nothing. 25485 25486- bpo-21858: Better handling of Python exceptions in the sqlite3 module. 25487 25488- bpo-21476: Make sure the email.parser.BytesParser TextIOWrapper is 25489 discarded after parsing, so the input file isn't unexpectedly closed. 25490 25491- bpo-20295: imghdr now recognizes OpenEXR format images. 25492 25493- bpo-21729: Used the "with" statement in the dbm.dumb module to ensure 25494 files closing. Patch by Claudiu Popa. 25495 25496- bpo-21491: socketserver: Fix a race condition in child processes reaping. 25497 25498- bpo-21719: Added the ``st_file_attributes`` field to os.stat_result on 25499 Windows. 25500 25501- bpo-21832: Require named tuple inputs to be exact strings. 25502 25503- bpo-21722: The distutils "upload" command now exits with a non-zero return 25504 code when uploading fails. Patch by Martin Dengler. 25505 25506- bpo-21723: asyncio.Queue: support any type of number (ex: float) for the 25507 maximum size. Patch written by Vajrasky Kok. 25508 25509- bpo-21711: support for "site-python" directories has now been removed from 25510 the site module (it was deprecated in 3.4). 25511 25512- bpo-17552: new socket.sendfile() method allowing a file to be sent over a 25513 socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo 25514 Rodola'. 25515 25516- bpo-18039: dbm.dump.open() now always creates a new database when the flag 25517 has the value 'n'. Patch by Claudiu Popa. 25518 25519- bpo-21326: Add a new is_closed() method to asyncio.BaseEventLoop. 25520 run_forever() and run_until_complete() methods of asyncio.BaseEventLoop 25521 now raise an exception if the event loop was closed. 25522 25523- bpo-21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths 25524 before checking for a CGI script at that path. 25525 25526- bpo-21310: Fixed possible resource leak in failed open(). 25527 25528- bpo-21256: Printout of keyword args should be in deterministic order in a 25529 mock function call. This will help to write better doctests. 25530 25531- bpo-21677: Fixed chaining nonnormalized exceptions in io close() methods. 25532 25533- bpo-11709: Fix the pydoc.help function to not fail when sys.stdin is not a 25534 valid file. 25535 25536- bpo-21515: tempfile.TemporaryFile now uses os.O_TMPFILE flag is available. 25537 25538- bpo-13223: Fix pydoc.writedoc so that the HTML documentation for methods 25539 that use 'self' in the example code is generated correctly. 25540 25541- bpo-21463: In urllib.request, fix pruning of the FTP cache. 25542 25543- bpo-21618: The subprocess module could fail to close open fds that were 25544 inherited by the calling process and already higher than POSIX resource 25545 limits would otherwise allow. On systems with a functioning /proc/self/fd 25546 or /dev/fd interface the max is now ignored and all fds are closed. 25547 25548- bpo-20383: Introduce importlib.util.module_from_spec() as the preferred 25549 way to create a new module. 25550 25551- bpo-21552: Fixed possible integer overflow of too long string lengths in 25552 the tkinter module on 64-bit platforms. 25553 25554- bpo-14315: The zipfile module now ignores extra fields in the central 25555 directory that are too short to be parsed instead of letting a 25556 struct.unpack error bubble up as this "bad data" appears in many real 25557 world zip files in the wild and is ignored by other zip tools. 25558 25559- bpo-13742: Added "key" and "reverse" parameters to heapq.merge(). (First 25560 draft of patch contributed by Simon Sapin.) 25561 25562- bpo-21402: tkinter.ttk now works when default root window is not set. 25563 25564- bpo-3015: _tkinter.create() now creates tkapp object with wantobject=1 by 25565 default. 25566 25567- bpo-10203: sqlite3.Row now truly supports sequence protocol. In 25568 particular it supports reverse() and negative indices. Original patch by 25569 Claudiu Popa. 25570 25571- bpo-18807: If copying (no symlinks) specified for a venv, then the python 25572 interpreter aliases (python, python3) are now created by copying rather 25573 than symlinking. 25574 25575- bpo-20197: Added support for the WebP image type in the imghdr module. 25576 Patch by Fabrice Aneche and Claudiu Popa. 25577 25578- bpo-21513: Speedup some properties of IP addresses (IPv4Address, 25579 IPv6Address) such as .is_private or .is_multicast. 25580 25581- bpo-21137: Improve the repr for threading.Lock() and its variants by 25582 showing the "locked" or "unlocked" status. Patch by Berker Peksag. 25583 25584- bpo-21538: The plistlib module now supports loading of binary plist files 25585 when reference or offset size is not a power of two. 25586 25587- bpo-21455: Add a default backlog to socket.listen(). 25588 25589- bpo-21525: Most Tkinter methods which accepted tuples now accept lists 25590 too. 25591 25592- bpo-22166: With the assistance of a new internal _codecs._forget_codec 25593 helping function, test_codecs now clears the encoding caches to avoid the 25594 appearance of a reference leak 25595 25596- bpo-22236: Tkinter tests now don't reuse default root window. New root 25597 window is created for every test class. 25598 25599- bpo-10744: Fix :pep:`3118` format strings on ctypes objects with a 25600 nontrivial shape. 25601 25602- bpo-20826: Optimize ipaddress.collapse_addresses(). 25603 25604- bpo-21487: Optimize ipaddress.summarize_address_range() and 25605 ipaddress.{IPv4Network,IPv6Network}.subnets(). 25606 25607- bpo-21486: Optimize parsing of netmasks in ipaddress.IPv4Network and 25608 ipaddress.IPv6Network. 25609 25610- bpo-13916: Disallowed the surrogatepass error handler for non UTF-\* 25611 encodings. 25612 25613- bpo-20998: Fixed re.fullmatch() of repeated single character pattern with 25614 ignore case. Original patch by Matthew Barnett. 25615 25616- bpo-21075: fileinput.FileInput now reads bytes from standard stream if 25617 binary mode is specified. Patch by Sam Kimbrel. 25618 25619- bpo-19775: Add a samefile() method to pathlib Path objects. Initial patch 25620 by Vajrasky Kok. 25621 25622- bpo-21226: Set up modules properly in PyImport_ExecCodeModuleObject (and 25623 friends). 25624 25625- bpo-21398: Fix a unicode error in the pydoc pager when the documentation 25626 contains characters not encodable to the stdout encoding. 25627 25628- bpo-16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an 25629 (address, netmask) tuple argument, so as to easily construct network 25630 objects from existing addresses. 25631 25632- bpo-21156: importlib.abc.InspectLoader.source_to_code() is now a 25633 staticmethod. 25634 25635- bpo-21424: Simplified and optimized heaqp.nlargest() and nmsmallest() to 25636 make fewer tuple comparisons. 25637 25638- bpo-21396: Fix TextIOWrapper(..., write_through=True) to not force a 25639 flush() on the underlying binary stream. Patch by akira. 25640 25641- bpo-18314: Unlink now removes junctions on Windows. Patch by Kim Gräsman 25642 25643- bpo-21088: Bugfix for curses.window.addch() regression in 3.4.0. In 25644 porting to Argument Clinic, the first two arguments were reversed. 25645 25646- bpo-21407: _decimal: The module now supports function signatures. 25647 25648- bpo-10650: Remove the non-standard 'watchexp' parameter from the 25649 Decimal.quantize() method in the Python version. It had never been 25650 present in the C version. 25651 25652- bpo-21469: Reduced the risk of false positives in robotparser by checking 25653 to make sure that robots.txt has been read or does not exist prior to 25654 returning True in can_fetch(). 25655 25656- bpo-19414: Have the OrderedDict mark deleted links as unusable. This gives 25657 an early failure if the link is deleted during iteration. 25658 25659- bpo-21421: Add __slots__ to the MappingViews ABC. Patch by Josh Rosenberg. 25660 25661- bpo-21101: Eliminate double hashing in the C speed-up code for 25662 collections.Counter(). 25663 25664- bpo-21321: itertools.islice() now releases the reference to the source 25665 iterator when the slice is exhausted. Patch by Anton Afanasyev. 25666 25667- bpo-21057: TextIOWrapper now allows the underlying binary stream's read() 25668 or read1() method to return an arbitrary bytes-like object (such as a 25669 memoryview). Patch by Nikolaus Rath. 25670 25671- bpo-20951: SSLSocket.send() now raises either SSLWantReadError or 25672 SSLWantWriteError on a non-blocking socket if the operation would block. 25673 Previously, it would return 0. Patch by Nikolaus Rath. 25674 25675- bpo-13248: removed previously deprecated asyncore.dispatcher __getattr__ 25676 cheap inheritance hack. 25677 25678- bpo-9815: assertRaises now tries to clear references to local variables in 25679 the exception's traceback. 25680 25681- bpo-19940: ssl.cert_time_to_seconds() now interprets the given time string 25682 in the UTC timezone (as specified in RFC 5280), not the local timezone. 25683 25684- bpo-13204: Calling sys.flags.__new__ would crash the interpreter, now it 25685 raises a TypeError. 25686 25687- bpo-19385: Make operations on a closed dbm.dumb database always raise the 25688 same exception. 25689 25690- bpo-21207: Detect when the os.urandom cached fd has been closed or 25691 replaced, and open it anew. 25692 25693- bpo-21291: subprocess's Popen.wait() is now thread safe so that multiple 25694 threads may be calling wait() or poll() on a Popen instance at the same 25695 time without losing the Popen.returncode value. 25696 25697- bpo-21127: Path objects can now be instantiated from str subclass 25698 instances (such as ``numpy.str_``). 25699 25700- bpo-15002: urllib.response object to use _TemporaryFileWrapper (and 25701 _TemporaryFileCloser) facility. Provides a better way to handle file 25702 descriptor close. Patch contributed by Christian Theune. 25703 25704- bpo-12220: mindom now raises a custom ValueError indicating it doesn't 25705 support spaces in URIs instead of letting a 'split' ValueError bubble up. 25706 25707- bpo-21068: The ssl.PROTOCOL* constants are now enum members. 25708 25709- bpo-21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd. 25710 25711- bpo-21262: New method assert_not_called for Mock. It raises AssertionError 25712 if the mock has been called. 25713 25714- bpo-21238: New keyword argument `unsafe` to Mock. It raises 25715 `AttributeError` incase of an attribute startswith assert or assret. 25716 25717- bpo-20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not 25718 PROTOCOL_SSLv3, for maximum compatibility. 25719 25720- bpo-21239: patch.stopall() didn't work deterministically when the same 25721 name was patched more than once. 25722 25723- bpo-21203: Updated fileConfig and dictConfig to remove inconsistencies. 25724 Thanks to Jure Koren for the patch. 25725 25726- bpo-21222: Passing name keyword argument to mock.create_autospec now 25727 works. 25728 25729- bpo-21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX. 25730 25731- bpo-17498: Some SMTP servers disconnect after certain errors, violating 25732 strict RFC conformance. Instead of losing the error code when we issue 25733 the subsequent RSET, smtplib now returns the error code and defers raising 25734 the SMTPServerDisconnected error until the next command is issued. 25735 25736- bpo-17826: setting an iterable side_effect on a mock function created by 25737 create_autospec now works. Patch by Kushal Das. 25738 25739- bpo-7776: Fix ``Host:`` header and reconnection when using 25740 http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath. 25741 25742- bpo-20968: unittest.mock.MagicMock now supports division. Patch by 25743 Johannes Baiter. 25744 25745- bpo-21529: Fix arbitrary memory access in JSONDecoder.raw_decode with a 25746 negative second parameter. Bug reported by Guido Vranken. (See also: 25747 CVE-2014-4616) 25748 25749- bpo-21169: getpass now handles non-ascii characters that the input stream 25750 encoding cannot encode by re-encoding using the replace error handler. 25751 25752- bpo-21171: Fixed undocumented filter API of the rot13 codec. Patch by 25753 Berker Peksag. 25754 25755- bpo-20539: Improved math.factorial error message for large positive inputs 25756 and changed exception type (OverflowError -> ValueError) for large 25757 negative inputs. 25758 25759- bpo-21172: isinstance check relaxed from dict to collections.Mapping. 25760 25761- bpo-21155: asyncio.EventLoop.create_unix_server() now raises a ValueError 25762 if path and sock are specified at the same time. 25763 25764- bpo-21136: Avoid unnecessary normalization of Fractions resulting from 25765 power and other operations. Patch by Raymond Hettinger. 25766 25767- bpo-17621: Introduce importlib.util.LazyLoader. 25768 25769- bpo-21076: signal module constants were turned into enums. Patch by 25770 Giampaolo Rodola'. 25771 25772- bpo-20636: Improved the repr of Tkinter widgets. 25773 25774- bpo-19505: The items, keys, and values views of OrderedDict now support 25775 reverse iteration using reversed(). 25776 25777- bpo-21149: Improved thread-safety in logging cleanup during interpreter 25778 shutdown. Thanks to Devin Jeanpierre for the patch. 25779 25780- bpo-21058: Fix a leak of file descriptor in 25781 :func:`tempfile.NamedTemporaryFile`, close the file descriptor if 25782 :func:`io.open` fails 25783 25784- bpo-21200: Return None from pkgutil.get_loader() when __spec__ is missing. 25785 25786- bpo-21013: Enhance ssl.create_default_context() when used for server side 25787 sockets to provide better security by default. 25788 25789- bpo-20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a 25790 TypeError if the second argument is not a string or compiled regex. 25791 25792- bpo-20633: Replace relative import by absolute import. 25793 25794- bpo-20980: Stop wrapping exception when using ThreadPool. 25795 25796- bpo-21082: In os.makedirs, do not set the process-wide umask. Note this 25797 changes behavior of makedirs when exist_ok=True. 25798 25799- bpo-20990: Fix issues found by pyflakes for multiprocessing. 25800 25801- bpo-21015: SSL contexts will now automatically select an elliptic curve 25802 for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise default to 25803 "prime256v1". 25804 25805- bpo-21000: Improve the command-line interface of json.tool. 25806 25807- bpo-20995: Enhance default ciphers used by the ssl module to enable better 25808 security and prioritize perfect forward secrecy. 25809 25810- bpo-20884: Don't assume that __file__ is defined on importlib.__init__. 25811 25812- bpo-21499: Ignore __builtins__ in several test_importlib.test_api tests. 25813 25814- bpo-20627: xmlrpc.client.ServerProxy is now a context manager. 25815 25816- bpo-19165: The formatter module now raises DeprecationWarning instead of 25817 PendingDeprecationWarning. 25818 25819- bpo-13936: Remove the ability of datetime.time instances to be considered 25820 false in boolean contexts. 25821 25822- bpo-18931: selectors module now supports /dev/poll on Solaris. Patch by 25823 Giampaolo Rodola'. 25824 25825- bpo-19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale), 25826 :py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the 25827 ``surrogateescape`` error handler, instead of the ``strict`` error 25828 handler. 25829 25830- bpo-20574: Implement incremental decoder for cp65001 code (Windows code 25831 page 65001, Microsoft UTF-8). 25832 25833- bpo-20879: Delay the initialization of encoding and decoding tables for 25834 base32, ascii85 and base85 codecs in the base64 module, and delay the 25835 initialization of the unquote_to_bytes() table of the urllib.parse module, 25836 to not waste memory if these modules are not used. 25837 25838- bpo-19157: Include the broadcast address in the usuable hosts for IPv6 in 25839 ipaddress. 25840 25841- bpo-11599: When an external command (e.g. compiler) fails, distutils now 25842 prints out the whole command line (instead of just the command name) if 25843 the environment variable DISTUTILS_DEBUG is set. 25844 25845- bpo-4931: distutils should not produce unhelpful "error: None" messages 25846 anymore. distutils.util.grok_environment_error is kept but doc-deprecated. 25847 25848- bpo-20875: Prevent possible gzip "'read' is not defined" NameError. Patch 25849 by Claudiu Popa. 25850 25851- bpo-11558: ``email.message.Message.attach`` now returns a more useful 25852 error message if ``attach`` is called on a message for which 25853 ``is_multipart`` is False. 25854 25855- bpo-20283: RE pattern methods now accept the string keyword parameters as 25856 documented. The pattern and source keyword parameters are left as 25857 deprecated aliases. 25858 25859- bpo-20778: Fix modulefinder to work with bytecode-only modules. 25860 25861- bpo-20791: copy.copy() now doesn't make a copy when the input is a bytes 25862 object. Initial patch by Peter Otten. 25863 25864- bpo-19748: On AIX, time.mktime() now raises an OverflowError for year 25865 outsize range [1902; 2037]. 25866 25867- bpo-19573: inspect.signature: Use enum for parameter kind constants. 25868 25869- bpo-20726: inspect.signature: Make Signature and Parameter picklable. 25870 25871- bpo-17373: Add inspect.Signature.from_callable method. 25872 25873- bpo-20378: Improve repr of inspect.Signature and inspect.Parameter. 25874 25875- bpo-20816: Fix inspect.getcallargs() to raise correct TypeError for 25876 missing keyword-only arguments. Patch by Jeremiah Lowin. 25877 25878- bpo-20817: Fix inspect.getcallargs() to fail correctly if more than 3 25879 arguments are missing. Patch by Jeremiah Lowin. 25880 25881- bpo-6676: Ensure a meaningful exception is raised when attempting to parse 25882 more than one XML document per pyexpat xmlparser instance. (Original 25883 patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with suggested 25884 wording by David Gutteridge) 25885 25886- bpo-21117: Fix inspect.signature to better support functools.partial. Due 25887 to the specifics of functools.partial implementation, 25888 positional-or-keyword arguments passed as keyword arguments become 25889 keyword-only. 25890 25891- bpo-20334: inspect.Signature and inspect.Parameter are now hashable. 25892 Thanks to Antony Lee for bug reports and suggestions. 25893 25894- bpo-15916: doctest.DocTestSuite returns an empty unittest.TestSuite 25895 instead of raising ValueError if it finds no tests 25896 25897- bpo-21209: Fix asyncio.tasks.CoroWrapper to workaround a bug in yield-from 25898 implementation in CPythons prior to 3.4.1. 25899 25900- asyncio: Add gi_{frame,running,code} properties to CoroWrapper (upstream 25901 issue #163). 25902 25903- bpo-21311: Avoid exception in _osx_support with non-standard compiler 25904 configurations. Patch by John Szakmeister. 25905 25906- bpo-11571: Ensure that the turtle window becomes the topmost window when 25907 launched on OS X. 25908 25909- bpo-21801: Validate that __signature__ is None or an instance of 25910 Signature. 25911 25912- bpo-21923: Prevent AttributeError in 25913 distutils.sysconfig.customize_compiler due to possible uninitialized 25914 _config_vars. 25915 25916- bpo-21323: Fix http.server to again handle scripts in CGI subdirectories, 25917 broken by the fix for security issue #19435. Patch by Zach Byrne. 25918 25919- bpo-22733: Fix ffi_prep_args not zero-extending argument values correctly 25920 on 64-bit Windows. 25921 25922- bpo-23302: Default to TCP_NODELAY=1 upon establishing an HTTPConnection. 25923 Removed use of hard-coded MSS as it's an optimization that's no longer 25924 needed with Nagle disabled. 25925 25926IDLE 25927---- 25928 25929- bpo-20577: Configuration of the max line length for the FormatParagraph 25930 extension has been moved from the General tab of the Idle preferences 25931 dialog to the FormatParagraph tab of the Config Extensions dialog. Patch 25932 by Tal Einat. 25933 25934- bpo-16893: Update Idle doc chapter to match current Idle and add new 25935 information. 25936 25937- bpo-3068: Add Idle extension configuration dialog to Options menu. Changes 25938 are written to HOME/.idlerc/config-extensions.cfg. Original patch by Tal 25939 Einat. 25940 25941- bpo-16233: A module browser (File : Class Browser, Alt+C) requires an 25942 editor window with a filename. When Class Browser is requested otherwise, 25943 from a shell, output window, or 'Untitled' editor, Idle no longer displays 25944 an error box. It now pops up an Open Module box (Alt+M). If a valid name 25945 is entered and a module is opened, a corresponding browser is also opened. 25946 25947- bpo-4832: Save As to type Python files automatically adds .py to the name 25948 you enter (even if your system does not display it). Some systems 25949 automatically add .txt when type is Text files. 25950 25951- bpo-21986: Code objects are not normally pickled by the pickle module. To 25952 match this, they are no longer pickled when running under Idle. 25953 25954- bpo-17390: Adjust Editor window title; remove 'Python', move version to 25955 end. 25956 25957- bpo-14105: Idle debugger breakpoints no longer disappear when inserting or 25958 deleting lines. 25959 25960- bpo-17172: Turtledemo can now be run from Idle. Currently, the entry is on 25961 the Help menu, but it may move to Run. Patch by Ramchandra Apt and Lita 25962 Cho. 25963 25964- bpo-21765: Add support for non-ascii identifiers to HyperParser. 25965 25966- bpo-21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav 25967 Heblikar. 25968 25969- bpo-18592: Add unittest for SearchDialogBase. Patch by Phil Webster. 25970 25971- bpo-21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar. 25972 25973- bpo-21686: add unittest for HyperParser. Original patch by Saimadhav 25974 Heblikar. 25975 25976- bpo-12387: Add missing upper(lower)case versions of default Windows key 25977 bindings for Idle so Caps Lock does not disable them. Patch by Roger 25978 Serwy. 25979 25980- bpo-21695: Closing a Find-in-files output window while the search is still 25981 in progress no longer closes Idle. 25982 25983- bpo-18910: Add unittest for textView. Patch by Phil Webster. 25984 25985- bpo-18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar. 25986 25987- bpo-18409: Add unittest for AutoComplete. Patch by Phil Webster. 25988 25989- bpo-21477: htest.py - Improve framework, complete set of tests. Patches by 25990 Saimadhav Heblikar 25991 25992- bpo-18104: Add idlelib/idle_test/htest.py with a few sample tests to begin 25993 consolidating and improving human-validated tests of Idle. Change other 25994 files as needed to work with htest. Running the module as __main__ runs 25995 all tests. 25996 25997- bpo-21139: Change default paragraph width to 72, the :pep:`8` 25998 recommendation. 25999 26000- bpo-21284: Paragraph reformat test passes after user changes reformat 26001 width. 26002 26003- bpo-17654: Ensure IDLE menus are customized properly on OS X for 26004 non-framework builds and for all variants of Tk. 26005 26006- bpo-23180: Rename IDLE "Windows" menu item to "Window". Patch by Al 26007 Sweigart. 26008 26009Build 26010----- 26011 26012- bpo-15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the 26013 configure script. 26014 26015- bpo-22935: Allow the ssl module to be compiled if openssl doesn't support 26016 SSL 3. 26017 26018- bpo-22592: Drop support of the Borland C compiler to build Python. The 26019 distutils module still supports it to build extensions. 26020 26021- bpo-22591: Drop support of MS-DOS, especially of the DJGPP compiler 26022 (MS-DOS port of GCC). 26023 26024- bpo-16537: Check whether self.extensions is empty in setup.py. Patch by 26025 Jonathan Hosmer. 26026 26027- bpo-22359: Remove incorrect uses of recursive make. Patch by Jonas 26028 Wagner. 26029 26030- bpo-21958: Define HAVE_ROUND when building with Visual Studio 2013 and 26031 above. Patch by Zachary Turner. 26032 26033- bpo-18093: the programs that embed the CPython runtime are now in a 26034 separate "Programs" directory, rather than being kept in the Modules 26035 directory. 26036 26037- bpo-15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/ 26038 now display special message when and only when there are failures. 26039 26040- bpo-21141: The Windows build process no longer attempts to find Perl, 26041 instead relying on OpenSSL source being configured and ready to build. 26042 The ``PCbuild\build_ssl.py`` script has been re-written and re-named to 26043 ``PCbuild\prepare_ssl.py``, and takes care of configuring OpenSSL source 26044 for both 32 and 64 bit platforms. OpenSSL sources obtained from 26045 svn.python.org will always be pre-configured and ready to build. 26046 26047- bpo-21037: Add a build option to enable AddressSanitizer support. 26048 26049- bpo-19962: The Windows build process now creates "python.bat" in the root 26050 of the source tree, which passes all arguments through to the most 26051 recently built interpreter. 26052 26053- bpo-21285: Refactor and fix curses configure check to always search in a 26054 ncursesw directory. 26055 26056- bpo-15234: For BerkeleyDB and Sqlite, only add the found library and 26057 include directories if they aren't already being searched. This avoids an 26058 explicit runtime library dependency. 26059 26060- bpo-17861: Tools/scripts/generate_opcode_h.py automatically regenerates 26061 Include/opcode.h from Lib/opcode.py if the latter gets any change. 26062 26063- bpo-20644: OS X installer build support for documentation build changes in 26064 3.4.1: assume externally supplied sphinx-build is available in /usr/bin. 26065 26066- bpo-20022: Eliminate use of deprecated bundlebuilder in OS X builds. 26067 26068- bpo-15968: Incorporated Tcl, Tk, and Tix builds into the Windows build 26069 solution. 26070 26071- bpo-17095: Fix Modules/Setup *shared* support. 26072 26073- bpo-21811: Anticipated fixes to support OS X versions > 10.9. 26074 26075- bpo-21166: Prevent possible segfaults and other random failures of python 26076 --generate-posix-vars in pybuilddir.txt build target. 26077 26078- bpo-18096: Fix library order returned by python-config. 26079 26080- bpo-17219: Add library build dir for Python extension cross-builds. 26081 26082- bpo-22919: Windows build updated to support VC 14.0 (Visual Studio 2015), 26083 which will be used for the official release. 26084 26085- bpo-21236: Build _msi.pyd with cabinet.lib instead of fci.lib 26086 26087- bpo-17128: Use private version of OpenSSL for OS X 10.5+ installer. 26088 26089C API 26090----- 26091 26092- bpo-14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo(), 26093 bytearray_getbuffer(), bytesiobuf_getbuffer() and array_buffer_getbuf(). 26094 All functions now raise BufferError in that case. 26095 26096- bpo-22445: PyBuffer_IsContiguous() now implements precise contiguity 26097 tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation 26098 flag. Previously the function reported false negatives for corner cases. 26099 26100- bpo-22079: PyType_Ready() now checks that statically allocated type has no 26101 dynamically allocated bases. 26102 26103- bpo-22453: Removed non-documented macro PyObject_REPR(). 26104 26105- bpo-18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, 26106 rename ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document 26107 these functions. 26108 26109- bpo-21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(), 26110 PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) is now using 26111 ``calloc()`` instead of ``malloc()`` for large objects which is faster and 26112 use less memory. 26113 26114- bpo-20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to 26115 match what importlib does; this affects _frozen_importlib as well as any 26116 module loaded using imp.init_frozen(). 26117 26118Documentation 26119------------- 26120 26121- bpo-19548: Update the codecs module documentation to better cover the 26122 distinction between text encodings and other codecs, together with other 26123 clarifications. Patch by Martin Panter. 26124 26125- bpo-22394: Doc/Makefile now supports ``make venv PYTHON=../python`` to 26126 create a venv for generating the documentation, e.g., ``make html 26127 PYTHON=venv/bin/python3``. 26128 26129- bpo-21514: The documentation of the json module now refers to new JSON RFC 26130 7159 instead of obsoleted RFC 4627. 26131 26132- bpo-21777: The binary sequence methods on bytes and bytearray are now 26133 documented explicitly, rather than assuming users will be able to derive 26134 the expected behaviour from the behaviour of the corresponding str 26135 methods. 26136 26137- bpo-6916: undocument deprecated asynchat.fifo class. 26138 26139- bpo-17386: Expanded functionality of the ``Doc/make.bat`` script to make 26140 it much more comparable to ``Doc/Makefile``. 26141 26142- bpo-21312: Update the thread_foobar.h template file to include newer 26143 threading APIs. Patch by Jack McCracken. 26144 26145- bpo-21043: Remove the recommendation for specific CA organizations and to 26146 mention the ability to load the OS certificates. 26147 26148- bpo-20765: Add missing documentation for PurePath.with_name() and 26149 PurePath.with_suffix(). 26150 26151- bpo-19407: New package installation and distribution guides based on the 26152 Python Packaging Authority tools. Existing guides have been retained as 26153 legacy links from the distutils docs, as they still contain some required 26154 reference material for tool developers that isn't recorded anywhere else. 26155 26156- bpo-19697: Document cases where __main__.__spec__ is None. 26157 26158Tests 26159----- 26160 26161- bpo-18982: Add tests for CLI of the calendar module. 26162 26163- bpo-19548: Added some additional checks to test_codecs to ensure that 26164 statements in the updated documentation remain accurate. Patch by Martin 26165 Panter. 26166 26167- bpo-22838: All test_re tests now work with unittest test discovery. 26168 26169- bpo-22173: Update lib2to3 tests to use unittest test discovery. 26170 26171- bpo-16000: Convert test_curses to use unittest. 26172 26173- bpo-21456: Skip two tests in test_urllib2net.py if _ssl module not 26174 present. Patch by Remi Pointel. 26175 26176- bpo-20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de 26177 Gaye. 26178 26179- bpo-22060: test_ctypes has been somewhat cleaned up and simplified; it now 26180 uses unittest test discovery to find its tests. 26181 26182- bpo-22104: regrtest.py no longer holds a reference to the suite of tests 26183 loaded from test modules that don't define test_main(). 26184 26185- bpo-22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch. 26186 26187- bpo-22002: Added ``load_package_tests`` function to test.support and used 26188 it to implement/augment test discovery in test_asyncio, test_email, 26189 test_importlib, test_json, and test_tools. 26190 26191- bpo-21976: Fix test_ssl to accept LibreSSL version strings. Thanks to 26192 William Orr. 26193 26194- bpo-21918: Converted test_tools from a module to a package containing 26195 separate test files for each tested script. 26196 26197- bpo-9554: Use modern unittest features in test_argparse. Initial patch by 26198 Denver Coneybeare and Radu Voicilas. 26199 26200- bpo-20155: Changed HTTP method names in failing tests in test_httpservers 26201 so that packet filtering software (specifically Windows Base Filtering 26202 Engine) does not interfere with the transaction semantics expected by the 26203 tests. 26204 26205- bpo-19493: Refactored the ctypes test package to skip tests explicitly 26206 rather than silently. 26207 26208- bpo-18492: All resources are now allowed when tests are not run by 26209 regrtest.py. 26210 26211- bpo-21634: Fix pystone micro-benchmark: use floor division instead of true 26212 division to benchmark integers instead of floating point numbers. Set 26213 pystone version to 1.2. Patch written by Lennart Regebro. 26214 26215- bpo-21605: Added tests for Tkinter images. 26216 26217- bpo-21493: Added test for ntpath.expanduser(). Original patch by Claudiu 26218 Popa. 26219 26220- bpo-19925: Added tests for the spwd module. Original patch by Vajrasky 26221 Kok. 26222 26223- bpo-21522: Added Tkinter tests for Listbox.itemconfigure(), 26224 PanedWindow.paneconfigure(), and Menu.entryconfigure(). 26225 26226- bpo-17756: Fix test_code test when run from the installed location. 26227 26228- bpo-17752: Fix distutils tests when run from the installed location. 26229 26230- bpo-18604: Consolidated checks for GUI availability. All platforms now at 26231 least check whether Tk can be instantiated when the GUI resource is 26232 requested. 26233 26234- bpo-21275: Fix a socket test on KFreeBSD. 26235 26236- bpo-21223: Pass test_site/test_startup_imports when some of the extensions 26237 are built as builtins. 26238 26239- bpo-20635: Added tests for Tk geometry managers. 26240 26241- Add test case for freeze. 26242 26243- bpo-20743: Fix a reference leak in test_tcl. 26244 26245- bpo-21097: Move test_namespace_pkgs into test_importlib. 26246 26247- bpo-21503: Use test_both() consistently in test_importlib. 26248 26249- bpo-20939: Avoid various network test failures due to new redirect of 26250 http://www.python.org/ to https://www.python.org: use 26251 http://www.example.com instead. 26252 26253- bpo-20668: asyncio tests no longer rely on tests.txt file. (Patch by 26254 Vajrasky Kok) 26255 26256- bpo-21093: Prevent failures of ctypes test_macholib on OS X if a copy of 26257 libz exists in $HOME/lib or /usr/local/lib. 26258 26259- bpo-22770: Prevent some Tk segfaults on OS X when running gui tests. 26260 26261- bpo-23211: Workaround test_logging failure on some OS X 10.6 systems. 26262 26263- bpo-23345: Prevent test_ssl failures with large OpenSSL patch level values 26264 (like 0.9.8zc). 26265 26266Tools/Demos 26267----------- 26268 26269- bpo-22314: pydoc now works when the LINES environment variable is set. 26270 26271- bpo-22615: Argument Clinic now supports the "type" argument for the int 26272 converter. This permits using the int converter with enums and typedefs. 26273 26274- bpo-20076: The makelocalealias.py script no longer ignores UTF-8 mapping. 26275 26276- bpo-20079: The makelocalealias.py script now can parse the SUPPORTED file 26277 from glibc sources and supports command line options for source paths. 26278 26279- bpo-22201: Command-line interface of the zipfile module now correctly 26280 extracts ZIP files with directory entries. Patch by Ryan Wilson. 26281 26282- bpo-22120: For functions using an unsigned integer return converter, 26283 Argument Clinic now generates a cast to that type for the comparison to -1 26284 in the generated code. (This suppresses a compilation warning.) 26285 26286- bpo-18974: Tools/scripts/diff.py now uses argparse instead of optparse. 26287 26288- bpo-21906: Make Tools/scripts/md5sum.py work in Python 3. Patch by Zachary 26289 Ware. 26290 26291- bpo-21629: Fix Argument Clinic's "--converters" feature. 26292 26293- Add support for ``yield from`` to 2to3. 26294 26295- Add support for the :pep:`465` matrix multiplication operator to 2to3. 26296 26297- bpo-16047: Fix module exception list and __file__ handling in freeze. 26298 Patch by Meador Inge. 26299 26300- bpo-11824: Consider ABI tags in freeze. Patch by Meador Inge. 26301 26302- bpo-20535: PYTHONWARNING no longer affects the run_tests.py script. Patch 26303 by Arfrever Frehtes Taifersar Arahesis. 26304 26305Windows 26306------- 26307 26308- bpo-23260: Update Windows installer 26309 26310- The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible 26311 result of this change is the addition of new native file dialogs when 26312 running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more 26313 information. Also, this version of Tcl/Tk includes support for Windows 26314 10. 26315 26316- bpo-17896: The Windows build scripts now expect external library sources 26317 to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``. 26318 26319- bpo-17717: The Windows build scripts now use a copy of NASM pulled from 26320 svn.python.org to build OpenSSL. 26321 26322- bpo-21907: Improved the batch scripts provided for building Python. 26323 26324- bpo-22644: The bundled version of OpenSSL has been updated to 1.0.1j. 26325 26326- bpo-10747: Use versioned labels in the Windows start menu. Patch by Olive 26327 Kilburn. 26328 26329- bpo-22980: .pyd files with a version and platform tag (for example, 26330 ".cp35-win32.pyd") will now be loaded in preference to those without tags. 26331 26332 26333**(For information about older versions, consult the HISTORY file.)** 26334