Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JonathanRoth13 opened this issue Oct 22, 2021 · 1 comment
Open

Comments

@JonathanRoth13
Copy link

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

@sylikc
Copy link

sylikc commented Jan 30, 2022

something is weird about your usage of Exiftool... the constructor is supposed to point to the executable, yet you have it pointed to the distribution? I don't think it's the linked problem... something else going on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants