Skip to content

Commit df52667

Browse files
committed
Fix writing tarfile with unicode filename in python 2.6
1 parent bee56cd commit df52667

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pre_commit/make_archives.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def make_archive(name, repo, ref, destdir):
4949
# We don't want the '.git' directory
5050
shutil.rmtree(os.path.join(tempdir, '.git'))
5151

52-
with tarfile_open(output_path, 'w|gz') as tf:
52+
# XXX: py2.6 derps if filename is unicode while writing
53+
# XXX: str() is used to preserve behavior in py3
54+
with tarfile_open(str(output_path), 'w|gz') as tf:
5355
tf.add(tempdir, name)
5456

5557
return output_path

0 commit comments

Comments
 (0)