[New-bugs-announce] [issue39662] Characters are garbled when displaying Byte data

福永陽平 report at bugs.python.org
Mon Feb 17 08:51:38 EST 2020


New submission from 福永陽平 <yohei.fukunaga at gmail.com>:

Hex data is garbled when displaying received data from serial.

--- code ---
recvMessage = serialPort.readline()
print(recvMessage, end="\r\n")
------------

--- result ---
b'ERXUDP FE80:0000:0000:0000:0280:8700:3015:64F5 FE80:0000:0000:0000:021D:1290:0003:8331 0E1A 0E1A 00808700301564F5 1 0012 \x10\x81\x00\x01\x02\x88\x01\x05\xff\x01r\x01\xe7\x04\x00\x00\x02\x04\r\n'
--------------

Mysterious value of 0x01r.
When the corresponding value is judged, it becomes 0x72.

The correct behavior is...
--- correct result ---
b'ERXUDP FE80:0000:0000:0000:0280:8700:3015:64F5 FE80:0000:0000:0000:021D:1290:0003:8331 0E1A 0E1A 00808700301564F5 1 0012 \x10\x81\x00\x01\x02\x88\x01\x05\xff\x72\x01\xe7\x04\x00\x00\x02\x04\r\n'
--------------

----------
components: IO
messages: 362145
nosy: 福永陽平
priority: normal
severity: normal
status: open
title: Characters are garbled when displaying Byte data
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39662>
_______________________________________


More information about the New-bugs-announce mailing list