This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [PDB] NameError in list comprehension in PDB
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Diaa Jad, SilentGhost, georg.brandl
Priority: normal Keywords:

Created on 2016-06-14 07:40 by Diaa Jad, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg268539 - (view) Author: Diaa Jad (Diaa Jad) Date: 2016-06-14 07:46
This code fails in the python debugger:
(Pdb) z = True
(Pdb) p [x for x in [1,2] if z]
*** NameError: name 'z' is not defined

While the same code works in the interactive shell:
>>> [x for x in [1,2] if z]
[1, 2]
msg268542 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-06-14 08:18
I cannot reproduce this issue on 3.5, do you have a chance to test this on a 3.5 or some other version of python? Also, could you provide any more details of your system?
msg268561 - (view) Author: Diaa Jad (Diaa Jad) Date: 2016-06-14 14:43
I actually drop to pdb from nosetests on test failure using --pdb option. I use a Fedora 23 machine.
Anyway, it looks like this issue is specific to the virtual environment we use at work that uses version 3.4.4, as I couldn't reproduce it on native 3.4 .
As this bug does not show up in the original release I think we can safely close the ticket and I will try to debug the issue locally.
History
Date User Action Args
2022-04-11 14:58:32adminsetgithub: 71503
2016-06-14 14:53:27SilentGhostsetstatus: open -> closed
resolution: works for me
stage: resolved
2016-06-14 14:43:20Diaa Jadsetmessages: + msg268561
2016-06-14 08:18:46SilentGhostsetnosy: + SilentGhost
messages: + msg268542
2016-06-14 08:12:25SilentGhostsetnosy: + georg.brandl
type: crash -> behavior
2016-06-14 07:46:27Diaa Jadsetmessages: + msg268539
2016-06-14 07:44:00Diaa Jadsetcomponents: + Library (Lib), - Extension Modules
2016-06-14 07:40:48Diaa Jadcreate