1

Maybe I should use a different tool, but rpl has always worked for me like this...

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

(If you're wondering, R = recursive, i = ignore case, s = dry-run simulation)

The error is...

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
0

locale library isn't able to find the default locale and hence failing. The issue can be fixed by setting the LANG environment variable to set the default locale like export LANG=en_US.utf-8.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.