-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save & load config fail in combination with sidecar-template #1716
Comments
and the generated config file from the first reproduction step: |
Weird...I'm using the same TOML library to write the config file as I am to read it. I'll take a look to see if I can figure out what is going on. |
I have run the file through https://www.toml-lint.com/ ... and it says it's valid. 🤷🏻 |
This appears to be a known bug in the toml library used by OSXPhotos. I've confirmed that both tomli and the built in tomllib (which is only available in python 3.11+) do not have this problem and correctly parse the toml file. I will update the toml code in OSXPhotos to use tomli. In the next release I'll be dropping support for Python 3.9 and adding support for Python 3.13. Once I get to Python 3.11 as the minimum I can then use the built in toml library. In the meantime you can pass the |
@all-contributors please add @Syntaxheld for bug |
I've put up a pull request to add @Syntaxheld! 🎉 |
Describe the bug
When using the
--sidecar-template
option and saving the command to a TOML config file, osxphotos crashes when loading that config file.To Reproduce
Steps to reproduce the behavior:
osxphotos export --directory "{created}{moment?{comma} {moment},}" --album export-test --sidecar-template custom_sidecar_json.mako "{filepath}.json" write_skipped,strip_lines --edited-suffix "-edit" --save-config CONFIG.toml --config-only DIR
osxphotos export --load-config CONFIG.toml DIR
Something went wrong and osxphotos encountered an error: list index out of range
Expected behavior
Export command using the config file should work just as well as the one without.
Desktop (please complete the following information):
Python 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)]
macOS 15.1.0, arm64
Additional context
If you comment out the
sidecar_template
line in the toml file (and specify the option on the CLI), it works.Crashlog attached.
osxphotos_crash.log
The text was updated successfully, but these errors were encountered: