From cf6774afe6aa7af88b4287a4587b861003875bfb Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 7 Sep 2015 23:56:50 +0200 Subject: [PATCH] Add binary mode for writing Useless on Linux, can prevent data corruption on windows. --- weboob/applications/boobill/boobill.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weboob/applications/boobill/boobill.py b/weboob/applications/boobill/boobill.py index f3d4a828..ad579ae7 100644 --- a/weboob/applications/boobill/boobill.py +++ b/weboob/applications/boobill/boobill.py @@ -206,7 +206,7 @@ class Boobill(ReplApplication): print(buf) else: try: - with open(dest, 'w') as f: + with open(dest, 'wb') as f: f.write(buf) except IOError as e: print('Unable to write bill in "%s": %s' % (dest, e), file=self.stderr) @@ -223,7 +223,7 @@ class Boobill(ReplApplication): print(buf) else: try: - with open(dest, 'w') as f: + with open(dest, 'wb') as f: f.write(buf) except IOError as e: print('Unable to write bill in "%s": %s' % (dest, e), file=self.stderr)