On 2021-04-04 at 18:05:12 -0000,
Shreyan Avigyan <pythonshreya...@gmail.com> wrote:

> When importing the curses module, be it on Windows or Darwin or
> UNIX-based OS or any other platform, if the _curses module is not
> found then just a ModuleNotFoundError is raised. But this error is not
> very informational in case of _curses module. Since the curses module
> is packaged with the Python interpreter itself at first it may seem,
> to beginners especially, that the Python interpreter was not installed
> correctly and then they would go searching for an answer for about 4-5
> days.
> 
> We know that curses library is not installed on windows by default and
> may or may not be present on other operating systems. Most UNIX system
> have ncurses or other curses library installed by default.
> 
> Python errors have a reputation of being very informational. I would
> like to submit a PR to modify the curses module a little bit by
> declaring a BaseException class and raising that Exception with the
> message "_curses module not found. Make sure a curses library is
> installed" or some kind of message like that.
> 
> But before I do that I would like to take advice from experienced
> developers about somethings. Is this change in the exception, raised
> when _curses module is not found, acceptable by the Python Community?
> If it is then should a draft PEP be submitted or should a PR be
> directly submitted to https://github.com/python/cpython?

BaseException seems, well, wrong to me, and arguably less informational
(or worse, misinformational).  Why not just improve the error message in
the (presumably existing) ModuleNotFoundError?  Or create a specialized
CursesNotFoundError derived from ModuleNotFoundError?
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/M2UI5LR5ADOOBOBLTIEQ2VOUXY7LYGFO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to