Closed abhisheksingh1234 closed 2 years ago
Error 58 is ERROR_WRITING_FILE
, so it looks like StringIO
doesn't behave the same way in Python 2.7 and Python 3.x. In order to confirm that this issue is related to StringIO
I would try using a real file and see what happens.
According to the test cases in Python 3.x you may need to use io.BytesIO()
instead of io.StringIO()
. See this:
https://github.com/VirusTotal/yara-python/blob/e58af70ec7280e69e8a4e447729812230921c0e1/tests.py#L1014-L1017
Thank you it works.
I was using the below code which compiles Yara, saves it in the memory. It then loads it and scans the files, It was working fine with Python2.7
When I execute the same code with Python3 I get an error
Traceback (most recent call last): File "/home/yaraengine.py", line 24, in YaraInit rules.save(file=buff) yara.Error: internal error: 58
Were there any changes in saving Yara in memory?
yara-python==4.1.3 yara version is 4.0.2