So I have a StringIO() file-like object, and I am trying to write it to a ZipFile(), but I get this TypeError:
coercing to Unicode: need string or buffer, c
To add a string to a ZipFile you need to use the writestr method and pass the string from StringIO using getvalue method of the StringIO instance
e.g.
archive.writestr("name of file in zip", my_file.getvalue())
Note you also need to give the name of the string to say where it is placed in the zip file.