[Zope] bug in DTMLMethod.py / decapitate ?

Maik Jablonski maik.jablonski@uni-bielefeld.de
Fri, 12 Apr 2002 12:28:31 +0200


hi,

-- the following may only be a problem of linux, but I can't test it against
windows --

I've just tried to improve my PHProduct. I wanted to process the returned
PHP-Headers, so creating images and so on will be possible out of the box.

I tried to process the PHP-result through the standard
'decapitate'-method. But this did not work, because PHP returns headers with
'\r\n'-newlines, but DTMLMethod.py / 'decapitate' searches only for '\n'. If I
remember right (feel free to correct me), '\r\n' is a valid newline for
headers in the HTTP-RFC's. So I would call it a minor bug in 'DTMLMethod.py /
decapitate'...

Work-a-round (maybe of interest for others who play with other external
processors and wonder why headers aren't processed correct):

yourOutput.replace('\r\n\r\n','\n\n',1) before returning the result to ZOPE.

greetings, maik.

p.s.: I will release a new version of PHParser with working headers next week.

-- 
maik jablonski                    http://www.sachunterricht-online.de
 universitaet bielefeld          http://www.zfl.uni-bielefeld.de
  zentrum fuer lehrerbildung    tlph://+49.(0).521.106.4234