evansd/whitenoise — pull request #24 by ryanrhee (2014-11-25 19:20:05+00:00)
Title: Don't throw on empty files

Attempting to compress an empty file will make white noise throw a division by 0 exception, since the empty file's size is 0, and the ratio is computed by division.

Empty files obviously don't need compression anyway, so we can just get rid of it.

One might ask, "Why have an empty file in the static dir?" See heroku's [guide](https://devcenter.heroku.com/articles/django-assets) for serving static assets with heroku:

> Django won’t automatically create the collectstatic target directory, so we recommend adding a dummy file to your repository ...