Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83496 > unrolled thread

Re: Non-unique dirs in sys.path

Started byTerry Reedy <tjreedy@udel.edu>
First post2015-01-10 04:37 -0500
Last post2015-01-10 04:37 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Non-unique dirs in sys.path Terry Reedy <tjreedy@udel.edu> - 2015-01-10 04:37 -0500

#83496 — Re: Non-unique dirs in sys.path

FromTerry Reedy <tjreedy@udel.edu>
Date2015-01-10 04:37 -0500
SubjectRe: Non-unique dirs in sys.path
Message-ID<mailman.17560.1420882659.18130.python-list@python.org>
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
> times.
>
> I cooked up this .bat file to demonstrate the issue:
>    @echo off
>    setlocal
>    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
> Vanem\Programdata\Python\Python27\site-packages
>    f:\windows\system32\python27.zip    << !! doesn't exist, but okay.
>    G:\Programfiler\Python27
>    g:\Programfiler\Python27\DLLs
>    g:\Programfiler\Python27\lib
>    g:\Programfiler\Python27\lib\lib-tk
>    g:\Programfiler\Python27\lib\plat-win
>    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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web