This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年03月05日 22:09 by Jeff Zemla, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg237293 - (view) | Author: Jeff Zemla (Jeff Zemla) | Date: 2015年03月05日 22:09 | |
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 |
|||
| msg237294 - (view) | Author: Jeff Zemla (Jeff Zemla) | Date: 2015年03月05日 22:10 | |
In 3), "not" should be "now" |
|||
| msg237295 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2015年03月05日 22:13 | |
This is a duplicate of an existing issue but I don't have time to find the issue. It's not a trivial problem to fix, though now that the import system is in python it may be possible. |
|||
| msg237296 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2015年03月05日 22:15 | |
#8087 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:13 | admin | set | github: 67782 |
| 2015年03月06日 01:38:22 | ned.deily | set | messages: - msg237316 |
| 2015年03月06日 01:37:42 | python-dev | set | nosy:
+ python-dev messages: + msg237316 |
| 2015年03月05日 22:30:08 | ned.deily | set | status: open -> closed superseder: Unupdated source file in traceback resolution: duplicate stage: resolved |
| 2015年03月05日 22:15:27 | ezio.melotti | set | nosy:
+ ezio.melotti messages: + msg237296 |
| 2015年03月05日 22:13:48 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg237295 |
| 2015年03月05日 22:10:22 | Jeff Zemla | set | messages: + msg237294 |
| 2015年03月05日 22:09:02 | Jeff Zemla | create | |