2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

s3cmdがエラーが出てしまう件のその場しのぎ対応

2
Last updated at Posted at 2014-12-19

何かmacのdefaultの文字エンコードがx-mac-japaneseにpython2.6が対応してないぽい。
叩いたらこんなエラー出る

$ s3cmd --configure
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please report the following lines to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Problem: LookupError: unknown encoding: x-mac-japanese
S3cmd:   1.0.1

Traceback (most recent call last):
  File "/usr/local/bin/s3cmd", line 2007, in <module>
    main()
  File "/usr/local/bin/s3cmd", line 1889, in main
    sys.stdout = codecs.getwriter(cfg.encoding)(sys.stdout, "replace")
  File "/usr/local/opt/pyenv/versions/inblue/lib/python2.6/codecs.py", line 994, in getwriter
    return lookup(encoding).streamwriter
LookupError: unknown encoding: x-mac-japanese

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
    Please report the above lines to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

あくまでもその場しのぎの対応ですので後々自分でどうにかしてください

強制的に直しちゃった

/usr/local/bin/s3cmd line 1889 周辺

1887     ## Set output and filesystem encoding for printing out filenames.
1888 +    cfg.encoding = "UTF-8"
1889     sys.stdout = codecs.getwriter(cfg.encoding)(sys.stdout, "replace")
1890     sys.stderr = codecs.getwriter(cfg.encoding)(sys.stderr, "replace")

pythonをコンパイルし直すのとか辛いのでこんな解決策。
コンパイルし直す方法は下のURLとかに載ってます。

もっといい方法をご存知の方がおりましたら是非教えて下さいませmm

参考

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?