classification
Title: Crash in string annotations in lambda with keyword-only argument without default value
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, lukasz.langa, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-09-30 16:25 by serhiy.storchaka, last changed 2018-09-30 18:41 by gvanrossum. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9645 merged serhiy.storchaka, 2018-09-30 16:29
PR 9646 merged miss-islington, 2018-09-30 18:07
Messages (5)
msg326730 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-30 16:25
Compiling a string annotation containing a lambda with keyword-only argument without default value causes a crash.

from __future__ import annotations
def f() -> (lambda *, x: x): pass

The following PR fixes this crash. It also fixes other errors:

* Removes a space between "lambda" and ":" in the representation of lambda without argument.

* Removes the final "*" (it is incorrect syntax) in the representation of lambda without *args and keyword-only arguments when compile from AST.
msg326737 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-30 18:07
New changeset 2a2940e5c3e6d92f4fac5e9d361a1e224bb2f12e by Serhiy Storchaka in branch 'master':
bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645)
https://github.com/python/cpython/commit/2a2940e5c3e6d92f4fac5e9d361a1e224bb2f12e
msg326739 - (view) Author: miss-islington (miss-islington) Date: 2018-09-30 18:19
New changeset 0f161b307969f86b4f8f31baf38f53f5462a9874 by Miss Islington (bot) in branch '3.7':
bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645)
https://github.com/python/cpython/commit/0f161b307969f86b4f8f31baf38f53f5462a9874
msg326742 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-30 18:33
These bugs was found when working on issue34856.
msg326743 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2018-09-30 18:41
Should go to @ambv.

On Sun, Sep 30, 2018 at 9:29 AM Serhiy Storchaka <report@bugs.python.org>
wrote:

>
> Change by Serhiy Storchaka <storchaka+cpython@gmail.com>:
>
>
> ----------
> keywords: +patch
> pull_requests: +9037
> stage:  -> patch review
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue34854>
> _______________________________________
>
-- 
--Guido (mobile)
History
Date User Action Args
2018-09-30 18:41:05gvanrossumsetmessages: + msg326743
2018-09-30 18:33:39serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg326742

stage: patch review -> resolved
2018-09-30 18:19:20miss-islingtonsetnosy: + miss-islington
messages: + msg326739
2018-09-30 18:07:22miss-islingtonsetpull_requests: + pull_request9038
2018-09-30 18:07:10serhiy.storchakasetmessages: + msg326737
2018-09-30 16:29:33serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request9037
2018-09-30 16:25:00serhiy.storchakacreate