[Python-Dev] test_import failing
Fred L. Drake, Jr.
Mon, 9 Oct 2000 22:09:34 -0400 (EDT)
Neil Schemenauer writes:
> I assume the CVS sources are basicly the same as 2.0c1. Anyhow,
> test_import is failing on my Debian machine. The script is
> creating "@test.py" and then trying to import it. "." is not in
> sys.path for some reason.
Jeremy & I finally figured this out. "make test" runs python with
PYTHONPATH set to '' (an empty string). This is decidedly different
from running with PYTHONPATH unset (I consider this a bug that should
be fixed in 2.1).
The empty string is interpreted as the current directory (as
expected), so running "make test" adds the current directory to
sys.path, but running the regression test (test_import or regrtest) as
a script does not.
We decided not to fix this now, since it's too late to be sure it's
the right change, and adjusting the test case also means a very late
change. So whoever runs the tests is responsible for making sure the
current directory is on sys.path. (*Really* bogus!)
Fred L. Drake, Jr. <fdrake at beopen.com>
BeOpen PythonLabs Team Member