Commit Graph

45033 Commits

Author SHA1 Message Date
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) 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) 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
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) 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
Miss Islington (bot) c7b16f8588
Fix typo from base to based (GH-18055)
(cherry picked from commit 558f078911)

Co-authored-by: Michael Haas <micha2718l@gmail.com>
2020-01-19 02:48:04 -08:00
Miss Islington (bot) 9f220e4968
Fix documentation in code.py (GH-17988)
(cherry picked from commit b4cdb3f60e)

Co-authored-by: Kyle Pollina <kylepollina@protonmail.com>
2020-01-14 12:13:59 -08:00
Karthikeyan Singaravelan 9955f33cdb [3.8] bpo-39033: Fix NameError in zipimport during hash validation (GH-17588) (GH-17642)
Fix `NameError` in `zipimport` during hash validation and add a regression test.

(cherry picked from commit 79f02fee1a)



https://bugs.python.org/issue39033
2020-01-14 03:39:19 -08:00
Miss Islington (bot) 3043ec7d6a
bpo-38293: Allow shallow and deep copying of property objects (GH-16438)
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 9f3fc6c5b4)

Co-authored-by: Guðni Natan Gunnarsson <1493259+GudniNatan@users.noreply.github.com>
2020-01-12 10:04:18 -08:00
Miss Islington (bot) eb9ba2f66d bpo-16575: Disabled checks for union types being passed by value. (GH-17960) (GH-17964)
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 c12440c371)
2020-01-12 11:41:07 +00:00
Miss Islington (bot) 33dd75a28f
bpo-38356: Fix ThreadedChildWatcher thread leak in test_asyncio (GH-16552)
Motivation for this PR (comment from @vstinner in bpo issue):
```
Warning seen o AMD64 Ubuntu Shared 3.x buildbot:
https://buildbot.python.org/all/GH-/builders/141/builds/2593

test_devnull_output (test.test_a=syncio.test_subprocess.SubprocessThreadedWatcherTests) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
```
The following implementation details for the new method are TBD:

1) Public vs private

2) Inclusion in `close()`

3) Name

4) Coroutine vs subroutine method

5) *timeout* parameter

If it's a private method, 3, 4, and 5 are significantly less important.

I started with the most minimal implementation that fixes the dangling threads without modifying the regression tests, which I think is particularly important. I typically try to avoid directly modifying existing tests as much as possible unless it's necessary to do so. However, I am open to changing any part of this.

https://bugs.python.org/issue38356
(cherry picked from commit 0ca7cc7fc0)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-01-12 03:21:00 -08:00
Miss Islington (bot) 98b1c0c7ac bpo-39297: Update for importlib_metadata 1.4. (GH-17947) (GH-17952)
* bpo-39297: Update for importlib_metadata 1.4. Includes performance updates.

* 📜🤖 Added by blurb_it.

* Update blurb

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-11 10:56:57 -05:00
Miss Islington (bot) 0f40482fde
Fix host in address of socket.create_server example. (GH-17706)
Host as None in address raises TypeError since it should be string, bytes or bytearray.
(cherry picked from commit 43682f1e39)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-10 21:39:01 -08:00
Miss Islington (bot) df2fb60cf7
[3.8] Add test cases for dataclasses. (GH-17909) (GH-17919)
* 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 eef1b027ab)


Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>

Automerge-Triggered-By: @ericvsmith
2020-01-10 04:12:08 -08:00
Miss Islington (bot) e47a7e3a7a Fix typo in test's docstring (GH-17856) (GH-17923)
* Fix typo in test's docstring. contination -> continuation.
(cherry picked from commit 2f65aa4658)

Co-authored-by: Daniel Hahler <git@thequod.de>

Co-authored-by: Daniel Hahler <github@thequod.de>
2020-01-09 23:03:05 +05:30
Miss Islington (bot) 8c08518c25
bpo-25172: Reduce scope of crypt import tests (GH-17881)
(cherry picked from commit ed367815ee)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-01-09 09:19:59 -08:00
Miss Islington (bot) b24e4fac03
bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903)
(cherry picked from commit 2e6a8efa83)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-08 07:48:33 -08:00
Miss Islington (bot) 39a5c889d3
bpo-38871: Fix lib2to3 for filter-based statements that contain lambda (GH-17780)
Correctly parenthesize filter-based statements that contain lambda
expressions in lib2to3.
(cherry picked from commit b821173b54)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-07 09:52:06 -08:00
Miss Islington (bot) bff48c6734 bpo-39198: Ensure logging global lock is released on exception in isEnabledFor (GH-17689) (GH-17897)
(cherry picked from commit 950c6795aa)
2020-01-07 17:03:23 +00:00
Andrew Svetlov 4112a3da2e
[3.8] bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863) (#17894)
https://bugs.python.org/issue39191.
(cherry picked from commit 10ac0cded2)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-07 16:55:19 +02:00
Miss Islington (bot) b2e281aaa2
bpo-39209: Manage correctly multi-line tokens in interactive mode (GH-17860)
(cherry picked from commit 5ec91f78d5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-06 08:26:13 -08:00
Miss Islington (bot) 33cb4a62bf bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864) (GH-17865)
Fixes error attempting to bind to IPv4 address.
(cherry picked from commit 7cdc31a14c)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-06 08:28:27 -05:00
Miss Islington (bot) 5ed9d60bc5 bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851) (#17854)
(cherry picked from commit ee94bdb059)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-06 07:34:10 -05:00
Miss Islington (bot) 5a065ac181
Minor formatting improvements and fixes to idle.rst (GH-17165)
(cherry picked from commit d6c08db853)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2020-01-05 16:09:56 -08:00
Miss Islington (bot) 49c108c832
Fix constant folding optimization for positional only arguments (GH-17837)
(cherry picked from commit b121a4a45f)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-01-05 09:21:47 -08:00
Miss Islington (bot) 636a850ed8
bpo-39152: add missing ttk.Scale.configure return value (GH-17815)
tkinter.ttk.Scale().configure([name]) now returns a configuration tuple for name
or a list thereof for all options. Based on patch Giovanni Lombardo.
(cherry picked from commit 5ea7bb25e3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-05 09:07:30 -08:00
Miss Islington (bot) 34aa3e71dc
bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616)
(cherry picked from commit b19c0d77e6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:36:48 -08:00
Miss Islington (bot) e1caa49f68
bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618)
No longer import the re module if it is not needed.
(cherry picked from commit 41ec17e45d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:33:08 -08:00
Miss Islington (bot) fc84d501b9
bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)
Ignore leading dots and no longer ignore a trailing newline.
(cherry picked from commit 6a265f0d0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:32:00 -08:00
Miss Islington (bot) 859525590c
Fix SystemError when nested function has annotation on positional-only argument (GH-17826)
(cherry picked from commit ec007cb43f)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-01-04 18:14:58 -08:00
Andrew Svetlov 867d8333ce
[3.8] bpo-39191: Don't spawn a task before failing (GH-17796) (GH-17820)
(cherry picked from commit 3a5de51159)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-04 11:49:11 +02:00
Miss Islington (bot) 1d5a7e5694 bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) (GH-17785)
(cherry picked from commit 46abfc1416)
2020-01-01 20:06:52 +00:00
Miss Islington (bot) 6c004955ac bpo-39176: Improve error message for 'named assignment' (GH-17777) (GH-17778)
(cherry picked from commit 37143a8e3b)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2019-12-31 21:28:08 -06:00
Miss Islington (bot) 302b35f82b
Fix idlelib README typo. (GH-17770)
(cherry picked from commit ba82ee894c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-12-31 10:52:38 -08:00
Dong-hee Na 2ee87913dd [3.8] bpo-38588: Fix possible crashes in dict and list when calling P… (GH-17764)
* [3.8] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (GH-17734)

Take strong references before calling PyObject_RichCompareBool to protect against the case
where the object dies during the call.
(cherry picked from commit 2d5bf568ea)

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

* Update Objects/listobject.c

@methane's suggestion

Co-Authored-By: Inada Naoki <songofacandy@gmail.com>

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-12-31 04:15:36 +00:00
Miss Islington (bot) fcaf14cd91
bpo-38610: Fix possible crashes in several list methods (GH-17022)
Hold strong references to list elements while calling PyObject_RichCompareBool().
(cherry picked from commit d9e561d23d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-12-30 11:51:06 -08:00
Terry Jan Reedy df647f3340
[3.8] bpo-39136: Fixed typos (GH-17720)
funtion -> function; configuraton -> configuration; defintitions -> definitions;
focusses -> focuses; necesarily -> necessarily; follwing -> following;
Excape -> Escape,

(cherry picked from commit 6c7bb38ff2)
2019-12-28 19:05:15 -05:00
Miss Islington (bot) 4ed79b7800
Fix import path for asyncio.TimeoutError (GH-17691)
(cherry picked from commit 025eeaa196)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-24 03:04:12 -08:00
Bar Harel 0846e5d460 [3.8] bpo-38878: Fix os.PathLike __subclasshook__ (GH-17336) (GH-17684)
https://bugs.python.org/issue38878
2019-12-23 18:31:00 +00:00
Łukasz Langa 114aad7b14 Python 3.8.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl36YEkACgkQsmmV4xAl
 BWh59Q/+OXxgPm7u3EG3KSDZk+Hcd7d7jcuODR67veRjIAe7PSvdPIttC39qVWv5
 j6mnH0xP3Q6wOcpOu+EpKiU60tvTYRVdk7BGCqZsFaQlIZY8lwbm30bw9x/wrFoa
 Qt7W1yJ00avn1x1rZ1ZejyOI9RL8im15WJF5NpS3eqX1EL+UBScrsQNjHGIYi+pM
 ERm+9BTTYVQ3odYnvQ6FsJIASf3IbWcQULtRsr7kGSP4E0Y9PXWCvy89tWay3R2N
 j1L11w7uL/RgqJUvfUljGwuWp2kiBEC1xIM85AzTo464IMIfix4aGhriLh4qX6ZD
 14sJmVJERdSqigpJlhwlaGIs2xOIzOcZ3Tok2aiJDGD9iqnsrtZFJRVGQxu4dEx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QVcMnSzE9MGKFu5ICNKPgKxPmqf
 4qxP9oeWjUwpgrGL7iem91XPq79FrMeubiyIH/b88oR6qHhceIe7MJ73fyBNe5uN
 uj+5BUpujg==
 =pQD9
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.1' into 3.8

Python 3.8.1
2019-12-19 09:00:46 +01:00
Victor Stinner b0eb046cbd
bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) (GH-17655)
Fix test_ressources_gced_in_workers() of test_concurrent_futures:
explicitly stop the manager to prevent leaking a child process
running in the background after the test completes.

(cherry picked from commit 673c39331f)
2019-12-18 21:30:43 +01:00