From 942c525d2caa116e69c68840925159df90764a04 Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Wed, 28 Sep 2016 17:21:02 +0100 Subject: [PATCH 1/3] Use newer version of python-magic To ensure subsequent fixes will work. --- requirements-test.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-test.txt b/requirements-test.txt index e2b9d59..7100241 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,7 +3,7 @@ nose==1.3.6 requests==2.2.1 # pdftables==0.0.4 xlrd==0.9.3 -python-magic==0.4.6 +python-magic==0.4.12 chardet==2.3.0 python-dateutil==2.4.2 lxml==3.3.3 diff --git a/setup.py b/setup.py index 9e79d6e..f438857 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ zip_safe=False, install_requires=[ 'xlrd>=0.8.0', - 'python-magic>=0.4.6', # used for type guessing + 'python-magic>=0.4.12', # used for type guessing 'chardet>=2.3.0', 'python-dateutil>=1.5.0', 'lxml>=3.2', From cdc98e8642320565b03737456e42ccf0a461d1ab Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Wed, 28 Sep 2016 17:21:42 +0100 Subject: [PATCH 2/3] Remove unnecessary decode Following the changes here: https://github.com/ahupp/python-magic/commit/b1666986236eab820e9155a5943d6b94938b4c40 --- messytables/any.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messytables/any.py b/messytables/any.py index 24b2827..0614503 100644 --- a/messytables/any.py +++ b/messytables/any.py @@ -63,7 +63,7 @@ def get_mime(fileobj): # seek back later. If not, slurp in the contents into a StringIO. fileobj = messytables.seekable_stream(fileobj) header = fileobj.read(4096) - mimetype = magic.from_buffer(header, mime=True).decode('utf-8') + mimetype = magic.from_buffer(header, mime=True) fileobj.seek(0) if MIMELOOKUP.get(mimetype) == 'ZIP': # consider whether it's an Microsoft Office document From 81076ff81a6f575cd9fd09056df2a2c129f04059 Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Wed, 28 Sep 2016 17:29:06 +0100 Subject: [PATCH 3/3] Fix Travis tests Current release version of html5lib (1.0b10) needs a newer setuptools version than the one Travis provides. Error is: html5lib requires setuptools version 18.5 or above Travis attempts to install html5lib as prompted by setup.py, which then installs the current version, which has this problem. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index c762df6..bd19ad7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ python: - "2.7" - "3.4" install: + # Fix for html5lib, probably can be removed after the version after + # 0.999999999/1.0b10 is released. + - pip install --upgrade setuptools - pip install -e . - pip install -r requirements-test.txt - pip install coveralls