UnboundLocalError in rmdSimple.py
Status: Alpha
Brought to you by:
enselic
When running gtk-recordMyDesktop I receive the following error:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/recordMyDesktop/rmdSimple.py", line 250, in __select_window__
if wid: xwininfo_com = ['xwininfo','-id',wid]
UnboundLocalError: local variable 'wid' referenced before assignment
A quick peek at that file and you see that the variable "wid" is only assigned inside an if block, so if the test fails then the variable is left uninitialized.
I've attached quite possibly the smallest of patches to fix the issue. There may be a preferred way to do this initialization, but I did it above the outermost if so that wid will always be bound.
Patch the rmdSimple.py file in the gtk module.
FYI, this problem caused the "Select Window" functionality to not work at all. Adding this fix brought the feature back to life.
Thanks! I have applied this patch now: https://github.com/Enselic/recordmydesktop/commit/b92006084a
Note that the project has migrated to GitHub.
Also note that the UI needs to be fully ported to GTK 3 (I started but will not have time to finish in the near future)