arkx/mpyq — pull request #17 by GraylinKim (2013-02-20 16:16:03+00:00)
Title: Properly write empty files to disk.

Sometime the MPQ file listing will include files for which there is no data ([example](ggtracker.com/matches/1786123/replay)). In these cases, ``read_file`` returns ``None`` and ``extract_to_disk`` fails with a type error:

```
Traceback (most recent call last):
File "/home/graylinkim/projects/sc2reader/env/bin/mpyq", line 8, in
load_entry_point('mpyq==0.2.0', 'console_scripts', 'mpyq')()
File "build/bdist.linux-x86_64/egg/mpyq.py", line 402, in main
File "build/bdist.linux-x86_64/egg/mpyq.py", line 254, in extract_to_disk
TypeError: must be string or buffer, not None
```

We can just substitute an empty string for ``None`` when writing to disk.