[issue38357] print adding extra bytes in hex above x7F

2019-10-03 Thread Brett Cannon
Brett Cannon added the comment: @Artificial please see the various blog posts and explanations about why the clear separation between bytes and text came to be and thus this change isn't "unnecessarily complicated". -- nosy: +brett.cannon ___

[issue38357] print adding extra bytes in hex above x7F

2019-10-02 Thread Artificial
Artificial added the comment: Thanks, Arfrever Seems unnecessarily complicated for what worked in Python2. -- ___ Python tracker ___

[issue38357] print adding extra bytes in hex above x7F

2019-10-02 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: However print() called with non-str argument would firstly call str() on it, which is most likely not what reporter wanted: >>> print(b'\x80') b'\x80' >>> str(b"\x80") "b'\\x80'" >>> print(str(b"\x80")) b'\x80' $ python -c

[issue38357] print adding extra bytes in hex above x7F

2019-10-02 Thread Ammar Askar
Ammar Askar 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

[issue38357] print adding extra bytes in hex above x7F

2019-10-02 Thread Artificial
Artificial added the comment: python3 -c "print('\x7F')" > test.txt && xxd test.txt : 7f0a .. python3 -c "print('\x80')" > test.txt && xxd test.txt : c280 0a ... --

[issue38357] print adding extra bytes in hex above x7F

2019-10-02 Thread Artificial
New submission from Artificial : Any hex str of value above \x7F causes an extra byte to printed. -- files: Screenshot from 2019-10-02 20-31-50.png messages: 353796 nosy: Artificial priority: normal severity: normal status: open title: print adding extra bytes in hex above x7F type: