problem: mime type function different across platforms #146

wesyoung opened this Issue Feb 16, 2017 · 3 comments


None yet

2 participants


test on RHEL

@wesyoung wesyoung added the bug label Feb 16, 2017
@wesyoung wesyoung added this to the R5 milestone Feb 16, 2017
I believe the error with magic was the function didnt exist:

We are on RHEL 7

not seeing the same issue on CentOS72 (i think?)

def _process_cache(self, split="\n", rstrip=True):
        ftype = mag.file(self.cache)
        if PYVERSION < 3:
            ftype = ftype.decode('utf-8')
alevere commented Feb 16, 2017

Traceback (most recent call last):
File "/usr/bin/csirtg-smrt", line 11, in
load_entry_point('csirtg-smrt==0.0.0a26', 'console_scripts', 'csirtg-smrt')()
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 387, in main
'goback': goback
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 278, in _run_smrt
for i in s.process(r, f, limit=args.limit, data=data, filters=filters):
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 238, in process
for indicator_batch in feed_indicators_batches:
File "/usr/lib/python2.7/site-packages/csirtg_smrt/utils/", line 93, in chunk
for x in it:
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 234, in
feed_indicators = (i for i in feed_indicators if not self.is_archived_with_log(i))
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 228, in
feed_indicators = (self.clean_indicator(i, rule) for i in feed_indicators)
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 227, in
feed_indicators = (i for i in feed_indicators if self.is_valid(i, rule))
File "/usr/lib/python2.7/site-packages/csirtg_smrt/parser/", line 12, in process
for l in self.fetcher.process():
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 228, in process
for l in self._process_cache(split=split, rstrip=rstrip):
File "/usr/lib/python2.7/site-packages/csirtg_smrt/", line 123, in _process_cache
ftype = magic.from_file(self.cache, mime=True)
AttributeError: 'module' object has no attribute 'from_file'

uname -a
Linux 3.10.0-514.6.1.el7.x86_64 #1 SMP Sat Dec 10 11:15:38 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
[axxxxxx@vxxxxx ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

-rw-r--r--. 1 root root 217 Jun 27 2016 Magic_file_extensions-0.2-py2.7.egg-info
-rw-r--r--. 1 root root 6558 Sep 22 2011
-rw-r--r--. 2 root root 8202 Jun 27 2016 magic.pyc
-rw-r--r--. 2 root root 8202 Jun 27 2016 magic.pyo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment