[Zope-PAS] Re: Merging my branch to the head tomorrow
zbir at urbanape.com
Fri Oct 15 11:59:47 EDT 2004
On 2004-10-15 11:43:52 -0400, Lennart Regebro
<regebro at nuxeo.com> said:
> Zachery Bir wrote:
>> If there aren't any objections, I want to merge my branch to the head
>> tomorrow morning (16 October), so I can start working on de-mangling
>> user ids inside PAS.
> That's fine.
> I finally realized why your inline-login form works. ;)
> If you do response.write('blablabla') that will set self._wrote = 1.
> Later, exception() will set the body to "something". At the end of the
> publishing process, outputBody() will be called. So, why does not
> "something" get output? Because, outputBody uses str(self) to figure
> out what to write, and request.__str__() checks self._wrote and then
> returns ''.
> Glah! Could it be more ugly? Why is even __str_ involved in this in teh
> first place?!?
I actually changed the implementation to use response.setBody(), which
does some nice paper work (setting the content length headers and so
on), but then to override response's setBody method after the fact, so
that exception doesn't munge it any more.
I think it might be a nicer player now at the expense of being tricky.
In any case, the implementation works the same.
More information about the Zope-PAS