Skip to content

Commit

Permalink
Fix crash when string contains SO but not SI (#489)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mfncooper committed Apr 18, 2023
1 parent 147be1c commit db10343
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion urwid/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'')
Expand Down

0 comments on commit db10343

Please sign in to comment.