Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"SyntaxError: unexpected EOF while parsing" while iterating a dictionary in PDB

I have a pdb trace set inside a GET request. I want to print all the attributes of the request object. I am trying the following, in pdb:

(Pdb) request
<GET /foo HTTP/1.1>
(Pdb) for d in dir(request):
*** SyntaxError: unexpected EOF while parsing (<stdin>, line 1)

I am sure there is something fundamental I am missing here.

like image 731
Doo Dah Avatar asked Mar 19 '12 20:03

Doo Dah


1 Answers

At the pdb prompt, do the following:

(Pdb) a = [1, 2, 3, 4]
(Pdb) for i in a:
*** SyntaxError: unexpected EOF while parsing (<stdin>, line 1)
(Pdb) import code
(Pdb) code.interact(local=locals())
>>> for i in a:
...     print i
... 
1
2
3
4
like image 197
Perennial Avatar answered Oct 01 '22 11:10

Perennial