+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from __future__ import absolute_import
+from . import config
+
+import re
+
+def escape(path):
+ return re.sub(r'[\\:\000-\040]', lambda m: "\\%03o" % ord(m.group(0)), path)