[issue43728] Change the exception type and message raised when _curses is not found.

Shreyan Avigyan report at bugs.python.org
Mon Apr 5 03:53:29 EDT 2021


Shreyan Avigyan <shreyan.avigyan at gmail.com> added the comment:

The curses module is not supported on all platforms is very clear. But beginners may seem to think that their python was not installed properly and then they would go around looking for answer. To make it clear I was thinking of how about changing just the message and if required then the type (maybe CursesNotFoundError exception class derived from ModuleNotFoundError class) so that the error message became a little bit informational. The message could be like "_curses library not installed. Install a supported curses library to use the curses module" or something like that? 

The exception right now looks like this :-

ModuleNotFoundError: No module named '_curses'

What about something like this :-

CursesNotFoundError: "_curses library not installed. Install a supported curses library to use the curses module."

N.B.: The curses library still can be used on Windows by using the UniCurses library or Christoph Gohlke's unofficial curses or some other third party library.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43728>
_______________________________________


More information about the Python-bugs-list mailing list