Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 181517 Details for
Bug 256953
emerge sometimes does not update .pyc and .pyo files
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Backport of upstream r69481
bug256953c.patch (text/plain), 1.85 KB, created by
Martin von Gagern
on 2009-02-10 08:17:15 UTC
(
hide
)
Description:
Backport of upstream r69481
Filename:
MIME Type:
Creator:
Martin von Gagern
Created:
2009-02-10 08:17:15 UTC
Size:
1.85 KB
patch
obsolete
>compileall used the ctime of bytecode and source to determine if the bytecode >should be recreated. This created a timing hole. Fixed by just doing what >import does; check the mtime and magic number. > >Backport of the core difference from r69481 to the release25-maint branch. > >2009-02-10 Martin von Gagern > >References: >https://bugs.gentoo.org/256953 >http://bugs.python.org/issue5128 >http://svn.python.org/view?view=rev&rev=69481 > >Index: Lib/compileall.py >=================================================================== >--- Lib/compileall.py (revision 69204) >+++ Lib/compileall.py (working copy) >@@ -11,10 +11,12 @@ > See module py_compile for details of the actual byte-compilation. > > """ >- >+from __future__ import with_statement > import os > import sys > import py_compile >+import struct >+import imp > > __all__ = ["compile_dir","compile_path"] > >@@ -54,11 +56,17 @@ > if os.path.isfile(fullname): > head, tail = name[:-3], name[-3:] > if tail == '.py': >- cfile = fullname + (__debug__ and 'c' or 'o') >- ftime = os.stat(fullname).st_mtime >- try: ctime = os.stat(cfile).st_mtime >- except os.error: ctime = 0 >- if (ctime > ftime) and not force: continue >+ if not force: >+ try: >+ mtime = os.stat(fullname).st_mtime >+ expect = struct.pack('<4sl', imp.get_magic(), mtime) >+ cfile = fullname + (__debug__ and 'c' or 'o') >+ with open(cfile, 'rb') as chandle: >+ actual = chandle.read(8) >+ if expect == actual: >+ continue >+ except IOError: >+ pass > if not quiet: > print 'Compiling', fullname, '...' > try:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 256953
:
180696
|
180702
|
181517
|
181526
|
181535