summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-17005: Move topological sort functionality to its own module (GH-20558)Miss Islington (bot)2020-06-014-515/+490
| | | | | | | | | 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 2f172d8f1525defe9bba4d49e967fdfc69151731) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40759: Deprecate the symbol module (GH-20364)Miss Islington (bot)2020-05-311-0/+9
| | | | | | Automerge-Triggered-By: @pablogsal (cherry picked from commit cf88871d6a9c12e7b7e5f4d65abc2ec6e2fe952e) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* Fix asyncio.to_thread() documented return type (GH-20547)Miss Islington (bot)2020-05-311-1/+1
| | | | | | | | 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 2b201369b435a4266bda5b895e3b615dbe28ea6e) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)Miss Islington (bot)2020-05-293-16/+50
| | | | | | 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 97e4e0f53d6690db6b942678489716a30925b8af) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* Further de-linting of zoneinfo module (GH-20499)Miss Islington (bot)2020-05-294-12/+5
| | | | | | | | | | * Remove unused imports in zoneinfo * Remove unused variables in zoneinfo * Remove else after raise (cherry picked from commit 364b5ead1584583db91ef7f9d9f87f01bfbb5774) Co-authored-by: Paul Ganssle <paul@ganssle.io>
* bpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435) ↵Miss Islington (bot)2020-05-291-0/+11
| | | | | | | | | | | | | | | | (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 895c9c1d438367722f74f437fda96767d770662b) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-40784: Fix sqlite3 deterministic test (GH-20448)Miss Islington (bot)2020-05-291-9/+27
| | | | | (cherry picked from commit c610d970f5373b143bf5f5900d4645e6a90fb460) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-39040: Fix parsing of email mime headers with whitespace between ↵Miss Islington (bot)2020-05-292-0/+28
| | | | | | | | | | | | | | | | | | 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 21017ed904f734be9f195ae1274eb81426a9e776) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
* bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)Miss Islington (bot)2020-05-281-20/+26
| | | | | (cherry picked from commit dc4eee9e266267498a6b783a0abccc23c06f2b87) Co-authored-by: Fantix King <fantix.king@gmail.com>
* bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)Miss Islington (bot)2020-05-281-0/+4
| | | | | | | | 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 84ee7e1573d166fe7a9be676813e12523b62ab24) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.9] bpo-40791: Use CRYPTO_memcmp() for compare_digest (GH-20456) (GH-20461)Christian Heimes2020-05-282-36/+55
| | | | | | | | | | | 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 db5aed931f8a617f7b63e773f62db468fe9c5ca1) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)Miss Islington (bot)2020-05-273-27/+44
| | | | | | | | | 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 10228bad0452d94e66c964b625a0b61befa08e59) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.9] bpo-40614: Respect feature version for f-string debug expressions ↵Pablo Galindo2020-05-271-0/+5
| | | | | | | | | (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>
* bpo-30064: Fix asyncio loop.sock_* race condition issue (GH-20369)Miss Islington (bot)2020-05-272-16/+156
| | | | | (cherry picked from commit 210a137396979d747c2602eeef46c34fc4955448) Co-authored-by: Fantix King <fantix.king@gmail.com>
* [3.9] Backport GH-20370 and GH-20436: Soft keywords (GH-20458)Lysandros Nikolaou2020-05-271-0/+42
|
* bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)Miss Islington (bot)2020-05-271-0/+15
| | | | | | | | | | | | | 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 29a1384c040d39659e7d01f1fd7b6eb71ef2634e) Co-authored-by: Sean Gillespie <sean@swgillespie.me>
* bpo-39244: multiprocessing return default start method first on macOS (GH-18625)Miss Islington (bot)2020-05-262-4/+7
| | | | | (cherry picked from commit db098bc1f05bd0773943e59f83489f05f28dedf8) Co-authored-by: idomic <michael.ido@gmail.com>
* bpo-40637: Fix test_pbkdf2_hmac_py for missing sha1 (GH-20422)Miss Islington (bot)2020-05-261-9/+23
| | | | | (cherry picked from commit be63019ed726b2da045bf232782062830bb6c27d) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-35714: Reject null characters in struct format strings (GH-16928)Miss Islington (bot)2020-05-261-0/+8
| | | | | | | struct.error is now raised if there is a null character in a struct format string. (cherry picked from commit 3f59b55316f4c6ab451997902579aa69020b537c) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* Simplify creation of the __new__ method in namedtuple() (GH-20361) (GH-20409)Miss Islington (bot)2020-05-261-4/+2
|
* [3.9] bpo-38964: Print correct filename on a SyntaxError in an fstring ↵Lysandros Nikolaou2020-05-261-1/+13
| | | | | | | | | | | (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 f7b1e461567e5e3fa3ba46f589d9edc1b45b2dd0)
* bpo-40246: Fix test_fstring when run with the old parser (GH-20402)Lysandros Nikolaou2020-05-261-1/+7
|
* bpo-23082: Better error message for PurePath.relative_to() from pathlib ↵Miss Islington (bot)2020-05-251-1/+2
| | | | | | | | (GH-19611) Co-authored-by: Sadhana Srinivasan <rotuna@Sadhanas-MBP.fritz.box> (cherry picked from commit 448325369ff73011d34d6c3a493014fe3ead8843) Co-authored-by: Rotuna <sadhanasrinivasan@protonmail.com>
* bpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383)Miss Islington (bot)2020-05-251-1/+1
| | | | | (cherry picked from commit ef16958d17e83723334a51428f410f726d6492a7) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* bpo-40695: Limit hashlib builtin hash fallback (GH-20259)Miss Islington (bot)2020-05-251-2/+3
| | | | | | | | | | :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 4cc2f9348c6e899b76af811fa3bb6c60de642a28) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)Miss Islington (bot)2020-05-242-0/+16
| | | | | (cherry picked from commit c73914a562580ae72048876cb42ed8e76e2c83f9) Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
* bpo-40443: Remove unused imports in the zoneinfo (GH-20354)Miss Islington (bot)2020-05-242-4/+0
| | | | | (cherry picked from commit 3436f5f899f272d7164add072beb18eebd46d777) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-37309: Update IDLE NEWS.txt (GH-20356)Miss Islington (bot)2020-05-241-0/+1
| | | | | (cherry picked from commit 16ef3241939a3a64a447e5d7aabaf2e29deca621) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)Miss Islington (bot)2020-05-242-1/+3
| | | | | | This was the only failure running unittest.main(test.test_idle) after imports. (cherry picked from commit 905b3cd05f8d2c29e1605d109900e3e9d07af4d3) Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
* bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)Miss Islington (bot)2020-05-222-3/+62
| | | | | | | | | | 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 7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e) Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
* bpo-9216: hashlib usedforsecurity fixes (GH-20258)Miss Islington (bot)2020-05-225-34/+87
| | | | | | | | | | | | 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 909b5714e1303357868bc5e281c1cf508d5d5a17) Co-authored-by: Christian Heimes <christian@python.org>
* Fix the URL to fishshell.com (GH-20251)Miss Islington (bot)2020-05-221-1/+1
| | | | | (cherry picked from commit da7d1f04086598a29f77bd452beefe847d038344) Co-authored-by: Jonathan Goble <jcgoble3@gmail.com>
* bpo-40334: Produce better error messages for non-parenthesized genexps ↵Miss Islington (bot)2020-05-221-5/+3
| | | | | | | | | (GH-20153) The error message, generated for a non-parenthesized generator expression in function calls, was still the generic `invalid syntax`, when the generator expression wasn't appearing as the first argument in the call. With this patch, even on input like `f(a, b, c for c in d, e)`, the correct error message gets produced. (cherry picked from commit ae145833025b0156ee2a28219e3370f3b27b2a36) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40715: Reject dict unpacking on dict comprehensions (GH-20292)Miss Islington (bot)2020-05-211-0/+5
| | | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com> (cherry picked from commit b8a65ec1d3d4660d0ee38a9765d98f5cdcabdef5) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* [3.9] bpo-40176: Improve error messages for trailing comma on from import ↵Pablo Galindo2020-05-211-0/+8
| | | | | | | (GH-20294) (GH-20302) (cherry picked from commit 72e0aa2) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)Miss Islington (bot)2020-05-212-2/+20
| | | | | | | | Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143GH-discussion_r427808225) in GH-20143 for context. Automerge-Triggered-By: @aeros (cherry picked from commit 0f56263e62ba91d0baae40fb98947a3a98034a73) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* s/wakup/wakeup (GH-20250)Miss Islington (bot)2020-05-201-1/+1
| | | | | | | | (as title) Automerge-Triggered-By: @Mariatta (cherry picked from commit f2947e354c95d246b1836ac78d4c820c420e259b) Co-authored-by: Kunal Bhalla <bhalla.kunal@gmail.com>
* bpo-40698: Improve distutils upload hash digests (GH-20260)Miss Islington (bot)2020-05-202-5/+41
| | | | | | | | | | - Fix upload test on systems that blocks MD5 - Add SHA2-256 and Blake2b-256 digests based on new Warehous and twine specs. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit e572c7f6dbe5397153803eab256e4a4ca3384f80) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-38870: invalid escape sequence (GH-20240)Miss Islington (bot)2020-05-191-1/+1
| | | | | | | | `/home/isidentical/cpython/cpython/Lib/test/test_unparse.py:333: DeprecationWarning: invalid escape sequence \X` Automerge-Triggered-By: @pablogsal (cherry picked from commit dd74b6fde31aff9aa46c4fc2a830c569764e1b63) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-32309: Implement asyncio.to_thread() (GH-20143)Miss Islington (bot)2020-05-193-0/+102
| | | | | | | | Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410GH-issuecomment-628930973) in GH-18410 for context. Automerge-Triggered-By: @aeros (cherry picked from commit cc2bbc2227c3f5ed9d8f6b3bd052e6f9e68279d2) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* Python 3.9.0b1v3.9.0b1Łukasz Langa2020-05-181-1/+1
|
* bpo-40275: More lazy imports in test.support (GH-20131)Hai Shi2020-05-1810-77/+81
| | | | | | | | | | | | | | | | | | | Make the the following imports lazy in test.support: * bz2 * gzip * lzma * resource * zlib The following test.support decorators now need to be called with parenthesis: * @support.requires_bz2 * @support.requires_gzip * @support.requires_lzma * @support.requires_zlib For example, "@requires_zlib" becomes "@requires_zlib()".
* bpo-38870: Don't omit parenthesis when unparsing a slice in ast.unparseBatuhan Taskaya2020-05-182-2/+20
| | | | When unparsing a non-empty tuple, the parentheses can be safely omitted if there aren't any elements that explicitly require them (such as starred expressions).
* bpo-40334: Reproduce error message for type comments on bare '*' in the new ↵Lysandros Nikolaou2020-05-181-0/+10
| | | | parser (GH-20151)
* bpo-38870: correctly escape unprintable characters on ast.unparse (GH-20166)CyberSaxosTiGER2020-05-182-4/+16
| | | | | | | | | Unprintable characters such as `\x00` weren't correctly roundtripped due to not using default string repr when generating docstrings. This patch correctly encodes all unprintable characters (except `\n` and `\t`, which are commonly used for formatting, and found unescaped). Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-40663: Correctly handle annotations with subscripts in ast_unparse.c ↵Batuhan Taskaya2020-05-181-0/+3
| | | | (GH-20156)
* bpo-40662: Fixed ast.get_source_segment for ast nodes that have incomplete ↵Irit Katriel2020-05-182-0/+13
| | | | | location information (GH-20157) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40661: Fix segfault when parsing invalid input (GH-20165)Lysandros Nikolaou2020-05-182-0/+4
| | | | | | Fix segfaults when parsing very complex invalid input, like `import äˆ ð£„¯ð¢·žð±‹á”€ð””ð‘©±å®ä±¬ð©¾\n𗶽`. Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-40257: Revert changes to inspect.getdoc() (GH-20073)Serhiy Storchaka2020-05-183-31/+113
|
* bpo-39148: fixup to account for IPV6_ENABLED being moved (GH-20170)Nathaniel J. Smith2020-05-181-1/+1
|