mirror of https://github.com/python/cpython
Fix translating of illegal characters on Windows (issue #6972).
This commit is contained in:
parent
23298cb7f5
commit
7c068750b6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue