Skip to content
This repository

python -m ipdb #3

Closed
sirex opened this Issue June 09, 2011 · 4 comments

2 participants

sirex Godefroid Chapelle
sirex
sirex commented June 09, 2011

I can start pdb this way:

python -m pdb manage.py test tests

But with ipdb this does not work:

python -m ipdb manage.py test tests     
python: No module named ipdb.__main__; 'ipdb' is a package and cannot be directly executed
Godefroid Chapelle
Owner
gotcha commented June 10, 2011

ipdb is distributed as an egg : this enforces that it is a package.

At first sight, I see no way to fix this issue.

sirex
sirex commented June 10, 2011

As I understand, information about how module is searched and executed, when called with -m is described here:
http://docs.python.org/library/runpy.html

Godefroid Chapelle
Owner
gotcha commented June 10, 2011
sirex
sirex commented June 11, 2011

It works!

$ bin/python -m ipdb boo.py
> /tmp/ipdb-test/boo.py(1)<module>()
----> 1 print('boo')
      2 
      3 for i in range(3):

ipdb> n
boo
> /tmp/ipdb-test/boo.py(3)<module>()
      2 
----> 3 for i in range(3):
      4     print(i)

ipdb> n
> /tmp/ipdb-test/boo.py(4)<module>()
      2 
      3 for i in range(3):
----> 4     print(i)

ipdb> p i
0
ipdb> c
0
1
2
The program finished and will be restarted
> /tmp/ipdb-test/boo.py(1)<module>()
----> 1 print('boo')
      2 
      3 for i in range(10):

ipdb> exit

$

Thanks!

sirex sirex closed this June 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.