[issue1602] windows console doesn't print or input Unicode

2016-10-22 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing

[issue1602] windows console doesn't print or input Unicode

2016-09-20 Thread Steve Dower
Steve Dower added the comment: Created issue28217 for adding these tests. -- superseder: -> Add interactive console tests ___ Python tracker ___

[issue1602] windows console doesn't print or input Unicode

2016-09-20 Thread Steve Dower
Steve Dower added the comment: Oh nice, I like that. We should definitely add some tests using that (though it seems like quite a big task... maybe I'll open a new issue for it). -- ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-09-20 Thread Dāvis
Dāvis added the comment: Steve Dower (steve.dower) > [...] > Anything else requires a real console with a real person with a real keyboard. FYI, not really, it is possible to fully automatically test console's output/input using WinAPI functions like WriteConsoleInput,

[issue1602] windows console doesn't print or input Unicode

2016-09-09 Thread Martin Panter
Martin Panter added the comment: Okay so regarding blocking reads with a full buffer, what you are saying is the second check to break the read loop should be sufficient: +/* If the buffer ended with a newline, break out */ +if (buf[*readlen - 1] == '\n') +break; --

[issue1602] windows console doesn't print or input Unicode

2016-09-09 Thread Eryk Sun
Eryk Sun added the comment: Martin, the console should be in line-input mode, in which case ReadConsole will block if there isn't at least one line in the input buffer. It reads up to the lesser of a complete line or the number of UTF-16 codes requested. If the previous call read the entire

[issue1602] windows console doesn't print or input Unicode

2016-09-09 Thread Steve Dower
Changes by Steve Dower : -- dependencies: -Python interactive console doesn't use sys.stdin for input resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-09-09 Thread sorin
Changes by sorin : -- nosy: -sorin ___ Python tracker ___ ___ Python-bugs-list

[issue1602] windows console doesn't print or input Unicode

2016-09-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6142d2d3c471 by Steve Dower in branch 'default': Issue #1602: Windows console doesn't input or print Unicode (PEP 528) https://hg.python.org/cpython/rev/6142d2d3c471 -- nosy: +python-dev ___ Python

[issue1602] windows console doesn't print or input Unicode

2016-09-08 Thread Martin Panter
Martin Panter added the comment: Also as I understand it, the open() function can return this new class, so the documentation at needs updating. -- ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-09-08 Thread Martin Panter
Martin Panter added the comment: Ah sorry I see Berker’s assert_() comment was _after_ you posted 1602_6.patch, so ignore that bit :) -- ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-09-08 Thread Martin Panter
Martin Panter added the comment: +++ b/Lib/test/test_winconsoleio.py +to real people with real keyborads. Should be keyboards There are still assert_() calls in this file (1602_6.patch). Did you miss them? +++ b/Lib/io.py +from _io import WindowsConsoleIO +__all__.append('WindowsConsoleIO') I

[issue1602] windows console doesn't print or input Unicode

2016-09-07 Thread Steve Dower
Steve Dower added the comment: Thanks! I've made the changes you suggested. -- ___ Python tracker ___ ___

[issue1602] windows console doesn't print or input Unicode

2016-09-07 Thread Berker Peksag
Berker Peksag added the comment: I left some minor comments for Doc/whatsnew/3.6.rst on Rietveld. In Lib/test/test_winconsoleio.py: * self.assert_() (deprecated) can be replaced by self.assertTrue() * We can add if __name__ == '__main__': unittest.main() -- nosy:

[issue1602] windows console doesn't print or input Unicode

2016-09-07 Thread Steve Dower
Steve Dower added the comment: I can't actually come up with many useful tests for this... so far I can validate that we can open the console IO object from 0, 1, 2, "CON", "CONIN$" and "CONOUT$", get fileno(), check readable()/writable() and close (multiple times without crashing). Anything

[issue1602] windows console doesn't print or input Unicode

2016-09-07 Thread Steve Dower
Steve Dower added the comment: Updated patch based on some suggestions from Eryk. The PEP has been accepted, so now I just need to land it in the next two days. Currently "normal" usage here is fine, and some edge cases match the Python 3.5 behaviour. I'm going to go through now and bulk out

[issue1602] windows console doesn't print or input Unicode

