Message237293
| 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 |
<1425593342.12.0.612342465209.issue23594@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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
x=5
2) Open Python and run using execfile() then a(). Receive error as expected:
File "test.py", 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 "test.py", 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 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年03月05日 22:09:02 | Jeff Zemla | set | recipients:
+ Jeff Zemla, ronaldoussoren, ned.deily |
| 2015年03月05日 22:09:02 | Jeff Zemla | set | messageid: <1425593342.12.0.612342465209.issue23594@psf.upfronthosting.co.za> |
| 2015年03月05日 22:09:02 | Jeff Zemla | link | issue23594 messages |
| 2015年03月05日 22:09:01 | Jeff Zemla | create |
|