Navigation Menu

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: PathBrowser isn't working #76281

Closed
csabella opened this issue Nov 21, 2017 · 10 comments
Closed

IDLE: PathBrowser isn't working #76281

csabella opened this issue Nov 21, 2017 · 10 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@csabella
Copy link
Contributor

BPO 32100
Nosy @terryjreedy, @csabella
PRs
  • bpo-32100: IDLE: PathBrowser does not open #4484
  • [3.6] bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (GH-4484) #4512
  • bpo-32100: Delete unneeded import in idlelib.pathbrowser. #4626
  • [3.6] bpo-32100: Delete unneeded import in idlelib.pathbrowser. (GH-4626) #4629
  • 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/terryjreedy'
    closed_at = <Date 2017-11-23.01:09:23.780>
    created_at = <Date 2017-11-21.01:14:15.686>
    labels = ['expert-IDLE', 'type-bug', '3.7']
    title = "IDLE: PathBrowser isn't working"
    updated_at = <Date 2017-11-29.03:15:09.074>
    user = 'https://github.com/csabella'

    bugs.python.org fields:

    activity = <Date 2017-11-29.03:15:09.074>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2017-11-23.01:09:23.780>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2017-11-21.01:14:15.686>
    creator = 'cheryl.sabella'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32100
    keywords = ['patch']
    message_count = 10.0
    messages = ['306606', '306667', '306676', '306692', '306757', '306765', '306776', '306777', '307200', '307204']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'cheryl.sabella']
    pr_nums = ['4484', '4512', '4626', '4629']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32100'
    versions = ['Python 3.6', 'Python 3.7']

    @csabella
    Copy link
    Contributor Author

    Clicking on Path Browser in the File menu gives an error instead of opening the Path Browser.

    @csabella csabella added type-crash A hard crash of the interpreter, possibly with a core dump 3.7 (EOL) end of life labels Nov 21, 2017
    @terryjreedy
    Copy link
    Member

    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

    @terryjreedy terryjreedy added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Nov 21, 2017
    @terryjreedy
    Copy link
    Member

    The issue is this:

    1. PathBrowser subclasses ModuleBrowser.
    2. ModuleBrowser.init() has the common code for initializing both.
    3. bpo-31460 changed the signature of ModuleBrowser.__init__ *and* .init.
    4. I must not have tested pathbrowser after the .init change. Bad.
    5. test_pathbrowser needs a new gui test class that at least calls PathBrowser.__init__, which will call ModuleBrowser.init

    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.

    @csabella
    Copy link
    Contributor Author

    I added a test for PathBrowser, but I didn't change the existing tests, except to move them to their own test class.

    @terryjreedy
    Copy link
    Member

    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.)

    @terryjreedy
    Copy link
    Member

    New changeset 20d48a4 by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (bpo-4484)
    20d48a4

    @terryjreedy
    Copy link
    Member

    New changeset ae3c5c7 by Terry Jan Reedy in branch '3.6':
    [3.6] bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (GH-4484) (bpo-4512)
    ae3c5c7

    @terryjreedy
    Copy link
    Member

    Thanks for catching and fixing this.

    @terryjreedy
    Copy link
    Member

    New changeset fd6f8c5 by Terry Jan Reedy in branch 'master':
    bpo-32100: Delete unneeded import in idlelib.pathbrowser. (bpo-4626)
    fd6f8c5

    @terryjreedy
    Copy link
    Member

    New changeset 38ecf57 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
    bpo-32100: Delete unneeded import in idlelib.pathbrowser. (GH-4626) (bpo-4629)
    38ecf57

    @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
    3.7 (EOL) end of life topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants