Cournape fix windows filemode

Using io.BytesIO() instead of name temporary files.

Does this work for your case?