at cygwin/bash LANG=ja_JP environment reproduce process(cygwin bash shell): $ $ uname -a CYGWIN_NT-5.1 MACHINE-NAME 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin $ LANG=ja_JP $ hg showconfig ** 予期せぬ例外が浮揚されました。 ** http://mercurial.selenic.com/wiki/BugTracker まで ** 以下の情報を報告してください。 ** Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] ** Mercurial Distributed SCM (version 1.7) ** Extensions loaded: Traceback (most recent call last): File "hg", line 38, in <module> File "mercurial\dispatch.pyc", line 16, in run File "mercurial\dispatch.pyc", line 36, in dispatch File "mercurial\dispatch.pyc", line 58, in _runcatch File "mercurial\dispatch.pyc", line 590, in _dispatch File "mercurial\dispatch.pyc", line 401, in runcommand File "mercurial\dispatch.pyc", line 641, in _runcommand File "mercurial\dispatch.pyc", line 595, in checkargs File "mercurial\dispatch.pyc", line 588, in <lambda> File "mercurial\util.pyc", line 427, in check File "mercurial\commands.pyc", line 1081, in showconfig UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 0: ordinal not in range(128) $ no problem in cmd.exe. this is bug?
reproduce in 1.6.4
What kind of Mercurial are you using? From a windows installer or something built for cygwin?
thanks kiilerix. I'm using windows installer version. Other command(commit/update/pull...) is all clear. Just happen 'showconfig'.
Hmm, the code in question is this: for f in util.rcpath(): ui.debug(_('read config from: %s\n') % f) I guess util.rcpath managed to return a Unicode string. The call end in win32.system_rcpath_win32, so I guess that returned a Unicode string. I'm not familiar with this API, though, and I cannot check it on my Linux box... (sharow: please leave the status at "chatting" instead of resetting it to "unread")
I want the following output to see the guilty file path: $ LC_MESSAGES=C hg showconfig --debug | head and $ hg showconfig --debug | head The following code raised the same exception, so as mg pointed out, util.rcpath() is likely to have unicode: >>> u'設定読み込み元: %s\n'.encode('cp932') % u'あ' UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 0: ordinal not in range(128)
thanks youjah, mg. I attached showconfig1.log. $ LC_MESSAGES=C hg showconfig --debug > showconfig1.log >>> print u'設定読み込み元: %s\n'.encode('cp932') % u'あ' UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 0: ordinal not in range(128) >>> print u'設定読み込み元: %s\n'.encode('cp932') % u'あ'.encode('cp932') 設定読み込み元: あ for f in util.rcpath(): ui.debug(_('read config from: %s\n') % f.encode(encoding.encoding)) hmm... I can't build bdist_wininst. > (sharow: please leave the status at "chatting" instead of resetting it to "unread") sorry. I mistook...
> I attached showconfig1.log. > $ LC_MESSAGES=C hg showconfig --debug > showconfig1.log Could you also send the output without LC_MESSAGES=C ? $ hg showconfig --debug I want to know the exact point where UnicodeDecodeError raised.
> Could you also send the output without LC_MESSAGES=C ? > $ hg showconfig --debug Nothing output(0 bytes). Crush at first iteration > for f in util.rcpath(): > ui.debug(_('read config from: %s\n') % f) Problem is using 'windows hg' in cygwin? (not bug?) hmm...
> Nothing output(0 bytes). Thanks. I found it's caused by win32process.GetModuleFileNameEx(), which returns unicode. http://docs.activestate.com/activepython/2.5/pywin32/win32process__GetModuleF ileNameEx_meth.html It doesn't matter whether on cygwin or not. I'll post a patch later.
Fixed by http://hg.intevation.org/mercurial/crew/rev/5f80f44d23c5 Yuya Nishihara <yuya@tcha.org> win32: remove try-catch block of GetModuleFileNameEx (issue2480)
I confirm this issue. $ uname -a CYGWIN_NT-5.1 MACHINE-NAME 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin $ which hg /cygdrive/c/Program Files/Mercurial/hg $ LANG=en hg --version Mercurial Distributed SCM (version 1.7.1) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2010 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ LANG=ja_JP hg showconfig extensions.hgext.bookmarks= .... $ Thanks!
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:14 EDT --- This bug was previously known as _bug_ 2480 at http://mercurial.selenic.com/bts/issue2480 Imported an attachment (id=1479)