zope.app.wsgi adapters not registered by default

Bug #782040 reported by Jeroen Michiel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grok
Fix Released
Undecided
Unassigned

Bug Description

If you try to return a tempfile for delivering a download to a client, like this:

from tempfile import TemporaryFile

class Download(grok.View):
    def render(self):
        tempfile = TemporaryFile()
        tempfile.write('testing')
        return tempfile

you will get the error 'TypeError: The result should be None, a string, or adaptable to IResult.' accessing the view.

zope.app.wsgi does provide adapters for this purpose, but they aren't registered by default.
Adding 'zope.app.wsgi' to install_requires in setup.py solves the issue.

Revision history for this message
Jan Wijbrand Kolman (janwijbrand) wrote :

Fixed in the grok package version 1.7

Changed in grok:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.