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 breaks programs which import from __main__ #42482

Closed
isandler mannequin opened this issue Oct 14, 2005 · 3 comments
Closed

pdb breaks programs which import from __main__ #42482

isandler mannequin opened this issue Oct 14, 2005 · 3 comments
Labels
stdlib Python modules in the Lib dir

Comments

@isandler
Copy link
Mannequin

isandler mannequin commented Oct 14, 2005

BPO 1326406
Nosy @birkenfeld

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 2007-03-13.22:00:58.000>
created_at = <Date 2005-10-14.04:23:51.000>
labels = ['library']
title = 'pdb breaks programs which import from __main__'
updated_at = <Date 2007-03-13.22:00:58.000>
user = 'https://bugs.python.org/isandler'

bugs.python.org fields:

activity = <Date 2007-03-13.22:00:58.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2005-10-14.04:23:51.000>
creator = 'isandler'
dependencies = []
files = []
hgrepos = []
issue_num = 1326406
keywords = []
message_count = 3.0
messages = ['26591', '26592', '26593']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'isandler']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1326406'
versions = []

@isandler
Copy link
Mannequin Author

isandler mannequin commented Oct 14, 2005

The following example illustrates the problem:

bagira:~/python/dist/src/Lib> cat tt/xx
hello=None
import yy
print "in xx:yy imported"

bagira:~/python/dist/src/Lib> cat tt/yy.py
from __main__ import hello
print "in yy: yy imported "

this works by itself:

bagira:~/python/dist/src/Lib> ../python tt/xx
in yy: yy imported
in xx:yy imported

But breaks under pdb

 bagira:~/python/dist/src/Lib> ../python -m pdb tt/xx 
 > /home/ilya/python/dist/src/Lib/tt/xx(1)?()
 -> hello=None
  (Pdb) c
  Traceback (most recent call last):
   File "/home/ilya/python/dist/src/Lib/pdb.py", line
1057, in main
    pdb._runscript(mainpyfile)
   File "/home/ilya/python/dist/src/Lib/pdb.py", line
982, in       _runscript
     self.run(statement, globals=globals_, locals=locals_)
   File "/home/ilya/python/dist/src/Lib/bdb.py", line
367, in run
     exec cmd in globals, locals
   File "<string>", line 1, in ?
   File "tt/xx", line 2, in ?
     import yy
   File "/home/ilya/python/dist/src/Lib/tt/yy.py", line
1, in ?
     from __main__ import hello
 ImportError: cannot import name hello
 Uncaught exception. Entering post mortem debugging
 Running 'cont' or 'step' will restart the program
  > /home/ilya/python/dist/src/Lib/tt/yy.py(1)?()
 -> from __main__ import hello

@isandler isandler mannequin closed this as completed Oct 14, 2005
@isandler isandler mannequin added the stdlib Python modules in the Lib dir label Oct 14, 2005
@isandler isandler mannequin closed this as completed Oct 14, 2005
@isandler isandler mannequin added the stdlib Python modules in the Lib dir label Oct 14, 2005
@isandler
Copy link
Mannequin Author

isandler mannequin commented May 18, 2006

Logged In: YES
user_id=971153

I have submitted a patch bpo-1429539 for this

@birkenfeld
Copy link
Member

Fixed with said patch.

@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
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant