GNOME Bugzilla – Bug 541788
Crash handling exception when saving game
Last modified: 2008-08-14 13:59:22 UTC
Version: 2.22.2.1 What were you doing when the application crashed? Saving the game to usb, thanks Distribution: Ubuntu 8.04 (hardy) Gnome Release: 2.22.2 2008-06-03 (Ubuntu) BugBuddy Version: 2.22.0 System: Linux 2.6.24-19-generic #1 SMP Wed Jun 18 14:43:41 UTC 2008 i686 X Vendor: The X.Org Foundation X Vendor Release: 10400090 Selinux: No Accessibility: Disabled GTK+ Theme: Human Icon Theme: Human Memory status: size: 0 vsize: 0 resident: 0 share: 0 rss: 0 rss_rlim: 0 CPU usage: start_time: 0 rtime: 0 utime: 0 stime: 0 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 0 ----------- .xsession-errors (11 sec old) --------------------- ** Message: GetValue variable 1 (1) ** Message: GetValue variable 2 (2) PID TTY TIME CMD 5114 ? 00:00:00 pulseaudio Traceback (most recent call last):
+ Trace 202173
error = self.__mainUI._saveView(self.__view, fname)
error = view.feedback.save(path)
return self.game.save()
return e.args[1]
-------------------------------------------------- Traceback (most recent call last):
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 535256 ***
Gianluca, this is not the same bug. Please check the backtrace carefully before marking duplicates.
The appropriate piece of code is: try: f = file(self.fileName, 'w') lines = pgnGame.getLines() for line in lines: f.write(line + '\n') f.write('\n') f.close() except IOError, e: return e.args[1] The documentation on IOError (http://docs.python.org/lib/module-exceptions.html) says: "When exceptions of this type are created with a 2-tuple, the first item is available on the instance's errno attribute (it is assumed to be an error number), and the second item is available on the strerror attribute (it is usually the associated error message). The tuple itself is also available on the args attribute." The above code is expecting a string describing the message to be on e.args[1]. The expection shows in this case there is 0 or 1 element in args, not 2.
2leeward24, does this occur always when you save to USB? Can you check the version of Python you are running by opening a terminal and typing: $ python And paste the result here so we can see what version you are running? Thanks, --Robert
(link to code): http://svn.gnome.org/viewvc/gnome-games/trunk/glchess/src/lib/main.py
Fixed for 2.24: http://svn.gnome.org/viewvc/gnome-games?view=revision&revision=7818