From 6f159e8959247cfe1d86e2ebbcd40c030bdd8a3e Mon Sep 17 00:00:00 2001 From: Sergey Obukhov Date: Tue, 25 Apr 2017 11:18:02 -0700 Subject: [PATCH] loosen the encoding requirement for detect_encoding --- setup.py | 2 +- tests/utils_test.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2b91f60..dad6009 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ class InstallCommand(install): setup(name='talon', - version='1.3.5', + version='1.3.6', description=("Mailgun library " "to extract message quotations and signatures."), long_description=open("README.rst").read(), diff --git a/tests/utils_test.py b/tests/utils_test.py index 778e858..8ddebdc 100644 --- a/tests/utils_test.py +++ b/tests/utils_test.py @@ -29,7 +29,9 @@ def test_unicode(): def test_detect_encoding(): eq_ ('ascii', u.detect_encoding(b'qwe').lower()) - eq_ ('iso-8859-2', u.detect_encoding(u'Versi\xf3n'.encode('iso-8859-2')).lower()) + ok_ (u.detect_encoding( + u'Versi\xf3n'.encode('iso-8859-2')).lower() in [ + 'iso-8859-1', 'iso-8859-2']) eq_ ('utf-8', u.detect_encoding(u'привет'.encode('utf8')).lower()) # fallback to utf-8 with patch.object(u.chardet, 'detect') as detect: