Skip to content

Commit

Permalink
PY2 allows ucs surrogates in UTF-8 conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <[email protected]>
  • Loading branch information
sloretz committed Mar 15, 2021
1 parent efd5a47 commit 1b02928
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_pytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def __repr__(self):

assert m.str_from_string_from_str("this is a str") == "this is a str"
ucs_surrogates_str = "\udcc3"
if env.PY2:
assert m.str_from_string_from_str(ucs_surrogates_str) is ucs_surrogates_str
with pytest.raises(UnicodeEncodeError):
m.str_from_string_from_str(ucs_surrogates_str)

Expand Down

0 comments on commit 1b02928

Please sign in to comment.