tstehr / RecipeMD

Markdown recipe format and cli tool
https://recipemd.org
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Bug when trying to use "flatten"? #36

Closed dasnessie closed 3 years ago

dasnessie commented 3 years ago

I got an unhandled exception:

$ recipemd -f chili-kaese-spaetzle.md 
Traceback (most recent call last):
  File "/usr/bin/recipemd", line 8, in <module>
    sys.exit(main())
  File "/home/nessie/.local/lib/python3.9/site-packages/recipemd/cli/main.py", line 55, in main
    r = _get_flattened_recipe(r, recipe_url=recipe_url, parser=rp)
  File "/home/nessie/.local/lib/python3.9/site-packages/recipemd/cli/main.py", line 151, in _get_flattened_recipe
    recipe = _create_flattened_substituted_ingredients(recipe, ingr_to_recipe)
  File "/home/nessie/.local/lib/python3.9/site-packages/recipemd/cli/main.py", line 246, in _create_flattened_substituted_ingredients
    flattened_ingr = _create_flattened_substituted_ingredients(ingr, ingr_to_recipe)
  File "/home/nessie/.local/lib/python3.9/site-packages/recipemd/cli/main.py", line 254, in _create_flattened_substituted_ingredients
    return replace(
TypeError: replace() missing 1 required positional argument: 'obj'
tstehr commented 3 years ago

Thank you for reporting 👍

This error is due to a change to replace in Python 3.9. A fix is already on master and will be part of the next release.

In the meantime you can install a build with the fixes from master as follows:

 pip install git+https://github.com/tstehr/RecipeMD.git@master
tstehr commented 3 years ago

Version 4.0.7 is now live and includes the fix for --flatten on Python 3.9.