Browse files

FIX: filename sanitizing not remove backslash

Lesson learned: Regular expression and Python both uses backslash to
escape. So to match a backslash, you should specify '\\\\' so the
regular expression would become '\\' which matches a backslash itself.
  • Loading branch information...
timothyqiu committed Feb 27, 2013
1 parent cee4d0a commit 18817b0646e5e81fd75a9b55ec3a94e8e1f2dd1f
Showing with 1 addition and 1 deletion.
  1. +1 −1
@@ -84,7 +84,7 @@ def decode_location(location):
def sanitize_filename(filename):
return re.sub('[\/:*?<>|]', '_', filename)
return re.sub(r'[\\/:*?<>|]', '_', filename)
def usage():

0 comments on commit 18817b0

Please sign in to comment.