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

Fix EPDType.encode str vs bytes conflict #67

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

danieldulaney
Copy link
Contributor

Issue: EPDType.encode tried to pack a str into a 22p struct format. However, in
Python 3 onward, 22p will only accept a bytes.

Resolution: Encode the string using the ASCII charset. This guarantees that
only one byte is used per character. Non-ASCII characters will never be
generated.

Issue: EPDType.encode tried to pack a str into a 22p struct format. However, in
Python 3 onward, 22p will only accept a bytes.

Resolution: Encode the string using the ASCII charset. This guarantees that
only one byte is used per character. Non-ASCII characters will never be
generated.
@Gadgetoid
Copy link
Member

Ah the string/bytes nonsense of Python 2.x / 3.x continues to catch me out! Thank you.

@Gadgetoid Gadgetoid merged commit 2be74fc into pimoroni:master Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants