Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'skip:[ 20': 0.04; '@echo': 0.09; 'exist,': 0.09; 'here?': 0.09; 'issue:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'will,': 0.09; 'python': 0.11; 'jan': 0.12; 'assume': 0.14; 'bug,': 0.16; 'fails.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Non': 0.16; 'demonstrate': 0.16; 'wrote:': 0.18; "skip:' 30": 0.19; 'skip:f 30': 0.19; 'skip:g 40': 0.19; 'import': 0.22; 'header :User-Agent:1': 0.23; 'sort': 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'skip:g 30': 0.30; "i'm": 0.30; 'file': 0.32; 'trouble': 0.34; 'but': 0.35; 'being': 0.38; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'different': 0.65; 'believe,': 0.84; 'received:fios.verizon.net': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Non-unique dirs in sys.path Date: Sat, 10 Jan 2015 04:37:14 -0500 References: <54AFD43F.5040100@yahoo.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-108-16-203-145.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: <54AFD43F.5040100@yahoo.no> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420882659 news.xs4all.nl 2905 [2001:888:2000:d::a6]:45532 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83496 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