python -m ipdb #3

Closed
sirex opened this Issue Jun 9, 2011 · 4 comments

Projects

None yet

2 participants

@sirex
sirex commented Jun 9, 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
@gotcha
Owner
gotcha commented Jun 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 Jun 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

@gotcha
Owner
gotcha commented Jun 10, 2011

Le 10/06/11 15:07, sirex a écrit :

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

I tried to implement the feature : however, as documented in
http://docs.python.org/library/runpy.html, it will work only for 2.7

Would you try the code I pushed to confirm it works for you before I
release ?

Thanks

Godefroid Chapelle (aka __gotcha) http://bubblenet.be

@sirex
sirex commented Jun 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 Jun 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment