From 8ff1f6a69e967951fb4de3049fbb847aacc901c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gust=C3=A4bel?= Date: Sat, 21 Apr 2007 12:20:09 +0000 Subject: [PATCH] Bug #1704156: Support for unicode strings as input filenames is neither documented nor intended but works in Python 2.4 under certain conditions. This stopped working in 2.5 because struct.pack is used. This small patch restores the old behaviour. A more solid solution is planned for 2.6. --- Lib/tarfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 474e306e4c..8afea475d8 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -963,7 +963,7 @@ class TarInfo(object): stn(prefix, 155) ] - buf += struct.pack("%ds" % BLOCKSIZE, "".join(parts)) + buf += "".join(parts).ljust(BLOCKSIZE, NUL) chksum = calc_chksums(buf[-BLOCKSIZE:])[0] buf = buf[:-364] + "%06o\0" % chksum + buf[-357:] self.buf = buf -- 2.40.0