OSX 10.5でcaty-consoleが動かない件への対処法
def __init__(self): #, encoding): self.encoding = locale.getpreferredencoding() if self.encoding == 'X-MAC-JAPANESE': self.encoding = 'ascii' self.out = codecs.getwriter(self.encoding)(sys.stdout) self.input = codecs.getwriter(self.encoding)(sys.stdin)
$CATY_HOME/python/caty/shell/system.py です。Python on OSXではよく起こる問題らしい(google:LookupError unknown encoding X-MAC-JAPANESEを参照)。エラー内容は:
$ python caty-console.py Traceback (most recent call last): File "caty-console.py", line 9, in <module> caty.shell.console.main() File "./python/caty/shell/console.py", line 140, in main CatyShell(site, wildcat).cmdloop() File "./python/caty/shell/console.py", line 19, in __init__ stream = StreamWrapper(StdStream()) File "./python/caty/shell/system.py", line 17, in __init__ self.out = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/codecs.py", line 978, in getwriter return lookup(encoding).streamwriter LookupError: unknown encoding: X-MAC-JAPANESE
ということで、Catyスクリプト試し中...