The problem has been resolved using “pub.unsubAll()” just before destroying the frame. I am using version 3.0rc2.
···
----- Original Message ----
From: oliver oliver.schoenborn@gmail.com
To: wxpython-users@lists.wxwidgets.org
Sent: Thursday, 2 October, 2008 2:18:45 AM
Subject: Re: [wxpython-users] wxPython and pubsub error
I’m not sure why it would do that. “sgl” is a module (pubsubcore/singletons.py) containing a TopicManager instance, topicMgr, which manages pubsub topic creation/destruction. The method called (__onDeadListener) is called when a listener
(subscribed to a topic) is garbage collected, so it can be automatically unsubscribed from the topic. It is strange that Python interpreter says sgl is None since it is never set to that, but since it is at application exit it is possible it has to do with garbage collection of the whole package.
Here are some things you could try:
- Put print self.getName(), str(listener) just before sgl.topicMgr to print out the topic name and listener id; this might give you enough info to just unsubscribe the one or two listeners that cause problem
- Explicitly unsubscribe all your listener(s) before exiting, until get ride of the error; this is less than ideal
- The singleton stuff has recently been changed to use data members so in the most recent version (not yet committed), the problem may no longer exist; if you want I could send you an egg of it so you can try it out.
- Give me something to reproduce the error, but given that most recent version is different it is probably worth doing #3 first;
- Other ideas? I’m open to suggestions.
Oliver
On Wed, Oct 1, 2008 at 3:01 PM, Prashant Saxena animator333@yahoo.com wrote:
I am using pubsub module which is working fine. How ever when I am closing my frame I am getting an error:
Traceback (most recent call last):
File “C:\Python25\Lib\site-packages\pubsubcore\weakmethod.py”, line 42, in __onNotifyDeadObj
self.notifyDead(self)
File “C:\Python25\Lib\site-packages\pubsubcore\listener.py”, line 128, in __notifyOnDeadnotifyDeath(self)
File “C:\Python25\Lib\site-packages\pubsubcore\topics.py”, line 989, in __onDeadListener
sgl.topicMgr.onDeadListener(self, listener)
AttributeError: ‘NoneType’ object has no attribute ‘topicMgr’could anybody point me out the reason?
Prashant
Be the first one to try the new Messenger 9 Beta! Click here.
wxpython-users mailing list
Add more friends to your messenger and enjoy! Invite them now.