Skip to content
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

Closed
serwy mannequin opened this issue Apr 2, 2013 · 8 comments
Closed

IDLE - quickly closing a large file triggers a traceback #61814

serwy mannequin opened this issue Apr 2, 2013 · 8 comments
Assignees
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@serwy
Copy link
Mannequin

serwy mannequin commented Apr 2, 2013

BPO 17614
Nosy @orsenthil, @ned-deily, @serwy
Files
  • issue17614.patch
  • issue17614_rev1.patch
  • 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:

    assignee = 'https://github.com/serwy'
    closed_at = <Date 2013-04-03.03:45:32.049>
    created_at = <Date 2013-04-02.03:42:40.663>
    labels = ['expert-IDLE', 'type-bug']
    title = 'IDLE - quickly closing a large file triggers a traceback'
    updated_at = <Date 2013-04-03.03:45:32.049>
    user = 'https://github.com/serwy'

    bugs.python.org fields:

    activity = <Date 2013-04-03.03:45:32.049>
    actor = 'roger.serwy'
    assignee = 'roger.serwy'
    closed = True
    closed_date = <Date 2013-04-03.03:45:32.049>
    closer = 'roger.serwy'
    components = ['IDLE']
    creation = <Date 2013-04-02.03:42:40.663>
    creator = 'roger.serwy'
    dependencies = []
    files = ['29651', '29659']
    hgrepos = []
    issue_num = 17614
    keywords = ['patch']
    message_count = 8.0
    messages = ['185802', '185803', '185804', '185811', '185815', '185820', '185879', '185881']
    nosy_count = 4.0
    nosy_names = ['orsenthil', 'ned.deily', 'roger.serwy', 'python-dev']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17614'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    @serwy
    Copy link
    Mannequin Author

    serwy mannequin commented Apr 2, 2013

    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'

    @serwy serwy mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels Apr 2, 2013
    @serwy
    Copy link
    Mannequin Author

    serwy mannequin commented Apr 2, 2013

    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.

    @serwy
    Copy link
    Mannequin Author

    serwy mannequin commented Apr 2, 2013

    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.

    @orsenthil
    Copy link
    Member

    Is there a better way to reproduce the error in the first place.
    On 2.7 tip,
    ./python -m idelib.idle
    Opened and closed bigfile.py and decimal.py - and could not reproduce the error. If I could, I could have tested the patch.

    @serwy
    Copy link
    Mannequin Author

    serwy mannequin commented Apr 2, 2013

    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.

    @ned-deily
    Copy link
    Member

    LGTM

    @serwy
    Copy link
    Mannequin Author

    serwy mannequin commented Apr 3, 2013

    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.

    @serwy serwy mannequin self-assigned this Apr 3, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 3, 2013

    New changeset 1e5e497ee33b by Roger Serwy in branch '2.7':
    bpo-17614: IDLE no longer raises exception when quickly closing a file.
    http://hg.python.org/cpython/rev/1e5e497ee33b

    New changeset d759b7bc9785 by Roger Serwy in branch '3.3':
    bpo-17614: IDLE no longer raises exception when quickly closing a file.
    http://hg.python.org/cpython/rev/d759b7bc9785

    New changeset 578edbe38f0a by Roger Serwy in branch 'default':
    bpo-17614: merge with 3.3.
    http://hg.python.org/cpython/rev/578edbe38f0a

    @serwy serwy mannequin closed this as completed Apr 3, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants