Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve error messages ofcurses by indicating failed C function #125843

Closed
Assignees
picnixz
Labels
extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement
@picnixz

Description

@picnixz

Feature or enhancement

Proposal:

Thecurses module raises an exceptioncurses.error with a message of the form "XXX() returned ERR" where XXX is generally the name of the Cor Python function that was just called. Most of the time, XXX and the Python function that was called have the same name and XXX is a real curses C function or macro. However, in some cases, this is not the case and the actual curses function that was called has a different name.

For debugging purposes, I suggest adding an attribute to the exception class, say.funcname which holds the name of the macro / function that was called at runtime in the C code. This will help users debug issues. For compatibility reasons, I willnot change the current error messages since this could break CI in the wild. In addition, I don't expect users toextract the function name from the error message (if they want to, they should use this new attribute).

I considered also adding whichPython function was the bad one, but since the exception is raised from a Python function, I think it's better not to do include an other attribute. If needed, we can always add it later but for now the curses C function name is more important.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp