From f274cdd973adf0f1b95036b00cf1522e785495d2 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Sat, 11 Jul 2009 22:07:06 -0400 Subject: [PATCH] fix latin-1 bug --HG-- branch : pmacs2 --- buffer/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buffer/__init__.py b/buffer/__init__.py index 9743cbc..8cdd57f 100644 --- a/buffer/__init__.py +++ b/buffer/__init__.py @@ -685,14 +685,14 @@ class FileBuffer(Buffer): try: data = self.make_string() if self.windows[0].mode.savetabs: - data = data.replace(" ", "\t").encode(self.codec) - - data = self.write_filter(data) + data = data.replace(" ", "\t") + data = self.write_filter(data.encode(self.codec)) f2 = self._open_file_w(self.path, preserve=False) f2.write(self.bytemark + data) f2.close() - except Exception, e: + #except Exception, e: + except NameError, e: if exists: shutil.copyfile(temp_path, self.path) raise e else: