From: Lars Gustäbel Date: Wed, 21 Dec 2011 18:27:50 +0000 (+0100) Subject: Issue #13639: Accept unicode filenames in tarfile.open(mode="w|gz"). X-Git-Tag: v2.7.3rc1~222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d4d074c9996f07a859a6e5a38774aa65a4ff85c;p=python Issue #13639: Accept unicode filenames in tarfile.open(mode="w|gz"). Passing a unicode filename to tarfile.open() along with mode "w|gz" failed with a UnicodeError because the filename was not encoded properly before being written to the gzipped stream in the FNAME extra field. --- diff --git a/Lib/tarfile.py b/Lib/tarfile.py index ed5bcf20ee..bd73965abf 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -454,6 +454,8 @@ class _Stream: 0) timestamp = struct.pack("