Skip to content
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

filepath.* in filename_template results in TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType #1541

Open
torarnv opened this issue May 12, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@torarnv
Copy link

torarnv commented May 12, 2024

Is this variable not available in the filename template? I was trying to use it in a conditional like this: filename_template = "{filepath.suffix contains aae?.}{original_name}"

@torarnv
Copy link
Author

torarnv commented May 12, 2024

osxphotos_crash.log

@RhetTbull
Copy link
Owner

No it's only available "post export" -- that is in options that are executed after the export happens as it refers to the exported path. Inside the filename template (which is used to determine the export path) it would be impossible to render (infinite recursion). However it should not crash -- so that's a bug. It should simply resolve to an empty value as it's not known yet.

@torarnv
Copy link
Author

torarnv commented May 12, 2024

Ah, thanks, that makes sense :) Perhaps it should also give a warning, in addition to the empty value (non-crash), as users might think it's working if there is no visible result telling them that it's not?

@RhetTbull RhetTbull added the bug Something isn't working label May 12, 2024
@RhetTbull
Copy link
Owner

@all-contributors please add @torarnv for bug

Copy link
Contributor

@RhetTbull

I've put up a pull request to add @torarnv! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants