[meld] Use binary mode to write text files (closes bgo#590760)



commit 74a9e35678b78cf377ac01881b21d016c9e968c9
Author: Robert Wahler <robert gearheadforhire com>
Date:   Tue Feb 16 13:24:01 2010 -0500

    Use binary mode to write text files (closes bgo#590760)
    
    _save_text_to_filename should use binary mode to keep line endings
    on Windows.

 meld/filediff.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 12c1d6f..3440975 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -979,7 +979,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
 
     def _save_text_to_filename(self, filename, text):
         try:
-            open(filename, "w").write(text)
+            open(filename, "wb").write(text)
         except IOError, e:
             misc.run_dialog(
                 _("Error writing to %s\n\n%s.") % (filename, e),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]