-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
IDLE: PathBrowser isn't working #76281
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
Comments
Clicking on Path Browser in the File menu gives an error instead of opening the Path Browser. |
Error is printed in console window if IDLE started from one.
>>> import idlelib.idle
# Select pathbrowser in File menu
Exception in Tkinter callback
Traceback (most recent call last):
File "F:\dev\3x\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "F:\dev\3x\lib\idlelib\editor.py", line 671, in open_path_browser
pathbrowser.PathBrowser(self.flist)
File "F:\dev\3x\lib\idlelib\pathbrowser.py", line 18, in __init__
self.init(flist)
TypeError: init() takes 1 positional argument but 2 were given |
The issue is this:
3.6.3 is OK, 3.7.0a2 has this bug. 3.7.0a3 is due 11/27. Patch should be merged before this with or without new unittests. Module items can be expanded either by clicking [+] or double-clicking. The latter also opens the file so that lines can be highlighted. I have thought about disabling both, and opening a module browser instead, but I can see the usefulness of expanding several files one level deep to get an overview of parts or all of a package. On the other hand, we might have double-click open both the module and a module browser. |
I added a test for PathBrowser, but I didn't change the existing tests, except to move them to their own test class. |
The reason double-clicking got worse from 3.6.3 to now is this. Previously, browser.ModuleBrowserTreeItem.OnDoubleClick ignored the file_open global (set to pyshell.flist.open in .__init__) and called pyshell.flist.open. The Class and Method OnDoubleClick called file_open. So double-clicking a file name in pathbrowser opened the file, but expanding a file and double-clicking a class or function name raised "'NoneType' object is not callable". I don't know if I ever tried the latter before. We subsequently changed the Module DoubleClick to also use file_open, so double clicking a file name also raises. (I meant to submit this yesterday.) |
Thanks for catching and fixing this. |
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: