RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
2.17k stars 100 forks source link

Unsupported Operand Type(s) #726

Closed franzone closed 2 years ago

franzone commented 2 years ago

Whenever I attempt to export my Photos library I get tons of the following errors:

Using last opened Photos library: /Users/jonathan/Pictures/Photos Library.photoslibrary Exporting 637 photos to /Volumes/MyBook/ExportOSXPhotos... Error exporting photo (jHqZK9JKTzy7Xs5qHrvDHw: IMG_0476.HEIC) as IMG_0476.HEIC: unsupported operand type(s) for ^: 'bool' and 'NoneType' Error exporting photo (C8ih9XhHS7WcGNTuW0lZNg: IMG_0794.HEIC) as IMG_0794.HEIC: unsupported operand type(s) for ^: 'bool' and 'NoneType' Exporting 637 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% -:--:--

I am running the latest version of osxphotos as of this submission (0.50.5). I am using pipx to manage installation. I am running macOS High Sierra (Version 10.13.6).

The command I used to run: osxphotos export --export-by-date --download-missing --from-date 2022-01-01 /Volumes/MyBook/TestExport

RhetTbull commented 2 years ago

I'll take a look. Your export command looks valid. Once I have a look at the code I may have a debug command for you to run to collect some additional info.

RhetTbull commented 2 years ago

@franzone Please try running your export command again this time with the --debug flag added to the command line. I think this should cause osxphotos to crash when it hits the first error and it will generate a crash log in osxphotos_crash.log of the current working directory. If you post the log file here or send it to me at rturnbull+git@gmail.com I'll take a look and see if I can further isolate the error.

franzone commented 2 years ago

Attached is the crash log file. Thanks!

osxphotos_crash.log

RhetTbull commented 2 years ago

Thanks -- that showed me where the problem is but I cannot figure out why it's happening nor replicate it. Please run the command again adding the following options to your command line and send me the resulting debug.out.

--verbose --debug --watch osxphotos.photoexporter.PhotoExporter._export_photo_uuid_applescript > debug.out

This will watch all calls to the offending function and hopefully point to a root cause.

franzone commented 2 years ago

Ok, here's the debug.out file. I had to rename it to debug.log so it would attach.

debug.log .

RhetTbull commented 2 years ago

Thanks -- the debug log was helpful. I think I may have found the issue -- please upgrade to v0.50.6 and let me know if you still experience the problem.

franzone commented 2 years ago

It works! Thank you so much for taking the time to fix the issue. I am now in photo organization bliss.

RhetTbull commented 2 years ago

Great! If you run into any issues/questions about osxphotos, don't hesitate to ask in the discussions page or on our subreddit

RhetTbull commented 2 years ago

@all-contributors please add @franzone for bug

allcontributors[bot] commented 2 years ago

@RhetTbull

I've put up a pull request to add @franzone! :tada: