Commit Graph

107415 Commits

Author SHA1 Message Date
Pablo Galindo 2b33cc3a25
[3.9] Remove PEG-specific syntax error check in the old parser (GH-20717) 2020-06-08 11:27:58 +01:00
Miss Islington (bot) 8df4f3942f
bpo-40903: Handle multiple '=' in invalid assignment rules in the PEG parser (GH-20697)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 9f495908c5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-08 02:22:06 -07:00
Miss Islington (bot) 66605d1572
allow macOS installer builds to package pre-built html docs (GH-20715)
build-installer now looks in its directory of source tarballs
for a suitable html tarball of the same version.  If so, it
will unpack and use it rather than rebuilding the html format
documentation set from the source repo.  This is intended as
a speedup for test builds of the installer.  Files names must
be in the same format as produced by the docs build for download,
for example, `python-3.9.0b1-docs-html.tar.bz2`.
(cherry picked from commit 63fc55b2ea)

Co-authored-by: Ned Deily <nad@python.org>
2020-06-08 01:11:43 -07:00
Miss Islington (bot) 3deded947c
Deny eval() direct access to builtins (GH-20713) (GH-20714) 2020-06-08 00:19:27 -07:00
Miss Islington (bot) be5ed59e29
bpo-22021: Update root_dir and base_dir documentation in shutil (GH-10367)
Also added an example in shutil in order to make more clear how they are to be used.

Initially reported by Weinan Li on bpo.
(cherry picked from commit 7633371dac)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-07 22:08:14 -07:00
Miss Islington (bot) 1e72fb2b78
bpo-40741: Update macOS installer to use SQLite 3.32.2. (GH-20705)
(cherry picked from commit 37eed5a9ee)

Co-authored-by: Ned Deily <nad@python.org>
2020-06-07 19:43:11 -07:00
Miss Islington (bot) 9cf1be46e3
bpo-39791 native hooks for importlib.resources.files (GH-20576)
* Provide native .files support on SourceFileLoader.

* Add native importlib.resources.files() support to zipimporter. Remove fallback support.

* make regen-all

* 📜🤖 Added by blurb_it.

* Move 'files' into the ResourceReader so it can carry the relevant module name context.

* Create 'importlib.readers' module and add FileReader to it.

* Add zip reader and rely on it for a TraversableResources object on zipimporter.

* Remove TraversableAdapter, no longer needed.

* Update blurb.

* Replace backslashes with forward slashes.

* Incorporate changes from importlib_metadata 2.0, finalizing the interface for extension via get_resource_reader.

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-06-07 18:30:08 -07:00
Miss Islington (bot) 6440911736
bpo-40904: Fix segfault in the new parser with f-string containing yield statements with no value (GH-20701)
(cherry picked from commit 972ab03276)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-07 18:08:53 -07:00
Miss Islington (bot) 71f501698d
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (GH-20681)
(cherry picked from commit 2efe18bf27)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-06-07 08:17:45 -07:00
Miss Islington (bot) 1d711f2e31
bpo-40724: Fix return type of test helper function heapctypewithbuffer_releasebuffer() (GH-20685) (GH-20690)
(cherry picked from commit b8867e5d5a)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
2020-06-07 09:28:03 +02:00
Miss Islington (bot) 1e4fa91104
bpo-40724: Support setting buffer slots from type specs (GH-20648) (GH-20683)
This is not part of the limited API but makes the buffer slots available for type specs.
(cherry picked from commit f7c4e23642)
2020-06-07 09:06:40 +02:00
Miss Islington (bot) 90ee51f1cd
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
(cherry picked from commit 68874a8502)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-06-06 10:04:38 -07:00
Miss Islington (bot) 18f1226884
Refactor scripts in Tools/peg_generator/scripts (GH-20401)
(cherry picked from commit ba6fd87e41)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-05 21:41:12 -07:00
Miss Islington (bot) d5e7348e41
bpo-40862: Raise TypeError when const is given to argparse.BooleanOptionalAction (GH-20623) (GH-20664) 2020-06-05 19:31:18 -07:00
Miss Islington (bot) 15fec5627a
bpo-40880: Fix invalid read in newline_in_string in pegen.c (GH-20666)
* bpo-40880: Fix invalid read in newline_in_string in pegen.c

* Update Parser/pegen/pegen.c

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>

* Add NEWS entry

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
(cherry picked from commit 2e6593db00)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-05 17:13:14 -07:00
Miss Islington (bot) 79e6c15aed
bpo-40883: Fix memory leak in fstring_compile_expr in parse_string.c (GH-20667)
(cherry picked from commit a54096e305)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-05 17:10:57 -07:00
Miss Islington (bot) a4fa9a9515
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659) (GH-20661)
* Refresh importlib.metadata from importlib_metadata 1.6.1.

* 📜🤖 Added by blurb_it.

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

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-06-05 17:46:24 -04:00
Miss Islington (bot) cdc3d9cb22
Fix missing FloatOperation in EXTRA_FUNCTIONALITY path. (GH-20655) (#20660)
(cherry picked from commit 5fe1df1886)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-05 22:22:49 +02:00
Miss Islington (bot) 83bff88b4b
bpo-40874: Update to libmpdec-2.5.0 (GH-20652)
(cherry picked from commit 087d612efe)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-05 21:41:17 +02:00
Miss Islington (bot) 3dfe549bfa
bpo-40807: Show warnings once from codeop._maybe_compile (GH-20486)
* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

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

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-06-04 16:59:44 -07:00
Miss Islington (bot) e4e5ec18e2
bpo-40865: Remove unused insint() macro from hash modules (GH-20627)
Automerge-Triggered-By: @tiran
(cherry picked from commit 6ed578f6db)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-06-04 13:27:23 -07:00
Miss Islington (bot) 082cff1786
Fix spacing in docs for tarfile (GH-20629)
Before
```
content.txt is 42 bytes in size and isa regular file.
folder is 420 bytes in size and isa directory.
magic is 4200 bytes in size and issomething else.
```

After:
```
content.txt is 42 bytes in size and is a regular file.
folder is 420 bytes in size and is a directory.
magic is 4200 bytes in size and is something else.
```

Automerge-Triggered-By: @orsenthil
(cherry picked from commit 7a280197f4)

Co-authored-by: Harsha Laxman <HarshaLaxman@users.noreply.github.com>
2020-06-04 13:19:33 -07:00
Miss Islington (bot) 196810a98a
bpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)
Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit b022e5cffb)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-04 10:22:36 -07:00
Victor Stinner 6d62dc1ea4
[3.9] bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) (GH-20618)
* bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)

Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.

(cherry picked from commit 3026cad59b)

* bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)

PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.

(cherry picked from commit cbe1296922)
2020-06-03 20:16:39 +02:00
Victor Stinner 5d2396c8cf
[3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613)
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

(cherry picked from commit c353764fd5)

* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

(cherry picked from commit fa7ab6aa0f)
2020-06-03 17:49:25 +02:00
Miss Islington (bot) a125561397
Update error message in _zoneinfo.py to use f-string (GH-20577)
Inline with the rest of the file, updated error message to use f-string.
(cherry picked from commit 5b9fbbabac)

Co-authored-by: aboddie <64019758+aboddie@users.noreply.github.com>
2020-06-03 08:09:49 -07:00
Miss Islington (bot) 74a1fceeb6
bpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)
Would be nice to backport to python 3.7+. I don't think it's worth the hassle to backport this all the way down to 3.10. But I'll let the maintainers decide.

