This instance will be upgraded to Heptapod 0.21.0rc3 on 2021-04-23 at 10:30 UTC+2 (a few minutes of down time)


parent 414341f24b2a
Pipeline #18703 passed with stage
in 5 minutes and 19 seconds
......@@ -1216,7 +1216,7 @@ def encode_object(space, w_obj, encoding, errors):
if rutf8.has_surrogates(utf8):
utf8 = rutf8.reencode_utf8_with_surrogates(utf8)
return space.newbytes(utf8)
if (encoding == "latin1" or encoding == "latin-1" and
if ((encoding == "latin1" or encoding == "latin-1") and
isinstance(w_obj, W_UnicodeObject) and w_obj.is_ascii()):
return space.newbytes(w_obj._utf8)
return encode(space, w_obj, encoding, errors)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment