digital clock applet is not multi-user-friendly

Bug #218300 reported by Bernhard Schussek
2
Affects Status Importance Assigned to Milestone
Awn Extras
Fix Released
Medium
Mark Lee

Bug Description

The digital clock applet only works for the first user that logs in (until a restart). For every other user, the applet will crash.

I suppose the problem is that the applet creates an image with a hardcoded filename in the global temp directory, which is then only writable by the user that created it.

The bug applies to the package avant-window-navigator-br 0.3.1.bzr222.1~hardy and awn-core-applets-br 0.3.1.br415.1~hardy under Ubuntu Hardy Beta.

Traceback (most recent call last):
  File "/usr/lib/awn/applets/digitalClock/digitalClock.py", line 110, in <module>
    applet = App (awn.uid, awn.orient, awn.height)
  File "/usr/lib/awn/applets/digitalClock/digitalClock.py", line 34, in __init__
    self.clock = dgTime.dgTime(self.pf.prefs, self)
  File "/usr/lib/awn/applets/digitalClock/dgTime.py", line 23, in __init__
    self.draw_clock()
  File "/usr/lib/awn/applets/digitalClock/dgTime.py", line 59, in draw_clock
    cs.write_to_png (self.tmp_image)
IOError: error while writing to output stream

Mark Lee (malept)
Changed in awn-extras:
assignee: nobody → ryancr
importance: Undecided → Medium
milestone: none → 0.2.8
status: New → Confirmed
Revision history for this message
Bernhard Schussek (bschussek) wrote :

I found a fix. As awn is started in a different process for each user, it works to insert the process ID in the filename:

Change dgTime.py:14 to the following:

  tmp_image = os.path.join(tmp_dir, 'digitalclock.%s.png' % os.getpid())

Revision history for this message
Mark Lee (malept) wrote :

Fixed in r438.

Changed in awn-extras:
assignee: ryancr → malept
status: Confirmed → Fix Committed
onox (onox)
Changed in awn-extras:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.