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

Error with recent bottle versions

Open eht16 opened this issue 1 year ago • 2 comments

When using web-pdb with bottle version >= 0.13, web-pdb will crash:

CRITICAL:root:Web-PDB: starting web-server on http://127.0.0.1:5555
Exception in thread Thread-1 (_run_server):
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/venv/lib/python3.12/site-packages/web_pdb/web_console.py", line 126, in _run_server
    app.frame_data = self._frame_data
    ^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/bottle.py", line 1143, in __setattr__
    raise AttributeError("Attribute %s already defined. Plugin conflict?" % name)
AttributeError: Attribute frame_data already defined. Plugin conflict?

I'm not sure if this is an issue in web-pdb or bottle though it seems to me the related code in https://github.com/bottlepy/bottle/blob/master/bottle.py#L1124 is pretty much on purpose.

On bottle version before 0.13 everything works fine.

eht16 avatar Oct 05 '24 09:10 eht16

I see the same issue and have the same experience in terms of old version working and new throwing this error.

Roosenn avatar Oct 24 '24 07:10 Roosenn

Thanks for reporting this. Strangely enough, it does not happen in tests, and the line in question in the Bottle sources added long time ago.

romanvm avatar Oct 24 '24 11:10 romanvm

Just hit into this issue so I can confirm that it occurs.

im-n1 avatar Oct 31 '24 09:10 im-n1

I met the same problem. I use python 3.8.20, web-pdb 1.6.2 and the bug disappeard when I changed bottle to 0.12.25

liurui1084 avatar Nov 13 '24 02:11 liurui1084

I also met the same issue. I use Python 3.11.0 and web_pdb 1.6.2 Is installing a lower bottle version will correct the problem (lower than 0.13)?

Dan-Eli avatar Nov 14 '24 14:11 Dan-Eli

Fixed in 1.6.3

romanvm avatar Nov 16 '24 18:11 romanvm