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

Export all recipes fails #155

Open
silverfern999 opened this issue Jul 5, 2023 · 2 comments
Open

Export all recipes fails #155

silverfern999 opened this issue Jul 5, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@silverfern999
Copy link

silverfern999 commented Jul 5, 2023

When exportig all recipes, the process files

Steps to Reproduce

  1. File --> Export all recipes
  2. Set file type to "My CookBok MCB file"
  3. Select destination directory and file
  4. Click OK

Expected Behavior

Expect Gourmand to export all recipes to mcb file

Current Behavior

flatpak run io.github.GourmandRecipeManager.Gourmand
args = Namespace(db_url='', debug=None, debug_file='', gourmanddir='', thread_debug=False, thread_debug_interval=5.0, threads=False, time=False)
Plugin  copy_paste_plugin not found
DEBUG:   /app/lib/python3.8/site-packages/gourmand/Undo.py: 457 gui_update
DEBUG:   /app/lib/python3.8/site-packages/gourmand/Undo.py: 481 Nothing to undo, desensitizing widgets
DEBUG:   /app/lib/python3.8/site-packages/gourmand/Undo.py: 451 set_sensitive
DEBUG:   /app/lib/python3.8/site-packages/gourmand/Undo.py: 451 set_sensitive
DEBUG:   /app/lib/python3.8/site-packages/gourmand/Undo.py: 451 set_sensitive
Return exporter instance
emit error 1 Error during Exporter Traceback (most recent call last):
  File "/app/lib/python3.8/site-packages/gourmand/threadManager.py", line 104, in run
    self.do_run()
  File "/app/lib/python3.8/site-packages/gourmand/plugin_loader.py", line 439, in _
    retval = f(self,*args,**kwargs)
  File "/app/lib/python3.8/site-packages/gourmand/exporters/exporter.py", line 582, in do_run
    e.do_run()
  File "/app/lib/python3.8/site-packages/gourmand/exporters/exporter.py", line 83, in do_run
    self.write_image(self.r.image)
  File "/app/lib/python3.8/site-packages/gourmand/plugins/import_export/mycookbook_plugin/mycookbook_exporter.py", line 76, in write_image
    result.save(pic_fullpath)
  File "/app/lib/python3.8/site-packages/PIL/Image.py", line 2169, in save
    fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpnb0hjwa1/images/Air_Fryer_Broccoli_w/_Oil_Free_Option.png'

emit done

Environment

  • Operating System: Debian
  • Version or commit id: 12
  • Installed as Flatpak or Python package?: Flatpak; gourmand-1.0.0.flatpak
@eliotb
Copy link
Contributor

eliotb commented May 23, 2024

This happens because you have a recipe with a "/" in the name, that has an attached image. Fix for export without changing any code is to remove the "/" from any recipe name. E.g. change "w/" to "with"

Proper fix is to sanitise the generated image name to remove the "/"

@FriedrichFroebel
Copy link
Contributor

Thanks for the report. I am open to merging a PR which fixes this accordingly.

@FriedrichFroebel FriedrichFroebel added the bug Something isn't working label Dec 28, 2024
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

3 participants