Eric
unread,Aug 27, 2012, 3:32:06 AM8/27/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pypu...@googlegroups.com
Hi all,
I am running into a problem where Tkinter is crashing if I send a message but it is fine if I comment out sendMessage. I put in print stmts to show the internal id for the problem control (self.msg_ctrl_login._w) and it is somehow reverting to an earlier control reference when sendMessage is used.
The sequence is to start a main dialog, click a Login button to bring up a Login dialog, fill in the login info and click connect. If the login fails, a message is published, pub.sendMessage("agile.fail.connect", msg=Config.MSG_AGILE_CONN_TIMEOUT) to change a message and background color of a label on the Login diaglog.
I ran a sequence of launching the Login dialog, print the control ID at the end of the init routine; click Login and print the ID again, after a timeout failure the Login function exits and prints again. I cancel out of the dialog (destroy it) and get another print.
Here is the debug output:
(sendMessage commented out, you can see the designator change when Login launches a second time)
Init done .51829376.51860184.51860384
Login entry .51829376.51860184.51860384
Login exit .51829376.51860184.51860384
Cancel .51829376.51860184.51860384
Init done .51850896.51863064.53428392 << New designator
Login entry .51850896.51863064.53428392
Login exit .51850896.51863064.53428392
Cancel .51850896.51863064.53428392
=========================================
2nd try
pub.sendMessage enabled, prints the msg and the control ID ("Failed...") in the subscribed function
Init done .52750976.52766760.52766960
Login entry .52750976.52766760.52766960
Msg Connection Timeout
Failed .52750976.52766760.52766960
Login exit .52750976.52766760.52766960
Cancel .52750976.52766760.52766960
Init done .52766320.52787240.52786880
Login entry .52766320.52787240.52786880
Msg Connection Timeout
Failed .52750976.52766760.52766960 << reference reverted???
Exception in Tkinter callback
Traceback (most recent call last):
File "D:\Python27\Lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "D:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\src\agile_revision_check.py", line 640, in login
if connection_agile.login(self.txtUser_name.get(), self.txtPassword.get()):
File "D:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\src\agile_revision_check.py", line 412, in login
if not self.connect():
File "D:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\src\agile_revision_check.py", line 405, in connect
pub.sendMessage("agile.fail.connect", msg=Config.MSG_AGILE_CONN_TIMEOUT)
File "d:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\lib\site-packages\pubsub\core\kwargs\publisher.py", line 30, in sendMessage
topicObj.publish(**kwargs)
File "d:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\lib\site-packages\pubsub\core\kwargs\publishermixin.py", line 24, in publish
self._publish(msgKwargs)
File "d:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\lib\site-packages\pubsub\core\topicobj.py", line 340, in _publish
self.__sendMessage(data, self, iterState)
File "d:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\lib\site-packages\pubsub\core\topicobj.py", line 359, in __sendMessage
self._mix_callListener(listener, data, iterState)
File "d:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\lib\site-packages\pubsub\core\kwargs\publishermixin.py", line 64, in _mix_callListener
listener(iterState.filteredArgs, self, msgKwargs)
File "d:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\lib\site-packages\pubsub\core\kwargs\listenerimpl.py", line 27, in __call__
cb(**kwargs)
File "D:\SVNRepo\projects-sw\ISIApps\trunk\src\virtenv\src\agile_revision_check.py", line 673, in logon_failure
self.msg_ctrl_login.configure(bg=Config.CTRL_COLOR_LOGIN_FAIL)
File "D:\Python27\Lib\lib-tk\Tkinter.py", line 1202, in configure
return self._configure('configure', cnf, kw)
File "D:\Python27\Lib\lib-tk\Tkinter.py", line 1193, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
TclError: invalid command name ".52750976.52766760.52766960"
This is with PyPubSub 3.1.2, Python 2.7 on Windows 7.
I'd appreciate any pointers on how to troubleshoot this further.
Thanks,
Eric