Open Syntaxheld opened 3 weeks ago
and the generated config file from the first reproduction step: CONFIG.toml.zip
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. 🤷🏻 So maybe it is an issue in combination with the option parsing?
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 --sidecar-template
option directly on the command line instead of via the config file.
@all-contributors please add @Syntaxheld for bug
@RhetTbull
I've put up a pull request to add @Syntaxheld! :tada:
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):
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