Module python-magic on/for Windows?

Michael Torrie torriem at gmail.com
Mon May 12 00:09:11 EDT 2008


Larry Hale wrote:
> ALSO: I've even tried putting the 4 "magic" files INTO the .egg
> file... still no-go.  :/

It's often the custom of programs ported from unix to windows to use the
dll location as a key to find the other files that are typically in
share, or etc.  GTK, for example uses ../share and ../etc from the
location where the dlls are stored (if the dlls are in a folder called bin).

In this case I'd try making a folder in the Python25 folder called
"share" and put the contents of the gnuwin32 share/file stuff in there.
 Should look something like this:

c:/python25/share/file/magic.mime.mgc
c:/python25/share/file/magic
c:/python25/share/file/magic.mgc
c:/python25/share/file/magic.mime

Or, judging by a string I found in the dll itself, you might have to put
the files here:

c:/progra~1/File/share/file/magic

Although if such a path really is hardcoded into the dll, this is
certainly a bug, since it will fail on certain non-english windows systems.

Anyway, who knows.  Give these options a try.




More information about the Python-list mailing list