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 8 tracked by the garbage collector to a permanent generation, effectively 9 removing them from future collection events. This can be used to protect 10 those objects from having their PyGC_Head mutated. In effect, this enables 11 great 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 20 Restored blocking "from package import module" by setting 21 sys.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 30 Allow 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 39 Drop 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 48 The -u option now makes the stdout and stderr streams unbuffered rather than 49 line-buffered. 50 51 .. 52 53 .. bpo: 31619 54 .. date: 2017-09-29-20-32-24 55 .. nonce: 6gQ1kv 56 .. section: Core and Builtins 57 58 Fixed a ValueError when convert a string with large number of underscores to 59 integer 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 68 Fix 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 78 Fixed 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 88 Raise a `TypeError` with a helpful error message when class creation fails 89 due to a metaclass with a bad ``__prepare__()`` method. Patch by Oren 90 Milman. 91 92 .. 93 94 .. bpo: 31574 95 .. date: 2017-09-25-12-35-48 96 .. nonce: 5yX5r5 97 .. section: Core and Builtins 98 99 Importlib 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 108 Fix an assertion failure in `_warnings.warn()` in case of a bad ``__name__`` 109 global. 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 118 Improved 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 127 Fix an assertion failure in `json`, in case `_json.make_encoder()` received 128 a 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 137 Fix 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 139 such 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 148 Fix an assertion failure in `_random.Random.seed()` in case the argument has 149 a 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 158 Speed up class creation by 10-20% by reducing the overhead in the necessary 159 special 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 168 Add ``-X importtime`` option to show how long each import takes. It can be 169 used 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 179 Optimized 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 191 whatever 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 201 Maintain a list of open buffered files, flush them before exiting the 202 interpreter. 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 211 Fix an assertion failure in imp.create_dynamic(), when spec.name is not a 212 string. 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 221 Fix a crash in the ``__setstate__()`` method of `ctypes._CData`, in case of 222 a 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 231 Fix crashes in true division and multiplication of a timedelta object by a 232 float 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 241 Fix an assertion failure in `warnings.warn_explicit`, when the return value 242 of the received loader's get_source() has a bad splitlines() method. Patch 243 by 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 252 Make ``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 261 Fixed 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 271 it 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 280 On 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 289 Prevent crashes in `_elementtree` due to unsafe cleanup of `Element.text` 290 and `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 299 Now ``re.compile()`` converts passed RegexFlag to normal int object before 300 compiling. 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 309 The 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 311 re module. 312 313 .. 314 315 .. bpo: 31675 316 .. date: 2017-10-03-15-06-24 317 .. nonce: Nh7jJ3 318 .. section: Library 319 320 Fixed memory leaks in Tkinter's methods splitlist() and split() when pass a 321 string 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 330 Fixed 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 339 Improvements to path predicates in ElementTree: 340 341 * Allow whitespace around predicate parts, i.e. "[a = 'text']" instead of requiring the less readable "[a='text']". 342 * Add support for text comparison of the current node, like "[.='text']". 343 344 Patch by Stefan Behnel. 345 346 .. 347 348 .. bpo: 30806 349 .. date: 2017-09-29 350 .. nonce: lP5GrH 351 .. section: Library 352 353 Fix the string representation of a netrc object. 354 355 .. 356 357 .. bpo: 31638 358 .. date: 2017-09-29-07-14-28 359 .. nonce: jElfhl 360 .. section: Library 361 362 Add optional argument ``compressed`` to ``zipapp.create_archive``, and add 363 option ``--compress`` to the command line interface of ``zipapp``. 364 365 .. 366 367 .. bpo: 25351 368 .. date: 2017-09-28-23-10-51 369 .. nonce: 2JmFpF 370 .. section: Library 371 372 Avoid venv activate failures with undefined variables 373 374 .. 375 376 .. bpo: 20519 377 .. date: 2017-09-28-13-17-33 378 .. nonce: FteeQQ 379 .. section: Library 380 381 Avoid ctypes use (if possible) and improve import time for uuid. 382 383 .. 384 385 .. bpo: 28293 386 .. date: 2017-09-26-17-51-17 387 .. nonce: UC5pm4 388 .. section: Library 389 390 The regular expression cache is no longer completely dumped when it is full. 391 392 .. 393 394 .. bpo: 31596 395 .. date: 2017-09-26-11-38-52 396 .. nonce: 50Eyel 397 .. section: Library 398 399 Added pthread_getcpuclockid() to the time module 400 401 .. 402 403 .. bpo: 27494 404 .. date: 2017-09-26-01-43-17 405 .. nonce: 37QnaT 406 .. section: Library 407 408 Make 2to3 accept a trailing comma in generator expressions. For example, 409 ``set(x for x in [],)`` is now allowed. 410 411 .. 412 413 .. bpo: 30347 414 .. date: 2017-09-25-14-04-30 415 .. nonce: B4--_D 416 .. section: Library 417 418 Stop crashes when concurrently iterate over itertools.groupby() iterators. 419 420 .. 421 422 .. bpo: 30346 423 .. date: 2017-09-24-13-08-46 424 .. nonce: Csse77 425 .. section: Library 426 427 An iterator produced by itertools.groupby() iterator now becomes exhausted 428 after advancing the groupby iterator. 429 430 .. 431 432 .. bpo: 31556 433 .. date: 2017-09-22-23-48-49 434 .. nonce: 9J0u5H 435 .. section: Library 436 437 Cancel asyncio.wait_for future faster if timeout <= 0 438 439 .. 440 441 .. bpo: 31540 442 .. date: 2017-09-22-16-02-00 443 .. nonce: ybDHT5 444 .. section: Library 445 446 Allow passing a context object in 447 :class:`concurrent.futures.ProcessPoolExecutor` constructor. Also, free job 448 resources in :class:`concurrent.futures.ProcessPoolExecutor` earlier to 449 improve memory usage when a worker waits for new jobs. 450 451 .. 452 453 .. bpo: 31516 454 .. date: 2017-09-20-18-43-01 455 .. nonce: 23Yuq3 456 .. section: Library 457 458 ``threading.current_thread()`` should not return a dummy thread at shutdown. 459 460 .. 461 462 .. bpo: 31525 463 .. date: 2017-09-19-18-48-21 464 .. nonce: O2TIL2 465 .. section: Library 466 467 In the sqlite module, require the sqlite3_prepare_v2 API. Thus, the sqlite 468 module now requires sqlite version at least 3.3.9. 469 470 .. 471 472 .. bpo: 26510 473 .. date: 2017-09-19-13-29-29 474 .. nonce: oncW6V 475 .. section: Library 476 477 argparse subparsers are now required by default. This matches behaviour in 478 Python 2. For optional subparsers, use the new parameter 479 ``add_subparsers(required=False)``. Patch by Anthony Sottile. 480 (As of 3.7.0rc1, the default was changed to not required as had been the case 481 since Python 3.3.) 482 483 .. 484 485 .. bpo: 27541 486 .. date: 2017-09-17-19-59-04 487 .. nonce: cIMFJW 488 .. section: Library 489 490 Reprs of subclasses of some collection and iterator classes (`bytearray`, 491 `array.array`, `collections.deque`, `collections.defaultdict`, 492 `itertools.count`, `itertools.repeat`) now contain actual type name insteads 493 of hardcoded name of the base class. 494 495 .. 496 497 .. bpo: 31351 498 .. date: 2017-09-17-15-24-25 499 .. nonce: yQdKv- 500 .. section: Library 501 502 python -m ensurepip now exits with non-zero exit code if pip bootstrapping 503 has failed. 504 505 .. 506 507 .. bpo: 31389 508 .. date: 2017-09-07-15-31-47 509 .. nonce: jNFYqB 510 .. section: Library 511 512 ``pdb.set_trace()`` now takes an optional keyword-only argument ``header``. 513 If given, this is printed to the console just before debugging begins. 514 515 .. 516 517 .. bpo: 31537 518 .. date: 2017-10-08-23-02-14 519 .. nonce: SiFNM8 520 .. section: Documentation 521 522 Fix incorrect usage of ``get_history_length`` in readline documentation 523 example code. Patch by Brad Smith. 524 525 .. 526 527 .. bpo: 30085 528 .. date: 2017-09-14-18-44-50 529 .. nonce: 0J9w-u 530 .. section: Documentation 531 532 The operator functions without double underscores are preferred for clarity. 533 The one with underscores are only kept for back-compatibility. 534 535 .. 536 537 .. bpo: 31696 538 .. date: 2017-10-04-23-40-32 539 .. nonce: Y3_aBV 540 .. section: Build 541 542 Improve compiler version information in :data:`sys.version` when Python is 543 built with Clang. 544 545 .. 546 547 .. bpo: 31625 548 .. date: 2017-09-28-23-21-20 549 .. nonce: Bb2NXr 550 .. section: Build 551 552 Stop using ranlib on static libraries. Instead, we assume ar supports the 553 's' flag. 554 555 .. 556 557 .. bpo: 31624 558 .. date: 2017-09-28-20-54-52 559 .. nonce: 11w91_ 560 .. section: Build 561 562 Remove support for BSD/OS. 563 564 .. 565 566 .. bpo: 22140 567 .. date: 2017-09-26-22-39-58 568 .. nonce: ZRf7Wn 569 .. section: Build 570 571 Prevent double substitution of prefix in python-config.sh. 572 573 .. 574 575 .. bpo: 31569 576 .. date: 2017-09-25-00-25-23 577 .. nonce: TS49pM 578 .. section: Build 579 580 Correct PCBuild/ case to PCbuild/ in build scripts and documentation. 581 582 .. 583 584 .. bpo: 31536 585 .. date: 2017-09-20-21-32-21 586 .. nonce: KUDjno 587 .. section: Build 588 589 Avoid wholesale rebuild after `make regen-all` if nothing changed. 590 591 .. 592 593 .. bpo: 31460 594 .. date: 2017-09-30-19-03-26 595 .. nonce: HpveI6 596 .. section: IDLE 597 598 Simplify the API of IDLE's Module Browser. 599 600 Passing a widget instead of an flist with a root widget opens the option of 601 creating a browser frame that is only part of a window. Passing a full file 602 name instead of pieces assumed to come from a .py file opens the possibility 603 of browsing python files that do not end in .py. 604 605 .. 606 607 .. bpo: 31649 608 .. date: 2017-09-30-13-59-18 609 .. nonce: LxN4Vb 610 .. section: IDLE 611 612 IDLE - Make _htest, _utest parameters keyword only. 613 614 .. 615 616 .. bpo: 31559 617 .. date: 2017-09-23-12-52-24 618 .. nonce: ydckYX 619 .. section: IDLE 620 621 Remove test order dependence in idle_test.test_browser. 622 623 .. 624 625 .. bpo: 31459 626 .. date: 2017-09-22-20-26-23 627 .. nonce: L0pnH9 628 .. section: IDLE 629 630 Rename IDLE's module browser from Class Browser to Module Browser. The 631 original module-level class and method browser became a module browser, with 632 the addition of module-level functions, years ago. Nested classes and 633 functions were added yesterday. For back-compatibility, the virtual event 634 <<open-class-browser>>, which appears on the Keys tab of the Settings 635 dialog, is not changed. Patch by Cheryl Sabella. 636 637 .. 638 639 .. bpo: 31500 640 .. date: 2017-09-18-10-43-03 641 .. nonce: Y_YDxA 642 .. section: IDLE 643 644 Default fonts now are scaled on HiDPI displays. 645 646 .. 647 648 .. bpo: 1612262 649 .. date: 2017-08-14-15-13-50 650 .. nonce: -x_Oyq 651 .. section: IDLE 652 653 IDLE module browser now shows nested classes and functions. Original patches 654 for code and tests by Guilherme Polo and Cheryl Sabella, respectively. 655 656 .. 657 658 .. bpo: 28280 659 .. date: 2017-09-30-19-41-44 660 .. nonce: K_EjpO 661 .. section: C API 662 663 Make `PyMapping_Keys()`, `PyMapping_Values()` and `PyMapping_Items()` always 664 return a `list` (rather than a `list` or a `tuple`). Patch by Oren Milman. 665 666 .. 667 668 .. bpo: 31532 669 .. date: 2017-09-20-21-59-52 670 .. nonce: s9Cw9_ 671 .. section: C API 672 673 Fix memory corruption due to allocator mix in getpath.c between Py_GetPath() 674 and Py_SetPath() 675 676 .. 677 678 .. bpo: 25658 679 .. date: 2017-06-24-14-30-44 680 .. nonce: vm8vGE 681 .. section: C API 682 683 Implement PEP 539 for Thread Specific Storage (TSS) API: it is a new Thread 684 Local Storage (TLS) API to CPython which would supersede use of the existing 685 TLS API within the CPython interpreter, while deprecating the existing API. 686 PEP written by Erik M. Bray, patch by Masayuki Yamamoto. 687