cpython: c3ab8a698d2f (original) (raw)
Mercurial > cpython
changeset 81923:c3ab8a698d2f 2.7
Fix translating of illegal characters on Windows (issue #6972). [#6972]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Sat, 02 Feb 2013 12:30:49 +0200 |
parents | 706218e0facb |
children | b6b707063991 |
files | Lib/zipfile.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-)[+] [-] Lib/zipfile.py 3 |
line wrap: on
line diff
--- 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))[](#l1.15)
table = string.maketrans(illegal, '_' * len(illegal))[](#l1.16) arcname = arcname.translate(table)[](#l1.17)