#69 Division by zero when syncing remote to local

Malfunction
closed-fixed
nobody
s3cmd (119)
5
2015-02-09
2010-10-16
No

I did a sync from remote to local, and there were no files out of date. The following error was reported:

Problem: ZeroDivisionError: float division
S3cmd: 0.9.9.91

Traceback (most recent call last):
File "/cygdrive/c/Users/Margaret/bin/s3cmd", line 1737, in <module>
main()
File "/cygdrive/c/Users/Margaret/bin/s3cmd", line 1682, in main
cmd_func(args)
File "/cygdrive/c/Users/Margaret/bin/s3cmd", line 1071, in cmd_sync
return cmd_sync_remote2local(args)
File "/cygdrive/c/Users/Margaret/bin/s3cmd", line 917, in cmd_sync_remote2loca
l
speed_fmt = formatSize(total_size/total_elapsed, human_readable = True, floa
ting_point = True)
ZeroDivisionError: float division

The error is caused by "total_size/total_elapsed" in s3cmd line 917, which is in cmd_sync_remote2local.

It looks like someone already fixed the same issue in cmd_sync_local2remote, because that function protects against divide by zero:

total\_speed = total\_elapsed and total\_size/total\_elapsed or 0.0
speed\_fmt = formatSize\(total\_speed, human\_readable = True, floating\_point = True\)

cmd_sync_remote2local needs similar code.

Discussion

  • Matt Domsch

    Matt Domsch - 2015-02-09

    Fixed in 1.5.0 and some older releases.

     
  • Matt Domsch

    Matt Domsch - 2015-02-09
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks