Browse Source

Port pagure to chardet 4.0+

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Pierre-Yves Chibon 3 years ago
parent
commit
f2df67cb8a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      pagure/lib/encoding_utils.py
  2. 1 1
      requirements.txt

+ 1 - 1
pagure/lib/encoding_utils.py

@@ -59,7 +59,7 @@ def detect_encodings(data):
     if not result:
         return {"utf-8": 1.0}
     encodings = {result["encoding"]: result["confidence"]}
-    if ch_version[0] == "3":
+    if ch_version[0] in ("3", "4"):
         for prober in detector._charset_probers:
             if hasattr(prober, "probers"):
                 for prober in prober.probers:

+ 1 - 1
requirements.txt

@@ -7,7 +7,7 @@ binaryornot
 bleach
 blinker
 celery
-chardet<4.0
+chardet
 cryptography
 docutils
 enum34;python_version<"3.4"