Commit Graph

105749 Commits

Author SHA1 Message Date
Miss Islington (bot) 2477aed12d
Fix "versionchanged" for pow named arguments (GH-19042) (GH-19079)
The ability to use named arguments in "pow" was introduced in Python 3.8, not Python 3.9. See https://bugs.python.org/issue38237
(cherry picked from commit c691f20952)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-03-19 18:35:02 +00:00
Miss Islington (bot) ec8a973f7c
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 9052f7a41b)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-19 04:54:16 -07:00
Miss Islington (bot) da1fe768e5
bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026)
PyObject_GenericSetDict() takes three arguments, not two.
(cherry picked from commit a45b695b9f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-17 01:25:34 -07:00
Victor Stinner 046255c40f
bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977) (GH-19029)
If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(),
log the error as an unraisable exception.

(cherry picked from commit f6a5850782)
2020-03-16 18:18:20 +01:00
Miss Islington (bot) 7f5302fed4
bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009)
When the pull is not used via the context manager or terminate() is called, there is a system in multiprocessing.util that handles finalization of all pools via an atexit handler (the Finalize) class. This class registers the _terminate_pool handler in the registry of finalizers of the module, and that registry is called on interpreter exit via _exit_function. The problem is that the "happy" path with the context manager or manual call to finalize() does some extra steps that _terminate_pool does not. The step that is not executed when the atexit() handler calls _terminate_pool is pinging the _change_notifier queue to unblock the maintenance threads.

This commit moves the notification to the _terminate_pool function so is called from both code paths.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit ac10e0c932)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-15 14:26:43 -07:00
Miss Islington (bot) 890dcfe403
Fix a possible refleak in tupleobject.c (GH-19018)
(cherry picked from commit c81609e44e)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2020-03-15 12:55:39 -07:00
Miss Islington (bot) f7e32fcbd6
bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010)
(cherry picked from commit 90235810ec)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-14 21:46:26 -07:00
Miss Islington (bot) 4abe77c725
bpo-39869: Fix typo in 'Instance objects' section. (GH-18889)
(cherry picked from commit e5e56328af)

Co-authored-by: Antoine <43954001+awecx@users.noreply.github.com>
2020-03-14 15:13:18 -07:00
Miss Islington (bot) 9c63cd8c63
Link to list of keywords in the laguage reference (GH-18024)
(cherry picked from commit 33238ec2af)

Co-authored-by: Борис Верховский <boris.verk@gmail.com>
2020-03-14 12:14:57 -07:00
Miss Islington (bot) ff69c9d12c
bpo-38576: Disallow control characters in hostnames in http.client (GH-18995)
Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165addc22)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-03-14 12:13:32 -07:00
Miss Islington (bot) a927e91186
bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550)
(cherry picked from commit 6672c16b1d)

Co-authored-by: Taine Zhao <twshere@outlook.com>
2020-03-14 07:45:23 -07:00
Miss Islington (bot) 9644702936
bpo-39582: ossaudiodev module update helpers signature for ioctl calls. (GH-18412)
(cherry picked from commit b81f40f0ad)

Co-authored-by: David CARLIER <devnexen@gmail.com>
2020-03-14 07:43:53 -07:00
Mark Dickinson e634a8ac1f
[3.8] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18989)
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>.
(cherry picked from commit 5208b4b379)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-14 11:38:52 +00:00
Miss Islington (bot) f6bdac1bf7
bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18927)
Create call objects with awaited arguments instead of using call_args which has only last call value.
(cherry picked from commit e553f204bf)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-03-14 07:12:57 +00:00
Karthikeyan Singaravelan d3af92ecc2
[3.8] Doc: Fix grammar in PyErr_ResourceWarning (GH-18879) (GH-18976)
(cherry picked from commit fdcd53f)

Co-authored-by: Daniel Hahler <git@thequod.de>
2020-03-13 21:02:38 +05:30
Miss Islington (bot) f8ce3e2dae
bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18966)
- When casting to _Bool, arrays should only contain zeros or ones.
(cherry picked from commit 1ae9cde4b2)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-03-12 19:56:18 +01:00
Miss Islington (bot) 35ae5d916c
bpo-39930: Fix MSBuild detection for Build Tools (GH-18938)
Ensure we detect Build Tools installs using the newer logic, and skip looking in the registry for VS 2017.
(cherry picked from commit 894adc18b4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-12 09:47:53 -07:00
Victor Stinner 03ac090c5f
bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18956)
PyDescr_NewMethod() and PyCFunction_NewEx() now include the method
name in the SystemError "bad call flags" error message to ease debug.

(cherry picked from commit c7d2d69d95)
2020-03-12 13:37:02 +01:00
Serhiy Storchaka ab9c729121
[3.8] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18954)
(cherry picked from commit e5ccc94bbb)
2020-03-12 09:30:56 +02:00
Miss Islington (bot) 99ef1ac9a7
Fix syntax error in an example in the ast documentation and sync docstrings (GH-18946)
(cherry picked from commit c00c86b904)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-11 18:06:53 -07:00
Miss Islington (bot) 60b1b5ac56
bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780)
The 32-bit (49-day) TickCount relied on in EnterNonRecursiveMutex can overflow
in the gap between the 'target' time and the 'now' time WaitForSingleObjectEx
returns, causing the loop to think it needs to wait another 49 days. This is
most likely to happen when the machine is hibernated during
WaitForSingleObjectEx.

This makes acquiring a lock/event/etc from the _thread or threading module
appear to never timeout.

Replace with GetTickCount64 - this is OK now Python no longer supports XP which
lacks it, and is in use for time.monotonic().

Co-authored-by: And Clover <and.clover@bromium.com>
(cherry picked from commit 64838ce717)

Co-authored-by: bobince <and+github@doxdesk.com>
2020-03-11 16:57:16 -07:00
Miss Islington (bot) cd07b4da65
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
(cherry picked from commit 185903de12)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-11 13:18:01 -07:00
Miss Islington (bot) c22879914b
bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880)
(cherry picked from commit 704e2065f8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-11 10:07:04 -07:00
Miss Islington (bot) 17571c54e0
bpo-39930: Convert error to warning for more silent failure (GH-18921)
Makes it an error to create a layout without vcruntime DLL
(cherry picked from commit fde44ae6d0)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-11 07:31:07 -07:00
Miss Islington (bot) d01c5507e5
bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918)
Also adds GitHub CI test for Windows installer changes
(cherry picked from commit 2dd41740c9)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-11 04:38:18 -07:00
Miss Islington (bot) 6ce36ed4a7
Fix download.html (GH-18902)
`<tt>` is not allowed.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 39c34933fc)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-03-10 21:40:04 -07:00
Miss Islington (bot) 212acf544a
bpo-38662: ensurepip invokes pip via runpy (GH-18901)
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2b9e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-03-10 14:37:50 -07:00
Miss Islington (bot) b26ccfe3f9
tracemalloc: 'pretty top' example no longer changes the filename (GH-18903)
I've used this recipe a couple times and the filename editing has always
been less than useful and something I've removed. This is because many
modules end up losing which package they are located in, e.g. `util/date.py`.
(cherry picked from commit d06eec218e)

Co-authored-by: Adam Johnson <me@adamj.eu>
2020-03-10 11:26:20 -07:00
Dong-hee Na caec8a0dfb
[3.8] bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779). (GH-18894)
(cherry picked from commit 700cb58730)

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

Automerge-Triggered-By: @vstinner
2020-03-10 01:14:08 -07:00
Miss Islington (bot) cadfe52a00
bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab83b8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-09 16:45:19 -07:00
Miss Islington (bot) 5854d451cb
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
python-gdb.py now checks for "take_gil" function name to check if a
frame tries to acquire the GIL, instead of checking for
"pthread_cond_timedwait" which is specific to Linux and can be a
different condition than the GIL.
(cherry picked from commit 6d0ee60740)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-09 11:52:27 -07:00
Pablo Galindo 3ede1bc794
[3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876)
(cherry picked from commit 6012f30bef)
2020-03-09 14:48:03 +00:00
Miss Islington (bot) 97bbdb28b4
bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850)
(cherry picked from commit 88944a44aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-09 05:55:17 -07:00
Miss Islington (bot) f3f0c7a108
bpo-27115: Move IDLE Query error blanking (GH-18868)
Move required blanking of error text to non-overridden entry_ok().
(Omit news item.)
(cherry picked from commit e53a3932cb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 22:56:28 -07:00
Miss Islington (bot) 0687bdf5de
bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699)
(cherry picked from commit 0911ea5c17)

Co-authored-by: Maor Kleinberger <kmaork@gmail.com>
2020-03-08 13:59:59 -07:00
Miss Islington (bot) b2e8240261
bpo-39885: IDLE context menu clears selection (GH-18859)
Since clicking to get an IDLE context menu moves the cursor,
any text selection should be and now is cleared.
(cherry picked from commit 4ca060d8ad)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 12:47:05 -07:00
Miss Islington (bot) a5e821c726
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
It appears standard that moving the text insert cursor away from a selection clears the
selection.  Clearing prevents accidental deletion of a possibly off-screen bit of text.
The update is for Ln and Col on the status bar.
(cherry picked from commit 2522db11df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 11:49:44 -07:00
Miss Islington (bot) 765117dc16
fix typo: add space (GH-18853)
Fix typo in cmdline.rst
Add space between the `-m` option and the module name (`timeit`).
(cherry picked from commit c580981ba0)

Co-authored-by: Julin S <48789920+ju-sh@users.noreply.github.com>
2020-03-08 10:58:19 -07:00
Miss Islington (bot) 928b4dd0ed
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions (GH-18815)
Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
(cherry picked from commit eb7560a73d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-07 10:11:24 -08:00
Serhiy Storchaka 92b72788ec
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
(cherry picked from commit c4928fc1a8)
2020-03-07 18:55:32 +02:00
Miss Islington (bot) d692d52f4a
bpo-39837: Disable macOS tests on Azure Pipelines (GH-18818)
(cherry picked from commit 31350f9af0)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-06 16:30:09 -08:00
Miss Islington (bot) 6df0c47669
bpo-17422: slightly more precise language (GH-18682)
(cherry picked from commit e59334ebc9)

Co-authored-by: Caleb Donovick <cdonovick@users.noreply.github.com>
2020-03-06 10:26:52 -08:00
Miss Islington (bot) 0c71770eee
bpo-39868: Update Language Reference for PEP 572. (GH-18793)
(cherry picked from commit 8bae21962b)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2020-03-05 21:25:15 -08:00
Miss Islington (bot) da9ee00ffe
IDLE doc: improve Startup failure subsection. (GH-18771)
Eliminate repeat of 'Options', reported by Jules Lasne, and improve wording elsewhere.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ce305d6410)

Co-authored-by: Jules Lasne (jlasne) <jules.lasne@gmail.com>
2020-03-05 17:35:43 -08:00
Miss Islington (bot) 7b39c474e4
[3.8] bpo-39808: Improve docs for pathlib.Path.stat() (GH-18719) (GH-18783)
(cherry picked from commit 67152d0ed6)


Co-authored-by: Brett Cannon <54418+brettcannon@users.noreply.github.com>

Automerge-Triggered-By: @brettcannon
2020-03-05 10:36:54 -08:00
Miss Islington (bot) 6b452ff97f
bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (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 85cf1d514b)

Co-authored-by: Gregory P. Smith <gps@google.com>
2020-03-04 17:04:38 -08:00
Miss Islington (bot) 5a3926d559
Add a missing space after a period in 'typing.TypedDict' documentation (GH-18784)
(cherry picked from commit d4a09c13dd)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
2020-03-04 16:18:22 -08:00
Miss Islington (bot) 6c8cc0dbfd
Fix misleading statement about mixed-type numeric comparisons (GH-18615) (#18773)
(cherry picked from commit 9f1cb1bb49)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2020-03-04 11:52:56 +00:00
Miss Islington (bot) 57fb29219f
bpo-39831: Remove outdated comment. (GH-18764)
(cherry picked from commit ae75a29435)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-03 10:01:09 -08:00
Victor Stinner 2aa694dd55
bpo-39674: Update collections ABC deprecation doc (GH-18748) 2020-03-03 17:31:24 +01:00