Commit ea1060c2 authored by owsla's avatar owsla

Open stdin/stdout in binary mode on Windows


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@949 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent d3db6226
New in v1.2.2 (????/??/??) 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 Print a more informative error message if the user's remote shell prints
extraneous information before rdiff-backup runs. (Andrew Ferguson) extraneous information before rdiff-backup runs. (Andrew Ferguson)
......
...@@ -19,6 +19,13 @@ ...@@ -19,6 +19,13 @@
import sys import sys
import rdiff_backup.Main 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__'): if __name__ == "__main__" and not globals().has_key('__no_execute__'):
rdiff_backup.Main.error_check_Main(sys.argv[1:]) rdiff_backup.Main.error_check_Main(sys.argv[1:])
......
...@@ -1422,7 +1422,7 @@ class MaybeGzip: ...@@ -1422,7 +1422,7 @@ class MaybeGzip:
new_rp = self.get_gzipped_rp() new_rp = self.get_gzipped_rp()
if self.callback: self.callback(new_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) return self.fileobj.write(buf)
def close(self): def close(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment