Index: Lib/lib2to3/main.py =================================================================== --- Lib/lib2to3/main.py (revision 67665) +++ Lib/lib2to3/main.py (working copy) @@ -6,6 +6,7 @@ import os import logging import optparse +import shutil from . import refactor @@ -39,6 +40,7 @@ # Actually write the new file super(StdoutRefactoringTool, self).write_file(new_text, filename, old_text) + shutil.copymode(backup, filename) def print_output(self, lines): for line in lines: