From 3bb46e6c06c9c25546a1cdbd8a4553472ae4fb36 Mon Sep 17 00:00:00 2001 From: Alessandro Dalvit Date: Fri, 22 Sep 2023 09:57:57 +0200 Subject: [PATCH] fix: Assume exiftool path could contain whitespaces (#660) * fix: Assume exiftool path could contain whitespaces * fix: Try to make mypy in github happy --- mapillary_tools/upload.py | 2 +- .../extractors/exiftool_runtime_parser.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mapillary_tools/upload.py b/mapillary_tools/upload.py index 88561083..e63552d7 100644 --- a/mapillary_tools/upload.py +++ b/mapillary_tools/upload.py @@ -66,7 +66,7 @@ def wrap_http_exception(ex: requests.HTTPError): lines = [ f"{ex.request.method} {resp.url}", f"> HTTP Status: {ex.response.status_code}", - f"{resp.content}", + str(resp.content), ] return UploadHTTPError("\n".join(lines)) diff --git a/mapillary_tools/video_data_extraction/extractors/exiftool_runtime_parser.py b/mapillary_tools/video_data_extraction/extractors/exiftool_runtime_parser.py index 0d4698b4..85bad643 100644 --- a/mapillary_tools/video_data_extraction/extractors/exiftool_runtime_parser.py +++ b/mapillary_tools/video_data_extraction/extractors/exiftool_runtime_parser.py @@ -37,8 +37,17 @@ def __init__( if not self.geotag_source_path: return - args = f"{exiftool_path} -q -r -n -ee -api LargeFileSupport=1 -X".split(" ") - args.append(str(self.geotag_source_path)) + args = [ + exiftool_path, + "-q", + "-r", + "-n", + "-ee", + "-api", + "LargeFileSupport=1", + "-X", + str(self.geotag_source_path), + ] xml_content = subprocess.run(args, capture_output=True, text=True).stdout