python 1.5.2 freezes on import statement on mandrake 7.2

Yann SAMAMA ysamama at cybercable.fr
Tue Nov 21 13:22:24 EST 2000


Hi all.

Each time I want to run a Python script, it freezes on the "import"
statement.

For testing purpose I have written this small script :

*** begin test.py ***
import os
os.system("/bin/hostname")
*** end test.py ***

When I run it, the script get blocked. I run the "top" utility from another
terminal. It indicates almost 98 % of cpu time for Python...

The weirdest thing is that my script runs perfectly when I type it in the
interactive mode.

The pythons rpms are the following :
python-1.5.2-12mdk
rpm-python-3.0.5-27mdk
python-devel-1.5.2-12mdk
pythonlib-1.23-2mdk
python-imaging-1.1-2mdk
python-docs-1.5.2-12mdk


the output of "python -v" follow :

[yann at linux01 yann]$ python -v
# /usr/lib/python1.5/exceptions.pyc matches /usr/lib/python1.5/exceptions.py
import exceptions # precompiled from /usr/lib/python1.5/exceptions.pyc
# /usr/lib/python1.5/site.pyc matches /usr/lib/python1.5/site.py
import site # precompiled from /usr/lib/python1.5/site.pyc
# /usr/lib/python1.5/os.pyc matches /usr/lib/python1.5/os.py
import os # precompiled from /usr/lib/python1.5/os.pyc
import posix # builtin
# /usr/lib/python1.5/posixpath.pyc matches /usr/lib/python1.5/posixpath.py
import posixpath # precompiled from /usr/lib/python1.5/posixpath.pyc
# /usr/lib/python1.5/stat.pyc matches /usr/lib/python1.5/stat.py
import stat # precompiled from /usr/lib/python1.5/stat.pyc
# /usr/lib/python1.5/UserDict.pyc matches /usr/lib/python1.5/UserDict.py
import UserDict # precompiled from /usr/lib/python1.5/UserDict.pyc
Python 1.5.2 (#1, Sep 30 2000, 18:08:36)  [GCC 2.95.3 19991030 (prerelease)]
on
linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import readline # dynamically loaded from
/usr/lib/python1.5/lib-dynload/readlin
e.so
>>>
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] readline
# cleanup[1] exceptions
# cleanup[1] posix
# cleanup[1] site
# cleanup[1] signal
# cleanup[2] os.path
# cleanup[2] os
# cleanup[2] UserDict
# cleanup[2] posixpath
# cleanup[2] stat
# cleanup sys
# cleanup __builtin__
# cleanup ints: 1 unfreed int in 1 out of 1 block
# cleanup floats


Has anybody a clue??
I feel bad when I can't use me favourite language...

Yann.





More information about the Python-list mailing list