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

[PDB] NameError in list comprehension in PDB #83151

Open
castix mannequin opened this issue Dec 4, 2019 · 2 comments
Open

[PDB] NameError in list comprehension in PDB #83151

castix mannequin opened this issue Dec 4, 2019 · 2 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@castix
Copy link
Mannequin

castix mannequin commented Dec 4, 2019

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

@castix
Copy link
Mannequin Author

castix mannequin commented 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

@castix castix mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 4, 2019
@tirkarthi
Copy link
Member

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.

import pdb

def foo():
  pdb.set_trace()

foo()

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant