python/pypi-cdn-log-archiver — pull request #5 by ewdurbin (2014-05-09 16:19:39+00:00)
Title: guard against passing zero byte data into compressor

it appears that on occasion either Fastly pushes zero length files into our bucket, or DreamHost Objects fails to store any data in keys.

regardless the outcome is the same:

```
+ export PYPI_LOG_DATE=2014-05-02
+ PYPI_LOG_DATE=2014-05-02
+ /opt/pypi-cdn-log-archiver/env/bin/pypi-cdn-log-archiver-wrapper.sh
Traceback (most recent call last):
File "/opt/pypi-cdn-log-archiver/env/bin/pypi-cdn-log-archiver", line 130, in
sys.exit(main())
File "/opt/pypi-cdn-log-archiver/env/bin/pypi-cdn-log-archiver", line 116, in main
target_date.strftime('%Y-%m-%d'))
File "/opt/pypi-cdn-log-archiver/env/bin/pypi-cdn-log-archiver", line 55, in archive_logs
compress_logs(archive_file, temp_dir)
File "/opt/pypi-cdn-log-archiver/env/bin/pypi-cdn-log-archiver", line 42, in compress_logs
archive.write(log.read())
File "/opt/pypi-cdn-log-archiver/env/lib/python2.7/site-packages/backports/lzma/__init__.py", line 327, in write
compressed = self._compressor.compress(data)
_lzma.LZMAError: Insufficient buffer space
```

apparently zero bytes can not be compressed :sheep: