Skip to content

IDLE: PathBrowser isn't working #76281

Closed
Closed

Description

@csabella
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']

    Activity

    1. csabella commented on Nov 21, 2017

      @csabella
      ContributorAuthor

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

    2. added
      type-crash
      3.7 (EOL)
      on Nov 21, 2017
    3. terryjreedy commented on Nov 21, 2017

      @terryjreedy
      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
    4. added
      type-bug
      and removed
      type-crash
      on Nov 21, 2017
    5. terryjreedy commented on Nov 21, 2017

      @terryjreedy
      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.

    6. csabella commented on Nov 21, 2017

      @csabella
      ContributorAuthor

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

    7. terryjreedy commented on Nov 22, 2017

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

    8. terryjreedy commented on Nov 23, 2017

      @terryjreedy
      Member

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

    9. terryjreedy commented on Nov 23, 2017

      @terryjreedy
      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

    10. terryjreedy commented on Nov 23, 2017

      @terryjreedy
      Member

      Thanks for catching and fixing this.

    11. terryjreedy commented on Nov 29, 2017

      @terryjreedy
      Member

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

    12. terryjreedy commented on Nov 29, 2017

      @terryjreedy
      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

    13. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)topic-IDLEtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions