python / python/cpython

IDLE/pyclbr failures for __main__

Open
#117,743 1 comment 0 reactions 1 assignee View on GitHub

@terryjreedy is already working on this.

Since Apr 11, 2024.

topic-IDLE type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

This discuss post says that IDLE's module browser, which uses pyclrb, fails if the file name is __main__, the filename has a '.', or the file has a syntax error. The first is the fault of of importlib.util._find_spec_from_path('main') failing (##117742). I need to verify the second. The third is a result of switching from custom parsing code that passed over syntax errors to ast.parse which does not -- and not noticing the possibility of exceptions and taking them into account. Since IDLE seems to hang, it is not clear where, and whether IDLE gets the exception.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.