-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
support chardet v5.0.0 #6177
Comments
Related to this issue, I'm wondering about why |
This is affecting us as well over at https://github.com/adafruit/cookiecutter-adafruit-circuitpython and possibly other projects that use requests together with some other package that installs chardet. Here's a 'reproducer' for the problem (in our case, cookiecutter depends on binaryornot depends on chardet) :
At the last command, this warning is produced:
When importing requests under pytest, it appears that the caught AssertionError and the RequestsDependencyWarning are treated as errors, as seen in this workflow excerpt:
.. this makes our CI process fail. |
We've merged #6179 which should address this. We could potentially remove the chardet check now that it's not the primary character detector but we're introducing some risk. Chardet major versions maybe every 2 years, sometimes longer. If users are co-installing chardet from somewhere else, Requests currently uses it, so we should continue to be clear if there's an incompatible version being used. There's been discussion of removing chardet entirely in previous issues (#5871) which will likely happen eventually, but I don't foresee us changing that in the immediate future. I believe our current change should mitigate issues for the immediate future though. The fix will be available in the next patch release 2.28.1. |
What about the suggestion to use |
…n restored (PR #4467) # Description With the context given in psf/requests#6177 (comment), I think it should be safe to drop this requirement again. Do you agree? # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) # Reviewer Checklist: - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
…n restored (PR #4467) # Description With the context given in psf/requests#6177 (comment), I think it should be safe to drop this requirement again. Do you agree? # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) # Reviewer Checklist: - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
While this avoids a warning every couple years, it introduces subtle failure modes. When a new major version is released and a user unintentionally installs it, they've potentially disabled an opt-in they made previously. This results in impact on their system(s) they weren't intending and we get a long list of issues. Being explicit is what we've found to be the least problematic over the lifetime of the library. |
I see, thanks for the detailed response. Making it even more explicit by detecting whether the extra was actually selected (making it opt-in only) would probably be the best of both worlds, but if there's talk of removing chardet entirely at some point I guess there's no sufficient incentive to put in that effort. |
- Due to incompatibility with `requests`, see psf/requests#6177
…n restored (PR #4467) With the context given in psf/requests#6177 (comment), I think it should be safe to drop this requirement again. Do you agree? Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
…n restored (PR #4467) With the context given in psf/requests#6177 (comment), I think it should be safe to drop this requirement again. Do you agree? Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
…n restored (PR #4467) With the context given in psf/requests#6177 (comment), I think it should be safe to drop this requirement again. Do you agree? Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
chardet
just released v5.0.0 which is not supported by the latest version (2.28.0) of requests:requests/requests/__init__.py
Line 79 in da9996f
Could you please add the support for the v5.0.0 of chardet ?
The text was updated successfully, but these errors were encountered: