[Twisted-Python] using defers with requests
twisted at st.imul.us
Sun Nov 16 00:47:58 EST 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!
> > > 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
> a channel to respond on?
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python