1.. bpo: 31558 2.. date: 2017-10-16-14-27-25 3.. nonce: K-uRRm 4.. release date: 2017-10-16 5.. section: Core and Builtins 6 7``gc.freeze()`` is a new API that allows for moving all objects currently 8tracked by the garbage collector to a permanent generation, effectively 9removing them from future collection events. This can be used to protect 10those objects from having their PyGC_Head mutated. In effect, this enables 11great copy-on-write stability at fork(). 12 13.. 14 15.. bpo: 31642 16.. date: 2017-10-08-10-00-55 17.. nonce: 1IKqgs 18.. section: Core and Builtins 19 20Restored blocking "from package import module" by setting 21sys.modules["package.module"] to None. 22 23.. 24 25.. bpo: 31708 26.. date: 2017-10-06-02-10-48 27.. nonce: 66CCVU 28.. section: Core and Builtins 29 30Allow use of asynchronous generator expressions in synchronous functions. 31 32.. 33 34.. bpo: 31709 35.. date: 2017-10-06-00-27-04 36.. nonce: _PmU51 37.. section: Core and Builtins 38 39Drop support of asynchronous __aiter__. 40 41.. 42 43.. bpo: 30404 44.. date: 2017-10-03-23-46-39 45.. nonce: _9Yi5u 46.. section: Core and Builtins 47 48The -u option now makes the stdout and stderr streams unbuffered rather than 49line-buffered. 50 51.. 52 53.. bpo: 31619 54.. date: 2017-09-29-20-32-24 55.. nonce: 6gQ1kv 56.. section: Core and Builtins 57 58Fixed a ValueError when convert a string with large number of underscores to 59integer with binary base. 60 61.. 62 63.. bpo: 31602 64.. date: 2017-09-27-09-30-03 65.. nonce: MtgLCn 66.. section: Core and Builtins 67 68Fix an assertion failure in `zipimporter.get_source()` in case of a bad 69`zlib.decompress()`. Patch by Oren Milman. 70 71.. 72 73.. bpo: 31592 74.. date: 2017-09-26-16-05-04 75.. nonce: IFBZj9 76.. section: Core and Builtins 77 78Fixed an assertion failure in Python parser in case of a bad 79`unicodedata.normalize()`. Patch by Oren Milman. 80 81.. 82 83.. bpo: 31588 84.. date: 2017-09-26-13-03-16 85.. nonce: wT9Iy7 86.. section: Core and Builtins 87 88Raise a `TypeError` with a helpful error message when class creation fails 89due to a metaclass with a bad ``__prepare__()`` method. Patch by Oren 90Milman. 91 92.. 93 94.. bpo: 31574 95.. date: 2017-09-25-12-35-48 96.. nonce: 5yX5r5 97.. section: Core and Builtins 98 99Importlib was instrumented with two dtrace probes to profile import timing. 100 101.. 102 103.. bpo: 31566 104.. date: 2017-09-24-09-57-04 105.. nonce: OxwINs 106.. section: Core and Builtins 107 108Fix an assertion failure in `_warnings.warn()` in case of a bad ``__name__`` 109global. Patch by Oren Milman. 110 111.. 112 113.. bpo: 31506 114.. date: 2017-09-19-10-29-36 115.. nonce: pRVTRB 116.. section: Core and Builtins 117 118Improved the error message logic for object.__new__ and object.__init__. 119 120.. 121 122.. bpo: 31505 123.. date: 2017-09-18-12-07-39 124.. nonce: VomaFa 125.. section: Core and Builtins 126 127Fix an assertion failure in `json`, in case `_json.make_encoder()` received 128a bad `encoder()` argument. Patch by Oren Milman. 129 130.. 131 132.. bpo: 31492 133.. date: 2017-09-16-22-49-16 134.. nonce: RtyteL 135.. section: Core and Builtins 136 137Fix assertion failures in case of failing to import from a module with a bad 138``__name__`` attribute, and in case of failing to access an attribute of 139such a module. Patch by Oren Milman. 140 141.. 142 143.. bpo: 31478 144.. date: 2017-09-15-09-13-07 145.. nonce: o06iKD 146.. section: Core and Builtins 147 148Fix an assertion failure in `_random.Random.seed()` in case the argument has 149a bad ``__abs__()`` method. Patch by Oren Milman. 150 151.. 152 153.. bpo: 31336 154.. date: 2017-09-13-12-04-23 155.. nonce: gi2ahY 156.. section: Core and Builtins 157 158Speed up class creation by 10-20% by reducing the overhead in the necessary 159special method lookups. Patch by Stefan Behnel. 160 161.. 162 163.. bpo: 31415 164.. date: 2017-09-11-14-28-56 165.. nonce: GBdz7o 166.. section: Core and Builtins 167 168Add ``-X importtime`` option to show how long each import takes. It can be 169used to optimize application's startup time. Support the 170:envvar:`PYTHONPROFILEIMPORTTIME` as an equivalent way to enable this. 171 172.. 173 174.. bpo: 31410 175.. date: 2017-09-10-20-58-51 176.. nonce: wD_RbH 177.. section: Core and Builtins 178 179Optimized calling wrapper and classmethod descriptors. 180 181.. 182 183.. bpo: 31353 184.. date: 2017-09-05-14-19-02 185.. nonce: oGZUeJ 186.. section: Core and Builtins 187 188:pep:`553` - Add a new built-in called ``breakpoint()`` which calls 189``sys.breakpointhook()``. By default this imports ``pdb`` and calls 190``pdb.set_trace()``, but users may override ``sys.breakpointhook()`` to call 191whatever debugger they want. The original value of the hook is saved in 192``sys.__breakpointhook__``. 193 194.. 195 196.. bpo: 17852 197.. date: 2017-09-04-12-46-25 198.. nonce: OxAtCg 199.. section: Core and Builtins 200 201Maintain a list of open buffered files, flush them before exiting the 202interpreter. Based on a patch from Armin Rigo. 203 204.. 205 206.. bpo: 31315 207.. date: 2017-09-01-00-40-58 208.. nonce: ZX20bl 209.. section: Core and Builtins 210 211Fix an assertion failure in imp.create_dynamic(), when spec.name is not a 212string. Patch by Oren Milman. 213 214.. 215 216.. bpo: 31311 217.. date: 2017-08-31-17-52-56 218.. nonce: bNE2l- 219.. section: Core and Builtins 220 221Fix a crash in the ``__setstate__()`` method of `ctypes._CData`, in case of 222a bad ``__dict__``. Patch by Oren Milman. 223 224.. 225 226.. bpo: 31293 227.. date: 2017-08-28-17-51-42 228.. nonce: eMYZXj 229.. section: Core and Builtins 230 231Fix crashes in true division and multiplication of a timedelta object by a 232float with a bad as_integer_ratio() method. Patch by Oren Milman. 233 234.. 235 236.. bpo: 31285 237.. date: 2017-08-27-21-18-30 238.. nonce: 7lzaKV 239.. section: Core and Builtins 240 241Fix an assertion failure in `warnings.warn_explicit`, when the return value 242of the received loader's get_source() has a bad splitlines() method. Patch 243by Oren Milman. 244 245.. 246 247.. bpo: 30406 248.. date: 2017-07-20-22-03-44 249.. nonce: _kr47t 250.. section: Core and Builtins 251 252Make ``async`` and ``await`` proper keywords, as specified in :pep:`492`. 253 254.. 255 256.. bpo: 30058 257.. date: 2017-10-12-19-00-53 258.. nonce: cENtry 259.. section: Library 260 261Fixed buffer overflow in select.kqueue.control(). 262 263.. 264 265.. bpo: 31672 266.. date: 2017-10-12-02-47-16 267.. nonce: DaOkVd 268.. section: Library 269 270``idpattern`` in ``string.Template`` matched some non-ASCII characters. Now 271it uses ``-i`` regular expression local flag to avoid non-ASCII characters. 272 273.. 274 275.. bpo: 31701 276.. date: 2017-10-09-17-42-30 277.. nonce: NRrVel 278.. section: Library 279 280On Windows, faulthandler.enable() now ignores MSC and COM exceptions. 281 282.. 283 284.. bpo: 31728 285.. date: 2017-10-08-23-28-30 286.. nonce: XrVMME 287.. section: Library 288 289Prevent crashes in `_elementtree` due to unsafe cleanup of `Element.text` 290and `Element.tail`. Patch by Oren Milman. 291 292.. 293 294.. bpo: 31671 295.. date: 2017-10-04-21-28-44 296.. nonce: E-zfc9 297.. section: Library 298 299Now ``re.compile()`` converts passed RegexFlag to normal int object before 300compiling. bm_regex_compile benchmark shows 14% performance improvements. 301 302.. 303 304.. bpo: 30397 305.. date: 2017-10-03-22-45-50 306.. nonce: e4F7Kr 307.. section: Library 308 309The types of compiled regular objects and match objects are now exposed as 310`re.Pattern` and `re.Match`. This adds information in pydoc output for the 311re module. 312 313.. 314 315.. bpo: 31675 316.. date: 2017-10-03-15-06-24 317.. nonce: Nh7jJ3 318.. section: Library 319 320Fixed memory leaks in Tkinter's methods splitlist() and split() when pass a 321string larger than 2 GiB. 322 323.. 324 325.. bpo: 31673 326.. date: 2017-10-03-14-37-46 327.. nonce: RFCrka 328.. section: Library 329 330Fixed typo in the name of Tkinter's method adderrorinfo(). 331 332.. 333 334.. bpo: 31648 335.. date: 2017-09-30-10-45-12 336.. nonce: Cai7ji 337.. section: Library 338 339Improvements to path predicates in ElementTree: 340Allow whitespace around predicate parts, i.e. "[a = 'text']" instead of requiring the less readable "[a='text']". 341Add support for text comparison of the current node, like "[.='text']". 342Patch by Stefan Behnel. 343 344.. 345 346.. bpo: 30806 347.. date: 2017-09-29 348.. nonce: lP5GrH 349.. section: Library 350 351Fix the string representation of a netrc object. 352 353.. 354 355.. bpo: 31638 356.. date: 2017-09-29-07-14-28 357.. nonce: jElfhl 358.. section: Library 359 360Add optional argument ``compressed`` to ``zipapp.create_archive``, and add 361option ``--compress`` to the command line interface of ``zipapp``. 362 363.. 364 365.. bpo: 25351 366.. date: 2017-09-28-23-10-51 367.. nonce: 2JmFpF 368.. section: Library 369 370Avoid venv activate failures with undefined variables 371 372.. 373 374.. bpo: 20519 375.. date: 2017-09-28-13-17-33 376.. nonce: FteeQQ 377.. section: Library 378 379Avoid ctypes use (if possible) and improve import time for uuid. 380 381.. 382 383.. bpo: 28293 384.. date: 2017-09-26-17-51-17 385.. nonce: UC5pm4 386.. section: Library 387 388The regular expression cache is no longer completely dumped when it is full. 389 390.. 391 392.. bpo: 31596 393.. date: 2017-09-26-11-38-52 394.. nonce: 50Eyel 395.. section: Library 396 397Added pthread_getcpuclockid() to the time module 398 399.. 400 401.. bpo: 27494 402.. date: 2017-09-26-01-43-17 403.. nonce: 37QnaT 404.. section: Library 405 406Make 2to3 accept a trailing comma in generator expressions. For example, 407``set(x for x in [],)`` is now allowed. 408 409.. 410 411.. bpo: 30347 412.. date: 2017-09-25-14-04-30 413.. nonce: B4--_D 414.. section: Library 415 416Stop crashes when concurrently iterate over itertools.groupby() iterators. 417 418.. 419 420.. bpo: 30346 421.. date: 2017-09-24-13-08-46 422.. nonce: Csse77 423.. section: Library 424 425An iterator produced by itertools.groupby() iterator now becomes exhausted 426after advancing the groupby iterator. 427 428.. 429 430.. bpo: 31556 431.. date: 2017-09-22-23-48-49 432.. nonce: 9J0u5H 433.. section: Library 434 435Cancel asyncio.wait_for future faster if timeout <= 0 436 437.. 438 439.. bpo: 31540 440.. date: 2017-09-22-16-02-00 441.. nonce: ybDHT5 442.. section: Library 443 444Allow passing a context object in 445:class:`concurrent.futures.ProcessPoolExecutor` constructor. Also, free job 446resources in :class:`concurrent.futures.ProcessPoolExecutor` earlier to 447improve memory usage when a worker waits for new jobs. 448 449.. 450 451.. bpo: 31516 452.. date: 2017-09-20-18-43-01 453.. nonce: 23Yuq3 454.. section: Library 455 456``threading.current_thread()`` should not return a dummy thread at shutdown. 457 458.. 459 460.. bpo: 31525 461.. date: 2017-09-19-18-48-21 462.. nonce: O2TIL2 463.. section: Library 464 465In the sqlite module, require the sqlite3_prepare_v2 API. Thus, the sqlite 466module now requires sqlite version at least 3.3.9. 467 468.. 469 470.. bpo: 26510 471.. date: 2017-09-19-13-29-29 472.. nonce: oncW6V 473.. section: Library 474 475argparse subparsers are now required by default. This matches behaviour in 476Python 2. For optional subparsers, use the new parameter 477``add_subparsers(required=False)``. Patch by Anthony Sottile. 478(As of 3.7.0rc1, the default was changed to not required as had been the case 479since Python 3.3.) 480 481.. 482 483.. bpo: 27541 484.. date: 2017-09-17-19-59-04 485.. nonce: cIMFJW 486.. section: Library 487 488Reprs of subclasses of some collection and iterator classes (`bytearray`, 489`array.array`, `collections.deque`, `collections.defaultdict`, 490`itertools.count`, `itertools.repeat`) now contain actual type name insteads 491of hardcoded name of the base class. 492 493.. 494 495.. bpo: 31351 496.. date: 2017-09-17-15-24-25 497.. nonce: yQdKv- 498.. section: Library 499 500python -m ensurepip now exits with non-zero exit code if pip bootstrapping 501has failed. 502 503.. 504 505.. bpo: 31389 506.. date: 2017-09-07-15-31-47 507.. nonce: jNFYqB 508.. section: Library 509 510``pdb.set_trace()`` now takes an optional keyword-only argument ``header``. 511If given, this is printed to the console just before debugging begins. 512 513.. 514 515.. bpo: 31537 516.. date: 2017-10-08-23-02-14 517.. nonce: SiFNM8 518.. section: Documentation 519 520Fix incorrect usage of ``get_history_length`` in readline documentation 521example code. Patch by Brad Smith. 522 523.. 524 525.. bpo: 30085 526.. date: 2017-09-14-18-44-50 527.. nonce: 0J9w-u 528.. section: Documentation 529 530The operator functions without double underscores are preferred for clarity. 531The one with underscores are only kept for back-compatibility. 532 533.. 534 535.. bpo: 31696 536.. date: 2017-10-04-23-40-32 537.. nonce: Y3_aBV 538.. section: Build 539 540Improve compiler version information in :data:`sys.version` when Python is 541built with Clang. 542 543.. 544 545.. bpo: 31625 546.. date: 2017-09-28-23-21-20 547.. nonce: Bb2NXr 548.. section: Build 549 550Stop using ranlib on static libraries. Instead, we assume ar supports the 551's' flag. 552 553.. 554 555.. bpo: 31624 556.. date: 2017-09-28-20-54-52 557.. nonce: 11w91_ 558.. section: Build 559 560Remove support for BSD/OS. 561 562.. 563 564.. bpo: 22140 565.. date: 2017-09-26-22-39-58 566.. nonce: ZRf7Wn 567.. section: Build 568 569Prevent double substitution of prefix in python-config.sh. 570 571.. 572 573.. bpo: 31569 574.. date: 2017-09-25-00-25-23 575.. nonce: TS49pM 576.. section: Build 577 578Correct PCBuild/ case to PCbuild/ in build scripts and documentation. 579 580.. 581 582.. bpo: 31536 583.. date: 2017-09-20-21-32-21 584.. nonce: KUDjno 585.. section: Build 586 587Avoid wholesale rebuild after `make regen-all` if nothing changed. 588 589.. 590 591.. bpo: 31460 592.. date: 2017-09-30-19-03-26 593.. nonce: HpveI6 594.. section: IDLE 595 596Simplify the API of IDLE's Module Browser. 597Passing a widget instead of an flist with a root widget opens the option of 598creating a browser frame that is only part of a window. Passing a full file 599name instead of pieces assumed to come from a .py file opens the possibility 600of browsing python files that do not end in .py. 601 602.. 603 604.. bpo: 31649 605.. date: 2017-09-30-13-59-18 606.. nonce: LxN4Vb 607.. section: IDLE 608 609IDLE - Make _htest, _utest parameters keyword only. 610 611.. 612 613.. bpo: 31559 614.. date: 2017-09-23-12-52-24 615.. nonce: ydckYX 616.. section: IDLE 617 618Remove test order dependence in idle_test.test_browser. 619 620.. 621 622.. bpo: 31459 623.. date: 2017-09-22-20-26-23 624.. nonce: L0pnH9 625.. section: IDLE 626 627Rename IDLE's module browser from Class Browser to Module Browser. The 628original module-level class and method browser became a module browser, with 629the addition of module-level functions, years ago. Nested classes and 630functions were added yesterday. For back-compatibility, the virtual event 631<<open-class-browser>>, which appears on the Keys tab of the Settings 632dialog, is not changed. Patch by Cheryl Sabella. 633 634.. 635 636.. bpo: 31500 637.. date: 2017-09-18-10-43-03 638.. nonce: Y_YDxA 639.. section: IDLE 640 641Default fonts now are scaled on HiDPI displays. 642 643.. 644 645.. bpo: 1612262 646.. date: 2017-08-14-15-13-50 647.. nonce: -x_Oyq 648.. section: IDLE 649 650IDLE module browser now shows nested classes and functions. Original patches 651for code and tests by Guilherme Polo and Cheryl Sabella, respectively. 652 653.. 654 655.. bpo: 28280 656.. date: 2017-09-30-19-41-44 657.. nonce: K_EjpO 658.. section: C API 659 660Make `PyMapping_Keys()`, `PyMapping_Values()` and `PyMapping_Items()` always 661return a `list` (rather than a `list` or a `tuple`). Patch by Oren Milman. 662 663.. 664 665.. bpo: 31532 666.. date: 2017-09-20-21-59-52 667.. nonce: s9Cw9_ 668.. section: C API 669 670Fix memory corruption due to allocator mix in getpath.c between Py_GetPath() 671and Py_SetPath() 672 673.. 674 675.. bpo: 25658 676.. date: 2017-06-24-14-30-44 677.. nonce: vm8vGE 678.. section: C API 679 680Implement :pep:`539` for Thread Specific Storage (TSS) API: it is a new Thread 681Local Storage (TLS) API to CPython which would supersede use of the existing 682TLS API within the CPython interpreter, while deprecating the existing API. 683PEP written by Erik M. Bray, patch by Masayuki Yamamoto. 684