summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-10-12 01:55:29 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-10-12 01:55:29 +0000
commit8e4eacb461cee6ee8b15822185553bc42e508263 (patch)
treeb131b5d91bdc7a34b99bc71a971371c6e78afc95
parent0b04891044ac699108e7d303a85fef04ba0a7d5c (diff)
downloadrdiff-backup-8e4eacb461cee6ee8b15822185553bc42e508263.tar.gz
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
-rw-r--r--rdiff-backup/CHANGELOG3
-rwxr-xr-xrdiff-backup/rdiff-backup7
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py2
3 files changed, 11 insertions, 1 deletions
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):