msel-source / pymef

Python wrapper for MEF library
Other
5 stars 3 forks source link

RuntimeError: "Epoc" (0x636f7045) is an unrecognized record type when opening MefSession #25

Closed henrydavidge closed 3 years ago

henrydavidge commented 3 years ago

Problem Description

I see this error when I try to load certain MEF files. I can load other files ok.

What steps reproduce the problem?

from pymef.mef_session import MefSession
ms = MefSession(path,  password)

Paste Traceback/Error Below (if applicable)


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
RuntimeError: "Epoc" (0x636f7045) is an unrecognized record type

The above exception was the direct cause of the following exception:

SystemError                               Traceback (most recent call last)
SystemError: <built-in function __import__> returned a result with an error set
---------------------------------------------------------------------------

Pymef version and platform

pymef==1.2.1
numpy==1.20.3
python==3.8.10

Ubuntu 16.04

cimbi commented 3 years ago

That happens because the MEF session has the "Epoc" record in the .rdat file which is not specified in the MEF library. The file was obviously built with a different version of MEF library than the one pymef uses. I can add "Epoc" record to the github version of MEF library easily but I would have to see the C code.

henrydavidge commented 3 years ago

I see. It looks like the "Epoc" record is defined in the version of the MEF library that pymef uses: https://github.com/msel-source/meflib/blob/88c6e832167aae395b7ee68475fa40e3feee1271/meflib/mefrec.c#L878-L976. It would be great if we could add the record details to the python code.

cimbi commented 3 years ago

I did not notice this, so thanks for letting me know. I'll try to create a new release next week.

henrydavidge commented 3 years ago

Awesome, thanks @cimbi! I'd be happy to try out a patch before a release too.

cimbi commented 3 years ago

@henrydavidge I added those records and they currently reside in the "develop" branch. I am having trouble running my builds using Travis CI so I am trying to resolve it with their support. If you need this fix soon I can help you compile pymef locally, Otherwise just please be patient

cimbi commented 3 years ago

Resolved by commit 47309997a15c5434db85be7cedf87a04205ea018

henrydavidge commented 3 years ago

The new release works like a charm. Thanks @cimbi !