From 7b6a0af3146202030069ed5823061ee221ab41bc Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 8 Jan 2021 11:33:50 +0000 Subject: [PATCH] Ensure keyword list only contains string This commit ensures that every keyword in the keyword list that is to be written to a sidecar or exif only contains strings. The current implementation fails with an exception as the "sorted" functions will fail if the list contains a mix of strings and integers. --- osxphotos/photoinfo/_photoinfo_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osxphotos/photoinfo/_photoinfo_export.py b/osxphotos/photoinfo/_photoinfo_export.py index 26964401..3445c916 100644 --- a/osxphotos/photoinfo/_photoinfo_export.py +++ b/osxphotos/photoinfo/_photoinfo_export.py @@ -1443,7 +1443,7 @@ def _exiftool_dict( if keyword_list: # remove duplicates - keyword_list = sorted(list(set(keyword_list))) + keyword_list = sorted(list(set([str(keyword) for keyword in keyword_list]))) exif["IPTC:Keywords"] = keyword_list.copy() exif["XMP:Subject"] = keyword_list.copy() exif["XMP:TagsList"] = keyword_list.copy()