I'm trying to run python -m pdb -c continue foo.py
, in order to enable debugging upon errors. The -c continue
arguments should allow me to do this without specifying 'c' upon program start. However, I receive the error: Error: -c does not exist
. I will demonstrate the versions and setup below with a virtualenv
example.
$ virtualenv --version
15.1.0
$ virtualenv tempenv
New python executable in tempenv/bin/python
Installing setuptools, pip...done.
$ source tempenv/bin/activate
(tempenv)$ which python
/usr0/home/eqzx/tempenv/bin/python
(tempenv)$ python --version
Python 2.7.6
(tempenv)$ echo "1/0" > foo.py
(tempenv)$ python foo.py
Traceback (most recent call last):
File "foo.py", line 1, in <module>
1/0
ZeroDivisionError: integer division or modulo by zero
Then:
(tempenv)$ python -m pdb -c continue foo.py
Error: -c does not exist
After installing pdb locally into the virtualenv:
(tempenv)$ pip install -I pdb
(tempenv)$ which pdb
/usr0/home/eqzx/tempenv/bin/pdb
(tempenv)$ python -m pdb -c continue foo.py
Error: -c does not exist
Running without -c continue
works fine (although I'm surprised to see it using /usr/lib/python2.7/pdb.py
instead of the local pdb? even when I retried with virtualenv --no-site-packages
, it still showed that same path):
(tempenv)$ python -m pdb foo.py
> /usr0/home/eqzx/foo.py(1)<module>()
-> 1/0
(Pdb) c
Traceback (most recent call last):
File "/usr/lib/python2.7/pdb.py", line 1314, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
self.run(statement)
File "/usr/lib/python2.7/bdb.py", line 400, in run
exec cmd in globals, locals
File "<string>", line 1, in <module>
File "foo.py", line 1, in <module>
1/0
ZeroDivisionError: integer division or modulo by zero
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr0/home/eqzx/foo.py(1)<module>()
-> 1/0
(Pdb)