rr- / urwid_readline

readline text edit for urwid
MIT License
27 stars 11 forks source link

DeprecationWarning: Do not import 'is_wide_char' from urwid.urwid.util, import it from 'urwid'. #27

Open sylvain-vq opened 4 months ago

sylvain-vq commented 4 months ago

I'm getting this warning with urwid-readline 0.14 and urwid 2.6.15. It comes from readline_edit.py:

def _is_valid_key(char):
    return urwid.util.is_wide_char(char, 0) or (
        len(char) == 1 and ord(char) >= 32
    )

urwid.util.is_wide_char should be changed for urwid.is_wide_char though I don't know if this would also work with older versions of urwid.

nikhilweee commented 3 months ago

Came here to report the same issue. Although for me I see these warnings while using pudb. @rr- I believe this was fixed in #23, and this package is due for a new version on pypi.

Until then one can use the following in requirements.txt or when using pip install:

urwid-readline @ git+https://github.com/rr-/urwid_readline@master
neiljp commented 3 months ago

Zulip-terminal will run into this issue shortly, so it would be great to have this released from our point of view too.

My only concern would be how much it is backwards compatible, and while we could introduce a matrix of urwid versions, would the existing tests cover it, to tell us that? (I've not checked)

It's been great to see the uptake in Urwid development again - though rather rapidly at this point, so testing over select Urwid versions may be an idea in any case, since it might pick up aspects like this :)