Fix tgz archival on Windows.
authorcsaba.henk@creo.hu
Wed, 27 Jun 2007 08:35:26 -0700
changeset 4731 1d5a2ee683b0
parent 4730 eadfaa9ec487
child 4732 b0520e3903fe
Fix tgz archival on Windows. Making tgz's on Windows has been broken by 06de65673ec2 due to not being careful enough about binary mode opens.
mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -72,7 +72,7 @@ class tarit:
             if kind == 'gz':
                 mode = mode[0]
                 if not fileobj:
-                    fileobj = open(name, mode)
+                    fileobj = open(name, mode + 'b')
                 gzfileobj = self.GzipFileWithTime(name, mode + 'b',
                                                   zlib.Z_BEST_COMPRESSION,
                                                   fileobj, timestamp=mtime)