diff options
author | toonn <toonn@toonn.io> | 2019-09-26 11:51:12 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2019-09-26 11:51:12 +0200 |
commit | 4a2281cb2595413a04c82ca9b9725cf22cee90d6 (patch) | |
tree | aab633cc16a59499f48551af121ce450e7472af2 /ranger | |
parent | fcb01c2c941b8a199627f99173eb31925a30ce47 (diff) | |
download | ranger-4a2281cb2595413a04c82ca9b9725cf22cee90d6.tar.gz |
Pass surrogates when listing files for bulkrename
Surrogates aren't allowed in the UTF-8 encoding but filenames can contain any bytes. We need to pass the surrogates literally because otherwise `mv` won't be renaming the right files.
Diffstat (limited to 'ranger')
-rwxr-xr-x | ranger/config/commands.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 55dd9cd1..94921f8b 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1078,7 +1078,8 @@ class bulkrename(Command): listpath = listfile.name if py3: - listfile.write("\n".join(filenames).encode("utf-8")) + listfile.write("\n".join(filenames).encode(encoding="utf-8", + errors="surrogatepass")) else: listfile.write("\n".join(filenames)) listfile.close() |