<div>I'm baffled by the behavior of pdb as I attempt to debug a Twill test.  </div><div>I'm trying to step through socket.get_fqdn() and my key entries are garbled.</div><div><br></div><div>I prefer to use ipdb, but the STDOUT gets messed up and printed at the end of the ipdb session. That defeats the purpose of a debugger.</div>
<div>So I'm using pdb.</div><div><br></div><div>Here is the code:</div><div>def v1endpoint(self, port):</div><div>    """Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""</div>
<div>    import pdb; pdb.set_trace()</div><div>    base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)</div><div>    ep = OpenIDServiceEndpoint()</div><div>    ep.claimed_id = base + "/id/bob"</div>
<div>    ep.server_url = base + "/openidserver"</div><div>    ep.type_uris = [OPENID_1_1_TYPE]</div><div>    return ep</div><div><br></div><div>Here is the behavior:</div><div>----------------------------------------------------------------------</div>
<div>Ran 2 tests in 0.029s</div><div><br></div><div>FAILED (errors=2)</div><div>Destroying test database 'default'...</div><div>> /Users/Bryan/work/osqa/forum/tests.py(96)v1endpoint()</div><div>-> base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)</div>
<div>(Pdb) > /Users/Bryan/work/osqa/forum/tests.py(96)v1endpoint()</div><div>-> base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)</div><div>########################################</div><div>
# I enter 's' + return  no character is displayed</div><div>(Pdb) --Call--</div><div>> /usr/local/lib/python2.7/socket.py(124)getfqdn()</div><div>-> def getfqdn(name=''):</div><div>########################################</div>
<div># I enter 's' + return no character is displayed</div><div>(Pdb) > /usr/local/lib/python2.7/socket.py(133)getfqdn()</div><div>-> name = name.strip()</div><div>########################################</div>
<div># I enter 's' + return no character is displayed</div><div>(Pdb) </div><div>########################################</div><div># I enter 's' + return no character is displayed</div><div>(Pdb) *** NameError: name 'ss' is not defined</div>
<div>########################################</div><div># I enter 'l' + return ; it's displayed but not the inputed data aparently</div><div>(Pdb) l*** NameError: name 'ss' is not defined</div><div>########################################</div>
<div># I enter 'l' + return ; it's displayed but not the inputed data aparently</div><div>(Pdb) s</div><div>*** NameError: name 'ls' is not defined</div><div>########################################</div>
<div># I enter 'name' + return ; it's displayed but not the inputed data aparently</div><div>(Pdb) ne</div><div><br></div><div><br></div><div>None of the pdb commands work. Characters are added or not added. It's driving me nuts.</div>
<div><br></div><div>I'm using Python 2.7 on osX-10.5.8</div><div><br></div><div>What is going on?</div><div>I've never seen anything like this.</div><div><br></div><div>thanks,</div><div>Bryan</div>