Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 166151 - x11-misc/driconf-0.9.1f uninitialized variable
Summary: x11-misc/driconf-0.9.1f uninitialized variable
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Joshua Baergen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-10 01:45 UTC by James C. Georgas
Modified: 2007-02-11 18:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix python error (dri.patch,362 bytes, patch)
2007-02-10 01:49 UTC, James C. Georgas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James C. Georgas 2007-02-10 01:45:11 UTC
An uninitialized variable in a x11-misc/driconf-0.9.1 file causes python to complain.

I start driconf from a terminal without a pre-existing ~/.drirc configuration file.

I open the "Application settings" dropdown at the bottom of the page.

I select "Add", and put in doom3-demo and doom.x86 in the dialog fields, and select "OK".

At this point driconf spews forth it's displeasure upon stderr:

Code:
Traceback (most recent call last):
  File "/usr/lib/driconf/driconf_simpleui.py", line 692, in changeApp
    self.selectApp(app)
  File "/usr/lib/driconf/driconf_simpleui.py", line 641, in selectApp
    self.appPage = AppPage (self.driver, app)
  File "/usr/lib/driconf/driconf_simpleui.py", line 347, in __init__
    self.refreshOptions()
  File "/usr/lib/driconf/driconf_simpleui.py", line 369, in refreshOptions
    self.optionTree.append(sectIter, [
  File "/usr/lib/driconf/driconf_simpleui.py", line 271, in lineWrap
    head, tail = head + tail[:i] + '\n', tail[j:]
UnboundLocalError: local variable 'j' referenced before assignment

It must be a python interpreter change. It seems like variables must be initialized before being used...

To fix it, add "j = i" at line 260 in /usr/lib/driconf/driconf_simpleui.py, after the existing line "i = chars"

Reproducible: Always

Steps to Reproduce:
Comment 1 James C. Georgas 2007-02-10 01:49:13 UTC
Created attachment 109684 [details, diff]
patch to fix python error

This will fix the error described above.
Comment 2 Joshua Baergen (RETIRED) gentoo-dev 2007-02-10 18:37:26 UTC
This should be filed upstream.  Please open a bug in driconf's bug tracker at http://sourceforge.net/projects/driconf and post the link or bug # here.  Thanks!
Comment 3 James C. Georgas 2007-02-10 19:28:09 UTC
done.
Comment 4 James C. Georgas 2007-02-10 19:30:20 UTC
Perhaps we could do a revision bump until it gets fixed upstream.
Comment 5 Joshua Baergen (RETIRED) gentoo-dev 2007-02-11 18:16:56 UTC
Like other X packages, I don't really like maintaining a patch set that doesn't match what upstream is doing.  You're more than welcome to post an ebuild that uses your patch, and if upstream doesn't do anything about it any time soon we may put it into the tree anyway.