<div dir="ltr">Will request.finish have the same effect as return server.NOT_DONE_YET ?<br>Or do the statements do different things ?<br><br><br><div class="gmail_quote">On Mon, Aug 4, 2008 at 3:50 PM, Maarten ter Huurne <span dir="ltr">&lt;<a href="mailto:maarten@treewalker.org">maarten@treewalker.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On Monday 04 August 2008, DJ wrote:<br>
<br>
&gt; For some strange reason I this text is being added to the end of the html<br>
&gt; pages rendered by twisted.<br>
&gt; Request did not return a string<br>
&gt;<br>
&gt; Request:<br>
&gt;<br>
&gt; &lt;GET /config/deleteSection HTTP/1.1&gt;<br>
&gt;<br>
&gt;<br>
&gt; Resource:<br>
&gt;<br>
&gt; &lt;configPages.deleteSection instance at 0x00EC4EE0&gt;<br>
&gt;<br>
&gt;<br>
&gt; Value:<br>
&gt;<br>
&gt; None<br>
&gt;<br>
&gt; I am using the resource.Resource and render. My html is passed has a<br>
&gt; string using request.write.<br>
&gt; As far has I can tell, there should not be a problem. Does anyone know<br>
&gt; why and what I need to do to fix this.<br>
<br>
</div></div>Python functions implicitly return None if there is no return statement.<br>
<br>
Twisted.web wants the render method to either return a string, or the<br>
special object NOT_DONE_YET, which indicates that the reply will be written<br>
with request.write(). The name was probably chosen for cases where the<br>
content is written using deferreds, but it should be used even if you call<br>
request.write() from the render method.<br>
<br>
So try putting &quot;return server.NOT_DONE_YET&quot; at the end of your render<br>
method.<br>
<br>
Bye,<br>
<font color="#888888"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Maarten<br>
</font><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Dafina A. Abernathy (DJ)<br><br>
</div>