[PATCH] Fix tgz archival on Windows.

Csaba Henk csaba-ml at creo.hu
Wed Jun 27 05:23:32 CDT 2007


# HG changeset patch
# User csaba.henk at creo.hu
# Node ID d814950cfc6e4de6acb105760751f794c6f38d97
# Parent  cf8b8f62688aef733ca6f97f1b8833030da2d63c
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.

diff -r cf8b8f62688a -r d814950cfc6e mercurial/archival.py
--- a/mercurial/archival.py	Mon Jun 25 21:23:24 2007 -0500
+++ b/mercurial/archival.py	Wed Jun 27 12:18:08 2007 +0200
@@ -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)



More information about the Mercurial-devel mailing list