diff --git a/CHANGES.txt b/CHANGES.txt index 81dc7dc4..29eedbfb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,9 @@ TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014 ============================================================================== +Jul 07 2015: +. (kfsone) Fixed division by zero in transfers.py with empty file + v7.3.0 Jul 05 2015: . (ahamid/kfsone) "fromfile" support for command options: - All commands will now look for a "fromfile" specifying default arguments diff --git a/transfers.py b/transfers.py index fe069779..2ad7fa5a 100644 --- a/transfers.py +++ b/transfers.py @@ -181,10 +181,11 @@ def download( tdenv.DEBUG0("End of data") if not tdenv.quiet: progBar.clear() + elapsed = (time.time() - started) or 1 tdenv.NOTE( "Downloaded {} of {}ed data {}/s", makeUnit(fetched), encoding, - makeUnit(fetched / (time.time() - started)) + makeUnit(fetched / elapsed) ) # Swap the file into place