I need to read whole source data from file something.zip (not uncompress it)
f = open('file.zip')
s = f.read()
Use binary mode(
b) when you're dealing with binary file.
def read_zipfile(path): with open(path, 'rb') as f: return f.read()
with statement instead of manual