--- Lib/py_compile.py.orig 2013-10-30 08:16:08.478176098 +0100 +++ Lib/py_compile.py 2013-10-30 08:16:12.849167355 +0100 @@ -108,15 +108,15 @@ byte-compile all installed files (or all files in selected directories). """ - with tokenize.open(file) as f: - try: - st = os.fstat(f.fileno()) - except AttributeError: - st = os.stat(file) - timestamp = int(st.st_mtime) - size = st.st_size & 0xFFFFFFFF - codestring = f.read() try: + with tokenize.open(file) as f: + try: + st = os.fstat(f.fileno()) + except AttributeError: + st = os.stat(file) + timestamp = int(st.st_mtime) + size = st.st_size & 0xFFFFFFFF + codestring = f.read() codeobject = builtins.compile(codestring, dfile or file, 'exec', optimize=optimize) except Exception as err: