Import and absolute file names, sys.path including ''... or not

Aahz aahz at
Wed May 20 20:52:43 CEST 2009

In article <mailman.406.1242754524.8015.python-list at>,
Jean-Michel Pichavant  <jeanmichel at> wrote:
>I spent quite a time on a malicious issue. I found out that there is a
>slight difference on the sys.path content when either executing code
>from a shell or from within a script.  This difference is the '' item,
>which is present in the shell form of sys.path.

Why are you calling this a malicious issue?

When I do this test, I find that the current working directory's full
path is prepended to sys.path, so if you're having problems, I bet that
you're changing your working directory during program execution.
Aahz (aahz at           <*>

"A foolish consistency is the hobgoblin of little minds, adored by little
statesmen and philosophers and divines."  --Ralph Waldo Emerson

More information about the Python-list mailing list