[apport] spe crashed with AttributeError in skip()

Bug #87844 reported by Alberto Milone
8
Affects Status Importance Assigned to Milestone
spe (Ubuntu)
Confirmed
Medium
Unassigned
Gutsy
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: spe

I closed all my tabs, SPE crashed but I was able to keep using SPE since it didn't exit.

ProblemType: Crash
Date: Sun Feb 25 18:32:25 2007
DistroRelease: Ubuntu 7.04
ExecutablePath: /usr/bin/spe
InterpreterPath: /usr/bin/python2.5
Package: spe 0.8.2a+repack-1
ProcCmdline: python /usr/bin/spe
ProcCwd: /home/alberto/Projects/project1
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/spe']
SourcePackage: spe
Traceback:
 Traceback (most recent call last):
   File "/usr/lib/python2.5/site-packages/_spe/Menu.py", line 188, in skip
     child.statusBar.throbber.Play()
 AttributeError: 'NoneType' object has no attribute 'statusBar'
Uname: Linux alberto-desktop 2.6.20-8-generic #2 SMP Tue Feb 13 05:18:42 UTC 2007 i686 GNU/Linux

Revision history for this message
Alberto Milone (albertomilone) wrote :
Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for your bug report.

Changed in spe:
assignee: nobody → motu
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Alberto Milone (albertomilone) wrote :

I have fixed it!

Download the source code, enter the "_spe" folder and open Menu.py

Get to line 188 and replace these lines:
    def skip(self):
        child = self.app.childActive
        child.statusBar.throbber.Play()

with:

    def skip(self):
        child = self.app.childActive
        try:
            child.statusBar.throbber.Play()
        except AttributeError:
            pass

and that's all.

To fix an installed version of SPE, just open your "/usr/lib/python2.5/site-packages/_spe/Menu.py" and edit line 188 as I have described.

I can proudly say that I can't reproduce the error any longer.

I'll contact SPE developer via email.

Can a MOTU commit this fix, please?

Thank you.

Alberto

Revision history for this message
Alberto Milone (albertomilone) wrote :

UPDATE:
the problem is fixed in svn

Changed in spe:
importance: Medium → High
Changed in spe:
status: Confirmed → In Progress
Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

Your patch do not work. I'm looking in svn...

Changed in spe:
status: In Progress → Confirmed
Revision history for this message
xtknight (xt-knight) wrote :

I can't get Alberto's patch to work, either. But here is the traceback I get.

Launching application...
Create: Framework: menu.
Create: Framework: toolbar.
Create: Framework: statusbar.
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/_spe/SPE.py", line 209, in <module>
    style = style)
  File "/usr/share/pycentral/spe/site-packages/_spe/sm/wxp/smdi.py", line 1278, in __init__
    wx.App.__init__(self,redirect=not debug)
  File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7757, in __init__
    self._BootstrapApp()
  File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7354, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/usr/share/pycentral/spe/site-packages/_spe/sm/wxp/smdi.py", line 1298, in OnInit
    **self.attributes)
  File "/usr/share/pycentral/spe/site-packages/_spe/sm/wxp/smdi.py", line 801, in __init__
    Parent.__init__(self,app=app,page=page,**options)
  File "/usr/share/pycentral/spe/site-packages/_spe/sm/wxp/smdi.py", line 596, in __init__
    **options)
  File "/usr/share/pycentral/spe/site-packages/_spe/sm/wxp/smdi.py", line 325, in __init__
    self.__statusBar__()
  File "/usr/share/pycentral/spe/site-packages/_spe/sm/wxp/smdi.py", line 417, in __statusBar__
    self.statusBar = self.app.StatusBar(parent=self,id=wx.ID_ANY)
  File "/usr/share/pycentral/spe/site-packages/_spe/Menu.py", line 730, in __init__
    self.throbber = Throbber(self,'throbber_still.gif')
  File "/usr/share/pycentral/spe/site-packages/_spe/Menu.py", line 736, in __init__
    GIFAnimationCtrl.__init__(self,statusBar,-1,info.imageFile(fileName))
  File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/animate.py", line 242, in __init__
    self.LoadFile(filename)
  File "/usr/share/pycentral/spe/site-packages/_spe/Menu.py", line 749, in LoadFile
    if fileName != self._fileName and not self._running:
