#26 Error when.. reporting error

closed
nobody
None
5
2007-09-25
2007-05-24
No

Pmw 1.5, Python 2.5.1 on Windows XP Pro.

From a coworker starting with Python and Tkinter/Pmw. He wrote a Script with a Pmw.Counter, and an entryfield_modifiedcommand handler for this counter (to capture all value modifications).

Found this error:

C:\Documents and Settings\pointal\Bureau>python controller-bug.py
Traceback (most recent call last):
File "controller-bug.py", line 98, in <module>
root.mainloop()
File "C:\Tools\Python25\lib\lib-tk\Tkinter.py", line 1023, in mainloop
self.tk.mainloop(n)
File "C:\Tools\Python25\Lib\site-packages\Pmw\Pmw_1_2\lib\PmwBase.py", line 17
51, in __call__
_reporterror(self.func, args)
File "C:\Tools\Python25\Lib\site-packages\Pmw\Pmw_1_2\lib\PmwBase.py", line 17
77, in _reporterror
msg = exc_type + ' Exception in Tk callback\n'
TypeError: unsupported operand type(s) for +: 'type' and 'str'

Resolved by modifying line 1777 of PmwBase into:

msg = str(exc_type) + ' Exception in Tk callback\n'

Now I can see the real internal error of Pmw:
File "C:\Tools\Python25\Lib\site-packages\Pmw\Pmw_1_2\lib\PmwEntryField.py", l
ine 218, in _postProcess
cmd()
<type 'exceptions.TypeError'>: evt_real_modified() takes exactly 2 arguments (1
given)

A+

Laurent Pointal.

Note: Seen many mixing of tab and spaces for indentation... very bad, should make a complete tab -> 8 spaces replacement in sources to avoid problems.

Discussion

  • Laurent Pointal

    Laurent Pointal - 2007-05-24

    Attached the sample file which trig the bug

     
  • Serge Hulne

    Serge Hulne - 2007-09-25
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks