Non-unique dirs in sys.path
tjreedy at udel.edu
Sat Jan 10 10:37:14 CET 2015
On 1/9/2015 8:14 AM, Gisle Vanem wrote:
> I'm having some trouble understanding why my Python 2.7.9
> has the '%PYTHONHOME%\lib\site-packages' listed multiple
> I cooked up this .bat file to demonstrate the issue:
> @echo off
> set PYTHONPATH=
> python -c "import sys; [sys.stdout.write('%%s\n' %% p) for (i,p) in
> enumerate(sys.path)]" | sort --ignore-case
> which produces:
> f:\Documents and Settings\Gisle
> f:\windows\system32\python27.zip << !! doesn't exist, but okay.
> g:\Programfiler\Python27\lib\site-packages << !!
> g:\programfiler\python27\lib\site-packages << !!
> Why are these listed twice with different casing? One
> would assume that Python on Win32 would be case-insensitive.
> Some .pth-file to blame here?
To me, this is a bug, as it will, I believe, result in site-packages
being searched twice before an import fails.
Terry Jan Reedy
More information about the Python-list