diff --git a/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/helpers/system.py b/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/helpers/system.py index 9e84a52b1..fbc44ff1a 100644 --- a/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/helpers/system.py +++ b/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/helpers/system.py @@ -194,6 +194,15 @@ def elf_attributes(cls, executable_path=sys.executable): # Open executable stream stream = open(executable_path, 'rb') + # Retrieve magic number (header) + magic = stream.read(4) + + if magic != b'\x7fELF': + log.warn('Unknown ELF format for %r (magic: %r)', executable_path, magic) + return None, None + + stream.seek(0) + # Parse ELF elf = ELFFile(stream)