2016-09-06 Thread Steve Dower
Steve Dower added the comment: Latest patch is attached. PEP acceptance is sounding likely, so feel free to critically review. -- Added file: http://bugs.python.org/file44409/1602_4.patch ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-09-05 Thread Steve Dower
Steve Dower added the comment: Updated patch. This implements everything we've been discussing on python-dev -- Added file: http://bugs.python.org/file44379/1602_3.patch ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-08-30 Thread Steve Dower
Steve Dower added the comment: New patch attached (1602_2.patch - hopefully the review will work this time too). I discovered while researching for the PEP that a decent amount of code expects to be able to write ASCII to sys.stdout.buffer (or sys.stdout.buffer.raw). As my first patch

[issue1602] windows console doesn't print or input Unicode

2016-08-29 Thread Christopher Gurnee
Changes by Christopher Gurnee : -- nosy: +gurnec ___ Python tracker ___ ___

[issue1602] windows console doesn't print or input Unicode

2016-08-15 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: -christian.heimes ___ Python tracker ___ ___

[issue1602] windows console doesn't print or input Unicode

2016-08-15 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue1602] windows console doesn't print or input Unicode

2016-08-15 Thread Martin Panter
Martin Panter added the comment: I think this CGI thing is a separate bug, just exacerbated by the stdin.encoding problem. :) The urllib.parse.parse_qs() function takes an encoding parameter to figure out what to do with percent-encoded values: "%A9" → b"\xA9".decode(...). This is different

[issue1602] windows console doesn't print or input Unicode

2016-08-14 Thread Steve Dower
Steve Dower added the comment: For more info here, cgi.parse has code like this: def parse(fp, ...): if fp is None: fp = sys.stdin encoding = getattr(fp, 'encoding', 'latin-1') # later on... return urllib.parse.parse_qs(a_str, encoding=encoding, ...) As an easy hack,

[issue1602] windows console doesn't print or input Unicode

2016-08-14 Thread Steve Dower
Steve Dower added the comment: I'm fairly happy with where my current patch is at (not posted right now - too many different machines involved) and only one test is failing - test_cgi. The problem seems to be that urllib.parse.unquote() takes an encoding parameter to decode utf-8 encoded

[issue1602] windows console doesn't print or input Unicode

2016-08-14 Thread Steve Dower
Steve Dower added the comment: The current patch actually only affects the raw IO, so the concern would be one of the wrappers trying to work in bytes when it should be dealing in characters. This should be no different from reading a UTF16 file, so either both work or both are broken. The

[issue1602] windows console doesn't print or input Unicode

2016-08-14 Thread Adam Bartoš
Adam Bartoš added the comment: There is also the following consequence of (not) having the standard filenos: input() either considers the streams interactive or not. To consider them interactive, standard filenos and isatty are needed on sys.stdin and sys.stdout. If the streams are considered

[issue1602] windows console doesn't print or input Unicode

2016-08-13 Thread Martin Panter
Martin Panter added the comment: For compatibility, I think it may be good to add custom implementations of the buffer attribute and detach() method to stdin/out. They should be able to at least read and write ASCII bytes. It might be easiest to keep them as the current BufferedReader/Writer

[issue1602] windows console doesn't print or input Unicode

2016-08-13 Thread Adam Bartoš
Adam Bartoš added the comment: Hello Steve, that's great you are working on this! I've ran through your patch and I have the following remarks: • Since wide chars have two bytes, there may be problem when someone wants to read or write odd number of bytes. If the number is > 1, it's ok since

[issue1602] windows console doesn't print or input Unicode

2016-08-13 Thread Steve Dower
Steve Dower added the comment: I'm now actively working on this for 3.6. I've attached my first pass at implementing an alternative raw IO stream that uses the *ConsoleW APIs instead of the CRT. It works fine for basic print() and input() (including handling redirection "properly", which is a

[issue1602] windows console doesn't print or input Unicode

2015-11-09 Thread Adam Bartoš
Adam Bartoš added the comment: dead1ne: Hello, I'm maintaining a package that tries to solve this issue: https://github.com/Drekin/win-unicode-console . There are actually many related problems. -- ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2015-11-09 Thread dead1ne
dead1ne added the comment: I've tried addressing the output problem by subclassing TextIOWrapper to use the windows functions GetConsoleOutputCP and WideCharToMultiByte. I've tested this as well as I can without figuring out how to install a better font for the windows console. It appears to

[issue1602] windows console doesn't print or input Unicode

2015-05-18 Thread Aki Sasaki
Changes by Aki Sasaki a...@escapewindow.com: -- nosy: +escapewindow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

[issue1602] windows console doesn't print or input Unicode

2015-05-11 Thread Nick Coghlan
Nick Coghlan added the comment: It sounds like fixing this properly requires fixing issue 17620 first (so the interactive interpreter actually uses sys.stdin), so I've flagged that as a dependency. -- dependencies: +Python interactive console doesn't use sys.stdin for input

[issue1602] windows console doesn't print or input Unicode

2015-05-11 Thread Paul Moore
Changes by Paul Moore p.f.mo...@gmail.com: -- nosy: +paul.moore ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

[issue1602] windows console doesn't print or input Unicode

2015-04-16 Thread lilydjwg
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing

[issue1602] windows console doesn't print or input Unicode

2015-01-20 Thread Mark Hammond
Mark Hammond added the comment: File redirection has nothing to do with win-unicode-console Thank you, that comment is spot on - there are multiple issues being conflated here. This bug is purely about the tty/console behaviour. -- ___ Python

[issue1602] windows console doesn't print or input Unicode

2015-01-15 Thread Drekin
Drekin added the comment: File redirection has nothing to do with win-unicode-console and this issue. When stdout is redirected, it is not a tty so win-unicode-console doesn't replace the stream object, which is the right thing to do. You got UnicodeEncodeError because Python creates

[issue1602] windows console doesn't print or input Unicode

2015-01-14 Thread Drekin
Drekin added the comment: Note that win-unicode-console replaces the stdio streams rather than wraps them. So the desired state would be Unicode stream objects wrapped by PTVS. There would be no problem if win-unicode-console stream replacement occured before PTVS wraps them, which should be

[issue1602] windows console doesn't print or input Unicode

2015-01-14 Thread Dainis Jonitis
Dainis Jonitis added the comment: Presumably Unicode streams would also fix file redirects. Currently, if you want to redirect stdout output to file it throws. For example PowerShell: C:\Python34\python.exe .\test.py | out-file -Encoding utf8 -FilePath 'test.txt' --

[issue1602] windows console doesn't print or input Unicode

2015-01-13 Thread Steve Dower
Steve Dower added the comment: It sounds like the script should handle the case where someone has already changed stdout better. We wrap the streams in PTVS so we can forward the output into the IDE where Unicode will display properly anyway. Our wrapper missing fileno is a bug in our side,

[issue1602] windows console doesn't print or input Unicode

2015-01-13 Thread Dainis Jonitis
Dainis Jonitis added the comment: Drekins module at https://github.com/Drekin/win-unicode-console is great, but there is small issue with it when running within debugger in Visual Studio (Python Tools for Visual Studio 2.1 installed). Debugger already wraps stdout and stderr inside the

[issue1602] windows console doesn't print or input Unicode

2015-01-03 Thread Drekin
Drekin added the comment: I tried the following code: import pdb pdb.set_trace() print(1 + 2) print(αβγ∫) When run in vanilla Python it indeed ends with UnicodeEncodeError as soon as it hits the line with non-ASCII characters. However, the solution via win_unicode_console package seems to

[issue1602] windows console doesn't print or input Unicode

2015-01-02 Thread Glenn Linderman
Glenn Linderman added the comment: Just to note that another side effect of this bug is that stepping through code where the source contains non-ASCII characters results in pdb producing an error when trying to print the source lines. This makes stepping through such source code impossible.

[issue1602] windows console doesn't print or input Unicode

2014-10-02 Thread stijn
stijn added the comment: New here, but I think this is the correct issue to get info about this unicode problem. On the windows console: chcp Active code page: 437 type utf.txt ╨ƒ╤Ç╨╕╨▓╨╡╤é chcp 65001 Active code page: 65001 type utf.txt Привет python --version Python 3.5.0a0 cat

[issue1602] windows console doesn't print or input Unicode

2014-10-02 Thread Drekin
Drekin added the comment: stijn: You are mixing two issues here. One is reading text from a file. There is no problem with it. You just call open(path, encoding=the_encoding_of_the_file). Since the encoding of the file depends on the file, you should provide the information about it. Another

[issue1602] windows console doesn't print or input Unicode

2014-10-02 Thread stijn
stijn added the comment: Drekin: you're right for both input and output. Using encoding with plain open() works just fine and using the latest win-unicode-console does give correct output for the second example as well. Thanks! -- ___ Python

[issue1602] windows console doesn't print or input Unicode

2014-09-24 Thread Stefan Champailler
Stefan Champailler added the comment: Thank you all for your quick and good answers. This level of responsiveness is truly amazing. I've played a bit with IPython and it works just fine. I can type the eurosign drectly with Alt Gr - E (so I didn't enter a unicode code). So the bug is

[issue1602] windows console doesn't print or input Unicode

2014-09-24 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, IPython has the advantage of running in a fully initialised browser, with the backend in a fully initialised Python environment. CPython's setting up the standard streams for the default REPL at a much lower level, and there are quite a few problems with

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Stefan Champailler
Stefan Champailler added the comment: I don't know if this is 100% related, but here I go. Here's a session in a windows console (cmd.exe) : Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\stcchcp 65001 Active code page: 65001

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Stefan Champailler
Stefan Champailler added the comment: In my previous comment, I've shown : print '€' which is not valid python 3.4.1 (don't why the interpreter didn't complaing though). So I tested again with missing parenthesis added : C:\PORT-STCA2\pl-PRIVATE\horsechcp 65001 Active code page: 65001

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Nick Coghlan
Nick Coghlan added the comment: Drekin, it would be good to be able to incorporate some of your improvements for Python 3.5. Before we could do that, we'd need to review and agree to the PSF Contributor Agreement at https://www.python.org/psf/contrib/contrib-form/ The underlying licensing

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Drekin
Drekin added the comment: Stefan Champailler: The crash you see is maybe not a crash at all. First it has nothing to do with printing, the problem is reading of your input line. That explains why Python exited even before printing the traceback of the SyntaxError. If you try to read input

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Drekin
Drekin added the comment: Nick Coghlan: Ok, done. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Nick Coghlan
Nick Coghlan added the comment: Drekin: thanks! That should get processed by the PSF Secretary before too long, and the * to indicate you have signed it will appear by your name. -- ___ Python tracker rep...@bugs.python.org

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Stefan Champailler
Stefan Champailler added the comment: Dear Drekin, The crash you see is maybe not a crash at all. First it has nothing to do with printing, the problem is reading of your input line. I guessed that, but thanks for pointing out. So maybe Python REPL then thinks the input just ended and so

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Mark Hammond
Mark Hammond added the comment: The crash you see is maybe not a crash at all. I'd call it a crash - the repl shouldn't exit. But it's not necessarily part of *this* bug. -- ___ Python tracker rep...@bugs.python.org

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Stefan, the Idle Shell handles the BMP subset of Unicode quite well. print('€') € It is superior to the Windows console in other ways too. For instance, cut and paste work normally as for other Windows windows. (cp65001 is know to be buggy and essentially

[issue1602] windows console doesn't print or input Unicode

2014-09-23 Thread Drekin
Drekin added the comment: Idle shell handles Unicode characters well, but one cannot enter them using deadkey combinations. See http://bugs.python.org/issue22408. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602

[issue1602] windows console doesn't print or input Unicode

2014-08-04 Thread Drekin
Drekin added the comment: I think that boxes are ok, it's just missing font. Without active workaroud there is just UnicodeEncodeError (with cp852 for me). There is problem with astral characters – I'm getting each box twice. It is possible that Windows console doesn't handle astral

[issue1602] windows console doesn't print or input Unicode

2014-08-02 Thread Mark Lawrence
Mark Lawrence added the comment: To ensure that we're all talking about the same thing, is everybody using the /u unicode output option or /a ansi (which I'm assuming is the default) when running cmd? -- nosy: +BreamoreBoy ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2014-08-02 Thread Glenn Linderman
Glenn Linderman added the comment: Mark, the /U and /A switches to CMD only affect (as the help messages say) the output of internal CMD commands. So they would only affect interoperability between internal command output piped to a Python program. The biggest issue in this bug, however, is

