Commit Graph

107361 Commits

Author SHA1 Message Date
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
Pablo Galindo 9b83829e7d
[3.9] bpo-40614: Respect feature version for f-string debug expressions (GH-20196) (GH-20464)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-05-27 22:01:11 +01:00
Miss Islington (bot) 3a2667d91e
bpo-30064: Fix asyncio loop.sock_* race condition issue (GH-20369)
(cherry picked from commit 210a137396)

Co-authored-by: Fantix King <fantix.king@gmail.com>
2020-05-27 13:39:03 -07:00
Lysandros Nikolaou c011d1b5be
[3.9] Backport GH-20440: Set p->error_indicator in more places (GH-20457) 2020-05-27 21:20:43 +01:00
Lysandros Nikolaou 1bfe659ee5
[3.9] Backport GH-20370 and GH-20436: Soft keywords (GH-20458) 2020-05-27 21:20:07 +01:00
Miss Islington (bot) 788d7bfe18
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.

The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)

Co-authored-by: Sean Gillespie <sean@swgillespie.me>
2020-05-27 08:46:57 -07:00
Miss Islington (bot) 43fccb1875
Fix the link to ncurses patch download in macos installer build script (GH-20421)
Reason: the link `ftp://invisible-island.net/ncurses//5.9/ncurses-5.9-20120616-patch.sh.bz2` is dead, which prevents `Mac/BuildScript/build-installer.py` from completing. Looks like the host of the FTP server was changed to `ftp.invisible-island.net`, thus this proposal.

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
(cherry picked from commit 7da46b676a)

Co-authored-by: Oleg Höfling <hoefling@users.noreply.github.com>
2020-05-27 03:32:25 -07:00
Miss Islington (bot) 1c88bf8541
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
(cherry picked from commit db098bc1f0)

Co-authored-by: idomic <michael.ido@gmail.com>
2020-05-26 08:13:33 -07:00
Miss Islington (bot) 500cd89ecc
bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
(cherry picked from commit 372ee27d49)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2020-05-26 06:38:18 -07:00
Miss Islington (bot) 7df9c41c69
bpo-40737: Fix possible reference leak for sqlite3 initialization (GH-20323)
(cherry picked from commit 5eb45d7d4e)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-05-26 05:38:51 -07:00
Miss Islington (bot) 66391b0c6e
bpo-40637: Fix test_pbkdf2_hmac_py for missing sha1 (GH-20422)
(cherry picked from commit be63019ed7)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-26 03:46:24 -07:00
Miss Islington (bot) cc0f50d62c
bpo-39301: State that floor division is used for right shift operations (GH-20347) (GH-20414)
* bpo-39301: State that floor division is used for right shift operations

* Remove "without overflow check"
(cherry picked from commit af7553ac95)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 09:33:10 +01:00
Miss Islington (bot) 5221a10dde
bpo-35714: Reject null characters in struct format strings (GH-16928)
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 00:04:59 -07:00
Miss Islington (bot) a729f4abb8
Simplify creation of the __new__ method in namedtuple() (GH-20361) (GH-20409) 2020-05-25 22:00:31 -07:00
Miss Islington (bot) fda47659bb
Fix peg_generator compiler warnings under MSVC (GH-20405)
(cherry picked from commit a2bbedc8b1)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2020-05-25 21:52:21 -07:00
Miss Islington (bot) 6597e2af83
bpo-40745: Fix typos in NewType docs (GH-20379)
(cherry picked from commit 2b0e654f91)

Co-authored-by: ziheng <zihenglv@gmail.com>
2020-05-25 21:52:14 -07:00
Benjamin Peterson b03e0ee226
[3.9] closes bpo-40774: Fix docs indentation for asyncio.create_subprocess_shell() (GH-20403) (#20407)
(cherry picked from commit 4a0ac42)

Co-authored-by: sth <sth.dev@tejp.de>
2020-05-25 23:19:42 -05:00
Lysandros Nikolaou 791a46ed58
[3.9] bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399) (GH-20404)
When a `SyntaxError` in the expression part of a fstring is found,
the filename attribute of the `SyntaxError` is always `<fstring>`.
With this commit, it gets changed to always have the name of the file
the fstring resides in.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>.
(cherry picked from commit f7b1e46156)
2020-05-26 02:24:31 +01:00
Lysandros Nikolaou 6cb0ad2039
bpo-40246: Fix test_fstring when run with the old parser (GH-20402) 2020-05-26 01:10:00 +01:00
Miss Islington (bot) 3c6c86ab77
bpo-40688: Use the correct parser in the peg_generator scripts (GH-20235)
The scripts in `Tools/peg_generator/scripts` mostly assume that
`ast.parse` and `compile` use the old parser, since this was the
state of things, while we were developing them. They need to be
updated to always use the correct parser. `_peg_parser` is being
extended to support both parsing and compiling with both parsers.
(cherry picked from commit 9645930b5b)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-05-25 13:11:36 -07:00
Miss Islington (bot) 318a18eb88
bpo-23082: Better error message for PurePath.relative_to() from pathlib (GH-19611)
Co-authored-by: Sadhana Srinivasan <rotuna@Sadhanas-MBP.fritz.box>
(cherry picked from commit 448325369f)

Co-authored-by: Rotuna <sadhanasrinivasan@protonmail.com>
2020-05-25 13:01:20 -07:00
Miss Islington (bot) 31084be618
bpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined (GH-20393)
(cherry picked from commit deb4355a37)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-25 12:37:56 -07:00
Miss Islington (bot) 82da2c3eb4
bpo-40750: Support -d flag in the new parser (GH-20340)
(cherry picked from commit 800a35c623)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-25 10:58:03 -07:00
Miss Islington (bot) 9a5e643483
bpo-39245: Fix docs links to the stable ABI (GH-20388)
Automerge-Triggered-By: @vstinner
(cherry picked from commit e50883ccc4)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-05-25 08:49:35 -07:00
Miss Islington (bot) 20b2bf3183
bpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383)
(cherry picked from commit ef16958d17)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-05-25 08:13:49 -07:00
Miss Islington (bot) 1fe1a14703
bpo-40671: Prepare _hashlib for PEP 489 (GH-20180)
(cherry picked from commit 20c22db602)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-25 05:18:49 -07:00
Miss Islington (bot) 7015823971
bpo-40695: Limit hashlib builtin hash fallback (GH-20259)
:mod:`hashlib` no longer falls back to builtin hash implementations when
OpenSSL provides a hash digest and the algorithm is blocked by security
policy.

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

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-25 02:07:35 -07:00
Miss Islington (bot) 82c274e3ba
bpo-40334: Support suppressing of multiple optional variables in Pegen (GH-20367)
(cherry picked from commit cba5031510)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-05-24 15:38:47 -07:00
Miss Islington (bot) 1a4e9e6f35
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
(cherry picked from commit c73914a562)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
2020-05-24 14:32:32 -07:00
Miss Islington (bot) 46c1b9c7b5
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661) (GH-20363) 2020-05-24 14:31:17 -07:00
Miss Islington (bot) 4bb4cde177
bpo-40443: Remove unused imports in the zoneinfo (GH-20354)
(cherry picked from commit 3436f5f899)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-05-24 07:58:25 -07:00
Miss Islington (bot) ebf650532b
bpo-40705: Fix use-after-free in _zoneinfo's module_free (GH-20280)
(cherry picked from commit 06a1b8915d)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2020-05-24 07:43:02 -07:00
Miss Islington (bot) 21a9af193c
bpo-37309: Update IDLE NEWS.txt (GH-20356)
(cherry picked from commit 16ef324193)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-24 07:16:09 -07:00
Miss Islington (bot) 874506cff9
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
This was the only failure running unittest.main(test.test_idle) after imports.
(cherry picked from commit 905b3cd05f)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-24 04:14:17 -07:00
Miss Islington (bot) a3c3e8920a
Remove spurious NULL in descrobject.c (GH-20344)
Co-authored-by: hai shi <shihai1991@126.com>
(cherry picked from commit 3f5f61409e)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2020-05-23 22:24:56 -07:00
Miss Islington (bot) 11fb605cb8
Use Py_ssize_t for the column number in the PEG support code (GH-20341)
(cherry picked from commit b23d7adfdf)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-23 22:20:44 -07:00
Miss Islington (bot) 9181e2e2f3
bpo-40405: Fix asyncio.as_completed docs (GH-19753)
* Fix as_completed docs to correctly state the function return value.
* Also, improves the general wording of the as_completed documentation.

Co-Authored-By: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Yury Selivanov <yury@edgedb.com>
(cherry picked from commit 13206b52d1)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2020-05-23 16:23:53 -07:00
Miss Islington (bot) 962c814ca7
bpo-40439: Update broken link in lexical analysis docs (GH-20184)
Automerge-Triggered-By: @csabella
(cherry picked from commit af23f0d3cf)

Co-authored-by: Matteo Bertucci <matteobertucci2004@gmail.com>
2020-05-22 18:19:13 -07:00
Miss Islington (bot) c1d7768ca8
Reword aware/naive introduction sentence (GH-20175)
This is more informative and avoids the question of whether the period should go inside or outside the quotation marks.

See also GH-20007.
(cherry picked from commit 2e76820a50)

Co-authored-by: Mathieu Dupuy <mathieu.dupuy@doctolib.com>
2020-05-22 15:30:47 -07:00
Miss Islington (bot) 1e5cf949ce
[3.9] bpo-39631: Adds NEWS entry (GH-20227) (GH-20241)
(cherry picked from commit 92327a9913)


Co-authored-by: Steve Dower <steve.dower@python.org>
2020-05-22 15:29:13 -07:00
Miss Islington (bot) 7f77ac463c
bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12bd5)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-05-22 14:35:22 -07:00
Miss Islington (bot) a08b7c3bb0
bpo-9216: hashlib usedforsecurity fixes (GH-20258)
func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP constructor
``_hashlib.new()``. test_hashlib and test_smtplib handle strict security
policy better.

Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
(cherry picked from commit 909b5714e1)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-22 11:22:30 -07:00
Miss Islington (bot) 983b17ca13
bpo-40730: Remove redundant 'to' (GH-20316) (GH-20318)
@ericvsmith I guess it is correct to merge it into master and not 3.9 directly?

Automerge-Triggered-By: @ericvsmith
(cherry picked from commit 30d5a7364d)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-22 11:26:54 -04:00
Miss Islington (bot) 51025e0c86
Fix the URL to fishshell.com (GH-20251)
(cherry picked from commit da7d1f0408)

Co-authored-by: Jonathan Goble <jcgoble3@gmail.com>
2020-05-22 07:32:21 -07:00