Jim Fulton wrote:
> When we refactored the Zope 3 pubisher to work more closely with WSGI,
> we decided to remove the response.write method.  We should have written
> a proposal for this, but we failed to do so.  Over the last few weeks
> there has been much discussion of this in which I asserted many times
> that I didn't think any applications outside of Zope 3 itself used this
> method.  No one has disagreed with me.  I want to double check this.
> Does anyone have any Zope 3 applications that are using response.write?
> 
> Assuming that the answer is "no" (or that no one answers today), I'm
> going to
> more clearly document how to return long output and I'm going to add a
> method that generates a hopefully helpful error.
> 
> Note that we may add this method (or something like it) back in the future
> to support chunked streaming output,

Alas, I just realized from Adam Summer's posting to zope3-users two days
ago
(http://mail.zope.org/pipermail/zope3-users/2005-December/001746.html)
that my book is using response.write(). I had totally forgotten about
it, though it isn't much of a problem. The book is about Zope X3 3.0 and
can't make guarantees about future versions. Just to be safe I've added
an entry to my errata page:

  page 204, Example 12.24, line 17: Using the ``write()`` method of
  HTTP-based responses does not provide a performance advantage in
  Zope X3 3.0 and 3.1 and is not supported anymore in Zope 3.2 and
  higher.  To effectively return large data without holding it in
  memory, it is now recommended to create a temporary file and return
  that::

    import tempfile
    f = tempfile.TemporaryFile()
    f.write(pdf.data)
    return f

  This will only work with Zope 3.2 and higher.

Philipp
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to