This is hard to test because the test setup already includes this [environment variable](https://github.com/python/cpython/blob/master/Lib/test/pythoninfo.pyGH-L292)

Let me know if something doesn't match the PR guidelines. This is my first PR in the python source code.
(cherry picked from commit c822efeda9)

Co-authored-by: Jeremy Attali <jeremy.attali@gmail.com>
2020-06-03 06:04:29 -07:00
Ammar Askar 20fe5328a3
[3.9] Fix MSVC warnings in pythonrun.c (GH-20587) (GH-20592)
(cherry picked from commit 90d297012b)
2020-06-03 08:34:55 +01:00
Miss Islington (bot) ff442f36b9
bpo-40241: What's New in Python 3.9: opaque PyGC_Head (GH-20586)
(cherry picked from commit 337d3103a2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-02 03:09:28 -07:00
Miss Islington (bot) 50e847a9eb
bpo-40244: Remove XLC's support from the noreturn flag (GH-20588)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 033d10bd21)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-06-02 01:39:55 -07:00
Miss Islington (bot) b90b61f231
Ensure correct version of Sphinx is used for Windows builds (GH-20582)
(cherry picked from commit fe5dd78182)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-06-01 14:24:10 -07:00
Huon Wilson 3c7609a23c
[3.9] bpo-40630: Add tracemalloc.reset_peak (GH-20102) (GH-20545)
* bpo-40630: Add tracemalloc.reset_peak (GH-20102, cherrypick 8b62644)

The reset_peak function sets the peak memory size to the current size,
representing a resetting of that metric. This allows for recording the
peak of specific sections of code, ignoring other code that may have
had a higher peak (since the most recent `tracemalloc.start()` or
tracemalloc.clear_traces()` call).

* Adjust docs to point to 3.9
2020-06-01 19:26:22 +02:00
Miss Islington (bot) 410b730c20
Make sure that keyword arguments are merged into the arguments dictionary when dict unpacking and keyword arguments are interleaved. (GH-20553) (GH-20569)
(cherry picked from commit db64f12e4d)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2020-06-01 17:07:32 +01:00
Miss Islington (bot) a169961dfc
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)
(cherry picked from commit c8966667bb)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-06-01 08:53:27 -07:00
Miss Islington (bot) 24a88b008b
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
(cherry picked from commit a871f692b4)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-01 00:18:39 -07:00
Miss Islington (bot) 0a674638a3
bpo-17005: Move topological sort functionality to its own module (GH-20558)
The topological sort functionality that was introduced initially in the
functools module has been moved to a new graphlib module to
better accommodate the new tools and keep the original scope of the
functools module.
(cherry picked from commit 2f172d8f15)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-31 17:01:37 -07:00
Miss Islington (bot) a176b314e7
Fix typo in "What's new in Python 3.9" (GH-20559)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 491a3d3a75)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-05-31 16:35:24 -07:00
Miss Islington (bot) 96d91071c0
bpo-40759: Deprecate the symbol module (GH-20364)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit cf88871d6a)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-05-31 15:23:29 -07:00
Miss Islington (bot) cdb015b7ed
Fix asyncio.to_thread() documented return type (GH-20547)
When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine.

This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.
(cherry picked from commit 2b201369b4)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-05-31 00:26:20 -07:00
Miss Islington (bot) 44400e88f9
bpo-40829: Add a what's new entry about deprecation of shuffle's random parameter (GH-20541) (GH-20544) 2020-05-30 15:33:06 -07:00
Miss Islington (bot) 588efc29c5
bpo-40798: Generate a different message for already removed elements (GH-20483)
(cherry picked from commit 735d902b36)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-30 00:54:28 -07:00
Miss Islington (bot) 78cf711d1f
closes bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Reference to PySide has been removed has it is for Qt 4, which has reached end of life.
(cherry picked from commit 4649202ea7)

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-05-29 19:04:25 -07:00
Miss Islington (bot) 9f3f70fd0b
bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Leave selection when right click within.  This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d.  I did not realize that this completely disabled the context menu entries, and  I should have merged a minimal fix immediately.  An automated test should follow.
(cherry picked from commit 97e4e0f53d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-29 16:13:21 -07:00
Miss Islington (bot) 805fa54676
Further de-linting of zoneinfo module (GH-20499)
* Remove unused imports in zoneinfo

* Remove unused variables in zoneinfo

* Remove else after raise
(cherry picked from commit 364b5ead15)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2020-05-29 06:53:52 -07:00
Miss Islington (bot) ad088ca5c6
bpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435) (GH-20514)
* Fix failure of _Py_dg_dtoa to remove trailing zeros

* Add regression test and news entry

* Add explanation about why it's safe to strip trailing zeros

* Make code safer, clean up comments, add change note at top of file

* Nitpick: avoid implicit int-to-float conversion in tests
(cherry picked from commit 895c9c1d43)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-05-29 14:46:54 +01:00
Miss Islington (bot) 8fcc1474ef
bpo-40784: Fix sqlite3 deterministic test (GH-20448)
(cherry picked from commit c610d970f5)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-05-29 05:46:52 -07:00
Miss Islington (bot) a6ae02d7e9
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)
* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string.

It is fairly common to find malformed mime headers (especially content-disposition
headers) where the parameter values, instead of being encoded to RFC
standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and
then enclosing the whole thing in quotes.  The processing of these malformed
headers was incorrectly leaving the spaces between encoded words in the decoded
text (whitespace between adjacent encoded words is supposed to be stripped on
decoding).  This changeset fixes the encoded word processing inside quoted strings
(bare-quoted-string) to do correct RFC 2047 decoding by stripping that
whitespace.
(cherry picked from commit 21017ed904)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2020-05-29 04:43:06 -07:00
Miss Islington (bot) 8e5f11d1f8
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)
(cherry picked from commit 2831642212)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2020-05-29 04:42:40 -07:00
Miss Islington (bot) 6637bd4516
bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)
(cherry picked from commit dc4eee9e26)

Co-authored-by: Fantix King <fantix.king@gmail.com>
2020-05-28 15:17:33 -07:00
Miss Islington (bot) 1a7e34cd62
Note the output ordering of combinatoric functions (GH-19732) (GH-20501) 2020-05-28 13:32:36 -07:00