[issue1602] windows console doesn't print or input Unicode

2014-07-28 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: -haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file27261/win_unicode_console_2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file29563/i.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file29564/win_unicode_console_3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file31756/streams.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file31770/win_unicode_console.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file35990/win_unicode_console.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Drekin
Drekin added the comment: I have deleted all my old files and added only my current implementation of the stream objects as the only relevant part to this issue. @Mark Summerfield: I have added __init__.py to the new version of win_unicode_console. If there is any problem, you can start an

[issue1602] windows console doesn't print or input Unicode

2014-07-26 Thread Nick Coghlan
Nick Coghlan added the comment: Drekin, you're right, that's a much better way to go, I just didn't think it through :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread Mark Summerfield
Mark Summerfield added the comment: I used pip to install the win_unicode_console package on windows 7 python 3.3. It works but wouldn't freeze with cx_freeze because there's no __init__.py file in the win_unicode_console directory. -- ___ Python

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread Nick Coghlan
Nick Coghlan added the comment: Hmm, I'm not sure if that would be a bug in cxFreeze or CPython - I don't think we've tried freezing or zipimporting namespace packages... (either way, adding the __init__.py to win_unicode_console would likely be the quickest fix) --

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread STINNER Victor
STINNER Victor added the comment: Since there is now an external project fixing the support of Windows console, I suggest to close this issue as wontfix. In a few months, if we get enough feedback on this project, we may reconsider integrating it into Python. What do you think?

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread Nick Coghlan
Nick Coghlan added the comment: The poor interaction with the Windows command line is still a bug in CPython - we could mark it closed/later but I don't see any value in doing so. I see Drekin's win_unicode_console module as similar to my own contextlib2 - used to prove the concept, and

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread STINNER Victor
STINNER Victor added the comment: The poor interaction with the Windows command line is still a bug in CPython - we could mark it closed/later but I don't see any value in doing so. I don't see any value in keeping the issue open since nobody worked on it last 7 years. I just want to make

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread Nick Coghlan
Nick Coghlan added the comment: Based on Steve's last post, the main challenge is that the IO model assumes a bytes-based streaming API - it isn't really set up to cope with a UTF-16 buffering layer. However, that's not substantially different from the situation when the standard streams are

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread Nick Coghlan
Nick Coghlan added the comment: Changing targets to Python 3.5, since this is almost certainly going to be too invasive for a maintenance release. -- versions: +Python 3.5 -Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue1602] windows console doesn't print or input Unicode

2014-07-25 Thread Glenn Linderman
Glenn Linderman added the comment: This bug deserves to stay open with its high priority (for whatever good that does these last seven years, although I appreciate all the efforts put forth, and have been making heavy use of the workarounds in the patches), because when working with Unicode

[issue1602] windows console doesn't print or input Unicode

2014-07-20 Thread Drekin
Changes by Drekin dre...@gmail.com: Removed file: http://bugs.python.org/file27245/win_unicode_console.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2014-07-20 Thread Drekin
Drekin added the comment: @Victor Stinner: You are right. So I did it. Here are the links to GitHub and PyPI: https://github.com/Drekin/win-unicode-console, https://pypi.python.org/pypi/win_unicode_console. I also tried to delete the files, but it seems that it is only possible to unlink a

[issue1602] windows console doesn't print or input Unicode

2014-07-20 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Drekin - I'll point folks to your project as a good place to provide initial feedback, and if that seems promising we can look at potentially integrating the various fixes into Python 3.5 -- ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2014-07-18 Thread Drekin
Drekin added the comment: I have made some updates in the streams code. Better error handling (getting errno by GetLastError() and raising exception when zero bytes are written on non-zero input). This prevents the infinite loop in BufferedIOWriter.flush() when there is odd number of bytes

[issue1602] windows console doesn't print or input Unicode

2014-07-18 Thread STINNER Victor
STINNER Victor added the comment: @Drekin: Please don't send ZIP files to the bug tracker. It would be much better to have a project on github, Mercurial or something else, to have the history of the source code. You may try tp list all people who contributed to this code. You may also

[issue1602] windows console doesn't print or input Unicode

2014-06-21 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- priority: low - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

[issue1602] windows console doesn't print or input Unicode

2014-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: The fact Unicode doesn't work at the command prompt makes it look like Unicode on Windows just plain doesn't work, even in Python 3. Steve, if you (or a colleague) could provide some insight on getting this to work properly, that would be greatly appreciated.

[issue1602] windows console doesn't print or input Unicode

2014-06-21 Thread Steve Dower
Steve Dower added the comment: My understanding is that the best way to write Unicode to the console is through WriteConsoleW(), which seems to be where this discussion ended up. The only apparent sticking point is that this would cause an ordering incompatibility with `stdout.write();

[issue1602] windows console doesn't print or input Unicode

2013-09-15 Thread Glenn Linderman
Glenn Linderman added the comment: Hi Drekin. Thanks for your work in progressing this issue. There have been a variety of techniques proposed for this issue, but it sounds like yours has built on what the others learned, and is close to complete, together with issue 17620. Is this in a form

[issue1602] windows console doesn't print or input Unicode

2013-09-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: From reading the module, import stream; stream.enable() replaces sys.stdin/out/err with new classes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602

[issue1602] windows console doesn't print or input Unicode

2013-09-15 Thread Drekin
Drekin added the comment: Glenn Linderman: Yes I have built on what the others learned. For your question, I made it and tested it in Python 3.3, it should also work in 3.4 and what I've tried, it actually works. As Terry J. Reedy says you can just load the module and enable the streams. I do

[issue1602] windows console doesn't print or input Unicode

2013-09-14 Thread Drekin
Drekin added the comment: Hello again. I have rewritten the custom stdio objects and implemented them as raw io reading and writing bytes in UTF-16-LE encoding. They are then wrapped in standard BufferedReader/Writer and TextIOWrapper objects. This approach also solves a bug of wrong string

[issue1602] windows console doesn't print or input Unicode

2013-03-24 Thread Drekin
Drekin added the comment: Hello. I have made a small upgrade of the workaround. • win_unicode_console.enable_streams() sets sys.stdin, stdout and stderr to custom filelike objects which use Windows functions ReadConcoleW and WriteConsoleW to handle unicode data properly. This can be done in

[issue1602] windows console doesn't print or input Unicode

2013-03-24 Thread Drekin
Changes by Drekin dre...@gmail.com: Added file: http://bugs.python.org/file29564/win_unicode_console_3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

[issue1602] windows console doesn't print or input Unicode

2013-03-24 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

[issue1602] windows console doesn't print or input Unicode

2012-09-22 Thread Drekin
Drekin added the comment: I have finished a solution working for me. It bypasses standard Python interactive interpreter and uses its own repl based on code.interact(). This repl is activated by an ugly hack since PYTHONSTARTUP doesn't apply when some file is run (python -i somefile.py). Why

[issue1602] windows console doesn't print or input Unicode

2012-09-21 Thread Drekin
Drekin added the comment: Hello, I'm trying to handle Unicode input and output in Windows console and found this issue. Will this be solved in 3.3 final? I tried to write a solution (file attached) based on solution here – rewriting sys.stdin and sys.stdout so it uses ReadConsoleW and

[issue1602] windows console doesn't print or input Unicode

2012-09-21 Thread STINNER Victor
STINNER Victor added the comment: Will this [issue] be solved in 3.3 final? No. It would be an huge change and the RC2 was already released. No new feature are accepted after the version 3.3.0 beta 1: http://www.python.org/dev/peps/pep-0398/ I'm not really motivated to work on this issue,

[issue1602] windows console doesn't print or input Unicode

2012-07-03 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: My fix for this errors error, might be similar to what is needed for issue 12967, although I don't know if my fix is really correct... just that it gets past the error, and 'strict' is the default for TextIOWrapper. I'm not at all sure

[issue1602] windows console doesn't print or input Unicode

2012-07-03 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I was reporting stock, as distributed 3.3b0. Is unicode3.py something to run once or import in each app that wants unicode output? Either way, if it is possible to fix the console, why is it not distribute it with the fix? Terry,

[issue1602] windows console doesn't print or input Unicode

2012-07-03 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Terry said: Is unicode3.py something to run once or import in each app that wants unicode output? I say: The latter... import it. Terry said: Either way, if it is possible to fix the console, why is it not distribute it with the fix?

  1   2   >