Commit Graph

105655 Commits

Author SHA1 Message Date
Miss Islington (bot) 30e769382d
closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)
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 cb1c0746f2)

Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
2020-02-04 13:41:55 -08:00
Miss Islington (bot) 9a740b6c7e
bpo-37224: Improve test__xxsubinterpreters.DestroyTests (GH-18058)
Adds an additional assertion check based on a race condition for `test__xxsubinterpreters.DestroyTests.test_still_running` discovered in the bpo issue.

https://bugs.python.org/issue37224
(cherry picked from commit f03a8f8d50)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-02-04 07:31:19 -08:00
Miss Islington (bot) a0389ba84b
Fixes in sorting descriptions (GH-18317)
Improvements in listsort.txt and a comment in sortperf.py.

Automerge-Triggered-By: @csabella
(cherry picked from commit 24e5ad4689)

Co-authored-by: Stefan Pochmann <stefan.pochmann@gmail.com>
2020-02-03 16:50:29 -08:00
Miss Islington (bot) d01ae1b223
bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973)
(cherry picked from commit 5807efd4c3)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2020-02-03 09:17:17 -08:00
Miss Islington (bot) db2f3114b2
fixes typos in http.client documentation (GH-18300)
(cherry picked from commit b94737a4af)

Co-authored-by: James Corbett <james.h.corbett@gmail.com>
2020-02-03 04:07:19 -08:00
Miss Islington (bot) 02395fad8e
bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175) (#18323)
(cherry picked from commit 032de7324e)

Co-authored-by: Steve Cirelli <scirelli+git@gmail.com>
2020-02-03 08:20:41 +00:00
Antoine Pitrou 1723687339
[3.8] bpo-39492: Fix a reference cycle between reducer_override and a Pickler instance (GH-18266) (#18316)
https://bugs.python.org/issue39492

Automerge-Triggered-By: @pitrou
(cherry picked from commit 0f2f35e)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
2020-02-02 21:22:57 +01:00
Miss Islington (bot) 83d3202b92
bpo-38792: Remove IDLE shell calltip before new prompt. (GH-17150)
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 bfdeaa37b3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-30 18:14:16 -08:00
Miss Islington (bot) b841633cc2
bpo-39502: Skip test_zipfile.test_add_file_after_2107() on AIX (GH-18282)
Skip test_zipfile.test_add_file_after_2107() if time.localtime()
fails with OverflowError. It is the case on AIX 6.1 for example.
(cherry picked from commit c232c9110c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-01-30 07:05:08 -08:00
Steve Dower ad4a20b87d
[3.8] bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231) (GH-18234)
https://bugs.python.org/issue39401



Automerge-Triggered-By: @zooba
2020-01-29 22:18:25 -08:00
Miss Islington (bot) 58076df0c5
bpo-39493: Fix definition of IO.closed in typing.py (GH-18265)
(cherry picked from commit 2e6569b669)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-01-29 21:42:38 -08:00
Miss Islington (bot) 696d2324cf
bpo-39485: fix corner-case in method-detection of mock (GH-18255)
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 a327677905)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2020-01-29 16:15:36 +00:00
Miss Islington (bot) 2b675f0c8f
bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247)
XFS filesystem is limited to 32-bit timestamp, but the utimensat()
syscall doesn't fail. Moreover, there is a VFS bug which returns
a cached timestamp which is different than the value on disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1795576
https://bugs.python.org/issue39460GH-msg360952
(cherry picked from commit 3cb49b62e6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-01-29 06:41:49 -08:00
Miss Islington (bot) d1fa90584f
Doc: Fix external links to functional programming tutorial. (GH-18249)
(cherry picked from commit 35eac4500a)

Co-authored-by: Julien Palard <julien@palard.fr>
2020-01-29 05:17:40 -08:00
Miss Islington (bot) 526523c193
bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)
Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.

* 📜🤖 Added by blurb_it.

* make docs consistent with signature

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit e1e80002e2)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-01-29 03:29:35 -08:00
Miss Islington (bot) dbb37aac14
bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)
(cherry picked from commit 0be3246d4f)

Co-authored-by: Adam Meily <ameily@users.noreply.github.com>
2020-01-28 02:52:47 -08:00
Miss Islington (bot) cee5da8610
bpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 148610d88a)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-01-28 02:18:09 -08:00
Miss Islington (bot) 46735c7e10
bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)
(cherry picked from commit 13c1c3556f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-28 02:00:16 -08:00
Miss Islington (bot) 595b516965
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows (GH-17961)
In bpo-36264 os.path.expanduser was changed to ignore HOME on Windows.

Path.expanduser/home still honored HOME despite being documented as behaving the same
as os.path.expanduser. This makes them also ignore HOME so that both implementations
behave the same way again.
(cherry picked from commit c45a2aa9e2)

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
2020-01-28 01:59:43 -08:00
Miss Islington (bot) 41f4dc3bcf bpo-36018: Minor fixes to the NormalDist() examples and recipes. (GH-18226) (GH-18227)
* Change the source for the SAT data to a primary source.
* Fix typo in the standard deviation
* Clarify that the binomial probabalities are just for the Python room.
(cherry picked from commit 01bf2196d8)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2020-01-27 19:40:14 -08:00
Miss Islington (bot) b487a8ed5b
bpo-39392: Turtle overlap fill depends on OS (GH-18223)
Whether or not overlap regions for self-intersecting polygons
or multiple shapes are filled depends on the operating system graphics,
typeof overlap, and number of overlaps.
(cherry picked from commit 2824c45a0a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-27 15:47:08 -08:00
mbarkhau cf9d005547 [3.8] bpo-39390 shutil: fix argument types for ignore callback (GH-18122) 2020-01-28 00:46:29 +01:00
Miss Islington (bot) 7b57b15bd8
bpo-30780: Add IDLE configdialog tests (GH-3592)
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 dd023ad161)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-27 14:35:08 -08:00
Miss Islington (bot) 57e7e5775e
Ignore NEWS snippets in code coverage stats (GH-18194)
(cherry picked from commit 7023288dc5)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2020-01-27 08:27:59 -08:00
Matthew Kokotovich 19be85c765 [3.8] bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18190)
(cherry picked from commit 62865f4532)

Co-authored-by: Matthew Kokotovich <mkokotovich@gmail.com>
2020-01-26 15:30:27 +00:00
Miss Islington (bot) eebcff8c07 bpo-36018: Add another example for NormalDist() (GH-18191) (GH-18192) 2020-01-25 21:24:13 -08:00
Miss Islington (bot) eec7636bfd bpo-39234: Doc: `enum.auto()` incrementation value not specified. (GH-17872) (GH-17875)
(cherry picked from commit 2e9012a3e1)

Co-authored-by: YoSTEALTH <35307184+YoSTEALTH@users.noreply.github.com>
2020-01-25 14:40:27 -05:00
Miss Islington (bot) 1cf0df4f1b bpo-36654: Add examples for using tokenize module programmatically (GH-18187)
(cherry picked from commit 4b09dc79f4)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2020-01-25 22:34:36 +03:00
Miss Islington (bot) 321491a536 bpo-15243: Document __prepare__ as classmethod (GH-17124)
(cherry picked from commit 7de617455e)

Co-authored-by: alclarks <57201106+alclarks@users.noreply.github.com>
2020-01-25 22:04:16 +03:00
Miss Islington (bot) 079dfe082a Update 3.8.rst (GH-18173) (#18182)
Fixed the name of the contributor (@selik).
(cherry picked from commit 9bfb4a7061)

Co-authored-by: fireattack <human.peng@gmail.com>
2020-01-25 12:33:36 -05:00
Miss Islington (bot) a5906b2bfc bpo-38473: Handle autospecced functions and methods used with attach_mock (GH-16784) (GH-18167)
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 66b00a9d3a)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-25 20:23:08 +05:30
Miss Islington (bot) a234492854
bpo-39388: IDLE: Fix bug when cancelling out of configdialog (GH-18068)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit d0d9fa8c5e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-25 01:17:54 -08:00
Miss Islington (bot) ea4a61fec8
bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)
Use `from ... import ...` to ensure module is fully loaded before accessing its attributes.
(cherry picked from commit 9017e0bd5e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-24 12:10:42 -08:00
Miss Islington (bot) 0ea7309927
Improve test coverage for AsyncMock. (GH-17906)
* Add test for nested async decorator patch.
* Add test for side_effect and wraps with a function.
* Add test for side_effect with an exception in the iterable.
(cherry picked from commit 54f743eb31)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-24 05:27:04 -08:00
Miss Islington (bot) a46728a570
bpo-39426: Fix outdated default and highest protocols in docs (GH-18154)
Some portions of the pickle documentation hadn't been updated for the pickle protocol changes in Python 3.8 (new protocol 5, default protocol 4). This PR fixes those docs.

https://bugs.python.org/issue39426
(cherry picked from commit e9652e8d58)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-01-24 02:20:35 -08:00
Alex Rebert 5654f83b97 [3.8] bpo-35182: fix communicate() crash after child closes its pipes (GH-18117) (GH-18148)
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 d3ae95e1e9)

