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

Decode 'htmlsrc' to string before re.sub() #13

Closed
wants to merge 1 commit into from
Closed

Decode 'htmlsrc' to string before re.sub() #13

wants to merge 1 commit into from

Conversation

jarkkojs
Copy link
Contributor

Python 3 has a distinct types for a byte array and a string, and
requires explicit conversion between them. In order to make the script
to work with Python 3, decode 'htmlsrc' to string before applying the
re.sub() API. Before writing the attachment to a file, encode it back to
as a byte array.

Signed-off-by: Jarkko Sakkinen jarkko.sakkinen@iki.fi

Python 3 has distinct types for a byte array and a string, and requires
explicit conversion between them. In order to make the script to work with
Python 3, decode 'htmlsrc' to string before applying using the re.sub() API.
Before writing the attachment to a file, encode it back to as a byte array.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
@jarkkojs jarkkojs closed this Oct 30, 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.

1 participant