Closed anthrotype closed 9 years ago
Hello,
it seems that there is a problem with the ctypes call. I'll investigate.
Fixed.
Thanks a lot! It's working now when using the win_unicode_console.enable() method.
However, I still don't understand why the transcoding from UTF-16-LE to UTF-8 is set to False when using the custom REPL. If I run the custom REPL with
python -i -m run
because the input/output are not transcoded, I get unicode decode/encode errors. If I change line 9 of run.py to:
streams.enable(transcode=True)
then the custom REPL works.
Thanks again for your support.
Cosimo
The custom REPL is from times when installing a custom readline hook wasn't supported. Now there is no need to use run.py.
Nevertheless, the transcoding is set to False when using the custom REPL because it shouldn't be needed. Trancoding is used only because certain Python internals cannot handle utf-16. I thought that the problem is only with the tokenizer, but it turns out that PyOS_Readline has also this problem. When isatty() and fileno() weren't set on the custom stream objects, input() used directly the stream objects, but now it goes via PyOS_Readline and that's why the problem occurs.
So I will eventually set transcode=True in run.py, but the point is that there is no need to use run.
Hello,
I installed the package via "pip install win_unicode_console". When I enable it inside an interactive session, I get this error below and the python interpreter crashes. I am using the vanilla python 3.4.2 distribution for win32, downloaded from the Python.org, from within the Windows Command Prompt (on Windows 7). I did not change the cmd.exe codepage through "chcp" command, it's stays the default "cp850" on my machine. Here is the output of my interactive session followed by traceback:
Thanks for your support.
Cosimo