diff options
author | Martin Cooper <mfncooper@gmail.com> | 2023-04-18 03:05:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 12:05:37 +0200 |
commit | db10343d8aa937770907a3dcc4456cbeefe16549 (patch) | |
tree | c6a900ce0a47a93cd5e4a86cbbbe25f2c6b5917f | |
parent | 147be1c34406f68f4b22eba0390c052b543e4030 (diff) | |
download | urwid-db10343d8aa937770907a3dcc4456cbeefe16549.tar.gz |
Fix crash when string contains SO but not SI (#489)
The DEC_TAG cs type should not be escaped when a lone SO is found
and should be used in the same way as when both SO and S1 are
present.
Fixes #322
-rw-r--r-- | urwid/util.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/urwid/util.py b/urwid/util.py index 9505d74..7fe2b6c 100644 --- a/urwid/util.py +++ b/urwid/util.py @@ -158,7 +158,7 @@ def apply_target_encoding(s: str | bytes): sin = sl[0] assert isinstance(sin, bytes) sout.append(sin) - rle_append_modify(cout, (escape.DEC_TAG.encode('ascii'), len(sin))) + rle_append_modify(cout, (escape.DEC_TAG, len(sin))) continue sin, son = sl son = son.replace(SI, b'') |