Skip to content

Fix python 3 support #18

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

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Fix python 3 support #18

merged 1 commit into from
Feb 2, 2021

Conversation

shaib
Copy link
Contributor

@shaib shaib commented Jan 8, 2020

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
@shaib
Copy link
Contributor Author

shaib commented Jan 8, 2020

(this solves #17 as well)

@delijati
Copy link

delijati commented Jan 9, 2020

can this merged !

dpfrakes added a commit to dpfrakes/supervisor-stdout that referenced this pull request Apr 13, 2020
nijel added a commit to WeblateOrg/docker that referenced this pull request Jul 22, 2020
@KroneckerDeIta
Copy link

Please merge this.

@arthuravila26
Copy link

Merge it, please!!

@coderanger coderanger merged commit 973ba19 into coderanger:master Feb 2, 2021
cristiroma added a commit to eaudeweb-skunkworks/docker-nginx-php-fpm that referenced this pull request Feb 5, 2021
cristiroma added a commit to eaudeweb-skunkworks/docker-nginx-php-fpm that referenced this pull request Feb 5, 2021
cristiroma added a commit to eaudeweb-skunkworks/docker-nginx-php-fpm that referenced this pull request Feb 5, 2021
cristiroma added a commit to eaudeweb-skunkworks/docker-nginx-php-fpm that referenced this pull request Feb 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.

5 participants