staticwebsync/staticwebsync — Issue #1: Division by Zero exception
Author: simonluijk
Created: 2011-12-30 07:11:21+00:00
State: open

I get the following traceback on first run. On the second run it works well. Maybe
because it's doing > 0. ;)

Traceback (most recent call last):
File "~/.virtualenvs/sws/bin/sws", line 8, in
load\_entry\_point('staticwebsync==1.0.0', 'console\_scripts', 'sws')()
File "~/.virtualenvs/sws/lib/python2.7/site-packages/staticwebsync/sws.py", line 103, in main
staticwebsync.setup(args)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/staticwebsync/\_\_init\_\_.py", line 273, in setup
upload(filename)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/staticwebsync/\_\_init\_\_.py", line 269, in upload
num\_cb=progress\_callback\_divisions)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/boto/s3/key.py", line 790, in set\_contents\_from\_file
self.send\_file(fp, headers, cb, num\_cb, query\_args)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/boto/s3/key.py", line 583, in send\_file
query\_args=query\_args)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/boto/s3/connection.py", line 429, in make\_request
override\_num\_retries=override\_num\_retries)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/boto/connection.py", line 796, in make\_request
return self.\_mexe(http\_request, sender, override\_num\_retries)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/boto/connection.py", line 717, in \_mexe
request.body, request.headers)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/boto/s3/key.py", line 509, in sender
cb(total\_bytes, self.size)
File "~/.virtualenvs/sws/lib/python2.7/site-packages/staticwebsync/sws.py", line 21, in \_\_call\_\_
progress = float(done) / doing
ZeroDivisionError: float division by zero