[Bug 213494] Re: [Hardy] Glipper dies when desktop starting

sibidiba czigola at gmail.com
Mon Oct 6 02:59:21 BST 2008


Can someone confirm the suggested workaround in the upstream bugreport
(http://sourceforge.net/support/tracker.php?aid=1940578)?

/usr/share/python-support/glipper/glipper/History.py

--- History.py.orig	2008-07-29 00:16:26.000000000 +0200
+++ History.py	2008-07-29 00:15:55.000000000 +0200
@@ -86,7 +86,10 @@
       
       length = file.readline()
       while length:
-         self.history.append(file.read(int(length)))
+         try:
+            self.history.append(file.read(int(length)))
+         except ValueError:
+            print "readline() gaves none int back " + str(length) 
          file.read(1) # This is for \n
          length = file.readline()

Can this be a real fix for this problem? I am not a Python expert, but it seems there is common confusion about how readline works:
http://www.tablix.org/~avian/blog/archives/2008/08/05/T21_01_42/
even related to handling Unicode characters:
http://www.tablix.org/~avian/blog/archives/2008/08/05/T21_01_42/

All the tracebacks in the duplicates of this bugs show an exception in
the file /var/lib/python-support/python2.5/glipper/History.py line
number 89, which is a symlink to the latter.

 80    def load(self):
 81       try:
 82          file = open(glipper.HISTORY_FILE, "r")
 83       except IOError:
 84          self.emit('changed', self.history)
 85          return # Cannot read history file
 86 
 87       length = file.readline()
 88       while length:
 89          self.history.append(file.read(int(length)))
 90          file.read(1) # This is for \n
 91          length = file.readline()
 92 
 93       file.close()
 94       self.emit('changed', self.history)

All the trackebacks start this way:

Traceback (most recent call last):
  File "/usr/lib/glipper/glipper", line 53, in applet_factory
    glipper.Applet.Applet(applet)
  File "/var/lib/python-support/python2.5/glipper/Applet.py", line 50, in __init__
    get_glipper_history().load()
  File "/var/lib/python-support/python2.5/glipper/History.py", line 89, in load
    self.history.append(file.read(int(length)))

and differ only in the single last line, for example on of these:

ValueError: invalid literal for int() with base 10: '\x14\x1b'

ValueError: invalid literal for int() with base 10: '\x14\x0c'

ValueError: invalid literal for int() with base 10: '\x14('

ValueError: invalid literal for int() with base 10: '\x14W'

ValueError: invalid literal for int() with base 10: '\x14\x0b'

ValueError: invalid literal for int() with base 10: '\x14\x07'

ValueError: invalid literal for int() with base 10: '\x14\x0f'

-- 
[Hardy] Glipper dies when desktop starting
https://bugs.launchpad.net/bugs/213494
You received this bug notification because you are a member of Ubuntu
Sponsors for universe, which is a direct subscriber.



More information about the Ubuntu-universe-sponsors mailing list