Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 181535 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 without "with"
bug256953e.patch (text/plain), 2.00 KB, created by
Martin von Gagern
on 2009-02-10 11:20:19 UTC
(
hide
)
Description:
Backport of upstream r69481 without "with"
Filename:
MIME Type:
Creator:
Martin von Gagern
Created:
2009-02-10 11:20:19 UTC
Size:
2.00 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. >By replacing the with/as with a try/finally, this patch should work for >python 2.4 as well. > >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,11 @@ > See module py_compile for details of the actual byte-compilation. > > """ >- > import os > import sys > import py_compile >+import struct >+import imp > > __all__ = ["compile_dir","compile_path"] > >@@ -54,11 +55,20 @@ > 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') >+ chandle = open(cfile, 'rb') >+ try: >+ actual = chandle.read(8) >+ finally: >+ chandle.close() >+ 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