AttributeError: 'Throbber' object has no attribute '_fileName'

Revision history for this message
Philipp Kern (pkern) wrote :

Oh well, that code scares me somewhat. SVN fixed the initial problem by placing "if self.app.children" checks in almost every function. (The exception patch proposed by Alberto looks wrong.)

The bug found by xtknight is similar but not the same. There upstream used hasattr to check if the attribute is really there before accessing it. So maybe we should merge all those sanity checks from SVN.

Philipp Kern (pkern)
Changed in spe:
importance: High → Medium
Revision history for this message
Alberto Milone (albertomilone) wrote :

@Philipp Kern
Not only does my patch look wrong, it IS wrong.

It should be fixed in SVN

Philipp Kern (pkern)
Changed in spe:
milestone: ubuntu-7.10-rc → none
Revision history for this message
Philipp Kern (pkern) wrote :

We should consider a SRU post-release.

Changed in spe:
assignee: motu → nobody
Revision history for this message
Stani (stani) wrote :

Hi, I am the author of SPE. Ubuntu is my main platform on which all development of SPE in svn takes place. The current package is just way too old and not compatible with wxPython2.8 and python 2.5 (e.g. debugging doesn't work). SPE should be taken from SVN as this fixes a lot of ubuntu specific bugs and makes spe much more stable. The integration with Ubuntu is also far better. For example "browse folder" will now start nautilus and not firefox, or "run in terminal" will now launch gnome-terminal correctly.
SPE in svn is compatible with wxPython 2.6 and 2.8 and with python 2.4 and 2.5. So if there is anyone here connected to MOTU please contact me directly. When it is time for a SRU post-release, maybe I can release a new version of SPE. Unfortunately I don't have enough knowledge about packaging or time to learn it.
The version number of SPE in svn is 0.8.4.b (compared to 0.8.2.a in universe, which in my version numbering is a huge difference) So please again, keep me updated.

Revision history for this message
Stani (stani) wrote :

I forgot to mention that you can fetch the subversion version from here:
svn checkout svn://svn.berlios.de/python/spe/trunk/_spe

More detailed instructions are here:
http://pythonide.blogspot.com/2007/02/how-to-download-latest-spe-from_26.html

Please do not invent your own patches! You probably have not enough knowledge about wxpython (especially how to keep things compatible between 2.6 and 2.8) or spe. SVN is all you need.

Philipp, I see you are a MOTU member. I will try to contact you.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Ubuntu get's this package from Debian and it appears that it's been orphaned in Debian.

At this point an update for Gutsy isn't in the cards. For Gutsy, we need patches to make the existing version work.

For Hardy, it'd be hugely helpful if someone concerned about spe would adopt it in Debian. There is a Debian Python Applications Team with active DD support, so you need not be a DD to do this.

Revision history for this message
Stani (stani) wrote :

I contacted Philip, but he has no time to package spe. Most packagers use vim or emacs, so there is no personal interest in this editor. I fully respect that. So I agree with Scott and hope someone is willing to update spe in the repository. By the way if you look to all bugs related to spe, many of them are duplicates of this. Here is a quick fix to for the spe package with changing one line of code so that should be possible without updating to the new release:
https://bugs.launchpad.net/ubuntu/+source/spe/+bug/124896/comments/6

And all the bugs which are not duplicates of this bugs are fixed in subversion. For them it is not possible to do small patches, updating the debian package is the best solution. As spe is pure python, there are no binaries involved.

Revision history for this message
Stani (stani) wrote :

Can someone mark this as a duplicate of bug 124896, which has on itself 10 duplicates already? I am not able to do it because of this error:
"There are other bugs already marked as duplicates of Bug 87844. These bugs should be changed to be duplicates of another bug if you are certain you would like to perform this change."

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 87844] Re: [apport] spe crashed with AttributeError in skip()

Would you be interested in maintaing the package yourself? Python apps are
generally quite easy.

In Ubuntu, Ubuntu MOTU can help you with this (come see us in #ubuntu-motu
on IRC). Once you get the package worked out in Ubuntu, I could help you
get connected with the Debian Python Applications Team and get Debian
updated too. They are very open to new contributors from Ubuntu.

Revision history for this message
Scott Kitterman (kitterman) wrote :

You have to undupe bugs against this first and then dupe this and they
against the other. Anyone else would have to do the same.

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.