Author Jeff Zemla
Recipients Jeff Zemla, ned.deily, ronaldoussoren
Date 2015-03-05.22:09:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've found a rather simple bug in the default CPython implementation on Mac OS X 10.9.5

1) Create a new .py file containing:

def a():
    print q


2) Open Python and run using execfile() then a(). Receive error as expected:

  File "", line 2, in a
    print q
NameError: global name 'q' is not defined

3) Edit file so that "print q" is not "print x", and save.

4) Run a() (Do not use execfile!)

5) Error:

  File "", line 2, in a
    print x
NameError: global name 'q' is not defined

EXPECTED: Traceback should say "print q" NOT "print x". It is reading from the file. Actually, the error in the file has been corrected-- it is the copy of the program in memory that is faulty.

Python 2.7.5 (default, Mar  9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Date User Action Args
2015-03-05 22:09:02Jeff Zemlasetrecipients: + Jeff Zemla, ronaldoussoren, ned.deily
2015-03-05 22:09:02Jeff Zemlasetmessageid: <>
2015-03-05 22:09:02Jeff Zemlalinkissue23594 messages
2015-03-05 22:09:01Jeff Zemlacreate