this should resolve #440
The run <tab> crash in the qtconsole was caused by another uncaught sys.stdin.encoding, which is None when there is no Terminal.
The remaining fixes prevent logging from being hooked up to stderr when under pythonw.exe, which prevented the kernel from starting.
commit e06a43d fixes issue as you suggested here: http://mail.scipy.org/pipermail/ipython-user/2011-June/007836.html
catch another unconditional encode in completerlib
fix ipython-qtconsole when run as a GUI script