[Zope-dev] 2.7 dies when downloading file

robert robert at redcor.ch
Mon Jan 5 00:48:38 EST 2004


Hi there,
I would be gratefull if somebody could help with the following:

calling the following piece of code lets Zope die.

    security.declareProtected(CMFCorePermissions.View, 'index_html')
    def index_html(self, RESPONSE):
        """ Produce a PDF for issue"""
        RESPONSE.setHeader('content-type', self.content_type())
        RESPONSE.setHeader('content-length', str(self.get_size()))
        RESPONSE.setHeader('content-disposition', 'attachment;filename=i%s' % 
self.getFilename())
        RESPONSE.write(self.getFile())


it produces the following traceback


  File "/home/zope/Zope-2.7-head/lib/python/Zope/Startup/run.py", line 49, 
in ?
    run()
  File "/home/zope/Zope-2.7-head/lib/python/Zope/Startup/run.py", line 19, in 
run
    start_zope(opts.configroot)
  File "/home/zope/Zope-2.7-head/lib/python/Zope/Startup/__init__.py", line 
66, in start_zope
    Lifetime.loop()
  File "/home/zope/Zope-2.7-head/lib/python/Lifetime.py", line 43, in loop
    lifetime_loop()
  File "/home/zope/Zope-2.7-head/lib/python/Lifetime.py", line 53, in 
lifetime_loop
    asyncore.poll(timeout, map)
  File "/usr/lib/python2.3/asyncore.py", line 125, in poll
    write(obj)
  File "/usr/lib/python2.3/asyncore.py", line 81, in write
    obj.handle_error()
  File "/home/zope/Zope-2.7-head/lib/python/ZServer/medusa/http_server.py", 
line 440, in handle_error
    asynchat.async_chat.handle_error (self)
  File "/usr/lib/python2.3/asyncore.py", line 420, in handle_error
    self.close()
  File "/home/zope/Zope-2.7-head/lib/python/ZServer/HTTPServer.py", line 342, 
in close
    p.more() # free up resources held by producer
AttributeError: more




More information about the Zope-Dev mailing list