Article ID No. 13268126610 (Delete) | New Date & Time 2010 2011 2012 2013 2014 /1 2 3 4 5 6 7 8 9 10 11 12 /1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 :0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 :0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 Category Title Content yum update したら怒られました。環境はタイトルの通り。<pre># yum update Loaded plugins: fastestmirror, priorities, rhnplugin Traceback (most recent call last): File "/usr/bin/yum", line 29, in <module> yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 274, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 129, in main result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 432, in doCommands self._getTs(needTsRemove) File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs self._getTsInfo(remove_only) File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo pkgSack = self.pkgSack File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 882, in <lambda> pkgSack = property(fget=lambda self: self._getSacks(), File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 668, in _getSacks self.repos.populateSack(whicepos) File "/usr/lib/python2.6/site-packages/yum/repos.py", line 265, in populateSack self.doSetup() File "/usr/lib/python2.6/site-packages/yum/repos.py", line 72, in doSetup self.ayum.plugins.run('prereposetup') File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/share/yum-plugins/rhnplugin.py", line 121, in prereposetup_hook str(e)) File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 177, in __repr__ "The message was:\n") + self.errmsg UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)</pre>rhnplugin が日本語のエラーメッセージ (UTF-8) を出そうとして、Python に怒られている模様。回避するには、英語ロカールにすればよろしい。<pre># LANG=en_US.UTF-8 yum update Loaded plugins: fastestmirror, priorities, rhnplugin There was an error communicating with RHN. RHN Satellite or RHN Classic support will be disabled. Error communicating with server. The message was: No route to host Loading mirror speeds from cached hostfile * sl: ftp.ne.jp * sl-fastbugs: ftp.ne.jp * sl-security: ftp.ne.jp file://var/cache/yum/x86_64/6.1/my-soft-channel/repodata/repomd.xml: [Errno 14] Could not open/read file://var/cache/yum/x86_64/6.1/my-soft-channel/repodata/repomd.xml Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: my-soft-channel. Please verify its path and try again</pre>って、<a href="/?article= 12159347050">何だか deja-vu ...</a> Pythonista でないのでよく判らないのですが、Python デフォルトのエンコードは ascii なのかな? こんなことをすると UTF-8 になるみたいだけれど、本質的に間違っている気がする。<pre>cat << '_EOF_' > /usr/lib/python2.6/site-packages/utf8.py import sys sys.setdefaultencoding("UTF-8") _EOF_</pre>追記: ネット上を探した感じだと、sitecustomize.py という名前で上記対応をしている人が多いみたい。 Password