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

Python scripts are executed regardless of md5 hash check #29

Closed
mchaaler opened this issue Mar 4, 2022 · 2 comments · Fixed by #27
Closed

Python scripts are executed regardless of md5 hash check #29

mchaaler opened this issue Mar 4, 2022 · 2 comments · Fixed by #27

Comments

@mchaaler
Copy link
Contributor

mchaaler commented Mar 4, 2022

Problem appears to lie in the following snippet in gen_single.py, in the generate_file_md method:

        if skip_and_return:
            # Return with 0 exec time and mem usage, and None thumbnail
            GalleryScriptResults(script=script, intro=intro, exec_time=0., memory=0., thumb=None)

Does not seem to return actually.

@mchaaler
Copy link
Contributor Author

mchaaler commented Mar 4, 2022

Simply adding a return statement in front of GalleryScriptResults() with "None thumbnail" as stated is not enough: it makes the call to script_results.thumb.exists() (in the _thumbnail_div method (in backreferences.py) raise the following exception:
AttributeError: 'NoneType' object has no attribute 'exists'

Suggestion would be to use the thumbnail pathname resolution process as implemented later in the same generate_file_md method.

@smarie
Copy link
Owner

smarie commented Mar 8, 2022

Great description, thanks so much @mchaaler for taking the time ! Much clearer now.

@smarie smarie closed this as completed in #27 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants