Fix python 3.6 support

Raphaël Vinot 2017-01-06 20:36:09 -05:00
parent 329586768b
commit 02f5e95a98
1 changed files with 2 additions and 2 deletions

View File

@ -214,8 +214,8 @@ def get_zipped_contents(filename, data, password=None):
if password is not None:
password = str.encode(password) # Byte encoded password required
for zip_file_name in zf.namelist(): # Get all files in the zip file
with, mode='rU', pwd=password) as fp:
file_data =
with, mode='r', pwd=password) as fp:
file_data = io.TextIOWrapper(fp).read().encode()
unzipped_files.append({"values": zip_file_name,
"data": base64.b64encode(file_data).decode(), # Any password works when not encrypted
"comment": "Extracted from {0}".format(filename)})