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


Groups > comp.lang.python > #15354

Re: leftover pyc files

From Terry Reedy <tjreedy@udel.edu>
Subject Re: leftover pyc files
Date 2011-11-04 16:01 -0400
References (5 earlier) <mailman.2409.1320342902.27778.python-list@python.org> <5204871.568.1320398878314.JavaMail.geo-discussion-forums@yqiu15> <4EB3BFA3.4090802@gmail.com> <CAPTjJmrvfGaTP_2f0g76tqdD2BVWTPBq=0SYc08QUDuixbevkA@mail.gmail.com> <4EB3C5E2.3020702@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2446.1320436902.27778.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-02 15:45 +0000
  Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:49 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:50 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:50 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 01:45 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 01:45 -0700
  Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:49 -0700
    Re: leftover pyc files Peter Otten <__peter__@web.de> - 2011-11-03 11:51 +0100
    Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-03 17:54 +0000
      Re: leftover pyc files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-04 06:48 +0000
      Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-04 02:27 -0700
        Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-04 10:34 +0000
        Re: leftover pyc files Chris Angelico <rosuav@gmail.com> - 2011-11-04 21:39 +1100
          Re: leftover pyc files 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-04 06:31 -0700
          Re: leftover pyc files 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-04 06:31 -0700
        Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-04 11:00 +0000
        Re: leftover pyc files Terry Reedy <tjreedy@udel.edu> - 2011-11-04 16:01 -0400
          Re: leftover pyc files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-04 23:15 +0000
      Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-04 02:27 -0700
        Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-04 02:29 -0700
    Re: leftover pyc files Chris Angelico <rosuav@gmail.com> - 2011-11-04 08:36 +1100
    Re: leftover pyc files David Robinow <drobinow@gmail.com> - 2011-11-03 20:14 -0400

csiph-web