Bug 247748

Summary: Variable not defined (wrd)
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: gourmetAssignee: Jef Spaleta <jspaleta>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 6CC: triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-06 19:42:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tim Waugh 2007-07-11 08:54:08 UTC
Description of problem:
I got a traceback from gourmet a few days ago.  I'm afraid I no longer have the
traceback, but I do have the (incorrect, I think) patch that made it go away,
and the problem is quite clear.

Version-Release number of selected component (if applicable):
gourmet-0.12.2-2.fc6

--- /usr/lib/python2.4/site-packages/gourmet/defaults_en_GB.py.orig    
2007-07-06 14:12:45.000000000 +0100
+++ /usr/lib/python2.4/site-packages/gourmet/defaults_en_GB.py  2007-07-06
14:13:16.000000000 +0100
@@ -683,7 +683,7 @@
         wrd=s[0:-2]
         if not wrd in rets: rets.append(wrd)
     if v_plural_matcher.search(s):
-        if not wrd in rets: rets.append(wrd)
+        #if not wrd in rets: rets.append(wrd)
         rets.append(s[0:-3]+'f')
     if one_digit_plural_matcher.search(s): rets.append(s[0:-1])
     return rets

The variable 'wrd' is referenced when it might not be defined.  The same problem
seems to be present in gourmet-0.13.3-1.fc7 as well.

Comment 1 Jef Spaleta 2007-07-11 12:59:25 UTC
Any chance you can describe the steps to make this happen?  Or produce a
screencast with one of the desktop recording tools showing your application
session which makes it happen.  I'd like to be able to poke at this a bit on my
box. 

-jef

Comment 2 Tim Waugh 2007-07-11 14:22:17 UTC
1. export LC_ALL=en_GB.UTF-8
2. gourmet
3. New Recipe
4. Click on Ingredients
5. In the 'Add ingredient' text-entry box type: "15 kalamata olives"
6. Click Add

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/gourmet/reccard.py", line 2949, in
quick_add
    lambda *args: self.rc.add_ingredient_from_line(txt,
  File "/usr/lib/python2.5/site-packages/gourmet/reccard.py", line 1473, in
add_with_undo
    widget=rc.ingtree_ui.ingController.imodel
  File "/usr/lib/python2.5/site-packages/gourmet/Undo.py", line 48, in perform
    self.action(*self.action_args)
  File "/usr/lib/python2.5/site-packages/gourmet/reccard.py", line 1467, in do_it
    method()
  File "/usr/lib/python2.5/site-packages/gourmet/reccard.py", line 2951, in <lambda>
    group_iter=group_iter)
  File "/usr/lib/python2.5/site-packages/gourmet/reccard.py", line 1066, in
add_ingredient_from_line
    d=self.rg.rd.ingredient_parser(line, conv=self.rg.conv)
  File "/usr/lib/python2.5/site-packages/gourmet/backends/rdatabase.py", line
1132, in ingredient_parser
    if get_key: d['ingkey']=self.km.get_key(i.strip())
  File "/usr/lib/python2.5/site-packages/gourmet/keymanager.py", line 116, in
get_key
    result = self.look_for_key(txt)
  File "/usr/lib/python2.5/site-packages/gourmet/keymanager.py", line 135, in
look_for_key
    main_txts.extend(defaults.guess_singulars(txt))
  File "/usr/lib/python2.5/site-packages/gourmet/defaults_en_GB.py", line 686,
in guess_singulars
    if not wrd in rets: rets.append(wrd)
UnboundLocalError: local variable 'wrd' referenced before assignment


Comment 3 Bug Zapper 2008-04-04 07:27:44 UTC
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

Comment 4 Bug Zapper 2008-05-06 19:42:24 UTC
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen thus bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.