inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
2.94k stars 226 forks source link

pudb, when run on a Python 3.x invoked with -bb, tracebacks #570

Open dstromberg opened 1 year ago

dstromberg commented 1 year ago

Describe the bug python3 -bb is for finding comparisons between str and bytes. I am using it to assist with porting some old code from CPython 2.7 to CPython 3.10. pudb appears to be doing at least one such comparison that interferes with its operation when used with python3 -bb. That may or may not be intentional.

The traceback looks like:

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                                                          Pudb Internal Exception Encountered                                                         x
x                                                                                                                                                      x
xPudb has encountered and safely caught an internal exception.                                                                          < OK          >x
x                                                                                                                                       < Save        >x
xThe full traceback and some other information can be found below. Please report this information, along with details on what you were    traceback    x
xdoing at the time the exception occurred, at: https://github.com/inducer/pudb/issues                                                                  x
x                                                                                                                                                      x
xpython version: 3.10.2 (main, Mar  2 2022, 03:29:23) [GCC 10.2.1 20210110]                                                                            x
xpudb version: 2022.1.2                                                                                                                                x
xurwid version: 2.1.2                                                                                                                                  x
xTraceback (most recent call last):                                                                                                                    x
x  File "/usr/local/lib/python3.10/site-packages/pudb/debugger.py", line 460, in user_line                                                             x
x    self.interaction(frame)                                                                                                                           x
x  File "/usr/local/lib/python3.10/site-packages/pudb/debugger.py", line 426, in interaction                                                           x
x    self.ui.call_with_ui(self.ui.interaction, exc_tuple,                                                                                              x
x  File "/usr/local/lib/python3.10/site-packages/pudb/debugger.py", line 2428, in call_with_ui                                                         x
x    self.hide()                                                                                                                                       x
x  File "/usr/local/lib/python3.10/site-packages/pudb/debugger.py", line 2421, in hide                                                                 x
x    self.screen.stop()                                                                                                                                x
x  File "/usr/local/lib/python3.10/site-packages/urwid/display_common.py", line 821, in stop                                                           x
x    self._stop()                                                                                                                                      x
x  File "/usr/local/lib/python3.10/site-packages/urwid/raw_display.py", line 275, in _stop                                                             x
x    self.tty_signal_keys(*(self._old_signal_keys + (fd,)))                                                                                            x
x  File "/usr/local/lib/python3.10/site-packages/urwid/display_common.py", line 761, in tty_signal_keys                                                x
x    if intr == 'undefined': intr = 0                                                                                                                  x
xBytesWarning: Comparison between bytes and string                                                                                                     x
x                                                                                                                                                      x
x                                                                                                                                                      x
x                                                                                                                                                      x
x                                                                                                                                                      x
x                                                                                                                                                      x
x                                                                                                                                                      x
x                                                                                                                                                      x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

To Reproduce Steps to reproduce the behavior:

  1. Debug code with python3 -bb and a pudb.set_trace()
  2. Unfortunately, I cannot share the code that is triggering this, but there's a good chance pudb does it frequently

Expected behavior A debugging session that doesn't give a Pudb Internal Exception.

Screenshots

Additional context

Versions

What version of pudb? What version of Python? pudb v2022.1.2, CPython 3.10.8.

Thanks for the great tool!

inducer commented 1 year ago

Thanks for the report. That looks like it's inside of Urwid, so I'm not sure it's our bug.