Commit Graph

107554 Commits

Author SHA1 Message Date
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
Miss Islington (bot) e4cc3a7c1f
bpo-40806: itertools.product immediately consumes its inputs (GH-20492) (GH-20498) 2020-05-28 09:58:33 -07:00
Miss Islington (bot) eceee544de
[3.9] bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time (GH-20493) (GH-20495)
Recent changes to _datetimemodule broke compilation on mingw; see the comments in this change for details.

FWIW, @corona10: this issue is why `PyType_FromModuleAndSpec` & friends take the `bases` argument at run time.
(cherry picked from commit 459acc5516)


Co-authored-by: Petr Viktorin <encukou@gmail.com>
2020-05-28 09:41:41 -07:00
Miss Islington (bot) a5936ad632
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
Try to make the meaning of platlibdir clear.  The previous wording could
be misinterpreted to suggest that it will be used to find all shared
libraries on the system, and not just Python extensions.  Furthermore,
it was unclear whether it affects third-party (site-packages) extensions
or not.  The new wording tries to make its dual purpose clear,
and provide the additional example of extensions in site-packages.
(cherry picked from commit 242d95659b)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
2020-05-28 09:41:31 -07:00
Miss Islington (bot) 6a478641c0
bpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
Update What's New in Python 3.9.

PyThreadState_DeleteCurrent was not removed, but excluded from the limited C API.
(cherry picked from commit fda7f6d61b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-28 09:34:47 -07:00
Miss Islington (bot) bcbe5c59dd
bpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types (reverts GH-19414) (GH-20264)
Heap types now always visit the type in tp_traverse. See added docs for details.

This reverts commit 0169d3003b.

Automerge-Triggered-By: @encukou
(cherry picked from commit 1cf15af9a6)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-28 08:12:23 -07:00
Miss Islington (bot) 1d82f00367
bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)
Skip new "racing" socket tests which fail randomly until someone fix
them, to ease analysis of buildbot failures (skip tests which are
known to be broken/unstable).
(cherry picked from commit 84ee7e1573)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-28 07:28:17 -07:00
Christian Heimes 8183e11d87
[3.9] bpo-40791: Use CRYPTO_memcmp() for compare_digest (GH-20456) (GH-20461)
hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function
when OpenSSL is available.

Note: The _operator module is a builtin module. I don't want to add
libcrypto dependency to libpython. Therefore I duplicated the wrapper
function and added a copy to _hashopenssl.c..
(cherry picked from commit db5aed931f)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-28 05:09:38 -07:00
Miss Islington (bot) d23ee5d652
Improve IO tutorial's "Old string formatting" section (GH-16251)
* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.

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

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2020-05-27 18:41:38 -07:00
Miss Islington (bot) de6b684109
bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473) (GH-20474)
(cherry picked from commit 56853d8ec6)

Co-authored-by: Elazar Gershuni <elazarg@gmail.com>

Co-authored-by: Elazar Gershuni <elazarg@gmail.com>
2020-05-28 03:24:33 +02:00
Miss Islington (bot) 9e3c583954
bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad04)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-27 16:00:01 -07:00
Miss Islington (bot) be240b8571
Fix compiler warnings in _zoneinfo.c (GH-20342)
```
D:\a\cpython\cpython\Modules\_zoneinfo.c(903,52): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(904,44): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(1772,31): warning C4244: '=': conversion from 'ssize_t' to 'uint8_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
```
(cherry picked from commit e4799b9594)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-27 14:08:20 -07:00