rplエラー "TypeError:encode()引数1はNoneではなくstrでなければなりません。"

rplエラー

他のツールを使用する必要があるかもしれませんが、rplは常にこのように動作しました。

rpl -Ris "oldname.com" "newname.com" *

(気になる場合はR =再帰、i =大文字と小文字を無視、s =ドライランシミュレーション)

エラーは...

The files listed below would be modified in a replace operation.
Traceback (most recent call last):
  File "/usr/bin/rpl", line 314, in <module>
main()
  File "/usr/bin/rpl", line 246, in main
matches = blockrepl(f, o, regex, old_str, new_str, 1024)
  File "/usr/bin/rpl", line 92, in blockrepl
parts = (after.join(parts)).encode(encoding=encoding, errors='ignore')
TypeError: encode() argument 1 must be str, not None

ベストアンサー1

ロケールライブラリがデフォルトのロケールを見つけることができず、失敗します。LANGデフォルトのロケールは環境変数ですexport LANG=en_US.utf-8

おすすめ記事