Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28a0aa1

Browse files
switched utils to use StringIO
1 parent 7458376 commit 28a0aa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

srtm/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_color_between(color1, color2, i):
4646

4747
def zip(contents, file_name):
4848
logging.debug('Zipping %s bytes' % len(contents))
49-
result = io.BytesIO()
49+
result = io.StringIO()
5050
zip_file = zipfile.ZipFile(result, 'w', zipfile.ZIP_DEFLATED, False)
5151
zip_file.writestr(file_name, contents)
5252
zip_file.close()
@@ -56,7 +56,7 @@ def zip(contents, file_name):
5656

5757
def unzip(contents):
5858
logging.debug('Unzipping %s bytes' % len(contents))
59-
zip_file = zipfile.ZipFile(io.BytesIO(contents))
59+
zip_file = zipfile.ZipFile(io.StringIO(contents))
6060
zip_info_list = zip_file.infolist()
6161
zip_info = zip_info_list[0]
6262
result = zip_file.open(zip_info).read()

0 commit comments

Comments
 (0)