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

Shreyan Avigyan report at bugs.python.org
Mon Apr 5 11:07:08 EDT 2021


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

> Is installing _curses possible, on any supported platform? Or would a better message say that curses is not supported on this platform?

No _curses can't be installed on any platform. I don't know about macOS but _curses can be installed on Windows and Linux (and presumably any UNIX-based OS). On Windows, Christoph Gohlke's unofficial curses, windows-curses and lot's of libraries allows us to use _curses library. Though I think curses can't be used directly on Windows cmd or powershell. Terminals provided by the Mingw-w64 project, the Cygwin project, etc., most presumably support curses library. WSL terminal also seem to support curses (ncurses). 

So what about a error message like this :-

ModuleNotFoundError: _curses library not found. Install a supported _curses library to use the curses module or migrate to a supported platform.

N.B.: UniCurses library may work with Windows cmd or powershell because it wraps up the PDCurses library on Windows which was developed specifically to work with Windows. Though UniCurses actually can't be used with the Python built-in module curses. We have to specifically import 'unicurses' to use it.

----------

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


More information about the Python-bugs-list mailing list