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 issue #318: test failures when cchardet is installed #471

Closed
wants to merge 0 commits into from

Conversation

maksverver
Copy link
Contributor

feedparser imports cchardet or chardet depending on what's installed:

try:
import cchardet as chardet # type: ignore[import]
except ImportError:
import chardet # type: ignore[no-redef]

Although these libraries are mostly equivalent, they return slightly different encoding strings, even though both are correct and lead to succesful decoding. This change allows the tests to be run with either library by accepting both encoding names as correct.

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