osxphotos
osxphotos copied to clipboard
Timewarp crash
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
- If you installed with pipx:
pipx upgrade osxphotos
- If you installed with pip:
pip install --upgrade osxphotos
- If you installed the pre-built binary, download and install the latest release
Describe the bug Crashed when attempting to run timeworn
To Reproduce Steps to reproduce the behavior:
- Select photos for action (~ 22K) in Photos
- Run osxphotos timewarp --pull-exif
Crash log:
osxphotos crash log
Created: 2024-08-17 10:14:27.051386
osxphotos version: 0.68.5
Platform: macOS-14.6.1-x86_64-i386-64bit
Python version: 3.12.5 (main, Aug 6 2024, 19:08:49) [Clang 15.0.0 (clang-1500.3.9.4)]
sys.argv: ['/Users/omkharanarasaratnam/.local/bin/osxphotos', 'timewarp', '--pull-exif']
CRASH_DATA:
locals: {'date': None, 'date_delta': None, 'time': None, 'time_delta': None, 'timezone': None, 'date_added': None, 'date_added_from_photo': False, 'inspect': False, 'compare_exif': False, 'push_exif': False, 'pull_exif': True, 'function': None, 'match_time': False, 'use_file_time': False, 'add_to_album': None, 'exiftool_path': None, 'verbose_flag': 0, 'library': None, 'theme': None, 'parse_date': None, 'plain': False, 'timestamp': False, 'force': False}
photo: 6907B9CB-FC8E-46EB-B63E-3F69E3E3266D VID_00000001.mp4
osxphotos version: 0.68.5
Error: expected string or bytes-like object, got 'int'
Traceback (most recent call last):
File "/Users/omkharanarasaratnam/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/crash_reporter.py", line 79, in wrapped
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/omkharanarasaratnam/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/cli/timewarp.py", line 666, in timewarp
exif_updater.update_photos_from_exif(
File "/Users/omkharanarasaratnam/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/exif_datetime_updater.py", line 166, in update_photos_from_exif
dtinfo = self.get_date_time_offset_from_exif(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/omkharanarasaratnam/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/exif_datetime_updater.py", line 225, in get_date_time_offset_from_exif
return get_exif_date_time_offset(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/omkharanarasaratnam/.local/pipx/venvs/osxphotos/lib/python3.12/site-packages/osxphotos/exifutils.py", line 106, in get_exif_date_time_offset
matched = re.match(pattern, dt)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/re/__init__.py", line 167, in match
return _compile(pattern, flags).match(string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'int'
This appears to be caused by trying to process a video (vs a Photo) perhaps the meta data returned is different? Expected behavior Should have updated the Photos timestamps based on exif data
Desktop (please complete the following information):
- OS: 14.6.1 (23G93)
- osxphotos version (
osxphotos --version
) 0.68.5