rpl 오류 "TypeError: encode() 인수 1은 None이 아니라 str이어야 합니다."

rpl 오류 "TypeError: encode() 인수 1은 None이 아니라 str이어야 합니다."

다른 도구를 사용해야 할 수도 있지만 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.

관련 정보