Skip to content

fix: catch OSError when exiftool binary is missing (#1960)#2082

Open
doitgo wants to merge 1 commit into
microsoft:mainfrom
doitgo:fix/issue-1960
Open

fix: catch OSError when exiftool binary is missing (#1960)#2082
doitgo wants to merge 1 commit into
microsoft:mainfrom
doitgo:fix/issue-1960

Conversation

@doitgo
Copy link
Copy Markdown

@doitgo doitgo commented Jun 6, 2026

Fixes #1960
When exiftool_path points to a binary that does not exist, the subprocess.run calls raised FileNotFoundError, which propagated unhandled through exiftool_metadata() and crashed the whole conversion.

Add OSError to the except clauses at both subprocess.run sites and wrap the error in a RuntimeError that includes the path, giving users a clear, actionable error message.

Add a regression test for the missing-binary case and a sanity check that the exiftool_path=None early return still works.

When exiftool_path points to a binary that does not exist, the
subprocess.run calls raised FileNotFoundError, which propagated
unhandled through exiftool_metadata() and crashed the whole
conversion.

Add OSError to the except clauses at both subprocess.run sites
and wrap the error in a RuntimeError that includes the path,
giving users a clear, actionable error message.

Add a regression test for the missing-binary case and a sanity
check that the exiftool_path=None early return still works.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

exiftool_metadata() crashes with FileNotFoundError when exiftool_path binary doesn't exist

1 participant