Open alexfikl opened 2 months ago
I managed to reproduce, but with the following additions:
repr
is the default stringifierAnyway this looks more like an urwid
than pudb
bug, and I suspect it's got something to do with the way numpy
formats its strings, since I can't reproduce just with a long regular python list of floating point numbers.
If it helps, just a single one of those numpy
arrays is sufficient to trigger the traceback for me.
Ooh actually to be even more precise it's something to do with the newline characters. If I had to guess I'd say that urwid
has a bug with how it handles special characters.
What I did:
import random
floats = [random.random() for _ in range(512)]
columns = [floats[i::5] for i in range(5)]
rows = list(zip(*columns))
strings = '\n'.join(', '.join(str(x) for x in row) for row in rows)
This skips the numpy dependency and, by comparing how the different variables behave, you can see that it's really only when you enable line wrapping and use the str
stringifier on the strings
variable that urwid
hits a traceback.
I'm not sure why str
is the one to trigger it instead of repr
. Probably something to do with how I included the newlines.
Describe the bug
When using
stringifier = repr
and there are several variables with a long repr in the local scope, pudb crashes somewhere inurwid/widget/listbox.py::755
with an error likeThis started happening in the last 2-3 months, I think, but I haven't had time to track it down.
Full traceback
``` Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/pudb/__init__.py", line 162, in runscript dbg._runscript(mainpyfile) File "/usr/lib/python3.12/site-packages/pudb/debugger.py", line 534, in _runscript self.run(statement) File "/usr/lib/python3.12/bdb.py", line 600, in run exec(cmd, globals, locals) File "To Reproduce
For a simple reproducer
and then running
python -m pudb reproducer.py
and pressingn
a few times will cause the crash above.Versions