← Back to team overview

screenlets-dev team mailing list archive

[Bug 1064649] [NEW] Image or File Option Window Crash

 

Public bug reported:

I have Screenlets v0.1.5 on Debian 6.  When changing an image/file
option with a screenlet's properties window, when the file selection
window pops up and if no file is given and you press Enter (NOT pressing
the Open button) in the empty text field, the file selection window
crashes with the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/screenlets/options/file_option.py", line 159, in but_callback
    self._entry.set_text(dlg.get_filename())
TypeError: Gtk.Entry.set_text() argument 1 must be string, not None

This error is avoided by pressing the Open button with an empty text
field, however.

The Properties window and the screenlet are still responsive, but the
file selection window won't close until the screenlet closes.  It's a
minor bug really, and I fixed it by replacing line 159 in
screenlets/options/file_option.py:

self._entry.set_text(dlg.get_filename())

With the following 3 lines:

fn = dlg.get_filename()
if not fn: fn = ""
self._entry.set_text(fn)

That fixed the problem, and it clears the string if None is given.  An
alternative would also be to only set the string if the filename is not
None:

fn = dlg.get_filename()
if (fn != None): self._entry.set_text(fn)

A minor bug, but easy to fix.

** Affects: screenlets
     Importance: Undecided
         Status: New


** Tags: crash file image option window

** Patch added: "file_option.py"
   https://bugs.launchpad.net/bugs/1064649/+attachment/3390852/+files/file_option.py

-- 
You received this bug notification because you are a member of
Screenlets Dev Team, which is subscribed to Screenlets.
https://bugs.launchpad.net/bugs/1064649

Title:
  Image or File Option Window Crash

To manage notifications about this bug go to:
https://bugs.launchpad.net/screenlets/+bug/1064649/+subscriptions


Follow ups

References