Skip to content

pyexiftool resulting in OSError: [Errno 8] Exec format error #37

@JonathanRoth13

Description

@JonathanRoth13

i encountered the following error :

Traceback (most recent call last):
  File "yeah.py", line 21, in <module>
    with exiftool.ExifTool("/usr/local/lib/python2.7/dist-packages/exiftool.py") as et:
  File "/usr/local/lib/python2.7/dist-packages/exiftool.py", line 191, in __enter__
    self.start()
  File "/usr/local/lib/python2.7/dist-packages/exiftool.py", line 174, in start
    stderr=devnull)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

the way i got around this was by modifying start()

def start(self):
     """Start an ``exiftool`` process in batch mode for this instance.

     This method will issue a ``UserWarning`` if the subprocess is
     already running.  The process is started with the ``-G`` and
     ``-n`` as common arguments, which are automatically included
     in every command you run with :py:meth:`execute()`.
     """
     if self.running:
         warnings.warn("ExifTool already running; doing nothing.")
         return
     with open(os.devnull, "w") as devnull:
         self._process = subprocess.Popen(
             [self.executable, "-stay_open", "True",  "-@", "-",
              "-common_args", "-G", "-n"],
             stdin=subprocess.PIPE, stdout=subprocess.PIPE,
             stderr=devnull,shell=True)
     self.running = True

see https://askubuntu.com/questions/801493/python-subprocess-call-not-working-as-expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions