Open rsyring opened 11 years ago
Fixed it with:
try:
import readline
readline # make pyflakes happy, readline makes interactive mode keep history
except ImportError:
# no readline on Windows
pass
however, you could also require pyreadline when on windows and try that if the readline import fails.
http://stackoverflow.com/questions/6024952/readline-functionality-on-windows-with-python-2-7
Awesome, if you can make a patch that would prefer pyreadline and fallback to readline (also in setup.py, like other examples there), that would be awesome!
A little bit more complicated than this.
Some Python / Linux distros (the ones that ship with CentOS IIRC) have no readline OTB.
On my Mac OSX box the stock Python 2.7 that ships with the OSX media has the readline module, when the one that comes with MacPorts have no readline module - unless you add it with "port install py27-readline".
On Windows, "pyreadline" works correctly with the ugly old console (cmd.exe) but AFAIK does not work correctly with Powershell or 3rd party consoles.
IMHO, the simples is the best. Readline is not essential to mrbob. Just use it if present or forget it otherwise.
The "emergency" is that the latest mr.bob does not work on Windows without a patch. The 2 minutes patch suggested by @rsyring works perfectly for me.
Thanks @domenkozar and hapPy new year to all.