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

Aahz aahz at pythoncraft.com
Wed May 20 14:52:43 EDT 2009


In article <mailman.406.1242754524.8015.python-list at python.org>,
Jean-Michel Pichavant  <jeanmichel at sequans.com> 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 pythoncraft.com)           <*>         http://www.pythoncraft.com/

"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