After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 541788 - Crash handling exception when saving game
Crash handling exception when saving game
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: glchess
unspecified
Other All
: High critical
: gnome-2-24
Assigned To: Robert Ancell
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-06 18:12 UTC by 2leeward24
Modified: 2008-08-14 13:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description 2leeward24 2008-07-06 18:12:07 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):
  • File "/var/lib/python-support/python2.5/glchess/gtkui/dialogs.py", line 538 in _on_response
    error = self.__mainUI._saveView(self.__view, fname)
  • File "/var/lib/python-support/python2.5/glchess/gtkui/gtkui.py", line 509 in _saveView
    error = view.feedback.save(path)
  • File "/var/lib/python-support/python2.5/glchess/display.py", line 530 in save
    return self.game.save()
  • File "/var/lib/python-support/python2.5/glchess/main.py", line 311 in save
    return e.args[1]
IndexError: tuple index out of range
--------------------------------------------------
Traceback (most recent call last):
  • File "/var/lib/python-support/python2.5/glchess/gtkui/dialogs.py", line 538 in _on_response
    error = self.__mainUI._saveView(self.__view, fname)
  • File "/var/lib/python-support/python2.5/glchess/gtkui/gtkui.py", line 509 in _saveView
    error = view.feedback.save(path)
  • File "/var/lib/python-support/python2.5/glchess/display.py", line 530 in save
    return self.game.save()
  • File "/var/lib/python-support/python2.5/glchess/main.py", line 311 in save
    return e.args[1]
IndexError: tuple index out of range

Comment 1 Gianluca Borello 2008-07-06 22:15:11 UTC
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 ***
Comment 2 Robert Ancell 2008-07-07 06:04:48 UTC
Gianluca, this is not the same bug. Please check the backtrace carefully before marking duplicates.
Comment 3 Robert Ancell 2008-07-07 06:17:16 UTC
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.
Comment 4 Robert Ancell 2008-07-07 06:19:28 UTC
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
Comment 5 Robert Ancell 2008-07-07 06:20:22 UTC
(link to code):
http://svn.gnome.org/viewvc/gnome-games/trunk/glchess/src/lib/main.py
Comment 6 Robert Ancell 2008-08-14 13:59:22 UTC
Fixed for 2.24:
http://svn.gnome.org/viewvc/gnome-games?view=revision&revision=7818