MantisBT - VTK
View Issue Details
0007768VTK(No Category)public2008-10-01 23:172013-04-05 19:37
Alexander Pletzer 
David Partyka 
normalmajoralways
closedfixed 
 
 
0007768: Python vtkTkRenderWindowInteractor failure with Tcl/Tk 8.5
The instantiation of vtkTkRenderWindowInteractor under Python fails with the latest tcl/tk version 8.5 on Fedora 9 x86_64. To see the problem it suffices
to run any of the examples under VTK/Examples/*/Python which uses vtkTkRenderWindowInteractor. For instance:

[pletzer@localhost Python]$ pwd
/home/research/pletzer/Download/VTK/Examples/Annotation/Python

[pletzer@localhost Python]$ python DispAllFonts.py
Traceback (most recent call last):
  File "DispAllFonts.py", line 79, in <module>
    vtkw = vtkTkRenderWindowInteractor(root, rw=renWin, width=800)
  File "/usr/lib/python2.5/site-packages/VTK-5.3.0-py2.5.egg/vtk/tk/vtkTkRenderWindowInteractor.py", line 48, in __init__
    vtkLoadPythonTkWidgets(master.tk)
  File "/usr/lib/python2.5/site-packages/VTK-5.3.0-py2.5.egg/vtk/tk/vtkLoadPythonTkWidgets.py", line 54, in vtkLoadPythonTkWidgets
    if len(path) > 0 and path[0] == '{' and path[-1] == '}':
TypeError: object of type '_tkinter.Tcl_Obj' has no len()
The problem is due to path containing not only a list of strings but also _tkinter.Tcl_Obj instances. This problem has been described at http://www.python.org/doc/2.3/whatsnew/node18.html. [^]

Cure: Replace

        except AttributeError:

by

        except: ###### fix AttributeError:


 at line 57 in file /usr/lib/python2.5/site-packages/VTK-5.3.0-py2.5.egg/vtk/tk/vtkLoadPythonTkWidgets.py.

Thanks for fixing this.

No tags attached.
patch vtkLoadPythonTkWidgets.py.patch (630) 2008-10-20 11:46
https://www.vtk.org/Bug/file/6788/vtkLoadPythonTkWidgets.py.patch
Issue History
2008-10-01 23:17Alexander PletzerNew Issue
2008-10-20 11:46dr4KeFile Added: vtkLoadPythonTkWidgets.py.patch
2008-10-20 11:47dr4KeNote Added: 0013907
2011-02-26 10:30David GobbiAssigned To => David Gobbi
2011-02-26 10:30David GobbiStatusbacklog => tabled
2011-04-17 00:57David GobbiNote Added: 0026201
2011-04-17 00:57David GobbiAssigned ToDavid Gobbi => David Partyka
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-04-05 19:36Berk GeveciStatusbacklog => tabled
2013-04-05 19:36Berk GeveciResolutionopen => fixed
2013-04-05 19:37Berk GeveciStatustabled => closed

Notes
(0013907)
dr4Ke   
2008-10-20 11:47   
My patch for this issue is joined.
(0026201)
David Gobbi   
2011-04-17 00:57   
It looks like this issue was fixed by David Partyka, so I'm assigning the bug to him.

commit 0c2451b1be36798517a59c7943593479c4bfd136
Author: Dave Partyka <dave.partyka@kitware.com>
Date: Fri Jul 3 10:29:11 2009 -0400

http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=0c2451b1be36798517a59c7943593479c4bfd136 [^]