Gael Varoquaux a écrit : > On Mon, Jul 18, 2011 at 06:22:05PM +0200, pellegrini wrote: > >> and when running "python setup.py bdist_wininst" I get the following error: >> > > > >> running bdist_wininst >> running build >> ---------------------------------------------------------------------- >> Building TVTK classes... SyntaxError: ('invalid syntax', >> ('tvtk_classes\\ls_dyna >> _reader.py', 100, 11, ' Get/Set the directory containing the >> LS-Dyna data >> base and determine\n')) >> > > >> error: tvtk_classes\ls_dyna_reader.pyc: Le fichier spÚcifiÚ est introuvable >> > > > >> Looking deeper into the code, it seems that the problem comes from >> the code TVTKGenerator. >> Looking at the generated 'ls-dyna-reader.py' file (cf attached file) >> I found something like a misformatted string at the line 100 but I >> have no single clue why and how such a strange string could be >> generated. >> > > What is happening is that the code generator for TVTK is spitting out > invalid Python file. > > I had a look at the ls_dyna_reader.py file generated on my system, and I > couldn't reproduce the problem. It could be related to Windows, but > glancing at the horrible characters in there, I wonder whether it is not > a locale problem (clearly you have you locale set to French). Can you try > adding at the begining of the gen_tvtk_classes_zip function in > tvtk/setup.py something like: > > import locale > locale.setlocale(locale.LC_ALL, ('en_US', 'UTF8')) > > Hi Gael,
I tried your fix but I get a "locale.Error: unsupported locale setting" error. In the meantime, I don't understand why and how, the problem stopped and I could build the package and it seems to work properly. It started to work when I put some print flags in the gen_tvtk_classes_zip function to get a better understanding of what was going on there. What is amazing is that the corrupted line in the ls_dyna_reader.py is still generated but for unknown reasons, now, it can be parsed and the module can be compiled. Another thing that looks strange is that suring the build there are two "tvtk_classes" temporary directories that are created and the "value" of the corrupted string is different in the two versions of the ls_dyna_reader.py. That might be interesting to dig further what is going on my "french" machine. We can perform other tests (e.g. locale) if that can lead to an improvment in the mayavi installation process. Do not hesitate. With all the help I asked those days, if I can be helpful in return. Eric Anyway, I would be interested to dig in the direction you mentionned to test if the corrupted string is stylr > and see if it fixes the problem. > > Gael > > -- Eric Pellegrini Calcul Scientifique Institut Laue-Langevin Grenoble, France ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ MayaVi-users mailing list MayaVi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mayavi-users