Grocery list / Pantry function crashes
This bug report was converted into a question: question #269216: Grocery list / Pantry function crashes.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gourmet |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Running Gourmet 0.17.4 from PPA under Ubuntu 14.04 LTS (both 32bit and 64bit) with all current updates.
The recipes stored in a centralized mySQL database, accessed using connect string Exec=gourmet --database-
Recently, the grocery list / pantry function crashes upon adding a recipe to it. This may be at the first recipe, but usually it happens after adding several recipes.
When the error occurs, when clicking the "Add to grocery list" button, nothing happens, the grocery list (when it was closed) is no longer opened and cannot be retrieved in any way. If the grocery list had remained open, the recipe added by clicking the button is not added to the grocery list.
I tried to establish whether there are errors in the recipes I am trying to add, but it seems that a recipe that "works" (is added to the grocery list correctly without error), might later be the recipe that "breaks" the grocery list - the error seems not to be caused by specific recipes.
Once the error has occurred, any subsequent recipe opened and added to the grocery list yields the same behavior and error message.
This is the verbose report Gourmet yields when the error occurs (the first few lines are recipes being opened to be added to the grocery list, being added before the error occurs):
[code]
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
<gourmet.
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
self.reset()
File "/usr/lib/
self.
File "/usr/lib/
return self.organize_
File "/usr/lib/
pantry = self.sh.
File "/usr/lib/
l[1]
File "/usr/lib/
inga = inga.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
[/code]
I'll happily add additional info if so required!
Thank you in advance for your help!
Further information / change to feature request.
My analysis was wrong. I found two recently added recipes that each had an empty line in the ingredients' list.
Deleting those empty entries resolved the issue.
Proposed workaround:
Using the ingredient key manager, look at the first entry which will in this situation show an empty ingredient key.
Change the empty ingredient key into something you will not eat - I used "uranium".
Search all recipes containing "uranium".
Open these recipes and delete the empty ingredient from the ingredients' list.
Save.
Proposed solution:
a) When saving a recipe, filter for empty lines before storing in database or, alternatively
b) filter for empty lines when adding a recipe to the grocery list.