Closed
Labels
3.7 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
| BPO | 38970 |
|---|---|
| Nosy | @xdegaye, @tirkarthi |
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 = None
created_at = <Date 2019-12-04.15:17:03.998>
labels = ['3.7', 'type-bug', 'library']
title = '[PDB] NameError in list comprehension in PDB'
updated_at = <Date 2019-12-05.08:04:29.609>
user = 'https://bugs.python.org/castix'bugs.python.org fields:
activity = <Date 2019-12-05.08:04:29.609>
actor = 'xtreak'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2019-12-04.15:17:03.998>
creator = 'castix'
dependencies = []
files = []
hgrepos = []
issue_num = 38970
keywords = []
message_count = 2.0
messages = ['357807', '357840']
nosy_count = 3.0
nosy_names = ['xdegaye', 'xtreak', 'castix']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue38970'
versions = ['Python 3.7']Linked PRs
Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
castix commentedon Dec 4, 2019
Related to https://bugs.python.org/issue27316
This code works from the repl: Python 3.7.4 (default, Oct 4 2019, 06:57:26) [GCC 9.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pdb; pdb.set_trace() --Return-- > <stdin>(1)<module>()->None (Pdb) z = True (Pdb) [x for x in [1,2] if z] [1, 2] (Pdb)However in my (turbogears2) wsgi application it raises:
(Pdb) z = True
(Pdb) [x for x in [1,2] if z]
*** NameError: name 'z' is not defined
(Pdb) z
True
(Pdb)
I don't know how to report the issue in a reproducible way.
Thanks
tirkarthi commentedon Dec 5, 2019
I think this is same as https://bugs.python.org/issue26072#msg277578 and is reproducible with below sample script without depending on turbogears. The attached patch in the issue fixes this. Try using interact command from pdb as a workaround.
GH-83151: Add closure support to pdb (GH-111094)
gaogaotiantian commentedon May 6, 2024
This is fixed by PEP 709.
pythonGH-83151: Add closure support to pdb (pythonGH-111094)