(original) (raw)

changeset: 81923:c3ab8a698d2f branch: 2.7 parent: 81919:706218e0facb user: Serhiy Storchaka storchaka@gmail.com date: Sat Feb 02 12:30:49 2013 +0200 files: Lib/zipfile.py description: Fix translating of illegal characters on Windows (issue #6972). diff -r 706218e0facb -r c3ab8a698d2f Lib/zipfile.py --- a/Lib/zipfile.py Sat Feb 02 12:16:22 2013 +0200 +++ b/Lib/zipfile.py Sat Feb 02 12:30:49 2013 +0200 @@ -5,6 +5,7 @@ import binascii, cStringIO, stat import io import re +import string try: import zlib # We may need its compression method @@ -1052,7 +1053,7 @@ # 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) /storchaka@gmail.com