Skip to content

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

2 participants