[meld] filediff: Add some paranoia in file saving
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Add some paranoia in file saving
- Date: Wed, 31 Dec 2014 23:33:12 +0000 (UTC)
commit c4ecf33faa49010d142bf7e221560d2c199c00f7
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Dec 29 09:14:04 2014 +1000
filediff: Add some paranoia in file saving
meld/filediff.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 6a098ae..ee15840 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1616,6 +1616,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
def _save_text_to_filename(self, filename, text):
try:
+ if not isinstance(text, str):
+ raise IOError("couldn't encode text")
open(filename, "wb").write(text)
except IOError as err:
misc.error_dialog(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]