Fix tar_contents() to open files in binary mode for py3k compatibility.
authorZac Medico <zmedico@gentoo.org>
Tue, 4 Aug 2009 21:14:58 +0000 (21:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 4 Aug 2009 21:14:58 +0000 (21:14 -0000)
svn path=/main/trunk/; revision=13908

pym/portage/dbapi/vartree.py

index 72c8292719e1593e9f9da50c3d362489ce6507ea..f99fb69da1fdd813c17ffff16b14e8c51d88e953 100644 (file)
@@ -4147,7 +4147,7 @@ def tar_contents(contents, root, tar, protect=None, onProgress=None):
                                tarinfo.size = 0
                                tar.addfile(tarinfo)
                        else:
-                               f = open(path)
+                               f = open(path, 'rb')
                                try:
                                        tar.addfile(tarinfo, f)
                                finally: