<div dir="ltr">Hi David,<div><br></div><div>Yes, it seems to be a bug related to the py3k modifications.  I believe that the swig-pointer initializer is still used in some places (it allows a person to create a python-wrapped VTK object, if all they have is a pointer to the object).</div><div><br></div><div>I'm going away for a few days but I'll take a look when I get back.</div><div><br></div><div> - David</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 7:56 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Aug 26, 2015 at 3:02 PM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm updating some code for a client to use current VTK master, and there's an error while instantiating a python class that derives from vtkInteractorStyle. It seems to be related to __init__ taking an extra parameter which is used by the subclass to initialize some internals.<div><br></div><div>A minimal example that reproduces the error:</div><div><br></div><div>test.py:</div><div><div>import vtk</div><div><br></div><div>class MyInteractorStyle(vtk.vtkInteractorStyleUser):</div><div>  def __init__(self, arg):</div><div>    pass</div><div>  </div><div>obj = MyInteractorStyle(2)</div><div><br></div></div><div>$ vtkpython test.py</div><div><div>Traceback (most recent call last):</div><div>  File "/tmp/test.py", line 7, in <module></div><div>    obj = MyInteractorStyle(2)</div><div>TypeError: method requires a string argument</div></div><div><br></div><div>Removing the extra argument from __init__ will make the error go away. </div><div><br></div><div>This worked a few months ago last time we bumped their VTK version. Is this a bug?</div></div></blockquote><div><br></div></span><div>It looks like the issue is in PyVTKObject_New, which treats all __init__ arguments as SWIG pointers for object initialization. I'm not familiar with the usecase for that, is there some additional check we can perform to pass over regular arguments?</div><div><br></div><div>Dave</div></div></div></div>
</blockquote></div><br></div>