pass PATH to exiftool to find xattr

This commit is contained in:
Rhet Turnbull
2022-02-22 22:11:12 -08:00
parent 6cb7dedd9b
commit e789cd5e9d

View File

@@ -69,6 +69,7 @@ def unescape_str(s):
"""unescape an HTML string returned by exiftool -E""" """unescape an HTML string returned by exiftool -E"""
if type(s) != str: if type(s) != str:
return s return s
s = s.replace(""", '\\"')
return html.unescape(s) return html.unescape(s)
@@ -151,6 +152,9 @@ class _ExifToolProc:
return return
# open exiftool process # open exiftool process
# make sure /usr/bin at start of path so exiftool can find xattr (see #636)
env = os.environ.copy()
env["PATH"] = f'/usr/bin/:{env["PATH"]}'
self._process = subprocess.Popen( self._process = subprocess.Popen(
[ [
self._exiftool, self._exiftool,
@@ -167,6 +171,7 @@ class _ExifToolProc:
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
env=env,
) )
self._process_running = True self._process_running = True