[Twisted-Python] getPage generates a traceback in abstract.py

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Sat Oct 2 13:26:20 EDT 2010

On 05:15 pm, jasonjwwilliams at gmail.com wrote:
>Hi Ivan,
>This looks really strange.  Could you add a print statement before
>>line 112 of abstract.py, to see what's in self._tempDataBuffer?
>The conents of self._tempDataBuffer is indeed a list:
>['HTTP/1.1 200 OK\r\n', 'Transfer-Encoding: chunked\r\n', '\r\n', 
>['__add__', '__class__', '__contains__', '__delattr__', '__doc__', 
>'__format__', '__ge__', '__getattribute__', '__getitem__', 
>'__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__',
>'__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__',
>'__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__',
>'__sizeof__', '__str__', '__subclasshook__', 
>'_formatter_parser', 'capitalize', 'center', 'count', 'decode', 
>'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 
>'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust',
>'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust',
>'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith',
>'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'], '\r\n',

So it appears as if someone is calling request.write(dir(some string)). 
If you add a type check to the implementation of write, you'll probably 
get a traceback pointing at exactly the offending code (and maybe we 
should add that type check to Twisted).


More information about the Twisted-Python mailing list