Explicitly set file write mode to binary. Python under windows don't know no better.