UnicodeDecodeError when entering password with unicode characters
Created originally on Bitbucket by Anonymous
The TortoiseHg team redirected me to mercurial_keyring extension for the source of the following bug.
https://bitbucket.org/tortoisehg/thg/issue/3651 https://bitbucket.org/tortoisehg/thg/issue/3541
When pushing changes in TortoiseHg the type password dialog appears. If the password has unicode characters (in my case it was ä) the push fails with the following error:
** Mercurial version (2.9). TortoiseHg version (2.11) ** Command: ** CWD: C:\Users\7006alex\Documents\MercurialRepos\ValmetHunterUI ** Encoding: cp1252 ** Extensions loaded: strip, mq, mercurial_keyring ** Python version: 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] ** Windows version: sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') ** Processor architecture: x64 ** Qt-4.8.5 PyQt-4.10.3 QScintilla-2.7.2 Traceback (most recent call last): File "tortoisehg\hgqt\thread.pyo", line 287, in run File "tortoisehg\util\hglib.pyo", line 711, in dispatch File "mercurial\dispatch.pyo", line 806, in _dispatch File "mercurial\dispatch.pyo", line 586, in runcommand File "mercurial\dispatch.pyo", line 897, in _runcommand File "mercurial\dispatch.pyo", line 868, in checkargs File "mercurial\dispatch.pyo", line 803, in File "mercurial\util.pyo", line 511, in check File "mercurial\extensions.pyo", line 151, in wrap File "mercurial\util.pyo", line 511, in check File "hgext\mq.pyo", line 3381, in mqcommand File "mercurial\util.pyo", line 511, in check File "mercurial\commands.pyo", line 4729, in push File "mercurial\localrepo.pyo", line 1880, in push File "mercurial\wireproto.pyo", line 308, in unbundle File "mercurial\httppeer.pyo", line 201, in _callpush File "mercurial\httppeer.pyo", line 171, in _call File "mercurial\httppeer.pyo", line 118, in _callstream File "urllib2.pyo", line 410, in open File "urllib2.pyo", line 523, in http_response File "urllib2.pyo", line 442, in error File "urllib2.pyo", line 382, in _call_chain File "urllib2.pyo", line 897, in http_error_401 File "mercurial\url.pyo", line 440, in http_error_auth_reqed File "hgext\mercurial_keyring.pyo", line 389, in basic_http_error_auth_reqed File "urllib2.pyo", line 872, in http_error_auth_reqed File "urllib2.pyo", line 878, in retry_http_basic_auth File "hgext\mercurial_keyring.pyo", line 383, in find_user_password File "hgext\mercurial_keyring.pyo", line 268, in find_auth File "hgext\mercurial_keyring.pyo", line 121, in set_http_password File "keyring\core.pyo", line 42, in set_password File "keyring\backends\Windows.pyo", line 146, in set_password UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 6: ordinal not in range(128)