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: make Load Module load os.path (posixpath.py, ntpath.py) #85316

Closed
E-Paine mannequin opened this issue Jun 27, 2020 · 5 comments
Closed

IDLE: make Load Module load os.path (posixpath.py, ntpath.py) #85316

E-Paine mannequin opened this issue Jun 27, 2020 · 5 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-IDLE

Comments

@E-Paine
Copy link
Mannequin

E-Paine mannequin commented Jun 27, 2020

BPO 41144
Nosy @terryjreedy, @taleinat, @miss-islington, @E-Paine
PRs
  • bpo-41144: Fix IDLE open module error #21182
  • [3.9] bpo-41144: Fix IDLE open module error (GH-21182) #21193
  • [3.8] bpo-41144: Fix IDLE open module error (GH-21182) #21194
  • 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 2020-06-28.06:49:26.884>
    created_at = <Date 2020-06-27.16:57:08.526>
    labels = ['expert-IDLE', '3.8', '3.9', '3.10']
    title = 'IDLE: make Load Module load os.path (posixpath.py, ntpath.py)'
    updated_at = <Date 2020-06-28.06:51:00.785>
    user = 'https://github.com/E-Paine'

    bugs.python.org fields:

    activity = <Date 2020-06-28.06:51:00.785>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2020-06-28.06:49:26.884>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2020-06-27.16:57:08.526>
    creator = 'epaine'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41144
    keywords = ['patch']
    message_count = 5.0
    messages = ['372469', '372491', '372493', '372494', '372495']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'taleinat', 'miss-islington', 'epaine']
    pr_nums = ['21182', '21193', '21194']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41144'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @E-Paine
    Copy link
    Mannequin Author

    E-Paine mannequin commented Jun 27, 2020

    When opening special modules (such as os.path) through the "Open Module" dialog, an ImportError is raised. The fix is to catch this error and retry the loader call without the "name" argument (hence opening the true file).

    @E-Paine E-Paine mannequin added topic-IDLE 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Jun 27, 2020
    @E-Paine E-Paine mannequin assigned terryjreedy Jun 27, 2020
    @E-Paine E-Paine mannequin added topic-IDLE 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Jun 27, 2020
    @E-Paine E-Paine mannequin assigned terryjreedy Jun 27, 2020
    @terryjreedy
    Copy link
    Member

    The problem is that there is no file os/path.py. When I try to load os.path, nothing happens, not even a "Module not found" message, as with idlelib.rrr, for instance. If I try 'os.pathx', I get "Error: __path__ attribute not found on 'os' while trying to find 'os.pathx'".

    A new test, without the patch, fails with
    ImportError: loader for ntpath cannot handle os.path
    I am going to assume that calling it with the module name is usually a good idea, so that adding a separate call without is a good idea.

    @terryjreedy
    Copy link
    Member

    New changeset 8ab77c6 by E-Paine in branch 'master':
    bpo-41144: Fix IDLE open module error (bpo-21182)
    8ab77c6

    @miss-islington
    Copy link
    Contributor

    New changeset 86ef6fe by Miss Islington (bot) in branch '3.8':
    bpo-41144: Fix IDLE open module error (GH-21182)
    86ef6fe

    @miss-islington
    Copy link
    Contributor

    New changeset 1497bf6 by Miss Islington (bot) in branch '3.9':
    bpo-41144: Fix IDLE open module error (GH-21182)
    1497bf6

    @terryjreedy terryjreedy changed the title IDLE: raises ImportError when opening special modules IDLE: make Load Module load os.path (posixpath.py, ntpath.py) Jun 28, 2020
    @terryjreedy terryjreedy changed the title IDLE: raises ImportError when opening special modules IDLE: make Load Module load os.path (posixpath.py, ntpath.py) Jun 28, 2020
    @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.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-IDLE
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants