[go: up one dir, main page]

Menu

#63 UnboundLocalError in rmdSimple.py

v1.0 (example)
closed-fixed
5
2021-03-13
2010-06-29
No

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.

Discussion

  • Doug Van Horn

    Doug Van Horn - 2010-06-29

    Patch the rmdSimple.py file in the gtk module.

     
  • Doug Van Horn

    Doug Van Horn - 2010-06-29

    FYI, this problem caused the "Select Window" functionality to not work at all. Adding this fix brought the feature back to life.

     
  • Martin Nordholts

    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)

     
  • Martin Nordholts

    • status: open --> closed-fixed
    • Group: --> v1.0 (example)
     

Log in to post a comment.