Skip to content

IDLE: Display full syntax error diagnostics in the Shell #159190

Closed as not planned

Description

@NaNIsaac

Feature or enhancement

Problem

When IDLE encounters a syntax error while checking a script, it displays only a short error message in a modal dialog.

This omits useful diagnostic information already provided by Python, including the filename, line number, offending source code, and error position.

Proposed improvement

Display standard Python syntax error diagnostics in the IDLE Shell instead of a modal dialog, while preserving error highlighting in the editor.

This would make syntax errors easier to diagnose and help beginners become familiar with Python's standard error messages.

Implementation

An implementation and regression test are available in #159189.

Related to #91312, which discusses extended syntax error location information.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. terryjreedy commented on Oct 11, 2026

    @terryjreedy
    Member

    I regard this as a change in the wrong direction, but have other duties now; will explain later.

  2. terryjreedy commented on Oct 17, 2026

    @terryjreedy
    Member

    Thank you for your interest in IDLE. However, I do not want syntax errors in the editor displayed in Shell.

    This omits useful diagnostic information already provided by Python, including the filename, line number, offending source code, and error position.

    The filename is at the top of the editor window. The line number is available on the left if one turns on the line number sidebar. But it is not really needed. The offending code and position are marked. (Marking a range when available, Https://github.com/python/cpython/issues/91312, is a separate issue.) The full error message is in the box. There is nothing missing.

    Currently, one dismisses the modal box with Enter, Esc, or [OK] click. I have considered making it non-modal with the cursor and focus left in the text, allowing users to immediately enter corrections. The box should then disappear on the first key action or maybe the first Enter. I have also considered putting the message below in the status bar. There is no Python standard for editors and IDEs.

    I actually want to make Shell more like the editor and not disable editing and error correcting upon a syntax error. The REPL is limited by assuming that it might be running on century-old mechanical teleprinters. (It only added color a couple of years ago.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-IDLEtype-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions