Ammar Askar <[email protected]> added the comment:
If you're trying to get raw bytes, you need to use
print(b'\x80')
what's happening right now is that the '\x80' is treated as a unicode code
point (see https://docs.python.org/3/howto/unicode.html#the-string-type), and
when Python goes to print it, it gets encoded to the raw underlying bytes.
Which, in the default encoding of utf-8 requires the extra byte.
>>> '\x80'.encode()
b'\xc2\x80'
----------
nosy: +ammar2
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38357>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com