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 "Import text file" function #807

Merged
merged 1 commit into from Jun 10, 2023

Conversation

corubba
Copy link
Contributor

@corubba corubba commented Jun 10, 2023

Depending on the file content type, read() returns either bytes or str, but decode() only works for bytes. Open the file always in textmode (so read() always return str) and let python handle the decoding, soft-failing on any decoding errors.

Fixes #806

Depending on the file content type, read() returns either bytes or str,
but decode() only works for bytes. Open the file always in textmode and
let python handle the decoding, and catch/ignore decoding errors.

Fixes puddletag#806
@sandrotosi sandrotosi merged commit 45558d7 into puddletag:master Jun 10, 2023
@corubba corubba deleted the bugfix/import_text_file branch June 10, 2023 23:33
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.

Attribute Error when using __filename reference in Import text file function
2 participants