Skip to content

Formatting of OS.SystemError messages #20898

Open
@jeremiah-corrado

Description

@jeremiah-corrado

The SystemError class in the OS module currently produces error messages in the following format:

{Error-Class name}: {Error-Code description} ({message from the call-site})

In some cases, this implementation ends up producing a long or somewhat redundant string. For example:

NotADirectoryError: Not a directory (in moveDir(some/directory, not/a/directory.txt))

Should we rethink SystemErrors implementation of message()?

Would it be an improvement to remove the {Error-Code description} portion since these strings often align with the name of the error class?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions