Skip to content

Commit

Permalink
Specify unit divisor for tqdm
Browse files Browse the repository at this point in the history
Previously, Zappa formatted in both SI and binary:

Uploading githubwatch-dev-1534354789.zip (14.8MiB)..
100%|###########################| 15.5M/15.5M [00:03<00:00, 4.54MiB/s]
  • Loading branch information
gaul committed Aug 15, 2018
1 parent 12ac82e commit c5033d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zappa/core.py
Expand Up @@ -937,7 +937,7 @@ def upload_to_s3(self, source_path, bucket_name, disable_progress=False):
try:
source_size = os.stat(source_path).st_size
print("Uploading {0} ({1})..".format(dest_path, human_size(source_size)))
progress = tqdm(total=float(os.path.getsize(source_path)), unit_scale=True, unit='B', disable=disable_progress)
progress = tqdm(total=float(os.path.getsize(source_path)), unit_scale=True, unit_divisor=1024, unit='iB', disable=disable_progress)

# Attempt to upload to S3 using the S3 meta client with the progress bar.
# If we're unable to do that, try one more time using a session client,
Expand Down

0 comments on commit c5033d0

Please sign in to comment.