[Twisted-Python] using defers with requests
charles brandt
twisted at st.imul.us
Sat Nov 15 22:47:58 MST 2003
For completeness, Christopher pointed out that I was not passing a string to
request.write (str(data)). Since I did not have an Errback call, the
exception that was raised in the callback was never output. (fixed by
adding: d.addErrback(log.err) )
Thanks for the help!
-Charles
> > > I added some print debug statements as follows:
> > >
> > > def printResult(data, request):
> > > print "entered printResult"
> > > request.write("pre-data")
> > > request.write(data)
>
> print repr(data)
>
> > > request.write("post-data")
> > > request.finish()
> > > print request
> >
> > What is 'data' here? can you print repr(data)? It might be the empty
> > string, or something.
>
> 2003/11/15 20:43 PST [-] entered printResult
> 2003/11/15 20:43 PST [-] ((13L, 'Hawaii', 'HI', 'US'),)
>
> Seems like the request might be different from the original, or doesn't
have
> a channel to respond on?
>
> -Charles
>
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
More information about the Twisted-Python
mailing list