Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: ahupp/python-magic
base: fa74c179c6
...
head fork: ahupp/python-magic
compare: d5fba526ba
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 7 additions and 5 deletions.
  1. +1 −0  README
  2. +5 −4 magic.py
  3. +1 −1  setup.py
1  README
View
@@ -55,3 +55,4 @@ lukenowak
FlaPer87
SimpleSeb
tehmaze
+sacha@ssl.co.uk
9 magic.py
View
@@ -115,11 +115,12 @@ def from_buffer(buffer, mime=False):
if not libmagic or not libmagic._name:
import sys
- platform_to_lib = {'darwin': 'libmagic.dylib',
- 'win32': 'magic1.dll'}
- if sys.platform in platform_to_lib:
+ platform_to_lib = {'darwin': ['/opt/local/lib/libmagic.dylib',
+ '/usr/local/lib/libmagic.dylib'],
+ 'win32': ['magic1.dll']}
+ for dll in platform_to_lib.get(sys.platform, []):
try:
- libmagic = ctypes.CDLL(platform_to_lib[sys.platform])
+ libmagic = ctypes.CDLL(dll)
except OSError:
pass
2  setup.py
View
@@ -6,7 +6,7 @@
author='Adam Hupp',
author_email='adam@hupp.org',
url="http://github.com/ahupp/python-magic",
- version='0.4.0',
+ version='0.4.1',
py_modules=['magic'],
long_description="""This module uses ctypes to access the libmagic file type
identification library. It makes use of the local magic database and

No commit comments for this range

Something went wrong with that request. Please try again.