Issue 1512007: ast branch changed interactive module name (original) (raw)
Python 2.4 displays tracebacks interactively like this:
Traceback (most recent call last): File "", line 1, in ? ZeroDivisionError: integer division or modulo by zero
Python 2.5b1 displays them like this:
Traceback (most recent call last): File "", line 1, in ZeroDivisionError: integer division or modulo by zero
This doesn't seem likely a particularly good change and it breaks tests which rely on the particular spelling of this message. I probably wouldn't mind the change if it were to a more useful string than "", but "?" seemed better than the current state. If anything is /not/ a module, it's an interactive session with the interpreter.
An interpreter session is essentially a module that the user types in, one statement at a time.
"?" tells me considerably less about where the error occurred than does "". "?" could mean anything.
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.