mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix writing tarfile with unicode filename in python 2.6
This commit is contained in:
parent
bee56cd5bc
commit
df52667950
1 changed files with 3 additions and 1 deletions
|
|
@ -49,7 +49,9 @@ def make_archive(name, repo, ref, destdir):
|
||||||
# We don't want the '.git' directory
|
# We don't want the '.git' directory
|
||||||
shutil.rmtree(os.path.join(tempdir, '.git'))
|
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)
|
tf.add(tempdir, name)
|
||||||
|
|
||||||
return output_path
|
return output_path
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue