|
From: Guenter S. <Gue...@ph...> - 2009-08-31 17:03:01
|
I ran into a number of problems with vpython on Linux which appear to be
all related. The problems do not happen in Windows. My system is ubuntu
9.04, vpython 5.12 compiled from source (5.11 gives identical results).
Thee common feature I see on Linux is, whenever vpython raises an
exception, python seg. faults.
Example 1:
In [1]: from visual import *
In [2]: a = vector(1,2,3)
In [3]: for i in a:
...: print i
...:
...:
1.0
2.0
3.0
Segmentation fault
~ $
but the following works:
Example 2:
In [1]: from visual import *
In [2]: a = vector(1,2,3)
In [3]: for i in a:
...: print i
...: if i>2:
...: break
...:
...:
1.0
2.0
3.0
This seems to point to the raising a StopIteration exception as the
problem point.
Example 3:
In [1]: from visual import *
In [2]: a = [1,2,3]
In [3]: mag2(a)
Out[3]: 14.0
In [4]: a = [1,2,'x']
In [5]: mag2(a)
Segmentation fault
~ $
It should have raised a TypeError as in this case
In [1]: from visual import *
In [2]: a = [1,2,'x']
In [3]: print a[0]*a[0]+a[1]*a[1]+a[2]*a[2]
------> print(a[0]*a[0]+a[1]*a[1]+a[2]*a[2])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Finally this fails as well:
Example 5:
In [1]: from visual import *
In [2]: quit()
Do you really want to exit ([y]/n)?
Segmentation fault
~ $
This error is probably caused by a SystemExit exception.
Is something wrong with my install? Hard to see how to go wrong there,
it's configure, make, make install and taking care of site-packages in
ubuntu 9.04.
Thank you for your help and the great work.
Guenter Schneider
|