replace charade by chardet
This commit is contained in:
parent
f78c228b3a
commit
9ead8bf157
|
@ -4,7 +4,7 @@ __all__ = ['guess_charset', 'fix_content_type']
|
|||
|
||||
import re
|
||||
import cgi
|
||||
import charade
|
||||
import chardet
|
||||
|
||||
from ..compat import to_native, to_unicode
|
||||
|
||||
|
@ -40,7 +40,7 @@ def guess_text_charset(text, is_html=False):
|
|||
return to_native(charset)
|
||||
# guess by chardet
|
||||
if isinstance(text, bytes):
|
||||
return to_native(charade.detect(text)['encoding'])
|
||||
return to_native(chardet.detect(text)['encoding'])
|
||||
|
||||
|
||||
def guess_html_charset(html):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
cssutils
|
||||
lxml
|
||||
charade
|
||||
chardet
|
||||
python-dateutil
|
||||
requests
|
||||
premailer>=2.8.3
|
||||
|
|
2
setup.py
2
setup.py
|
@ -125,7 +125,7 @@ settings.update(
|
|||
'emails.packages.dkim'
|
||||
],
|
||||
scripts=['scripts/make_rfc822.py'],
|
||||
install_requires=['cssutils', 'lxml', 'charade', 'python-dateutil', 'requests', 'premailer'],
|
||||
install_requires=['cssutils', 'lxml', 'chardet', 'python-dateutil', 'requests', 'premailer'],
|
||||
license=open('LICENSE').read(),
|
||||
#test_suite = "emails.testsuite.test_all",
|
||||
zip_safe=False,
|
||||
|
|
Reference in New Issue