[Zope] [BUG] in manage_exportObject in OFS/ObjectManager.py

Jerome Alet alet@unice.fr
Tue, 22 May 2001 21:01:02 +0200


Hi,

there's probably a bug in manage_exportObject:

this method accepts a RESPONSE argument which default value is None,
but at lines 515-517 there are the following lines:

    RESPONSE.setHeader('Content-type','application/data')
    RESPONSE.setHeader('Content-Disposition',
        'inline;filename=%s.%s' % (id, suffix))

These lines are executed when the user choose to download the
file from the export object form in the ZMI, so in this case RESPONSE
is set correctly and there's no problem.

However, when calling manage_exportObject programmatically without
sending a valid RESPONSE argument these two lines raise an exception because
RESPONSE is None:

          Error Type: AttributeError
          Error Value: 'None' object has no attribute 'setHeader'

To see this error occur, just create a Python Script which contain
the following line:

	context.manage_exportObject(id='Control_Panel', download=1)

Click on the 'Test' tab, that's it !

Put in the Collector, issue number is 2241.

hoping this helps.

bye,

Jerome Alet