Python debugging quirks

Hal Murray hmurray at megapathdsl.net
Thu Dec 15 07:28:04 UTC 2016


> 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/util.py", 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 util.py

Or something like that.



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list