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

2012-07-02 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: For the win_console.patch, it seems like adding the line self.errors='strict' inside UnicodeOutput.__init__ resolves the problem with input causing exceptions. Not sure if the sys_write_stdout.patch has the same sort of problem. Sure

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

2012-07-02 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: 3.3b0, Win7, 64 bit. Original test script stops at File C:\Programs\Python33\lib\encodings\cp437.py, line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode character

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

2012-05-26 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: A little more empirical info: the missing errors attribute doesn't show up except for input. print works fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602

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

2012-05-21 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: I actually had to go back to 3.1.2 to get it to run, I guess I had never run with Unicode output after installing 3.2. So it isn't an incompatibility between 3.2.2 and 3.2.3, but more likely a change between 3.1 and 3.2 that

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

2012-05-21 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- nosy: -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

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

2012-05-19 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___

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

2012-05-19 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Not sure whether a solution has already been proposed because the issue is very long, but I just bumped into this on Windows and come up with this: from __future__ import print_function import sys def safe_print(s): try:

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

2012-05-19 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: Giampaolo: See #msg120700 for why that won't work, and the subsequent comments for what will work instead (basically, using WriteConsoleW and a workaround for a Windows API bug). Also see the prototype win_console.patch from

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

2012-05-19 Thread Matt Mackall
Changes by Matt Mackall m...@selenic.com: -- nosy: -Matt.Mackall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

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

