[issue45164] int.to_bytes()

2021-09-10 Thread daniel capelle
daniel capelle added the comment: An ASCII representation is shown instead of the hexadecimal value, if there is any. I was not aware this is an intended behaviour. -- ___ Python tracker

[issue45164] int.to_bytes()

2021-09-10 Thread daniel capelle
daniel capelle added the comment: for example check: (6500).to_bytes(2, 'big') result is: b'\x19d' but was expected to be: b'\x19\x64' since ord('d') is 100 = 0x64 there seems to be hex and char representation mixed up. -- ___ Python tracker

[issue45164] int.to_bytes()

2021-09-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: b'\x1964' is a 3-bytes bytes object. >>> b = b'\x1964' >>> len(b) 3 >>> b[0], b[1], b[2] (25, 54, 52) What you what to get is b'\x19\x64'. And it is a different writing of b'\x19d', because b'\x64' is the same as b'd'. >>> b'\x19\x64' b'\x19d'

[issue45164] int.to_bytes()

2021-09-10 Thread daniel capelle
New submission from daniel capelle : for example check: (6500).to_bytes(2, 'big') result is: b'\x19d' but was expected to be: b'\x1964' since ord('d') is 100 = 0x64 there seems to be hex and char representation mixed up. -- messages: 401571 nosy: hypnoticum priority: normal severity: