This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: IDLE: make Load Module load os.path (,
Type: Stage: resolved
Components: IDLE Versions: Python 3.10, Python 3.9, Python 3.8
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: epaine, miss-islington, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2020-06-27 16:57 by epaine, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21182 merged epaine, 2020-06-27 16:57
PR 21193 merged miss-islington, 2020-06-28 06:03
PR 21194 merged miss-islington, 2020-06-28 06:03
Messages (5)
msg372469 - (view) Author: E. Paine (epaine) * Date: 2020-06-27 16:57
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).
msg372491 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-28 01:37
The problem is that there is no file os/  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.
msg372493 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-28 06:02
New changeset 8ab77c6f9fb6ef86af8f6b8722a2fcb37438edd0 by E-Paine in branch 'master':
bpo-41144: Fix IDLE open module error (#21182)
msg372494 - (view) Author: miss-islington (miss-islington) Date: 2020-06-28 06:20
New changeset 86ef6fe2b64360a1a55a913a09b12f0a80e8c06d by Miss Islington (bot) in branch '3.8':
bpo-41144: Fix IDLE open module error (GH-21182)
msg372495 - (view) Author: miss-islington (miss-islington) Date: 2020-06-28 06:22
New changeset 1497bf66f9b043e6db3801b1512cfbdeaaaa6650 by Miss Islington (bot) in branch '3.9':
bpo-41144: Fix IDLE open module error (GH-21182)
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85316
2020-06-28 06:51:00terry.reedysettitle: IDLE: raises ImportError when opening special modules -> IDLE: make Load Module load os.path (,
2020-06-28 06:49:26terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-28 06:22:09miss-islingtonsetmessages: + msg372495
2020-06-28 06:20:19miss-islingtonsetmessages: + msg372494
2020-06-28 06:03:21miss-islingtonsetpull_requests: + pull_request20348
2020-06-28 06:03:10miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request20347
2020-06-28 06:02:54terry.reedysetmessages: + msg372493
2020-06-28 01:37:00terry.reedysetmessages: + msg372491
2020-06-27 16:58:10epainesetassignee: terry.reedy
components: + IDLE
versions: + Python 3.8, Python 3.9, Python 3.10
2020-06-27 16:57:47epainesetkeywords: + patch
stage: patch review
pull_requests: + pull_request20338
2020-06-27 16:57:08epainecreate