DonnyBrasco25 / androguard

Automatically exported from code.google.com/p/androguard
Apache License 2.0
0 stars 0 forks source link

__init__() got an unexpected keyword argument 'magic_file' #67

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When i installed androguard1.5,that happend
TypeError                                 Traceback (most recent call last)
/root/androguard/androlyze.py in <module>()
----> 1 a=APK("/root/aaa.apk")

/root/androguard/androguard/core/bytecodes/apk.pyc in __init__(self, filename, 
raw, mode, magic_file)
    183                 self.validAPK = True
    184 
--> 185         self.get_files_types()
    186 
    187     def get_AndroidManifest(self) :

/root/androguard/androguard/core/bytecodes/apk.pyc in get_files_types(self)
    275                 self.files_crc32[ i ] = crc32( buffer )
    276         else :
--> 277             m = magic.Magic(magic_file=self.magic_file)
    278             for i in self.get_files() :
    279                 buffer = self.zip.read( i )

TypeError: __init__() got an unexpected keyword argument 'magic_file'

Original issue reported on code.google.com by huangxia...@gmail.com on 7 Aug 2012 at 6:45

GoogleCodeExporter commented 8 years ago
Hi,

magic is really a bad module, but I have not the choice because there is no 
other open source tool to do that.

I will try to do a fix. Please wait

Original comment by anthony....@gmail.com on 7 Aug 2012 at 7:29

GoogleCodeExporter commented 8 years ago
Thank you.I have solved this problem.I reinstalled some modules.
python-magic
git clone git://github.com/ahupp/python-magic.git
cd python-magic
sudo python setup.py install

pyfuzzy
download pyfuzzy-0.1.0.tar.gz from 
http://sourceforge.net/projects/pyfuzzy/files/pyfuzzy/pyfuzzy-0.1.0 
tar xzvf pyfuzzy-0.1.0.tar.gz
cd pyfuzzy-0.1.0
sudo python setup.py install

IPython
git clone https://github.com/ipython/ipython
cd ipython
sudo python setup.py install

Original comment by huangxia...@gmail.com on 7 Aug 2012 at 8:03

GoogleCodeExporter commented 8 years ago
Ok but it was python-magic the problem, not other modules.

Thx for your report, I was not sure about the origin of the bug

Original comment by anthony....@gmail.com on 7 Aug 2012 at 8:04

GoogleCodeExporter commented 8 years ago
I 'm not sure too.

huangxiaobo2011

From: androguard
Date: 2012-08-07 16:04
To: huangxiaobo2011
Subject: Re: Issue 67 in androguard: __init__() got an unexpected keyword 
argument 'magic_file'

Original comment by huangxia...@gmail.com on 7 Aug 2012 at 8:06

GoogleCodeExporter commented 8 years ago
When I use APIMonitor,i come across the same problem, then I reinstalled the 
python-magic module by this way:
git clone git://github.com/ahupp/python-magic.git
cd python-magic
sudo python setup.py install
It's OK now.

Original comment by huangxia...@gmail.com on 7 Sep 2012 at 7:27

GoogleCodeExporter commented 8 years ago
I had to uninstall the version of python-magic bundled with Ubuntu 12.04 
(python-magic_5.09-2) and `pip install python-magic` which installed 
python-magic-0.4.2.tar.gz

Original comment by hemisf...@gmail.com on 12 Sep 2012 at 11:24