New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.5 (a2) traceback regression snarls Idle #67819
Comments
3.5.0a2, my Win 7 and Guido's new Win laptop: error tracebacks are mangled in a way that makes Idle severely less functional, hence 'release blocker'. First, the normal behavior. Python 3.5.0a2 (v3.5.0a2:0337bd7ebcb6+, Mar 9 2015, 10:29:45) [MSC v.1900 64 bi
t (AMD64)] on win32
>>> 1/0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero Idle 3.4.3 and previous give same, with the helpful addition of the code line ('1/0'), as in batch mode tracebacks, since it uses the traceback module. But Idle 3.5.0a2 started from the installed icon gives >>> 1/0
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 353, in runcode
exec(code, self.locals)
File "<pyshell#1>", line 1, in <module>
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 126, in main
ret = method(*args, **kwargs)
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 365, in runcode
print_exception()
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 216, in print_exception
print_exc(typ, val, tb)
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 211, in print_exc
traceback.print_list(tbe, file=efile)
File "C:\Program Files\Python 3.5\lib\traceback.py", line 22, in print_list
for item in StackSummary.from_list(extracted_list).format():
File "C:\Program Files\Python 3.5\lib\traceback.py", line 370, in format
frame.filename, frame.lineno, frame.name))
AttributeError: 'tuple' object has no attribute 'filename'
run.py (as should be more or less everything in idlelib) is identical in 3.4 and 3.5. Idle started from a command line (py -3 -m idlelib) gives an even worse result. The Idle Shell just shows >>> 1/0
Traceback (most recent call last):
Traceback (most recent call last):
while the following appears in the command window (Command Prompt or PowerShell). Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 353, in runcode
exec(code, self.locals)
File "<pyshell#0>", line 1, in <module>
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 126, in main
ret = method(*args, **kwargs)
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 365, in runcode
print_exception()
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 216, in print_exception
print_exc(typ, val, tb)
File "C:\Program Files\Python 3.5\lib\idlelib\run.py", line 211, in print_exc
traceback.print_list(tbe, file=efile)
File "C:\Program Files\Python 3.5\lib\traceback.py", line 22, in print_list
for item in StackSummary.from_list(extracted_list).format():
File "C:\Program Files\Python 3.5\lib\traceback.py", line 370, in format
frame.filename, frame.lineno, frame.name))
AttributeError: 'tuple' object has no attribute 'filename'
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\rpc.py", line 359, in pollpacket
s = self.sock.recv(BUFSIZE)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the r
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\rpc.py", line 432, in pollresponse
message = self.pollmessage(wait)
File "C:\Program Files\Python 3.5\lib\idlelib\rpc.py", line 384, in pollmessage
packet = self.pollpacket(wait)
File "C:\Program Files\Python 3.5\lib\idlelib\rpc.py", line 361, in pollpacket
raise EOFError
EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\idlelib\PyShell.py", line 565, in poll_subprocess
response = clt.pollresponse(self.active_seq, wait=0.05)
File "C:\Program Files\Python 3.5\lib\idlelib\rpc.py", line 436, in pollresponse
self.handle_EOF()
File "C:\Program Files\Python 3.5\lib\idlelib\PyShell.py", line 383, in handle_EOF
raise EOFError
EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
ValueError: invalid literal for int() with base 10: '??'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\tkinter\__init__.py", line 1534, in __call__
args = self.subst(*args)
File "C:\Program Files\Python 3.5\lib\tkinter\__init__.py", line 1252, in _substitute
e.num = getint_event(b)
File "C:\Program Files\Python 3.5\lib\tkinter\__init__.py", line 1231, in getint_event
return int(s)
SystemError: result with error in PyObject_Call This needs to be checked on another OS, but the traceback problem does not strike me as Windows-specific. |
Yeah, the stack track makes me suspect http://bugs.python.org/issue17911 |
I suspect that this is due to a list being passed in that wasn't created by traceback, in the older tuple-only format. That was meant to work, but possibly is being short circuited somewhere. Shall fix asap. |
Ah, idle is being somewhat naughty. It's taking the original traceback and then mangling the contents in-place, which is preserving the type information, and throwing off StackSummary.from_list. We can and should make the new code deal with this in case other folk are doing it. In future it would be good to subsume cleanup_traceback's guts into the traceback module, but we don't need to do that now. |
And here is a patch, since this is a regression I'll apply it tomorrow (or sooner if it gets reviews :)) |
Patch looks good to me. |
New changeset ea3cc128ce35 by Robert Collins in branch 'default': |
Closing, though ideally Terry can confirm it is fully fixed for him. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: