Upgrade to chardet 4.x#5688
Merged
Merged
Conversation
|
|
|
I got this patch diff --git a/setup.py b/setup.py
index 4ff0cfe..eca8bf5 100755
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ if sys.argv[-1] == 'publish':
packages = ['requests']
requires = [
- 'chardet>=3.0.2,<4',
+ 'chardet>=4.0.0,<5',
'idna>=2.5,<3',
'urllib3>=1.21.1,<1.27',
--
2.29.2
diff --git a/requests/__init__.py b/requests/__init__.py
index c00f556..11f0e97 100644
--- a/requests/__init__.py
+++ b/requests/__init__.py
@@ -66,9 +66,9 @@ def check_compatibility(urllib3_version, chardet_version):
major, minor, patch = chardet_version.split('.')[:3]
major, minor, patch = int(major), int(minor), int(patch)
# chardet >= 3.0.2, < 3.1.0
- assert major == 3
- assert minor < 1
- assert patch >= 2
+ assert major == 4
+ assert minor >= 0
+ assert patch >= 0
def _check_cryptography(cryptography_version): |
nateprewitt
requested changes
Dec 11, 2020
Member
nateprewitt
left a comment
There was a problem hiding this comment.
Thanks for this @dan-blanchard! @maxice8 is right we'll need to get the init checks updated as well. Let's also keep the existing floor (3.0.2) for chardet unless there's a strong reason to raise it.
Feel free to add those changes or we'll get them incorporated before merging.
|
This should be goodish enough (idk if you can test diff --git a/requests/__init__.py b/requests/__init__.py
index c00f556..9bfe511 100644
--- a/requests/__init__.py
+++ b/requests/__init__.py
@@ -65,10 +65,10 @@ def check_compatibility(urllib3_version, chardet_version):
# Check chardet for compatibility.
major, minor, patch = chardet_version.split('.')[:3]
major, minor, patch = int(major), int(minor), int(patch)
- # chardet >= 3.0.2, < 3.1.0
- assert major == 3
- assert minor < 1
- assert patch >= 2
+ # chardet >= 3.0.2, < 5.0.0
+ assert major >= 3 < 5
+ assert minor >= 0
+ assert patch >= 0
def _check_cryptography(cryptography_version):
diff --git a/setup.py b/setup.py
index e714bfa..7ba4b2a 100755
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ if sys.argv[-1] == 'publish':
packages = ['requests']
requires = [
- 'chardet>=3.0.2,<4',
+ 'chardet>=3.0.2,<5',
'idna>=2.5,<3',
'urllib3>=1.21.1,<1.27',
'certifi>=2017.4.17' |
72a38d8 to
a32b7ac
Compare
a32b7ac to
516f84f
Compare
Contributor
Author
|
I've updated the check in |
sigmavirus24
approved these changes
Dec 11, 2020
nateprewitt
approved these changes
Dec 14, 2020
Member
nateprewitt
left a comment
There was a problem hiding this comment.
Thanks @dan-blanchard! We'll work on getting a release out today or tomorrow.
This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
This was referenced Mar 17, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I just released chardet 4.0.0 today, and it's faster and fully backward compatible with chardet 3.x (as long as you aren't mucking around in the models it uses under-the-hood directly). The next major release will be Python 3.6+, but seeing as it took me three years to put out this one, that's unlikely to be soon.