-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
Before submitting a bug report, please ensure you are running the most recent version of osxphotos and that the bug is reproducible on the latest version
osxphotos, version 0.73.3
Python 3.12.12 (main, Oct 12 2025, 15:04:06) [Clang 14.0.0 (clang-1400.0.29.202)]
Python executable: osxphotos/venv/bin/python3.12
macOS 12.7.6, x86_64
Describe the bug
An image file with keyword 144 which is interpreted as an int. Using osxphotos import image --export .osxphotos_export.db
The file (originally had 144 subject/keyword) and on export with merge_keywords option with export_as_hardlink=true osxphotos correctly added 144 to the tmp file.
To Reproduce
osxphotos import img027.jpg --exportdb photos/.osxphotos_export.db --walk --stop-on-error 10 --sidecar --verbose --timestamp --dup-check --skip-dups --resume
Expected behavior
Loading the pic and assign keyword correctly.
Will try to prepare a PR.
Screenshots
N/A
Desktop (please complete the following information):
osxphotos, version 0.73.3
Python 3.12.12 (main, Oct 12 2025, 15:04:06) [Clang 14.0.0 (clang-1400.0.29.202)]
Python executable: oxphotos/venv/bin/python3.12
macOS 12.7.6, x86_64
Additional context
Log output:
│ /Users/MSP/Documents/GitHub/osxphotos/osxphotos/cli/import_cli.py:1616 in set_photo_metadata │
│ │
│ 1613 │ photo.title = normalize_unicode(metadata.title) │
│ 1614 │ photo.description = normalize_unicode(metadata.description) │
│ 1615 │ keywords = metadata.keywords.copy() │
│ ❱ 1616 │ keywords = normalize_unicode(keywords) │
│ 1617 │ if merge_keywords: │
│ 1618 │ │ if old_keywords := normalize_unicode(photo.keywords): │
│ 1619 │ │ │ keywords.extend(old_keywords) │
│ │
│ /Users/MSP/Documents/GitHub/osxphotos/osxphotos/unicode.py:86 in normalize_unicode │
│ │
│ 83 │ if isinstance(value, tuple): │
│ 84 │ │ return tuple(unicodedata.normalize(form, v) for v in value) │
│ 85 │ elif isinstance(value, list): │
│ ❱ 86 │ │ return [unicodedata.normalize(form, v) for v in value] │
│ 87 │ elif isinstance(value, str): │
│ 88 │ │ return unicodedata.normalize(form, value) │
│ 89 │ else: │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: normalize() argument 2 must be str, not int
Metadata
Metadata
Assignees
Labels
No labels