BuildRequires: libtool
BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/
-Version: 5.18
+Version: 5.28
Release: 0
Summary: A Tool to Determine File Types
License: BSD-2-Clause
--- /dev/null
+addFilter("E: non-standard-group");
BuildRequires: findutils
BuildRequires: libtool
BuildRequires: python-devel
+BuildRequires: python-setuptools
BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/
-Version: 5.18
+Version: 5.28
Release: 0
Summary: Python module to use libmagic
License: BSD-3-Clause and BSD-4-Clause
as a filename or None if an error occurred and the MAGIC_ERROR flag
is set. A call to errno() will return the numeric error code.
"""
- try: # attempt python3 approach first
- bi = bytes(filename, 'utf-8')
- return str(_file(self._magic_t, bi), 'utf-8')
- except:
- return _file(self._magic_t, filename)
+ if isinstance(filename, bytes):
+ bi = filename
+ else:
+ try: # keep Python 2 compatibility
+ bi = bytes(filename, 'utf-8')
+ except TypeError:
+ bi = bytes(filename)
+ r = _file(self._magic_t, bi)
+ if isinstance(r, str):
+ return r
+ else:
+ return str(r).encode('utf-8')
def descriptor(self, fd):
"""
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.42 2014/05/07 10:13:12 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.56 2016/03/03 22:20:03 christos Exp $")
#endif
#include <assert.h>
const char *mime;
} clsid2mime[] = {
{
- { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
+ { 0x00000000000c1084ULL, 0x46000000000000c0ULL },
"x-msi",
},
{ { 0, 0 },
},
}, clsid2desc[] = {
{
- { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
+ { 0x00000000000c1084ULL, 0x46000000000000c0ULL },
"MSI Installer",
},
{ { 0, 0 },