[issue28333] input() with Unicode prompt produces mojibake on Windows

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +928 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Steve Dower
Changes by Steve Dower : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ ___ Pyt

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6b46c3deea2c by Steve Dower in branch '3.6': Issue #28333: Fixes off-by-one error that was adding an extra space. https://hg.python.org/cpython/rev/6b46c3deea2c New changeset 44d15ba67d2e by Steve Dower in branch 'default': Issue #28333: Fixes off-b

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Eryk Sun
Eryk Sun added the comment: I forgot to include the link to the python-list thread where this came up: https://mail.python.org/pipermail/python-list/2016-October/715428.html -- ___ Python tracker _

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Steve Dower
Steve Dower added the comment: Not sure how I missed it originally, but that extra 1 char is actually very important: Python 3.6.0b2 (v3.6.0b2:b9fadc7d1c3f, Oct 10 2016, 20:36:51) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> i

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-13 Thread Eryk Sun
Eryk Sun added the comment: MultibyteToWideChar includes the trailing NUL when it gets the string length, so the WriteConsoleW call needs to use (wlen - 1). -- ___ Python tracker __

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-08 Thread Steve Dower
Steve Dower added the comment: I made some minor tweaks to the patch (no need for strlen() - passing -1 works equivalently), but otherwise it's exactly what I would have done so I committed it. We currently have no tests to check which characters are written to a console output buffer. Issue2

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 63ceadf8410f by Steve Dower in branch '3.6': Issue #28333: Remove unnecessary increment. https://hg.python.org/cpython/rev/63ceadf8410f New changeset d76c8f9ea787 by Steve Dower in branch 'default': Issue #28333: Remove unnecessary increment. https:

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset faf5493e6f61 by Steve Dower in branch '3.6': Issue #28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk Sun) https://hg.python.org/cpython/rev/faf5493e6f61 New changeset cb62e921bd06 by Steve Dower in branch 'default': Issue #283

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Eryk Sun
Eryk Sun added the comment: I'm sure Steve already has this covered, but FWIW here's a patch to call WriteConsoleW. Here's the result with the patch applied: >>> sys.ps1 = '»»» ' »»» input("αβψδ: ") αβψδ: spam 'spam' and with interactive stdin and stdout/stderr redirected to a

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Eryk Sun
Eryk Sun added the comment: When I pointed this issue out in code reviews, I assumed you would add the relatively simple fix to decode the prompt and call WriteConsoleW. The long-term fix in issue 17620 has to be worked out with cross-platform support, and ISTM that it can wait for 3.7. Off t

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Steve Dower
Steve Dower added the comment: This may force issue17620 into 3.6 - we really ought to be getting and using sys.stdin and sys.stderr in PyOS_StdioReadline() rather than going directly to the raw streams. The problem here is that we're still using fprintf to output the prompt, even though we k

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is a regression from 3.5.2, where input("α") displays "α". -- ___ Python tracker ___ ___ Python

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Same output with cp437. -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-01 Thread Adam Bartoš
New submission from Adam Bartoš: In my setting (Python 3.6b1 on Windows), trying to prompt a non-ASCII character via input() results in mojibake. This is related to the recent fix of #1602 and so is Windows-specific. >>> input("α") ╬▒ The result corresponds to print("α".encode("utf-8").decode