-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Migrate to the next version of Python requests when released #15631
Comments
I think the Bot needs some adjustment ;) |
Requests 2.26.0 released without the mandatory chardet dependency: https://pypi.org/project/requests/2.26.0/ Instead of chardet, use the MIT-licensed charset_normalizer for Python3 to remove license ambiguity for projects bundling requests. If chardet is already installed on your machine it will be used instead of charset_normalizer to keep backwards compatibility. (#5797) You can also install chardet while installing requests by specifying [use_chardet_on_py3] extra as follows: shell pip install "requests[use_chardet_on_py3]" Python2 still depends upon the chardet module. |
How to force using chardet in requests, please? With request using charset-normalizer I am getting this error when calling Python via User Defined Transform in SAP BODS:
I am not able to define a source code encoding by placing magic comment into the source files (either as first or second line in the file) because the app probably modifies the script by itself.
|
See the comment just above:
or just install chardet manually. Once charder is installed it is automatically used instead of charset-normalizer |
You can also open an issue for charset nomarlizer https://github.com/ousret/charset_normalizer - @Ousret is usually very responsive and releases new versions quickly and often. I saw several releases recently so it might well be the issue is already solved in latest versions |
However this error is not a problem of charset normalizer. The error indicates that you have problem with your default system encoding on Windows: Please set the env variable as described here to get rid of the error: https://dev.to/methane/python-use-utf-8-mode-on-windows-212i
|
Thank you very much for your quick response. I uninstalled charset-normalizer, chardet and requests and installed requests with this command. The charset-normalizer was installed anyway back and I got the same error. Requests 2.26.0 use charset-normalizer (2.0.6) although there is chardet (4.0.0) in the site-packages folder. |
I set this environment variable (without reboot on Windows 2016 Server), I can see it in the Windows command prompt with 'set' command but unfortunately I am still getting the same error (Non-ASCII character '\xd1' in file c:\program files\python39\lib\site-packages\charset_normalizer_init_.py on line 12, but no encoding declared). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
It looks like we're on However... |
Looks like we're on |
Mmmh, why is pip-compile still brining |
Oh here it is, in I think it's ok to have LGPL on optional dependencies or in CI or dev-related deps, but still not great/desirable. There may be ASF material that says that more officially so you don't have to take my word for it. |
Hey folks... we're coming up on 6 months from the last comment. |
Hello Maintainers,
I am a PMC member of Apache Airflow, and I wanted to give you a bit of heads-up with rather important migration to the upcoming version of requests library in your Python release.
Since you are using requests library in your project, you are affected. It's not as bad for you as you seem to use requests library optionally (when some extras are used) and LGPL dependencies can be used if they are not optional, however it would be safer if you use non-LGPL dependency also here).
As discussed at length in https://issues.apache.org/jira/browse/LEGAL-572 we found out that the 'chardet
library used by
requests` library was a mandatory dependency to requests and since it has LGPL licence, we should not release any Apache Software with it.Since then (and since in Airflow we rely on requests heavily) we have been working with the requests maintainers and "charset-normalizer" maintainer to make it possible to replace chardet with MIT-licensed charset-normalizer instead so that requests library can be used in Python releases by Apache projects.
This was a bumpy road but finally the PR by @ashb has been merged: psf/requests#5797 and we hope soon a new version of requests library will be released.
This is just a heads-up. I will let you know when it is released, but I have a kind requests as well - I might ask the maintainers to release a release candidate of requests and maybe you could help to test it before it is released, that would be some re-assurance for the maintainers of requests who are very concerned about stability of their releases.
Let me know if you need any more information and whether you would like to help in testing the candidate when it is out.
The text was updated successfully, but these errors were encountered: