Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 2.1b1 dumps core on list compr. #34167

Closed
complex mannequin opened this issue Mar 16, 2001 · 7 comments
Closed

Python 2.1b1 dumps core on list compr. #34167

complex mannequin opened this issue Mar 16, 2001 · 7 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@complex
Copy link
Mannequin

complex mannequin commented Mar 16, 2001

BPO 409230
Nosy @mwhudson, @tim-one
Files
  • compile_patch: Patch to fix the bug
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2001-03-19.20:43:03.000>
    created_at = <Date 2001-03-16.22:01:48.000>
    labels = ['interpreter-core']
    title = 'Python 2.1b1 dumps core on list compr.'
    updated_at = <Date 2001-03-19.20:43:03.000>
    user = 'https://bugs.python.org/complex'

    bugs.python.org fields:

    activity = <Date 2001-03-19.20:43:03.000>
    actor = 'jhylton'
    assignee = 'jhylton'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2001-03-16.22:01:48.000>
    creator = 'complex'
    dependencies = []
    files = ['21']
    hgrepos = []
    issue_num = 409230
    keywords = []
    message_count = 7.0
    messages = ['3889', '3890', '3891', '3892', '3893', '3894', '3895']
    nosy_count = 5.0
    nosy_names = ['mwh', 'tim.peters', 'jhylton', 'moshez', 'complex']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue409230'
    versions = []

    @complex
    Copy link
    Mannequin Author

    complex mannequin commented Mar 16, 2001

    Hi!

    Python 2.1b1 dumps core when executing the following
    statement:

    print [[y for y in [x,x+1]] for x in [1,3]]

    (Should print: [[1,2],[3,4]])

    The problem may be related to variable scope resolving
    code, because python reports "unknown scope for _[2] in
    ?(0)" before dumping core. This bug makes impossible to
    use a list comprehension as the expression field of
    another one.

    -Complex-

    @complex complex mannequin closed this as completed Mar 16, 2001
    @complex complex mannequin assigned jhylton Mar 16, 2001
    @complex complex mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 16, 2001
    @complex complex mannequin closed this as completed Mar 16, 2001
    @complex complex mannequin assigned jhylton Mar 16, 2001
    @complex complex mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 16, 2001
    @mwhudson
    Copy link

    Logged In: YES
    user_id=6656

    this is a dup of

    [ bpo-406049 ] crash on nested listcomps

    so someone with appropriate privilege should mark it as such.

    @tim-one
    Copy link
    Member

    tim-one commented Mar 18, 2001

    Logged In: YES
    user_id=31435

    Assigned to Jeremy. Boosted priority. Note that mwh says
    this is a dup of 406049 (but this is clearly not the same
    test case). Whatever, I confirmed that this specific case
    still crashes.

    Fatal Python error: unknown scope for _[2] in ?(0) in
    <stdin>

    @mwhudson
    Copy link

    Logged In: YES
    user_id=6656

    Well, no, it's not the same test case, but it is the same
    problem. It also doesn't crash if you apply patch bpo-406076,
    which I wrote to fix bpo-406049.

    @moshez
    Copy link
    Mannequin

    moshez mannequin commented Mar 18, 2001

    Logged In: YES
    user_id=11645

    Here is a patch to fix the problem.

    @jhylton
    Copy link
    Mannequin

    jhylton mannequin commented Mar 19, 2001

    Logged In: YES
    user_id=31392

    This patch is incorrect. The root of the problem is that
    the symbol table does not have the correct entry for the
    nested list comp. The solution must address the symbol
    table problem.

    @jhylton
    Copy link
    Mannequin

    jhylton mannequin commented Mar 19, 2001

    Logged In: YES
    user_id=31392

    Fixed in rev. 2.187 of compile.c

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants