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

Opening a file in IDLE causes a crash or hang #63625

Closed
ned-deily opened this issue Oct 28, 2013 · 4 comments
Closed

Opening a file in IDLE causes a crash or hang #63625

ned-deily opened this issue Oct 28, 2013 · 4 comments
Assignees
Labels
release-blocker topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@ned-deily
Copy link
Member

BPO 19426
Nosy @benjaminp, @ned-deily, @serhiy-storchaka

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/serhiy-storchaka'
closed_at = <Date 2013-10-29.08:17:12.988>
created_at = <Date 2013-10-28.22:29:30.988>
labels = ['expert-IDLE', 'type-bug', 'release-blocker']
title = 'Opening a file in IDLE causes a crash or hang'
updated_at = <Date 2013-10-29.19:31:31.490>
user = 'https://github.com/ned-deily'

bugs.python.org fields:

activity = <Date 2013-10-29.19:31:31.490>
actor = 'python-dev'
assignee = 'serhiy.storchaka'
closed = True
closed_date = <Date 2013-10-29.08:17:12.988>
closer = 'serhiy.storchaka'
components = ['IDLE']
creation = <Date 2013-10-28.22:29:30.988>
creator = 'ned.deily'
dependencies = []
files = []
hgrepos = []
issue_num = 19426
keywords = []
message_count = 4.0
messages = ['201586', '201611', '201612', '201658']
nosy_count = 4.0
nosy_names = ['benjamin.peterson', 'ned.deily', 'python-dev', 'serhiy.storchaka']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue19426'
versions = ['Python 2.7']

@ned-deily
Copy link
Member Author

Using current IDLE in 2.7 tip (as in 2.7.6rc1), selecting a file to open in the IDLE menu or on the command line cause IDLE to either (depending on the platform and invocation) crash or hang due to an uncaught exception in idlelib/IOBinding.py:

/usr/local/bin/idle2.7 a.py
Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1470, in __call__
    return self.func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py", line 222, in open
    flist.open(filename)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/FileList.py", line 36, in open
    return self.EditorWindow(self, filename, key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py", line 131, in __init__
    EditorWindow.__init__(self, *args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py", line 323, in __init__
    io.loadfile(filename)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py", line 258, in loadfile
    chars = self.decode(chars)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py", line 296, in decode
    enc = coding_spec(chars)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py", line 129, in coding_spec
    for line in lst:
NameError: global name 'lst' is not defined

The culprit is 3d46ef0c62c5 for bpo-18873 which did a faulty backport of a change from the 3.x branches.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Oct 29, 2013

New changeset 7fde94ad5df4 by Serhiy Storchaka in branch '2.7':
Issue bpo-19426: Fixed the opening of Python source file with specified encoding.
http://hg.python.org/cpython/rev/7fde94ad5df4

@serhiy-storchaka
Copy link
Member

Thank you Ned. Definitely IDLE needs more unit tests.

@serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Oct 29, 2013
@python-dev
Copy link
Mannequin

python-dev mannequin commented Oct 29, 2013

New changeset e0475c44832f by Benjamin Peterson in branch '2.7':
backport bpo-19426
http://hg.python.org/cpython/rev/e0475c44832f

@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
release-blocker topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants