#Python download requests install
If you want to continue using chardet with Requests on Python 3 you can install chardet or install Requests using requests:Įnter fullscreen mode Exit fullscreen modeīefore Requests v2.24.0 the pyOpenSSL implementation of TLS was used by default if it was available. To take advantage of charset_normalizer you must uninstall chardet from your environment. Requests will continue to use chardet if the library is installed in your environment. The library itself is relatively young so a lot of work has gone into making sure users aren't broken with this change including extensive tests against real-life websites and comparing the results against chardet to ensure better performance and accuracy in every case. Starting in v2.26.0 for Python 3 the new default library for encoding detection will be charset_normalizer which is MIT licensed. When Requests is bundled with a static application users can no longer "switch out" chardet for a different library which causes a problem with LGPL. The LGPL-2.1 license is not a problem for almost all users, but an issue arises with statically linked Python applications which are pretty rare but becoming more common. The library that Requests uses for content encoding detection has for the past 10 years been chardet which is licensed LGPL-2.1. This feature only gets used when you call the Response.text() API. Requests uses character detection of response bodies in order to reliably decode bytes to str when responses don't define what encoding to use via Content-Type.
Please remember that I am not a lawyer and don't claim to understand anything about open source licenses. The following section has a brief discussion of licensing issues. Read the full set of changes for v2.26.0Įncoding detection with charset_normalizer.Regenerate your lock files and pinned dependencies if you're using pip-tools, poetry, or pipenv.