summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* 3.7.7v3.7.7Ned Deily2020-03-101-2/+2
|
* bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. ↵Miss Islington (bot)2020-03-101-1/+1
| | | | | | | | | | | (GH-18786) `list(sys.modules.items())` was apparently not immune to "dictionary changed size during iteration" errors. Tested internally using an integration test that has run into this a couple of times in the past two years. With this patch applied, the test is no longer flaky. (cherry picked from commit 85cf1d514b84dc9a4bcb40e20a12e1d82ff19f20) Co-authored-by: Gregory P. Smith <gps@google.com>
* 3.7.7rc1v3.7.7rc1Ned Deily2020-03-041-14/+22
|
* [3.7] bpo-39389: gzip: fix compression level metadata (GH-18077) (GH-18101)Miss Islington (bot)2020-03-042-3/+34
| | | | | | | | | | | | * bpo-39389: gzip: fix compression level metadata (GH-18077) As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a gzip member header should indicate whether the DEFLATE algorithm was tuned for speed or compression ratio. Prior to this patch, archives emitted by the `gzip` module always indicated maximum compression. (cherry picked from commit eab3b3f1c60afecfb4db3c3619109684cb04bd60) Co-authored-by: William Chargin <wchargin@gmail.com>
* bpo-37953: Fix ForwardRef hash and equality checks (GH-15400) (GH-18751)Ryan Rowe2020-03-032-3/+121
| | | | | | | | | Ideally if we stick a ForwardRef in a dictionary we would like to reliably be able to get it out again. https://bugs.python.org/issue37953 (cherry picked from commit e082e7c) Co-authored-by: plokmijnuhby <39633434+plokmijnuhby@users.noreply.github.com>
* [3.7] bpo-38597: Never statically link extension initialization code on ↵Steve Dower2020-03-032-99/+7
| | | | | Windows (GH-18724) (GH-18759) Automerge-Triggered-By: @zooba
* bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and ↵Miss Islington (bot)2020-03-021-0/+20
| | | | | | | | | tp_clear (GH-18749) Objects do not own weak references to them directly through the __weakref__ list so these do not need to be traversed by the GC. (cherry picked from commit 0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666)Miss Islington (bot)2020-03-022-5/+19
| | | | | | | | Open issue in the BPO indicated a desire to make the implementation of codecs.open() at parity with io.open(), which implements a try/except to assure file stream gets closed before an exception is raised. (cherry picked from commit 2565edec2c974b2acca03b4cc5025e83f903ddd7) Co-authored-by: Chris A <christopher.aporta@gmail.com>
* [3.7] bpo-39769: Fix compileall ddir for subpkgs. (GH-18676) (GH-18718) ↵Gregory P. Smith2020-03-013-12/+69
| | | | | | | | | | | | | | | | | | | | | | (GH-18725) Fix compileall.compile_dir() ddir= behavior on sub-packages. Fixes compileall.compile_dir's ddir parameter and compileall command line flag `-d` to no longer write the wrong pathname to the generated pyc file for submodules beneath the root of the directory tree being compiled. This fixes a regression introduced with Python 3.5. Tests backported from GH 02673352b5db6ca4d3dc804965facbedfe66425d, the implementation is different due to intervening code changes. But still quiet simple. Why was the bug ever introduced? The refactoring to add parallel execution kept the ddir -> dfile computations but discarded the results instead of sending them to compile_file(). This fixes that. Lack of tests meant this went unnoticed.. (cherry picked from commit ce720d3e0674d6ac6f1b950c20a89be4cfde7853) Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
* [3.7] bpo-39794: Add --without-decimal-contextvar (GH-18702)Stefan Krah2020-02-292-2/+7
| | | | | | | * bpo-39794: Add --without-decimal-contextvar (#18702) (cherry picked from commit 815280eb160af637e1347213659f9236adf78f80)
* bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest Auth (GH-18338)Miss Islington (bot)2020-02-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest authentication - The 'qop' value in the 'WWW-Authenticate' header is optional. The presence of 'qop' in the header should be checked before its value is parsed with 'split'. Signed-off-by: Stephen Balousek <stephen@balousek.net> * bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest authentication - Add NEWS item Signed-off-by: Stephen Balousek <stephen@balousek.net> * Update Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rst Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com> Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit 5e260e0fde211829fcb67060cfd602f4b679f802) Co-authored-by: Stephen Balousek <sbalousek@users.noreply.github.com>
* bpo-39781: Do not jump when select in IDLE codecontext (GH-18683)Miss Islington (bot)2020-02-283-19/+35
| | | | | | | Previously, the button-up part of selecting with a mouse was treated as a click that meant 'jump' to this line, which modified the context and undid the selection (cherry picked from commit c705fd1e89ccb8f6d414ec817b4616546147d877) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-30566: Fix IndexError when using punycode codec (GH-18632)Miss Islington (bot)2020-02-252-1/+13
| | | | | | | | | Trying to decode an invalid string with the punycode codec shoud raise UnicodeError. (cherry picked from commit ba22e8f174309979d90047c5dc64fcb63bc2c32e) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* Give proper credit for figuring out and writing PEP-3118 tests. (GH-18644) ↵Miss Islington (bot)2020-02-241-0/+2
| | | | | | | (#18645) (cherry picked from commit b942ba03b8530f26240d4e36567d2ff42d701420) Authored-by: Stefan Krah <skrah@bytereef.org>
* bpo-39649: Remove obsolete check for `__args__` in ↵Miss Islington (bot)2020-02-241-8/+1
| | | | | | | | | | bdb.Bdb.format_stack_entry (GH-18531) Appears to be obsolete since 75bb54c3d8. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit 4015d1cda3cdba869103779eb6ff32ad798ff885) Co-authored-by: Daniel Hahler <git@thequod.de>
* bpo-39382: Avoid dangling object use in abstract_issubclass() (GH-18530)Miss Islington (bot)2020-02-221-0/+21
| | | | | | | Hold reference of __bases__ tuple until tuple item is done with, because by dropping the reference the item may be destroyed. (cherry picked from commit 1c56f8ffad44478b4214a2bf8eb7cf51c28a347a) Co-authored-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
* bpo-39576: Prevent memory error for overly optimistic precisions (GH-18581) ↵Miss Islington (bot)2020-02-211-0/+35
| | | | | | | | (#18585) (cherry picked from commit 90930e65455f60216f09d175586139242dbba260) Authored-by: Stefan Krah <skrah@bytereef.org>
* bpo-39663: IDLE: Add additional tests for pyparse (GH-18536)Miss Islington (bot)2020-02-182-2/+16
| | | | | | | | Test when find_good_parse_start should return 0. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit ffda25f6b825f3dee493b6f0746266a4dd6989f0) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* [3.8] bpo-39453: Fix contains method of list to hold strong references ↵Miss Islington (bot)2020-02-171-0/+7
| | | | | | | (GH-18204) (cherry picked from commit f64abd10563c25a94011f9e3335fd8a1cf47c205) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* Revert "bpo-27657: Fix urlparse() with numeric paths (GH-661)" (#18526)Senthil Kumaran2020-02-162-7/+25
| | | | | | | | | | | | | | | | | | | | | This reverts commit 82b5f6b16e051f8a2ac6e87ba86b082fa1c4a77f. The change broke the backwards compatibility of parsing behavior in a patch release of Python (3.7.6). A decision was taken to revert this patch in 3.7.7. In https://bugs.python.org/issue27657 it was decided that the previous behavior like >>> urlparse('localhost:8080') ParseResult(scheme='', netloc='', path='localhost:8080', params='', query='', fragment='') >>> urlparse('undefined:8080') ParseResult(scheme='', netloc='', path='undefined:8080', params='', query='', fragment='') needs to be preserved in patch releases as number of users rely upon it. Explicitly mention the releases involved with the revert in NEWS. Adopt the wording suggested by @ned-deily.
* bpo-39606: allow closing async generators that are already closed (GH-18475) ↵Nathaniel J. Smith2020-02-131-2/+28
| | | | | | | | | | | | | | | | (GH-18502) The fix for [bpo-39386](https://bugs.python.org/issue39386) attempted to make it so you couldn't reuse a agen.aclose() coroutine object. It accidentally also prevented you from calling aclose() at all on an async generator that was already closed or exhausted. This commit fixes it so we're only blocking the actually illegal cases, while allowing the legal cases. The new tests failed before this patch. Also confirmed that this fixes the test failures we were seeing in Trio with Python dev builds: https://github.com/python-trio/trio/pull/1396 https://bugs.python.org/issue39606 (cherry picked from commit 925dc7fb1d0db85dc137afa4cd14211bf0d67414)
* bpo-21016: pydoc and trace use sysconfig (GH-18476)Miss Islington (bot)2020-02-122-6/+5
| | | | | | | | | | | bpo-21016, bpo-1294959: The pydoc and trace modules now use the sysconfig module to get the path to the Python standard library, to support uncommon installation path like /usr/lib64/python3.9/ on Fedora. Co-Authored-By: Jan Matějek <jmatejek@suse.com> (cherry picked from commit 4fac7ed43ebf1771a8fe86fdfe7b9991f3be78cd) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39600: Adjust code, add idlelib/NEWS item (GH-18449)Miss Islington (bot)2020-02-112-4/+4
| | | | | | Complete previous patch. (cherry picked from commit 96ce22706735779cf8cc46eaaa5ac61359364b5a) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-39600, IDLE: Remove duplicated font names (GH-18430)Miss Islington (bot)2020-02-101-2/+3
| | | | | | In the font configuration window, remove duplicated font names. (cherry picked from commit ed335cf53b5d4bca9a08c9b83ba684ba17be0f10) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39274: Ensure Fraction.__bool__() returns a bool (GH-18017)Miss Islington (bot)2020-02-062-1/+40
| | | | | | | | Some numerator types used (specifically NumPy) decides to not return a Python boolean for the "a != b" operation. Using the equivalent call to bool() guarantees a bool return also for such types. (cherry picked from commit 427c84f13f7719e6014a21bd1b81efdc02a046fb) Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)Miss Islington (bot)2020-02-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When called on a closed object, readinto() segfaults on account of a write to a freed buffer: ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==220553== Access not within mapped region at address 0x2A ==220553== at 0x48408A0: memmove (vg_replace_strmem.c:1272) ==220553== by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972) ==220553== by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053) ==220553== by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253) Reproducer: reader = open ("/dev/zero", "rb") _void = reader.read (42) reader.close () reader.readinto (bytearray (42)) GH-GH-GH- BANG! The problem exists since 2012 when commit dc469454ec added code to free the read buffer on close(). Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com> (cherry picked from commit cb1c0746f277052e45a60d6c436a765e34722821) Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
* Fixes in sorting descriptions (GH-18317)Miss Islington (bot)2020-02-041-1/+1
| | | | | | | | Improvements in listsort.txt and a comment in sortperf.py. Automerge-Triggered-By: @csabella (cherry picked from commit 24e5ad4689de9adc8e4a7d8c08fe400dcea668e6) Co-authored-by: Stefan Pochmann <stefan.pochmann@gmail.com>
* bpo-39450 Stripped whitespace before parsing the docstring in ↵Miss Islington (bot)2020-02-032-1/+10
| | | | | | | TestCase.shortDescription (GH-18321) (cherry picked from commit 032de7324e30c6b44ef272cea3be205a3d768759) Co-authored-by: Steve Cirelli <scirelli+git@gmail.com>
* bpo-38792: Remove IDLE shell calltip before new prompt. (GH-17150)Miss Islington (bot)2020-01-314-3/+7
| | | | | | | | | Previously, a calltip might be left after SyntaxError, KeyboardInterrupt, or Shell Restart. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Tal Einat <taleinat+github@gmail.com> (cherry picked from commit bfdeaa37b3df7466624c17f9450d2bd1c3d95edf) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] bpo-39493: Fix definition of IO.closed in typing.py (GH-18273)Miss Islington (bot)2020-01-301-1/+1
| | | | | | | | | | | | * bpo-39493: Fix definition of IO.closed in typing.py (GH-18265) (cherry picked from commit 2e6569b6692298fcc9aae0df3eb3181adb2a5099) Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com> * Use @absractproperty Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com> Co-authored-by: Guido van Rossum <guido@python.org>
* bpo-39485: fix corner-case in method-detection of mock (GH-18256)Miss Islington (bot)2020-01-291-5/+1
| | | | | | | | | | | | | | | | | | | | Replace check for whether something is a method in the mock module. The previous version fails on PyPy, because there no method wrappers exist (everything looks like a regular Python-defined function). Thus the isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check returns True for any descriptor, not just methods. This condition could also return erroneously True in CPython for C-defined descriptors. Instead to decide whether something is a method, just check directly whether it's a function defined on the class. This passes all tests on CPython and fixes the bug on PyPy. (cherry picked from commit a327677905956ae0b239ff430a1346dfe265709e) Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de> Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual ↵Adam Meily2020-01-281-1/+1
| | | | environment (GH-16098)
* bpo-30780: Add IDLE configdialog tests (GH-3592)Miss Islington (bot)2020-01-273-31/+148
| | | | | | | | | Expose dialog buttons to test code and complete their test coverage. Complete test coverage for highlights and keys tabs. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit dd023ad1619b6f1ab313986e8953eea32c18f50c) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-38473: Handle autospecced functions and methods used with attach_mock ↵Miss Islington (bot)2020-01-252-0/+33
| | | | | | | | | | | | (GH-16784) (#18166) If an autospecced object is attached using attach_mock the child would be a function with mock object as attribute from which signature has to be derived. (cherry picked from commit 66b00a9d3aacf6ed49412f48743e4913104a2bb3) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
* bpo-39388: IDLE: Fix bug when cancelling out of configdialog (GH-18068)Miss Islington (bot)2020-01-253-8/+18
| | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit d0d9fa8c5e30aff71b6d5e8b2673396622f33270) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)Miss Islington (bot)2020-01-241-10/+8
| | | | | | Use `from ... import ...` to ensure module is fully loaded before accessing its attributes. (cherry picked from commit 9017e0bd5e124ae6d2ed94b9e9cacb2e86270980) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.7] bpo-35182: fix communicate() crash after child closes its pipes ↵Alex Rebert2020-01-232-2/+13
| | | | | | | | | | | | | | | | | | | | | (GH-18117) (GH-18151) When communicate() is called in a loop, it crashes when the child process has already closed any piped standard stream, but still continues to be running Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>. (cherry picked from commit d3ae95e1e945ed20297e1c38ba43a18b7a868ab6) Co-authored-by: Alex Rebert <alex@forallsecure.com> https://bugs.python.org/issue35182 Automerge-Triggered-By: @gpshead
* bpo-39421: Fix posible crash in heapq with custom comparison operators ↵Miss Islington (bot)2020-01-231-0/+31
| | | | | | | | | | | | (GH-18118) * bpo-39421: Fix posible crash in heapq with custom comparison operators * fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators * fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators (cherry picked from commit 79f89e6e5a659846d1068e8b1bd8e491ccdef861) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-32989: IDLE - remove unneeded parameter (GH-18138)Miss Islington (bot)2020-01-232-2/+3
| | | | | | | IDLE does not pass a non-default _synchre in any of its calls to pyparse.find_good_parse_start. (cherry picked from commit f9e07e116c32b6dc4561d0bdeb452ccde13b0e7c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-39050: The Help button in IDLE's config menu works again (GH-17611)Miss Islington (bot)2020-01-233-1/+14
| | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit 2e43b64c94e49f7133b9c26e84c9519935c49063) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)Miss Islington (bot)2020-01-215-39/+152
| | | | | | | | | | Fix comments and add tests for editor newline_and_indent_event method. Remove unused None default for function parameter of pyparse find_good_parse_start method and code triggered by that default. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit ec64640a2c5236d7a5d5470d759172a3d93eab0b) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-39386: Prevent double awaiting of async iterator (GH-18081)Miss Islington (bot)2020-01-201-0/+36
| | | | | (cherry picked from commit a96e06db77dcbd3433d39761ddb4615d7d96284a) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Fix typo from base to based (GH-18055)Miss Islington (bot)2020-01-191-1/+1
| | | | | (cherry picked from commit 558f07891170fe5173f277d3749e92d844de0a27) Co-authored-by: Michael Haas <micha2718l@gmail.com>
* Fix documentation in code.py (GH-17988)Miss Islington (bot)2020-01-141-1/+1
| | | | | (cherry picked from commit b4cdb3f60e71888d7f3d4e0d40cb31e968ea160c) Co-authored-by: Kyle Pollina <kylepollina@protonmail.com>
* [3.7] bpo-16575: Disabled checks for union types being passed by value. ↵Vinay Sajip2020-01-121-1/+2
| | | | | | | | | | (GH-17960) (GH-17970) Although the underlying libffi issue remains open, adding these checks have caused problems in third-party projects which are in widespread use. See the issue for examples. The corresponding tests have also been skipped. (cherry picked from commit c12440c371025bea9c3bfb94945f006c486c2c01)
* bpo-38293: Allow shallow and deep copying of property objects (GH-16438)Miss Islington (bot)2020-01-122-3/+4
| | | | | | | | | | | | | | | | | | | | Copying property objects results in a TypeError. Steps to reproduce: ``` >>> import copy >>> obj = property() >>> copy.copy(obj) ```` This affects both shallow and deep copying. My idea for a fix is to add property objects to the list of "atomic" objects in the copy module. These already include types like functions and type objects. I also added property objects to the unit tests test_copy_atomic and test_deepcopy_atomic. This is my first PR, and it's highly likely I've made some mistake, so please be kind :) https://bugs.python.org/issue38293 (cherry picked from commit 9f3fc6c5b4993f2b362263b494f84793a21aa073) Co-authored-by: Guðni Natan Gunnarsson <1493259+GudniNatan@users.noreply.github.com>
* [3.7] Add test cases for dataclasses. (GH-17909) (GH-17920)Miss Islington (bot)2020-01-101-0/+19
| | | | | | | | | | | | * Add test cases for dataclasses. * Add test for repr output of field. * Add test for ValueError to be raised when both default and default_factory are passed. (cherry picked from commit eef1b027ab70704bcaa60a089e4ae1592c504b86) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com> Automerge-Triggered-By: @ericvsmith
* bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903)Miss Islington (bot)2020-01-082-3/+3
| | | | | (cherry picked from commit 2e6a8efa837410327b593dc83c57492253b1201e) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-38871: Fix lib2to3 for filter-based statements that contain lambda ↵Miss Islington (bot)2020-01-072-3/+12
| | | | | | | | | (GH-17780) Correctly parenthesize filter-based statements that contain lambda expressions in lib2to3. (cherry picked from commit b821173b5458d137c8d5edb6e9b4997aac800a38) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-39198: Ensure logging global lock is released on exception in ↵Miss Islington (bot)2020-01-071-6/+9
| | | | | isEnabledFor (GH-17689) (GH-17898) (cherry picked from commit 950c6795aa0ffa85e103a13e7a04e08cb34c66ad)