enthought/mayavi — Issue #19: Sporadic Build Failure on Win32
Author: mindw
Created: 2011-12-03 16:03:53+00:00
State: open

The following error shows up when building mayai2 on windows.
running build
----------------------------------------------------------------------
Building TVTK classes... SyntaxError: ('invalid syntax', ('tvtk_classes\\ls_dyna_reader.py', 100, 11, ' Get/Set the directory containing the LS-Dyna database and determine\n'))

error: tvtk_classes\ls_dyna_reader.pyc: The system cannot find the file specified

I've tracked down the issue to an uninitialized variable, and the following fixes this:
diff --git a/tvtk/wrapper_gen.py b/tvtk/wrapper_gen.py
index 29bd1df..b13c607 100644
--- a/tvtk/wrapper_gen.py
+++ b/tvtk/wrapper_gen.py
@@ -520,7 +520,9 @@ class WrapperGenerator:
elif typ in types.StringTypes:
if '\n' in default or '\r' in default:
default = clean_special_chars(default)
-
+ if name == 'database_directory':
+ default = ''
+
if default == '\x00':
default = ''
t_def = 'traits.String("%(default)s", '%locals()