You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a test file (gzipped tarball) generated using
importosimportrandomimportstringimporttarfileimportgzipdefcreate_tarball_and_gzip(tarball_name, num_files):
# Generate some files to include in the tarballforiinrange(num_files):
# Generate a random string of at least 10MBfile_size=10*1024*1024whileTrue:
file_data=''.join(random.choices(string.ascii_uppercase+string.digits, k=file_size))
iflen(file_data.encode('utf-8')) >=file_size:
break# Write the file to diskwithopen(f'file_{i}.txt', 'w') asf:
f.write(file_data)
# Create the tarballwithtarfile.open(tarball_name, 'w') astar:
foriinrange(num_files):
tar.add(f'file_{i}.txt')
# Gzip the tarballwithopen(tarball_name, 'rb') asf_in:
withgzip.open(tarball_name+'.gz', 'wb') asf_out:
f_out.writelines(f_in)
# Clean up the filesforiinrange(num_files):
os.remove(f'file_{i}.txt')
create_tarball_and_gzip('testball', 10)
gzip
file larger than ~1MB (ReadError: not a gzip file
) jupyterlite/jupyterlite#1153The text was updated successfully, but these errors were encountered: