From 7d4d074c9996f07a859a6e5a38774aa65a4ff85c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gust=C3=A4bel?= Date: Wed, 21 Dec 2011 19:27:50 +0100 Subject: [PATCH] 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. --- Lib/tarfile.py | 2 ++ Lib/test/test_tarfile.py | 7 +++++++ Misc/NEWS | 2 ++ 3 files changed, 11 insertions(+) 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("