Co-authored-by: Alex Rebert <alex@forallsecure.com>





https://bugs.python.org/issue35182
2020-01-23 15:31:29 -08:00
Miss Islington (bot) 5a2356be1a
bpo-39431: Also mention nonlocal in assignment quirk (GH-17375)
(cherry picked from commit 7142df5ea2)

Co-authored-by: Shanavas M <shanavas.m2@gmail.com>
2020-01-23 10:22:36 -08:00
Miss Islington (bot) 993811ffe7
bpo-39421: Fix posible crash in heapq with custom comparison operators (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 79f89e6e5a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-23 07:22:25 -08:00
Miss Islington (bot) 545fc51d95
bpo-32989: IDLE - remove unneeded parameter (GH-18138)
IDLE does not pass a non-default _synchre in any of its calls to
pyparse.find_good_parse_start.
(cherry picked from commit f9e07e116c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-22 21:13:41 -08:00
Miss Islington (bot) 3b7618809d
bpo-39050: The Help button in IDLE's config menu works again (GH-17611)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 2e43b64c94)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-22 20:13:29 -08:00
Miss Islington (bot) fdb21609d9 bpo-39425: Fix list.count performance regression (GH-18119) (GH-18120)
https://bugs.python.org/issue39425

Automerge-Triggered-By: @pablogsal
(cherry picked from commit 14d80d0b60)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-22 18:11:22 +00:00
Victor Stinner f84f65be56
bpo-39413: os.unsetenv() is not available on Windows (GH-18108)
Update os.unsetenv() documentation: it is not available on Windows.
2020-01-22 13:50:40 +01:00
Miss Islington (bot) a755410e05
closes bpo-39415: Remove unused codes from longobject.c complexobject.c floatobject.c. (GH-18105)
(cherry picked from commit 0d5eac8c32)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-21 19:26:34 -08:00
Miss Islington (bot) 41b3e87930 PyLong_AsLongLong() docs should say 'long long' (GH-18082) (GH-18110)
(cherry picked from commit 47be7d0108)

Co-authored-by: Keith Erskine <toastie604@gmail.com>

Co-authored-by: Keith Erskine <toastie604@gmail.com>
2020-01-21 19:22:21 +00:00
Victor Stinner f4e3e1c4d4
Move test_math tests (GH-18098) (GH-18102)
testPerm() and testComb() belong to MathTests, not to IsCloseTests().

(cherry picked from commit 59e2d26b25)
2020-01-21 15:04:33 +01:00
Miss Islington (bot) ab0d8e356e
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 eab3b3f1c6)

Co-authored-by: William Chargin <wchargin@gmail.com>
2020-01-21 03:42:49 -08:00
Miss Islington (bot) 060ad2fc15
bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)
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 ec64640a2c)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-21 02:29:39 -08:00
Miss Islington (bot) 070e68a59d
improve the documentation of the LOAD_METHOD and CALL_METHOD (GH-18079)
(cherry picked from commit 8698b34b68)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2020-01-20 17:12:07 -08:00
Miss Islington (bot) c1964e0942
bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)
(cherry picked from commit 8d57a4182f)

Co-authored-by: Peter Bittner <django@bittner.it>
2020-01-20 15:28:43 -08:00
Miss Islington (bot) 5cadd3fe3a
bpo-39386: Prevent double awaiting of async iterator (GH-18081)
(cherry picked from commit a96e06db77)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-20 15:06:40 -08:00