[Python-Dev] Re: test_import failing

Guido van Rossum guido@python.org
Tue, 10 Oct 2000 08:06:54 -0500

>   And it's questionable how many bugs are hiding here as well.  I
> count two:
>   - test_import.py assumes the current directory is on the path; this
>     is just plain fragile, and should explicitly pick the directory
>     off of test_support.TESTFN, and add it to sys.path for the
>     duration of the test (which does indeed fix this bug)

I'll fix this.

>   - Modules/getpath.c interprets an empty definition of $PYTHONPATH as
>     adding '' to sys.path, where I assert it should not add anything
>     to sys.path.  Everywhere else I've recall seeing an environment
>     variable used as a data source, the test is done like this:
>     char *cp = getenv("VARIABLE");
>     if (cp != NULL && cp[0] != '\0') {
>         ...
>     }
>     (with some spelling variations).

Agreed, but please *don't fix this in 2.0!*

Who knows how many other hidden bugs (in 3rd party code) this will

OK to fix it after 2.0final is released.

--Guido van Rossum (home page: http://www.python.org/~guido/)