summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into fix-traceback-syntax-errorfix-traceback-syntax-errorGuido van Rossum2020-05-1418-345/+410
|\
| * bpo-40334: Correctly identify invalid target in assignment errors (GH-20076)Pablo Galindo2020-05-155-23/+31
| | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
| * bpo-38872: Document exec symbol for codeop.compile_command (GH-20047)Joannah Nanjekye2020-05-141-1/+2
| | | | | | | | | | | | | | * Document exec symbol for codeop.compile_command * Remove extra statements Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
| * bpo-40462: Fix typo in test_json (GH-20094)Victor Stinner2020-05-151-1/+1
| |
| * bpo-40460: Fix typo in idlelib/zzdummy.py (GH-20093)Victor Stinner2020-05-151-1/+1
| | | | | | Replace ztest with ztext.
| * bpo-40618: Disallow invalid targets in augassign and except clauses (GH-20083)Lysandros Nikolaou2020-05-143-1/+41
| | | | | | | | | | | | | | | | | | This commit fixes the new parser to disallow invalid targets in the following scenarios: - Augmented assignments must only accept a single target (Name, Attribute or Subscript), but no tuples or lists. - `except` clauses should only accept a single `Name` as a target. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
| * bpo-40619: Correctly handle error lines in programs without file mode (GH-20090)Pablo Galindo2020-05-141-0/+2
| |
| * Revert "bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)" ↵Victor Stinner2020-05-141-299/+2
| | | | | | | | | | | | | | | | | | | | | | (GH-20089) * Revert "bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (GH-20069)" This reverts commit fa0a66e62d087765dbc5c1b89d6149a23ecfb0a6. * Revert "bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)" This reverts commit a1d9e0accd33af1d8e90fc48b34c13d7b07dcf57.
| * bpo-40495: compileall option to hardlink duplicate pyc files (GH-19901)Lumír 'Frenzy' Balhar2020-05-142-10/+256
| | | | | | | | | | | | | | compileall is now able to use hardlinks to prevent duplicates in a case when .pyc files for different optimization levels have the same content. Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Victor Stinner <vstinner@python.org>
| * bpo-40275: Import locale module lazily in gettext (GH-19905)Hai Shi2020-05-141-1/+7
| |
| * bpo-40597: email: Use CTE if lines are longer than max_line_length ↵Arkadiusz Hiler2020-05-132-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consistently (gh-20038) raw_data_manager (default for EmailPolicy, EmailMessage) does correct wrapping of 'text' parts as long as the message contains characters outside of 7bit US-ASCII set: base64 or qp Content-Transfer-Encoding is applied if the lines would be too long without it. It did not, however, do this for ascii-only text, which could result in lines that were longer than policy.max_line_length or even the rfc 998 maximum. This changeset fixes the heuristic so that if lines are longer than policy.max_line_length, it will always apply a content-transfer-encoding so that the lines are wrapped correctly.
| * bpo-29587: Make gen.throw() chain exceptions with yield from (GH-19858)Chris Jerdonek2020-05-132-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | The previous commits on bpo-29587 got exception chaining working with gen.throw() in the `yield` case. This patch also gets the `yield from` case working. As a consequence, implicit exception chaining now also works in the asyncio scenario of awaiting on a task when an exception is already active. Tests are included for both the asyncio case and the pure generator-only case.
| * issue-25872: Fix KeyError using linecache from multiple threads (GH-18007)Michael Graczyk2020-05-131-3/+3
| | | | | | | | The crash that this fixes occurs when using traceback and other modules from multiple threads; del cache[filename] can raise a KeyError.
* | Remove debug print() callsGuido van Rossum2020-05-141-4/+0
| |
* | Add thorough test, and fix found issues in traceback.pyGuido van Rossum2020-05-132-13/+38
| |
* | Fix test (and rebase)Guido van Rossum2020-05-131-1/+1
| |
* | bpo-40612: Fix SyntaxError edge cases in traceback moduleGuido van Rossum2020-05-132-10/+14
|/
* bpo-40334: Always show the caret on SyntaxErrors (GH-20050)Lysandros Nikolaou2020-05-131-9/+6
| | | | | | | | | | | | | | This commit fixes SyntaxError locations when the caret is not displayed, by doing the following: - `col_number` always gets set to the location of the offending node/expr. When no caret is to be displayed, this gets achieved by setting the object holding the error line to None. - Introduce a new function `_PyPegen_raise_error_known_location`, which can be called, when an arbitrary `lineno`/`col_offset` needs to be passed. This function then gets used in the grammar (through some new macros and inline functions) so that SyntaxError locations of the new parser match that of the old.
* bpo-40331: Increase test coverage for the statistics module (GH-19608)Tzanetos Balitsaris2020-05-131-0/+60
|
* bpo-40501: Replace ctypes code in uuid with native module (GH-19948)Steve Dower2020-05-122-177/+30
|
* bpo-40596: Fix str.isidentifier() for non-canonicalized strings containing ↵Serhiy Storchaka2020-05-121-0/+7
| | | | non-BMP characters on Windows. (GH-20053)
* bpo-40593: Improve syntax errors for invalid characters in source code. ↵Serhiy Storchaka2020-05-123-4/+9
| | | | (GH-20033)
* bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)Batuhan Taskaya2020-05-112-11/+0
| | | These were added by mistake (see https://bugs.python.org/issue39481#msg366288).
* bpo-40480: restore ability to join fnmatch.translate() results (GH-20049)Tim Peters2020-05-112-7/+34
| | | | | | | In translate(), generate unique group names across calls. The restores the undocumented ability to get a valid regexp by joining multiple translate() results via `|`.
* bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)Raymond Hettinger2020-05-112-1/+29
|
* bpo-40334: produce specialized errors for invalid del targets (GH-19911)Shantanu2020-05-112-8/+50
|
* bpo-40561: Add docstrings for webbrowser open functions (GH-19999)Brad Solomon2020-05-111-0/+16
| | | | Co-authored-by: Brad Solomon <brsolomon@deloitte.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-40585: Normalize errors messages in codeop when comparing them (GH-20030)Pablo Galindo2020-05-111-0/+9
| | | | | | With the new parser, the error message contains always the trailing newlines, causing the comparison of the repr of the error messages in codeop to fail. This commit makes the new parser mirror the old parser's behaviour regarding trailing newlines.
* bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)Serhiy Storchaka2020-05-101-1/+4
| | | | * Add the terminating period. * Omit module name for builtin types.
* bpo-40397: Fix subscription of nested generic alias without parameters. ↵Serhiy Storchaka2020-05-102-3/+16
| | | | (GH-20021)
* bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAlias ↵Serhiy Storchaka2020-05-101-80/+87
| | | | (GH-19984)
* bpo-40334: Avoid collisions between parser variables and grammar variables ↵Pablo Galindo2020-05-091-0/+27
| | | | | | | | | | | | | | | (GH-19987) This is for the C generator: - Disallow rule and variable names starting with `_` - Rename most local variable names generated by the parser to start with `_` Exceptions: - Renaming `p` to `_p` will be a separate PR - There are still some names that might clash, e.g. - anything starting with `Py` - C reserved words (`if` etc.) - Macros like `EXTRA` and `CHECK`
* bpo-40570: Improve compatibility of uname_result with late-bound .platform ↵Jason R. Coombs2020-05-092-3/+19
| | | | | | | (#20015) * bpo-40570: Improve compatibility of uname_result with late-bound .platform. * Add test capturing ability to cast uname to a tuple.
* bpo-39791: Add files() to importlib.resources (GH-19722)Jason R. Coombs2020-05-085-102/+257
| | | | | | | | | * bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5). * 📜🤖 Added by blurb_it. * Add some documentation about the new objects added. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)Raymond Hettinger2020-05-082-6/+101
|
* bpo-40273: Reversible mappingproxy (FH-19513)Zackery Spytz2020-05-071-0/+9
|
* bpo-40555: Check for p->error_indicator in loop rules after the main loop is ↵Pablo Galindo2020-05-081-0/+9
| | | | done (GH-19986)
* bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)Eric Snow2020-05-071-2/+299
| | | | | | | | | (Note: PEP 554 is not accepted and the implementation in the code base is a private one for use in the test suite.) If code running in a subinterpreter raises an uncaught exception then the "run" call in the calling interpreter fails. A RunFailedError is raised there that summarizes the original exception as a string. The actual exception type, __cause__, __context__, state, etc. are all discarded. This turned out to be functionally insufficient in practice. There is a more helpful solution (and PEP 554 has been updated appropriately). This change adds the exception propagation behavior described in PEP 554 to the _xxsubinterpreters module. With this change a copy of the original exception is set to __cause__ on the RunFailedError. For now we are using "pickle", which preserves the exception's state. We also preserve the original __cause__, __context__, and __traceback__ (since "pickle" does not preserve those). https://bugs.python.org/issue32604
* bpo-38787: C API for module state access from extension methods (PEP 573) ↵Petr Viktorin2020-05-072-1/+74
| | | | | | | | | (GH-19936) Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin. Co-authored-by: Marcel Plch <mplch@redhat.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40334: Error message for invalid default args in function call (GH-19973)Lysandros Nikolaou2020-05-072-2/+5
| | | | | When parsing something like `f(g()=2)`, where the name of a default arg is not a NAME, but an arbitrary expression, a specialised error message is emitted.
* bpo-40334: Fix error location upon parsing an invalid string literal (GH-19962)Lysandros Nikolaou2020-05-072-5/+4
| | | | | | | When parsing a string with an invalid escape, the old parser used to point to the beginning of the invalid string. This commit changes the new parser to match that behaviour, since it's currently pointing to the end of the string (or to be more precise, to the beginning of the next token).
* bpo-40397: Refactor typing._GenericAlias (GH-19719)Serhiy Storchaka2020-05-071-191/+198
| | | | | | Make the design more object-oriented. Split _GenericAlias on two almost independent classes: for special generic aliases like List and for parametrized generic aliases like List[int]. Add specialized subclasses for Callable, Callable[...], Tuple and Union[...].
* bpo-40334: Allow trailing comma in parenthesised context managers (GH-19964)Pablo Galindo2020-05-061-1/+65
|
* bpo-40528: Improve and clear several aspects of the ASDL definition code for ↵Batuhan Taskaya2020-05-061-1/+1
| | | | the AST (GH-19952)
* bpo-40527: Fix command line argument parsing (GH-19955)Victor Stinner2020-05-061-0/+11
|
* bpo-40480 "fnmatch" exponential execution time (GH-19908)Tim Peters2020-05-052-7/+70
| | | | | bpo-40480: create different regexps in the presence of multiple `*` patterns to prevent fnmatch() from taking exponential time.
* bpo-40523: Add pass-throughs for hash() and reversed() to weakref.proxy ↵Pablo Galindo2020-05-051-0/+20
| | | | objects (GH-19946)
* bpo-40504: Allow weakrefs to lru_cache objects (GH-19938)Dennis Sweeney2020-05-051-0/+31
|
* bpo-40355: Improve error messages in ast.literal_eval with malformed Dict ↵Curtis Bucher2020-05-052-4/+13
| | | | | nodes (GH-19868) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)Victor Stinner2020-05-051-3/+0
| | | | | | | | | | | | | | | | | | | _PyErr_ChainExceptions() now ensures that the first parameter is an exception type, as done by _PyErr_SetObject(). * The following function now check PyExceptionInstance_Check() in an assertion using a new _PyBaseExceptionObject_cast() helper function: * PyException_GetTraceback(), PyException_SetTraceback() * PyException_GetCause(), PyException_SetCause() * PyException_GetContext(), PyException_SetContext() * PyExceptionClass_Name() now checks PyExceptionClass_Check() with an assertion. * Remove XXX comment and add gi_exc_state variable to _gen_throw(). * Remove comment from test_generators