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

2010-10-02 Thread Jason J. W. Williams
Wow I feel stupid. That would be me in the callback that gets fired when
getPage completes. Originally I had written this to use web.client.Agent and
that code was helping me to inspect the response for debugging. Thank you
very much.

-J

On Sat, Oct 2, 2010 at 11:26 AM,  wrote:

> On 05:15 pm, jasonjwwilli...@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',
> >'47\r\n',
> >['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
> >'__eq__',
> >'__format__', '__ge__', '__getattribute__', '__getitem__',
> >'__getnewargs__',
> >'__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__',
> >'__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__',
> >'__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__',
> >'__sizeof__', '__str__', '__subclasshook__',
> >'_formatter_field_name_split',
> >'_formatter_parser', 'capitalize', 'center', 'count', 'decode',
> >'encode',
> >'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum',
> >'isalpha',
> >'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',
> >'0\r\n\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).
>
> Jean-Paul
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2010-10-02 Thread exarkun
On 05:15 pm, jasonjwwilli...@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', 
>'47\r\n',
>['__add__', '__class__', '__contains__', '__delattr__', '__doc__', 
>'__eq__',
>'__format__', '__ge__', '__getattribute__', '__getitem__', 
>'__getnewargs__',
>'__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__',
>'__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__',
>'__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__',
>'__sizeof__', '__str__', '__subclasshook__', 
>'_formatter_field_name_split',
>'_formatter_parser', 'capitalize', 'center', 'count', 'decode', 
>'encode',
>'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 
>'isalpha',
>'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',
>'0\r\n\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).

Jean-Paul

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2010-10-02 Thread Jason J. W. Williams
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', '47\r\n',
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__',
'__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__',
'__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__',
'__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split',
'_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode',
'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha',
'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',
'0\r\n\r\n']

-J
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2010-10-01 Thread Ivan Kozik
On Sat, Oct 2, 2010 at 01:01, Jason J. W. Williams
 wrote:
> I'm really pulling my hair out here. The code in question uses getPage:
> http://gist.github.com/607124
> If I remove the postdata argument to getPage no problem (except the postdata
> is required by server I'm calling). However, no matter what I put in
> postdata, I get this:
> http://gist.github.com/607126

This looks really strange.  Could you add a print statement before
line 112 of abstract.py, to see what's in self._tempDataBuffer?

Ivan

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2010-10-01 Thread Jason J. W. Williams
I'm really pulling my hair out here. The code in question uses getPage:

http://gist.github.com/607124

If I remove the postdata argument to getPage no problem (except the postdata
is required by server I'm calling). However, no matter what I put in
postdata, I get this:

http://gist.github.com/607126

Any help is greatly appreciated.

-J
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python