python -m pdb -c continue flag arguments not understood -
i'm trying run python -m pdb -c continue foo.py
, in order enable debugging upon errors. -c continue
arguments should allow me this without specifying 'c' upon program start. however, receive error: error: -c not exist
. demonstrate versions , setup below 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)$ 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 0
then:
(tempenv)$ python -m pdb -c continue foo.py error: -c not exist
after installing pdb locally virtualenv:
(tempenv)$ pip install -i pdb (tempenv)$ pdb /usr0/home/eqzx/tempenv/bin/pdb (tempenv)$ python -m pdb -c continue foo.py error: -c not exist
running without -c continue
works fine (although i'm surprised see using /usr/lib/python2.7/pdb.py
instead of local pdb? when retried virtualenv --no-site-packages
, still showed 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 0 uncaught exception. entering post mortem debugging running 'cont' or 'step' restart program > /usr0/home/eqzx/foo.py(1)<module>() -> 1/0 (pdb)
you using python 2.7, doesn't support -c
parameter:
new in version 3.2:
pdb.py
accepts -c option executes commands if given in.pdbrc
file, see debugger commands.
by upgrading python version 3.6 solve problem.
i didn't find package on pypi backports 3.2+ pdb
package python 2.7. the 1 trying install "password database".
Comments
Post a Comment