Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters are garbled when displaying Byte data #83843

Closed
ghost opened this issue Feb 17, 2020 · 3 comments
Closed

Characters are garbled when displaying Byte data #83843

ghost opened this issue Feb 17, 2020 · 3 comments
Labels
3.8 only security fixes topic-IO type-bug An unexpected behavior, bug, or error

Comments

@ghost
Copy link

ghost commented Feb 17, 2020

BPO 39662
Nosy @ericvsmith

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-02-18.20:48:18.916>
created_at = <Date 2020-02-17.13:51:38.543>
labels = ['invalid', 'type-bug', '3.8', 'expert-IO']
title = 'Characters are garbled when displaying Byte data'
updated_at = <Date 2020-02-18.20:48:18.915>
user = None

bugs.python.org fields:

activity = <Date 2020-02-18.20:48:18.915>
actor = 'eric.smith'
assignee = 'none'
closed = True
closed_date = <Date 2020-02-18.20:48:18.916>
closer = 'eric.smith'
components = ['IO']
creation = <Date 2020-02-17.13:51:38.543>
creator = '\xe7\xa6\x8f\xe6\xb0\xb8\xe9\x99\xbd\xe5\xb9\xb3'
dependencies = []
files = []
hgrepos = []
issue_num = 39662
keywords = []
message_count = 3.0
messages = ['362145', '362148', '362235']
nosy_count = 2.0
nosy_names = ['eric.smith', '\xe7\xa6\x8f\xe6\xb0\xb8\xe9\x99\xbd\xe5\xb9\xb3']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue39662'
versions = ['Python 3.8']

@ghost
Copy link
Author

ghost commented Feb 17, 2020

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'
--------------

Repository owner added 3.8 only security fixes topic-IO type-bug An unexpected behavior, bug, or error labels Feb 17, 2020
@ericvsmith
Copy link
Member

How do you know that isn't what is coming in over the serial port? I don't see any indication that this is a bug in python.

We can't really help you here with this sort of problem. I suggest you take this to the python-list mailing list: https://mail.python.org/mailman/listinfo/python-list

@ericvsmith
Copy link
Member

I'm going to close this. But if you have additional information that points to this being a bug in python, we can re-open it.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 only security fixes topic-IO type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants