From: Serhiy Storchaka Date: Sat, 2 Feb 2013 10:30:49 +0000 (+0200) Subject: Fix translating of illegal characters on Windows (issue #6972). X-Git-Tag: v2.7.4rc1~167 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c068750b611fe0298dd906bd9dc60cc38a03945;p=thirdparty%2FPython%2Fcpython.git Fix translating of illegal characters on Windows (issue #6972). --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 31000accbb55..9af2986bf9a4 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -5,6 +5,7 @@ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re +import string try: import zlib # We may need its compression method @@ -1052,7 +1053,7 @@ class ZipFile(object): # filter illegal characters on Windows if os.path.sep == '\\': illegal = ':<>|"?*' - table = str.maketrans(illegal, '_' * len(illegal)) + table = string.maketrans(illegal, '_' * len(illegal)) arcname = arcname.translate(table) targetpath = os.path.join(targetpath, arcname)