Fix fs._sanitize bug
authorJakob <jakob@jcornell.net>
Mon, 9 Dec 2019 21:26:46 +0000 (15:26 -0600)
committerJakob <jakob@jcornell.net>
Mon, 9 Dec 2019 21:26:46 +0000 (15:26 -0600)
fs.py

diff --git a/fs.py b/fs.py
index 9046573f1c558e2af8804189573fa8905e241aff..d29bae813d73991951f2eccbd88ce3bda928f690 100644 (file)
--- a/fs.py
+++ b/fs.py
@@ -135,7 +135,7 @@ def get_child_versions(path):
 # https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file
 def _sanitize(seg):
        bad = {*map(chr, range(0, 31 + 1)), *r'<>:"/\|?*'}
-       return seg.translate({ch: '!' for ch in bad})
+       return seg.translate({ord(ch): '!' for ch in bad})
 
 
 def join_content_path(path, content_doc):