Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'received:verizon.net': 0.07; 'terry': 0.07; 'obsolete': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:files': 0.09; 'files.': 0.09; '..pyc': 0.16; '3.2.': 0.16; '__pycache__': 0.16; 'aware,': 0.16; 'caching': 0.16; 'reedy': 0.16; 'jan': 0.19; 'header:In- Reply-To:1': 0.23; 'changed': 0.24; 'compiled': 0.25; 'statement': 0.25; 'import': 0.28; 'importing': 0.28; 'functional': 0.30; 'to:addr:python-list': 0.32; 'instead': 0.33; 'there': 0.33; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.33; 'file.': 0.34; 'stuck': 0.34; 'however,': 0.34; '(for': 0.35; 'file': 0.36; 'but': 0.37; 'received:org': 0.37; 'finding': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'delete': 0.40 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: leftover pyc files Date: Fri, 04 Nov 2011 16:01:14 -0400 References: <4EB14D9D.8080309@gmail.com> <11169846.60.1320306575820.JavaMail.geo-discussion-forums@yqiu15> <5204871.568.1320398878314.JavaMail.geo-discussion-forums@yqiu15> <4EB3BFA3.4090802@gmail.com> <4EB3C5E2.3020702@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 In-Reply-To: <4EB3C5E2.3020702@gmail.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320436902 news.xs4all.nl 6952 [2001:888:2000:d::a6]:37236 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15354 For those not aware, the compiled file caching and import system was changed for 3.2. Given test.py, the compiled file is no longer test.pyc, in the same directory, but (for cpython32) __pycache__/test.cpython-32.pyc. Given the statement 'import test', the __pycache__ directory is only searched (for the name given above) after finding test.py. So if 'test.py' is deleted or renamed to 'mytest.py', an unchanged 'import test' will *fail* instead of importing the obsolete .pyc file. So there is no longer a functional reason to delete such obsolete files. However, the OP is stuck with 2.5. -- Terry Jan Reedy