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: Fix encoding error in Serial TL due to python3 #102

Merged
merged 4 commits into from
Jan 13, 2019
Merged

Conversation

michaeldaas
Copy link
Collaborator

This PR fixes the encoding error in Serial TL that was coming up with the switch to python 3

@coveralls
Copy link

coveralls commented Jan 11, 2019

Coverage Status

Coverage remained the same at 33.81% when pulling 83a3801 on fix_101 into 15ebd75 on development.

basil/TL/Serial.py Show resolved Hide resolved
@@ -40,9 +40,9 @@ def close(self):

def write(self, data):
if self.write_termination is None:
self._port.write(bytes(data))
self._port.write(bytes(data, 'utf-8'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the constructor bytes apparently needs this explicit argument now with python 3. 'utf-8' should have been the default, so it was always implicitly used

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh. Python 3 serial.write function wants byte arrays? Or utf-8 strings?

@DavidLP DavidLP merged commit f46bcf9 into development Jan 13, 2019
@laborleben laborleben deleted the fix_101 branch January 18, 2019 11:04
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

4 participants