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 tagsources get_encoding #671

Merged

Conversation

bernd-wechner
Copy link
Contributor

This method leans on the html.parser module and that by specification only accepts strings:

https://docs.python.org/3/library/html.parser.html#html.parser.HTMLParser.feed

It cannot therefore be sensibly used to divine the encoding of a byte-string and this whole block of code is redundant. Likely a carry over from the Python 2 to 3 conversion.

Moreover I can find no reference in nay documentation to a FoundEncoding exception and no idea where that is implemented but certainly not by html.parser.

This method leans on the html.parser module and that by specification only accepts strings:

https://docs.python.org/3/library/html.parser.html#html.parser.HTMLParser.feed

It cannot therefore be sensibly used to divine the encoding of a byte-string and this whole block of code is  redundant. Likely a carry over from the Python 2 to 3 conversion.

Moreover I can find no reference in nay documentation to a FoundEncoding exception and no idea where that is implemented but certainly not by html.parser.
@bernd-wechner
Copy link
Contributor Author

Phew, finally coaxed it out of git. git cherrypick be praised. git rebase is a monster.

@sandrotosi sandrotosi merged commit 67dfacd into puddletag:master Jan 22, 2022
@sandrotosi
Copy link
Member

thanks @bernd-wechner !

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.

None yet

2 participants