On 12/8/2009 4:12 AM, dpapathanasiou wrote:
I have two methods for writing binaries files: the first works with
data received by a server corresponding to a file upload, and the
second works with data sent as email attachments.

The odd thing is, they're not interchangeable: if I use the first one
to saved data parsed from an email attachment, it fails; similarly,
the second function fails when dealing with an uploaded file data.

What are the critical differences?

Those code reeks for refactoring. If you're lucky enough to be in python 2.6 or above, use the io module to wrap the string in second function in a file-like object.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to