Fix translating of illegal characters on Windows (issue #6972).
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 31000ac..9af2986 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -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)