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

Allow charset normalizer >=2 and <4 #6261

Merged
merged 6 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions requests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_ver
elif charset_normalizer_version:
major, minor, patch = charset_normalizer_version.split(".")[:3]
major, minor, patch = int(major), int(minor), int(patch)
# charset_normalizer >= 2.0.0 < 3.0.0
assert (2, 0, 0) <= (major, minor, patch) < (3, 0, 0)
# charset_normalizer >= 3.0.0 < 4.0.0
assert (3, 0, 0) <= (major, minor, patch) < (4, 0, 0)
else:
raise Exception("You need either charset_normalizer or chardet installed")

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ provides-extra =
use_chardet_on_py3
requires-dist =
certifi>=2017.4.17
charset_normalizer>=2,<3
charset_normalizer>=3,<4
idna>=2.5,<4
urllib3>=1.21.1,<1.27

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run_tests(self):
sys.exit()

requires = [
"charset_normalizer>=2,<3",
"charset_normalizer>=3,<4",
"idna>=2.5,<4",
"urllib3>=1.21.1,<1.27",
"certifi>=2017.4.17",
Expand Down