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
IDLE - quickly closing a large file triggers a traceback #61814
Comments
Using the bigfile.py generation program from bpo-17613 triggers the following traceback: Traceback (most recent call last):
File "/usr/bin/idle", line 5, in <module>
main()
File "/usr/lib/python3.3/idlelib/PyShell.py", line 1431, in main
if flist.open(filename) is None:
File "/usr/lib/python3.3/idlelib/FileList.py", line 36, in open
edit = self.EditorWindow(self, filename, key)
File "/usr/lib/python3.3/idlelib/PyShell.py", line 113, in __init__
if self.io.filename: self.restore_file_breaks()
File "/usr/lib/python3.3/idlelib/PyShell.py", line 229, in restore_file_breaks
filename = self.io.filename
AttributeError: 'NoneType' object has no attribute 'filename' |
I misworded the first sentence. It should have read: "Using bigfile.py as generated by the program in bpo-17613 can trigger the following traceback when quickly closing the editor." Other large files can be used to trigger the bug as well, like Lib/decimal.py. |
Like bpo-17613, the root cause is a call to .update() in Lib/idlelib/PyShell.py .restore_file_breaks(). The attached patch fixes the issue. |
Is there a better way to reproduce the error in the first place. |
I forgot to specify that the race condition gets triggered by pressing Alt-F4 the moment the IDLE editor window appears. I am reliably reproducing the error using the Konsole terminal under Arch Linux. |
LGTM |
Updated patch based on Ezio's comments. Thank you, Ezio! Senthil, I wish I had a Mac to test against. I am able to trigger the bug on Win7 with 3.3. Without objection, I will commit the patch in the upcoming hours. |
New changeset 1e5e497ee33b by Roger Serwy in branch '2.7': New changeset d759b7bc9785 by Roger Serwy in branch '3.3': New changeset 578edbe38f0a by Roger Serwy in branch 'default': |
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: