Skip to content

Commit 06254ca

Browse files
mindwgsnedders
authored andcommitted
drop usage of charade - no longer maintained
1 parent 176651a commit 06254ca

File tree

6 files changed

+10
-17
lines changed

6 files changed

+10
-17
lines changed

README.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ functionality:
113113

114114
- ``genshi`` has a treewalker (but not builder); and
115115

116-
- ``charade`` can be used as a fallback when character encoding cannot
117-
be determined; ``chardet``, from which it was forked, can also be used
118-
on Python 2.
116+
- ``chardet`` can be used as a fallback when character encoding cannot
117+
be determined.
119118

120119
- ``ordereddict`` can be used under Python 2.6
121120
(``collections.OrderedDict`` is used instead on later versions) to

debug-info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"maxsize": sys.maxsize
1313
}
1414

15-
search_modules = ["charade", "chardet", "datrie", "genshi", "html5lib", "lxml", "six"]
15+
search_modules = ["chardet", "datrie", "genshi", "html5lib", "lxml", "six"]
1616
found_modules = []
1717

1818
for m in search_modules:

html5lib/inputstream.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,7 @@ def detectEncoding(self, parseMeta=True, chardet=True):
472472
if encoding is None and chardet:
473473
confidence = "tentative"
474474
try:
475-
try:
476-
from charade.universaldetector import UniversalDetector
477-
except ImportError:
478-
from chardet.universaldetector import UniversalDetector
475+
from chardet.universaldetector import UniversalDetector
479476
buffers = []
480477
detector = UniversalDetector()
481478
while not detector.done:

html5lib/tests/test_encoding.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,9 @@ def test_encoding():
6262
yield (runPreScanEncodingTest, test[b'data'], test[b'encoding'])
6363

6464
try:
65-
try:
66-
import charade # flake8: noqa
67-
except ImportError:
68-
import chardet # flake8: noqa
65+
import chardet # flake8: noqa
6966
except ImportError:
70-
print("charade/chardet not found, skipping chardet tests")
67+
print("chardet not found, skipping chardet tests")
7168
else:
7269
def test_chardet():
7370
with open(os.path.join(test_dir, "encoding" , "chardet", "test_big5.txt"), "rb") as fp:

requirements-optional.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# streams.
55
genshi
66

7-
# charade can be used as a fallback in case we are unable to determine
7+
# chardet can be used as a fallback in case we are unable to determine
88
# the encoding of a document.
9-
charade
9+
chardet>2.2
1010

1111
# lxml is supported with its own treebuilder ("lxml") and otherwise
1212
# uses the standard ElementTree support

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@
7070

7171
# Standard extras, will be installed when the extra is requested.
7272
"genshi": ["genshi"],
73-
"charade": ["charade"],
73+
"chardet": ["chardet>=2.2"],
7474

7575
# The all extra combines a standard extra which will be used anytime
7676
# the all extra is requested, and it extends it with a conditional
7777
# extra that will be installed whenever the condition matches and the
7878
# all extra is requested.
79-
"all": ["genshi", "charade"],
79+
"all": ["genshi", "chardet>=2.2"],
8080
"all:platform.python_implementation == 'CPython'": ["datrie", "lxml"],
8181
},
8282
)

0 commit comments

Comments
 (0)