Issue 1514617: evaluated code filename changed to instead of ? (original) (raw)

It seems as though the default filename for evaluated changed from "?" to "". Was this intentional? (it's causing some test failures for me. The tests are correctable of course, but it doesn't seem to be an obvious improvement in behavior, so if it wasn't intentional, perhaps it should be changed back.)

Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin

eval("0/0")
Traceback (most recent call last): File "", line 1, in ? File "", line 0, in ?

Python 2.5b1 (trunk:47096, Jun 25 2006, 23🔞21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin

eval("0/0")
Traceback (most recent call last): File "", line 1, in File "", line 1, in ZeroDivisionError: integer division or modulo by zero

  1. An interpreter session is essentially a module that the user types in, one statement at a time.

  2. "?" tells me considerably less about where the error occurred than does "". "?" could mean anything.

  3. Since Python 2.5 has already been released with the objected-to behavior, I'd say it's incredibly unlikely that this change will be reverted.