From 8e4eacb461cee6ee8b15822185553bc42e508263 Mon Sep 17 00:00:00 2001 From: owsla Date: Sun, 12 Oct 2008 01:55:29 +0000 Subject: Open stdin/stdout in binary mode on Windows git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@949 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff-backup | 7 +++++++ rdiff-backup/rdiff_backup/rpath.py | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 2662860..2305858 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,6 +1,9 @@ New in v1.2.2 (????/??/??) --------------------------- +Improve compatibility between Unix and remote native Windows client. It is now +possible to use SSH daemons other than Putty on Windows. (Andrew Ferguson) + Print a more informative error message if the user's remote shell prints extraneous information before rdiff-backup runs. (Andrew Ferguson) diff --git a/rdiff-backup/rdiff-backup b/rdiff-backup/rdiff-backup index 6fb0c00..3760ced 100755 --- a/rdiff-backup/rdiff-backup +++ b/rdiff-backup/rdiff-backup @@ -19,6 +19,13 @@ import sys import rdiff_backup.Main +try: + import msvcrt, os + msvcrt.setmode(0, os.O_BINARY) + msvcrt.setmode(1, os.O_BINARY) +except ImportError: + pass + if __name__ == "__main__" and not globals().has_key('__no_execute__'): rdiff_backup.Main.error_check_Main(sys.argv[1:]) diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index d208c4f..b3efc8c 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -1422,7 +1422,7 @@ class MaybeGzip: new_rp = self.get_gzipped_rp() if self.callback: self.callback(new_rp) - self.fileobj = new_rp.open("w", compress = 1) + self.fileobj = new_rp.open("wb", compress = 1) return self.fileobj.write(buf) def close(self): -- cgit v1.2.1