mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 12:30:08 -06:00
Fix writing tarfile with unicode filename in python 2.6
This commit is contained in:
@@ -49,7 +49,9 @@ def make_archive(name, repo, ref, destdir):
|
||||
# We don't want the '.git' directory
|
||||
shutil.rmtree(os.path.join(tempdir, '.git'))
|
||||
|
||||
with tarfile_open(output_path, 'w|gz') as tf:
|
||||
# XXX: py2.6 derps if filename is unicode while writing
|
||||
# XXX: str() is used to preserve behavior in py3
|
||||
with tarfile_open(str(output_path), 'w|gz') as tf:
|
||||
tf.add(tempdir, name)
|
||||
|
||||
return output_path
|
||||
|
||||
Reference in New Issue
Block a user