Skip to content

Instantly share code, notes, and snippets.

@JeffAMcGee
Created November 8, 2010 18:48
Show Gist options
  • Save JeffAMcGee/668068 to your computer and use it in GitHub Desktop.
Save JeffAMcGee/668068 to your computer and use it in GitHub Desktop.
body_string timeout pdb
(Pdb) bt
/Users/jeff/localcrawl/twitter.py(57)get_d()
-> return json.loads(r.body_string())
> /Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/client/response.py(46)body_string()
/Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/body.py(238)read()
/Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/body.py(136)read()
/Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/unreader.py(40)read()
/Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/unreader.py(72)chunk()
/Users/jeff/localcrawl/twitter.py(16)int_handler()
-> pdb.set_trace(frame)
(Pdb) print self.__dict__
{'status': '200 OK', 'final_url': 'http://api.twitter.com/1/statuses/user_timeline.json?count=200&user_id=174295980&oauth_stuff=SECRET&include_entities=1&trim_user=1&include_rts=1', 'headers': {'status': '200 OK', 'x-ratelimit-remaining': '339', 'connection': 'close', 'x-transaction': '1289238767-59066-35342', 'set-cookie': '_twitter_sess=SECRET; domain=.twitter.com; path=/', 'expires': 'Tue, 31 Mar 1981 05:00:00 GMT', 'vary': 'Accept-Encoding', 'content-length': '183633', 'server': 'hi', 'x-revision': 'DEV', 'last-modified': 'Mon, 08 Nov 2010 17:52:47 GMT', 'x-runtime': '0.07279', 'x-ratelimit-limit': '350', 'etag': '"SECRET"', 'pragma': 'no-cache', 'cache-control': 'no-cache, no-store, must-revalidate, pre-check=0, post-check=0', 'date': 'Mon, 08 Nov 2010 17:52:47 GMT', 'content-type': 'application/json; charset=utf-8', 'x-ratelimit-class': 'api_identified', 'x-ratelimit-reset': '1289239206'}, 'headerslist': [('Date', 'Mon, 08 Nov 2010 17:52:47 GMT'), ('Server', 'hi'), ('Status', '200 OK'), ('X-Transaction', '1289238767-59066-35342'), ('X-RateLimit-Limit', '350'), ('ETag', '"a8484b2800b129af363548e1c6b99cca"'), ('Last-Modified', 'Mon, 08 Nov 2010 17:52:47 GMT'), ('X-RateLimit-Remaining', '339'), ('X-Runtime', '0.07279'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '183633'), ('Pragma', 'no-cache'), ('X-RateLimit-Class', 'api_identified'), ('X-Revision', 'DEV'), ('Expires', 'Tue, 31 Mar 1981 05:00:00 GMT'), ('Cache-Control', 'no-cache, no-store, must-revalidate, pre-check=0, post-check=0'), ('X-RateLimit-Reset', '1289239206'), ('Set-Cookie', 'k=SECRET; path=/; expires=Mon, 15-Nov-10 17:52:45 GMT; domain=.twitter.com'), ('Set-Cookie', 'guest_id=SECRET; path=/; expires=Wed, 08 Dec 2010 17:52:47 GMT'), ('Set-Cookie', 'lang=en; path=/'), ('Set-Cookie', '_twitter_sess=SECRET; domain=.twitter.com; path=/'), ('Vary', 'Accept-Encoding'), ('Connection', 'close')], 'status_int': 200, 'version': (1, 1), 'closed': False, 'response': <restkit.http.message.Response object at 0x101293dd0>}
(Pdb) down
> /Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/body.py(238)read()
(Pdb) a
self = <restkit.http.body.Body object at 0x1012a01d0>
size = 9223372036854775807
(Pdb) print self.__dict__
{'req': <restkit.http.message.Response object at 0x101293dd0>, 'buf': <cStringIO.StringO object at 0x10129f148>, 'closed': False, 'reader': <restkit.http.body.LengthReader object at 0x101293f90>}
(Pdb) down
> /Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/body.py(136)read()
(Pdb) a
self = <restkit.http.body.LengthReader object at 0x101293f90>
size = 1024
(Pdb) print self.__dict__
{'length': 178513, 'req': <restkit.http.message.Response object at 0x101293dd0>, 'unreader': <restkit.http.unreader.SocketUnreader object at 0x101293b90>}
(Pdb) down
> /Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/unreader.py(40)read()
(Pdb) a
self = <restkit.http.unreader.SocketUnreader object at 0x101293b90>
size = None
(Pdb) print self.__dict__
{'sock': <socket._socketobject object at 0x1012639f0>, 'release_fun': <function <lambda> at 0x101290cf8>, 'buf': <cStringIO.StringO object at 0x10129f180>, 'mxchunk': 8192}
(Pdb) down
> /Users/jeff/localcrawl/build/bdist.macosx-10.6-universal/egg/restkit/http/unreader.py(72)chunk()
(Pdb) a
self = <restkit.http.unreader.SocketUnreader object at 0x101293b90>
(Pdb) print self.__dict__
{'sock': <socket._socketobject object at 0x1012639f0>, 'release_fun': <function <lambda> at 0x101290cf8>, 'buf': <cStringIO.StringO object at 0x10129f180>, 'mxchunk': 8192}
(Pdb) down
> /Users/jeff/localcrawl/twitter.py(16)int_handler()
-> pdb.set_trace(frame)
(Pdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment