Python debugging quirks

Eric S. Raymond esr at
Thu Dec 22 21:10:28 UTC 2016

Hal Murray <hmurray at>:
> > That doesn't sound possible to me.  Think about how an interpreter works.
> Do you have a better suggestion?
> It said:
> >   File "/usr/local/lib/python2.7/site-packages/ntp/", line 273, in 
> > summary
> >     sys.stderr.write("DNS lookup ends.\n")
> > NameError: global name 'logfp' is not defined
> There is no logfp in there.  (That's why I was editing it.)
> I botched the edit.  The actual buggy code was self/logfp.write...
> My claim is that the interpreter is doing the right thing and finds the local 
> util.pyc but the debugger isn't following the same search rules and finds the 
> wrong
> Or something like that.

Do you still have this problem?  Did you ever figure out what was going on?
		<a href="">Eric S. Raymond</a>

More information about the devel mailing list