atiumcache / pure-recipe

Input a recipe URL and receive well-formatted, ad-free recipes to your terminal, or save the output to a markdown file.
MIT License
71 stars 9 forks source link

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType #19

Open patrickgardella opened 3 days ago

patrickgardella commented 3 days ago

I installed the requirements into a venv on my linux system (python 3.12), and when I run pure_recipe.py, I get this error:

Traceback (most recent call last):
  File "/home/patrick/Documents/projects/pure-recipe/pure_recipe.py", line 331, in <module>
    main()
  File "/home/patrick/Documents/projects/pure-recipe/pure_recipe.py", line 16, in main
    settings = load_yaml()
               ^^^^^^^^^^^
  File "/home/patrick/Documents/projects/pure-recipe/pure_recipe.py", line 292, in load_yaml
    if not os.path.exists(recipe_directory):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen genericpath>", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

I should note that I get this same error if I run the python script without a command (i.e. "view") or without a URL.

I tried creating the config.yaml, but I get the same error. And after creating the recipes folder.

My first guess is that the os.path is different on Linux than Mac or PC, but I can't be the first person to run this on Linux :)

patrickgardella commented 3 days ago

Quick update:

Running this through pdb, the settings.get("directory") returns None.

I figured out that you were expecting the config.yaml file in the ~/.config/pure_recipes folder, not in the same folder as pure_recipes.py. When I moved it there, the script works.