Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix python 3 support #1

Merged
merged 1 commit into from
Jan 6, 2021
Merged

Fix python 3 support #1

merged 1 commit into from
Jan 6, 2021

Conversation

cwbeck
Copy link

@cwbeck cwbeck commented Jan 6, 2021

Under Python 3, the response argument passed to the event_handler() function is a bytes instance; before using the data from it in string manipulations and print statements, it needs to be transformed to str, because the automatic "cast" includes an initial b and quotes around the value.
Under Python 2, this is still ok if the logs are all ASCII, but more generally, who cares. Python 2 is dead.

This proposal is courtesy of Matific -- see https://www.matific.com

Under Python 3, the `response` argument passed to the `event_handler()` function is a `bytes` instance; before using the data from it in string manipulations and print statements, it needs to be transformed to `str`, because the automatic "cast" includes an initial `b` and quotes around the value.
Under Python 2, this is still ok if the logs are all ASCII, but more generally, who cares. Python 2 is dead.

This proposal is courtesy of Matific -- see https://www.matific.com
@cwbeck cwbeck merged commit 9e1f6f3 into scale8:master Jan 6, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants