[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread R. David Murray
R. David Murray added the comment: I decided to tweak the language slightly, Kushal. If this isn't what you were looking for, Martin, let me know. -- status: open -> closed ___ Python tracker

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset bdde36cd9048 by R David Murray in branch '3.4': #21169: add comment and doc update for getpass change. http://hg.python.org/cpython/rev/bdde36cd9048 New changeset fe532dccf8f6 by R David Murray in branch 'default': Merge: #21169: add comment and doc

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread Kushal Das
Kushal Das added the comment: Another patch with docs update and one line code comment. -- Added file: http://bugs.python.org/file34815/issue21169_v7.patch ___ Python tracker ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread R. David Murray
R. David Murray added the comment: Ok, I'll reopen the issue to do that. -- status: closed -> open ___ Python tracker ___ ___ Python-b

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: Ok. I wish the patch had a comment saying that, or better even a documentation change pointing out that feature. -- ___ Python tracker ___ ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread R. David Murray
R. David Murray added the comment: Since we don't want the prompting for the password to fail, what we do in the patch is use the replace error handler so that you get as much as could be encoded of the prompt. (Note: this approach was reviewed by both Toshio and Marc Andre.) Thanks for the

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset f430fdd1628e by R David Murray in branch '3.4': #21169: fix getpass to use replace error handler on UnicodeEncodeError. http://hg.python.org/cpython/rev/f430fdd1628e New changeset 461f5863f2aa by R David Murray in branch 'default': Mierge #21169: fi

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: Arfrever: If you set the locale to C, the device does *not* (anymore) support the character. The terminal application you are using may, but the "system" does not. It only supports the characters available in the locale, which your character is not. There sim

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Kushal Das
Kushal Das added the comment: New patchset with updated test, now sending ascii stream into the call as argument. -- Added file: http://bugs.python.org/file34810/issue21169_v6.patch ___ Python tracker

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Kushal Das
Kushal Das added the comment: Here is a new patch which uses stream.encoding instead getting the encoding from the locale as suggested by David. It also contains the new test. -- Added file: http://bugs.python.org/file34807/issue21169_v5.patch ___ Py

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Martin v. Löwis: In this case, device support non-ASCII characters, but Python's getpass module forgets to properly encode string. Message 215697 contains example with C locale. -- resolution: invalid -> _

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ LC_ALL=en_US.iso88591 ./python -c "print('\u20ac')" Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' in position 0: ordinal not in range(256) $ LC_ALL=en_US.iso88591 ./python -c "i

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: I agree that it is not a bug if the device where the prompt is shown simply does not support the characters; on Unix, this includes cases where the locale does not support the characters. Arfrever: when you say that it fails in Python 3 in a non-UTF-8 locale,

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think this is a bug. Any text output operation can fail when outputs unencodable string. You should use a stream with proper encoding and/or error handler. -- nosy: +serhiy.storchaka resolution: -> invalid stage: needs patch -> committed/rej

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-12 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-09 Thread Kushal Das
Kushal Das added the comment: New patch with actual test case :) -- Added file: http://bugs.python.org/file34776/issue21169_v4.patch ___ Python tracker ___ __

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-09 Thread Kushal Das
Kushal Das added the comment: Updated patch with discovering of currect locale and corresponding test case. -- Added file: http://bugs.python.org/file34775/issue21169_v3.patch ___ Python tracker ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-08 Thread Kushal Das
Kushal Das added the comment: Version 2 of the patch with a test update. -- Added file: http://bugs.python.org/file34767/issue21169_v2.patch ___ Python tracker ___ __

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-08 Thread Kushal Das
Kushal Das added the comment: Here is a patch which stops the breakage in getpass for python3. -- keywords: +patch nosy: +kushaldas Added file: http://bugs.python.org/file34766/issue21169.patch ___ Python tracker _

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : Added file: http://bugs.python.org/file34748/getpass_test_python3 ___ Python tracker ___ ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : Added file: http://bugs.python.org/file34747/getpass_test_python2 ___ Python tracker ___ ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-07 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: getpass.getpass() fails with non-ASCII characters in prompt. The attached example scripts (for Python 2 and 3) contain non-ASCII unicode prompt (Polish "hasło" == English "password") written in UTF-8. Python-2 version fails always. Python