Missing recipe description causes tracebacks on startup

Bug #652172 reported by Jeff Fortin Tam
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Recipe Manager
Fix Committed
Critical
Daniel G. Taylor

Bug Description

My test case: try to reproduce http://simplyrecipes.com/recipes/artichoke_soup/ into a recipemanager recipe.

The resulting recipe file has two problems:
1. The ingredients are saved incorrectly. Most of them are reset to 0.
2. It causes a traceback on startup (maybe a different bug?):

Traceback (most recent call last):
  File "./recipemanager", line 45, in <module>
    RecipeManager()
  File "/home/jeff/trunks/recipe-manager/main/librecipemanager/main_window.py", line 98, in __init__
    self.load_recipes()
  File "/home/jeff/trunks/recipe-manager/main/librecipemanager/main_window.py", line 303, in load_recipes
    self.recipes.append(Recipe(os.path.join(RECIPE_DIR, item)))
  File "/home/jeff/trunks/recipe-manager/main/librecipemanager/recipe.py", line 122, in __init__
    self.load(filename)
  File "/home/jeff/trunks/recipe-manager/main/librecipemanager/recipe.py", line 130, in load
    self._load(dom)
  File "/home/jeff/trunks/recipe-manager/main/librecipemanager/recipe.py", line 157, in _load
    self.description = node.childNodes[0].data
IndexError: list index out of range

This might be due to the fact that I was trying to enter 1/2 or 0.5 or 0,5 in the ingredient units at some point, but I doubt so (the spinbuttons wouldn't let me, anyway).

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :
Revision history for this message
Jeff Fortin Tam (kiddo) wrote : Re: Entering no description creates corrupt recipe that tracebacks on startup

Ah, this was caused by the fact that I erased the description and did not put anything in its place ;)

summary: - Creates corrupt recipe that tracebacks on startup
+ Entering no description creates corrupt recipe that tracebacks on
+ startup
summary: - Entering no description creates corrupt recipe that tracebacks on
- startup
+ Missing recipe description causes tracebacks on startup
Changed in recipe-manager:
status: New → Confirmed
Jeff Fortin Tam (kiddo)
Changed in recipe-manager:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.