14539: Simplifies a bit further the regexp replacement on escape() function.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 17 Jan 2019 09:55:40 +0000 (06:55 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 17 Jan 2019 09:55:40 +0000 (06:55 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

sdk/python/arvados/_normalize_stream.py

index 2619ba5086afed1ee918b089b496ac296f5c159e..b579d41ed2839b73fa72c6486101abe97e46a0cc 100644 (file)
@@ -8,9 +8,8 @@ from . import config
 import re
 
 def escape(path):
-    # Escape literal backslash
     path = re.sub('\\\\', lambda m: '\\134', path)
-    path = re.sub('([:\000-\040])', lambda m: "\\%03o" % ord(m.group(1)), path)
+    path = re.sub('[:\000-\040]', lambda m: "\\%03o" % ord(m.group(0)), path)
     return path
 
 def normalize_stream(stream_name, stream):