Good catch. However, the following seems cleaner and does the same thing:
```python
size_fmt = '\r{:>6.1%}'.format(current_size/(total_size or 1))
```