Skip to content

Commit

Permalink
Merge pull request #157 from StevenMaude/fix-python-magic-from-buffer
Browse files Browse the repository at this point in the history
Fix for Python Magic API change
  • Loading branch information
frabcus authored Sep 29, 2016
2 parents d006183 + 81076ff commit 38673cc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion messytables/any.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 38673cc

Please sign in to comment.