python-web-pdb icon indicating copy to clipboard operation
python-web-pdb copied to clipboard

Cohexistance with pdbpp

Open svalo opened this issue 2 years ago • 1 comments

When pdbpp and web_pdb are installed in the same env, web_pdb is unable to run giving following traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/Code/module.py", line 1772, in backup_data_tgz
    web_pdb.set_trace()
  File "/home/user/.virtualenvs/venv/lib/python3.10/site-packages/web_pdb/__init__.py", line 256, in set_trace
    pdb = WebPdb(host, port, patch_stdstreams)
  File "/home/user/.virtualenvs/venv/lib/python3.10/site-packages/pdbpp.py", line 276, in __call__
    obj.__init__(*args, **kwargs)
TypeError: WebPdb.__init__() got an unexpected keyword argument 'start_filename'

This happens because, by default, pdbpp hijacks pdb.

Setting environment variable PDBPP_HIJACK_PDB=0 solves this issue.

As I stumbled upon this error and struggled a bit to find the remediation I'm asking if it would be possible to mention the workaround in the README.md or to deal with this in web_pdb checking if pdbpp is installed and setting the environment so to make it work.

If you are not willing to do anything I'd understand as it seems more an issue of pdbpp but then I'd just leave this issue as closed for others to find it :)

svalo avatar Nov 10 '23 08:11 svalo

To be honest, I've never heard about pdbpp until now and don't want to add workarounds to some niche cases into web-pdb code. As for mentioning this in Readme, I'll consider it.

romanvm avatar Mar 02 '24 22:03 romanvm