Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError when using pdb #1

Open
fonnesbeck opened this issue Aug 2, 2010 · 12 comments
Open

NameError when using pdb #1

fonnesbeck opened this issue Aug 2, 2010 · 12 comments

Comments

@fonnesbeck
Copy link

After installing pdbtextmatesupport, I get the following error when I invoke pdb in a file:

In [4]: import koala
*** NameError: name 'precm' is not defined

/Users/fonnescj/PyMC Sandbox/koala.py(134)()
-> """
The file /Users/fonnescj/PyMC Sandbox/Sandbox/koala.py&line=134&column=2 does not exist.

The same name error and "&line=134&column=2 does not exist." message is reported regardless of what file I am debugging, so it is not specific to any particular file.

@schinckel
Copy link
Owner

Hmm. Not sure if it is related to there being spaces in the file path. I'll investigate a bit.

@schinckel
Copy link
Owner

Nope, spaces give me a different error.

@schinckel
Copy link
Owner

Okay, the first thing I notice is that 'precm' shouldn't be imported. The line in your ~/.pdbrc should be:

from PdbTextMateSupport import preloop, precmd

(And then some other lines after that).

Can you have a look and see if yours is different?

@fonnesbeck
Copy link
Author

Strange -- I cut and pasted the pdbrc.sample text into my .pdbrc, and I get the same NameError:

*** NameError: name 'precm' is not defined

However, I can see (I'm looking at it now) that precmd is imported and not precm.

@schinckel
Copy link
Owner

Did you ever get this resolved?

@fonnesbeck
Copy link
Author

Seems to have resolved itself. Closing.

@fonnesbeck
Copy link
Author

Actually, spoke too soon. Just now, I got the same thing:

*** NameError: name 'precm' is not defined
*** NameError: name 'precm' is not defined

and my .pdbrc is:

from rlcompleter import Completer
pdb.Pdb.complete = Completer(locals()).complete

from PdbTextMateSupport import preloop, precmd
pdb.Pdb.preloop = preloop
pdb.Pdb.precmd = precmd

@schinckel
Copy link
Owner

Can you check to see if the PdbTextMateSupport.py file that is installed has precmd in it?

@schinckel
Copy link
Owner

Actually, try the line:

>>> from PdbTextMateSupport import preloop, precmd

from a python shell.

@fonnesbeck
Copy link
Author

That works fine. I'm now trying to track down the where the NameError might be coming from.

@fonnesbeck
Copy link
Author

I've tried reinstalling pdbtextmatesupport, just incase I had somehow deleted some text somewhere. I still get the error, however, and in addition TextMate now generates a message:

This version of TextMate does not support “(null)” in its URL scheme.

every time I take a step in the debugger.

@fonnesbeck
Copy link
Author

Here is a screenshot of what pops up every time I take a step in the debugger:

http://cl.ly/dd8ec35228fec101c3a0

It looks like PdbTextMateSupport is making URL requests that TM does not recognize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants