[Zope3-dev] Re: PEP 333 and Zope
Phillip J. Eby
pje at telecommunity.com
Tue Nov 9 11:06:17 EST 2004
At 02:25 PM 11/9/04 -0500, Tres Seaver wrote:
>Jim Fulton wrote:
>>Eckart Hertzler wrote:
>>>from StringIO import StringIO
>>cStringIO is faster.
>
>cStringIO is not Unicode-safe.
You're both right, and also irrelevant. :) It doesn't matter that it's
not Unicode-safe, because it's being used for an already-encoded
bytestream. It doesn't matter that it's faster, because it shouldn't be
there; it's buffering the entire response output in memory, which is bad.
It needs to be a file-like object that starts the WSGI response process and
streams writes directly to the server, or else memory usage will blow up on
large files.
More information about the Zope3-dev
mailing list