2012-05-16 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Has something incompatible changed between 3.2.2 and 3.2.3 with respect to this bug? I have a program that had an earlier version of the workaround (Michael's original, I think), and it worked fine, then I upgraded from 3.2.2 to 3.2.3

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

2012-05-16 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Oh, and is this issues going to be fixed for 3.3, so we don't have to use the workaround in the future? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602

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

2012-05-16 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Glenn, I do not know what you are using the interactive interpreter for, but for the unicode BMP, the Idle shell generally works better. I only use CommandPrompt for cross-checking behavior. -- ___

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

2012-04-05 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: The issue #14227 has been marked as a duplicate of this issue. Copy of msg155149: This is on Windows 7 SP1. Run 'chcp 65001' then Python from a console. Note the extra characters when non-ASCII characters are in the string. At a

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

2012-01-20 Thread akira
Changes by akira 4kir4...@gmail.com: -- nosy: +akira ___ 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

2011-12-07 Thread Matt Mackall
Matt Mackall m...@selenic.com added the comment: The underlying cause of Python's write exceptions with cp65001 is: The ANSI C write() function as implemented by the Windows console returns the number of _characters_ written rather than the number of _bytes_, which Python reasonably

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

2011-10-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I added a cp65001 codec to Python 3.3: see issue #13216. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___

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

2011-10-19 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I done more tests on the Windows console. I focused my tests on output. To sum up, if we implement sys.stdout using WriteConsoleW() and sys.stdout.buffer.raw using WriteConsoleA(): - print() will not fail anymore on unencodable

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

2011-10-19 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: unicode3.py replaces sys.stdout, sys.stdout.buffer, sys.stderr and sys.stderr.buffer to use WriteConsoleW() and WriteConsoleA(). It displays also a lot of information about encodings and displays some characters (I wrote my tests

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

2011-10-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, mhammond ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___

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

2011-10-19 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: win_console.patch: a more complete prototype * patch the site module to replace sys.stdout and sys.stderr by UnicodeConsole and BytesConsole classes which use WriteConsoleW and WriteConsoleA * UnicodeConsole inherits from

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

2011-10-19 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: test_win_console.py: Small script to test win_console.patch. Write some characters into sys.stdout.buffer (WriteConsoleA) and sys.stdout (WriteConsoleW). The test is written for cp850, cp1252 and cp65001 code pages. --

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

2011-04-10 Thread pyloz
Changes by pyloz merlinschindlb...@googlemail.com: -- nosy: +smerlin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

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

2011-03-26 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: Glenn wrote: So if flush checks that bit, maybe TextIOWriter could just call buffer.flush, and it would be fast if clean and slow if dirty? Yes. I'll benchmark how much overhead is added by the calls to flush; there's no point

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

2011-03-26 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: David-Sarah wrote: Windows is very slow at scrolling a console, which might make the cost of flushing insignificant in comparison.) Just for the record, I noticed a huge speedup in Windows console scrolling when I switched from WinXP to

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

2011-03-25 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: First a minor correction: The new requirement would be that a correct app also needs to flush between a sequence of buffer.writes (that end in an incomplete line, or always if PYTHONUNBUFFERED or python -u is used), and a

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

2011-03-25 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: I wrote: A similar issue arises for stdin: to maintain strict compatibility, every read from a TextIOWrapper attached to an input console would have to drain the buffer of its buffer object, in case the app has read from it.

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

2011-03-25 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- nosy: -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

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

2011-03-25 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: David-Sarah said: In any case, given that the buffer of the initial std{out,err} will always be a BufferedWriter object (since .buffer is readonly), it would be possible for the TextIOWriter to test a dirty flag in the BufferedWriter, in

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

2011-03-24 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: I wrote: The only caveat would be that if you write a partial line to the buffer object (or if you set the buffer object to be fully buffered and write to it), and then write to the text stream, the buffer wouldn't be flushed

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

2011-03-24 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: I wrote: $ python3 -c 'import sys; sys.stdout.write(foo); sys.stdout.buffer.write(bbar); sys.stdout.write(baz\n)' barfoobaz Hmm, the behaviour actually would differ here: the proposed implementation would print foobaz bar (the

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

2011-03-24 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Presently, a correct application only needs to flush between a sequence of writes and a sequence of buffer.writes. Don't assume the flush happens after every write, for a correct application. --

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

2011-03-24 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: Glenn Linderman wrote: Presently, a correct application only needs to flush between a sequence of writes and a sequence of buffer.writes. Right. The new requirement would be that a correct app also needs to flush between a

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

2011-03-24 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Would it suffice if the new scheme internally flushed after every buffer.write? It wouldn't be needed after write, because the correct application would already do one there? Am I off-base in supposing that the performance of

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

2011-03-24 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Le vendredi 25 mars 2011 à 00:54 +, David-Sarah Hopwood a écrit : David-Sarah Hopwood david-sa...@jacaranda.org added the comment: I wrote: $ python3 -c 'import sys; sys.stdout.write(foo); sys.stdout.buffer.write(bbar);

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

2011-03-22 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: (For anyone wondering about the hold-up on this bug, I ended up switching to Ubuntu. Not to worry, I now have Python 3 building in XP under VirtualBox -- which is further than I ever got with my broken Vista install :-/ It seems

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

2011-03-21 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I did some tests with WriteConsoleW(): - with raster fonts, U+00E9 is displayed as é, U+0141 as L and U+042D as ? = good (work as expected) - with TrueType font (Lucida), U+00E9 is displayed as é, U+0141 as Ł and U+042D as Э =

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

2011-03-04 Thread Santoso Wijaya
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

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

2011-02-11 Thread Andrew Dunbar
Changes by Andrew Dunbar hippytr...@gmail.com: -- nosy: +hippietrail ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list

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

2011-02-02 Thread David-Sarah Hopwood
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: Feedback from Julie Solon of Microsoft: These console functions share a per-process heap that is 64K. There is some overhead, the heap can get fragmented, and calls from multiple threads all affect how much is available for

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

2011-01-15 Thread sorin
sorin sorin.sbar...@gmail.com added the comment: remeber that cp65001 cannot be set on windows. Also please read http://blogs.msdn.com/b/michkap/archive/2010/10/07/10072032.aspx and contact the author, Michael Kaplan from Microsoft, if you have more questions. I'm sure he will be glad to

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

2011-01-14 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: http://www.python.org/dev/peps/pep-0011/ says Name: Win9x, WinME, NT4 Unsupported in: Python 2.6 (warning in 2.5 installer) Code removed in: Python 2.6 Only xp+ now. email sent to webmaster@... Even if the best fix only

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

2011-01-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: I think we even agreed to drop 2000, although the PEP hasn't been updated and I couldn't find the supposed email where this was said. For implementing functionality that isn't supported on all Windows versions or architectures, you can look at

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

2011-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Here are some results of my test of unicode2.py. I'm testing py3k on Windows XP, OEM: cp850, ANSI: cp1252. Raster fonts With a fresh console, unicode2.py displays ?. input() accepts characters

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

2011-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: ..., because right now, I'm including instructions for the use to (1) choose Lucida or Consolas font if they can't figure out any other font that gets rid of the square boxes (2) chcp 65001 (3) set PYTHONIOENCODING=UTF-8

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

2011-01-14 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Victor said: Why do you set the code page to 65001? In all my tests (on Windows XP), it always break the standard input. My response: Because when I searched Windows for Unicode and/or UTF-8 stuff, I found 65001, and it seems like it

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

2011-01-11 Thread David-Sarah Hopwood
Changes by David-Sarah Hopwood david-sa...@jacaranda.org: -- title: windows console doesn't print utf8 (Py30a2) - windows console doesn't print or input Unicode Added file: http://bugs.python.org/file20363/doc-patch.diff ___ Python tracker

<    1   2