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

Prefer charset_normalizer for char detection #6714

Closed
wants to merge 1 commit into from
Closed

Conversation

nijel
Copy link

@nijel nijel commented May 22, 2024

charset_normalizer is a dependency for requests, while chardet is not, so it is more likely to be found.

For vendored requests this would still load whatever is available.

The reason I noticed this memory profiling in case both libraries are present and charset_normalizer has way lower memory footprint than chardet.

charset_normalizer is dependency for requests, while chardet is not, so it is more likely to be found.
@sigmavirus24
Copy link
Contributor

Just don't install chardet

@nijel
Copy link
Author

nijel commented May 22, 2024

I'd love to, but it's a dependency for a third-party library (otsaloma/gaupol#222).

What is actually the reason for trying chardet first when it's not dependency for requests? It's just an extra import that is very likely to fail.

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