[vtk-developers] vtkMathTextUtilities and otherPrint test

David Gobbi david.gobbi at gmail.com
Tue Jul 10 12:47:45 EDT 2012


I think that this class is doing things in the constructor that it
shouldn't be doing until Render is called.

David, how about moving all of the python initialization and
module-loading code into a method called "Initialize" that checks if
this->Parser is set, and if not, calls PyInitialize() and loads the
modules?  Then Initialize() can be called from RenderString().  The
idea is that none of the python initialization should be done from the
constructor.

Curly braces should also be added around any "if" bodies that are
currently lacking them.  I'm not fond of the goto's either, but I
don't know if the VTK style guidelines forbid them.  The curly-braces,
however, are definitely part of the guidelines...

 - David


On Tue, Jul 10, 2012 at 9:57 AM, Brad King <brad.king at kitware.com> wrote:
> David(s),
>
> Since somewhere around this change:
>
>  http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=0837cb97
>  http://review.source.kitware.com/#/c/6177/
>
> The VTK otherPrint test fails on some machines with
> the output below.  I can reproduce the error like this:
>
>  $ printf 'package require vtk\nvtkMathTextUtilities u\nexit' | bin/vtk
>
> when Tcl wrapping is enabled.  It's unclear to me from a quick look
> how we expect the symbol to be available to dlopen-ed modules.  Ideas?
>
> Thanks,
> -Brad
>
>
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 134, in <module>
>     from matplotlib.rcsetup import (defaultParams,
>   File "/usr/lib/pymodules/python2.7/matplotlib/rcsetup.py", line 19, in <module>
>     from matplotlib.colors import is_color_like
>   File "/usr/lib/pymodules/python2.7/matplotlib/colors.py", line 52, in <module>
>     import numpy as np
>   File "/usr/lib/pymodules/python2.7/numpy/__init__.py", line 137, in <module>
>     import add_newdocs
>   File "/usr/lib/pymodules/python2.7/numpy/add_newdocs.py", line 9, in <module>
>     from numpy.lib import add_newdoc
>   File "/usr/lib/pymodules/python2.7/numpy/lib/__init__.py", line 4, in <module>
>     from type_check import *
>   File "/usr/lib/pymodules/python2.7/numpy/lib/type_check.py", line 8, in <module>
>     import numpy.core.numeric as _nx
>   File "/usr/lib/pymodules/python2.7/numpy/core/__init__.py", line 5, in <module>
>     import multiarray
> ImportError: /usr/lib/pymodules/python2.7/numpy/core/multiarray.so: undefined symbol: PyExc_SystemError
> calling vtkMathTextUtilities::Print



More information about the vtk-developers mailing list