inducer / pudb

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

Command line [Ctrl+X] works wrongly (wrong encoding) in Py2 #370

Open lega911 opened 4 years ago

lega911 commented 4 years ago

Output for Python 3.7.3, Python2.7.16, Python3 in pudb 2019.2:

>>> u'\xf6' == u'ö'
True

Output for Python 2.7.16 (and 2.7.15) in pudb 2019.2

>>> u'\xf6' == u'ö'
False
inducer commented 4 years ago

Thanks for the report! With Py2 less than a month from EOL, I'm happy to take a patch, but I probably won't go debug myself.

asmeurer commented 4 years ago

When are you planning on dropping Python 2 support in PuDB?

inducer commented 4 years ago

How about Jan 1, to celebrate the new decade?

asmeurer commented 4 years ago

It's fine with me. I think we never did get all the encoding stuff right (as this issue shows). Possibly some of that stuff is still an issue in Python 3 as well, e.g., for terminals that aren't en_US.UTF-8. Pre 3.7 still does non-UTF-8 encoding depending on the LANG, and LC_ALL=C affects what characters urwid can print to the terminal. Plus I'm not convinced all the zero-width and double-width character logic is correct everywhere (that's mostly unrelated to Python 2/3).

I'm sure I'll still need to work on Python 2 stuff in the next year, but I'm fine with using an old version of PuDB when necessary.