[ARVADOS] updated: 1.3.0-156-ga974fc22e

Git user git at public.curoverse.com
Wed Jan 16 17:36:29 EST 2019


Summary of changes:
 sdk/python/arvados/_normalize_stream.py | 3 ++-
 sdk/python/tests/test_collections.py    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

       via  a974fc22eeef0c417eb9f41bda556baa89a5ea68 (commit)
      from  8b2eb7d1fa47e4a691849a485573c5da79bb1e2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a974fc22eeef0c417eb9f41bda556baa89a5ea68
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Wed Jan 16 19:34:34 2019 -0300

    14539: Fixes and simplifies the escape() function. Updates test.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/sdk/python/arvados/_normalize_stream.py b/sdk/python/arvados/_normalize_stream.py
index a119da238..9b29e8804 100644
--- a/sdk/python/arvados/_normalize_stream.py
+++ b/sdk/python/arvados/_normalize_stream.py
@@ -12,7 +12,8 @@ def escape(path):
     path = re.sub('\\\\', lambda m: '\\134', path)
     # Escape other special chars. Py3's oct() output differs from Py2, this takes
     # care of those differences.
-    path = re.sub('([\t\n\r: ])', lambda m: '\\'+oct(ord(m.group(1))).replace('o', '')[-3:], path)
+    path = re.sub(
+        '([:\000-\040])', lambda m: "\\%03o" % ord(m.group(1)), path)
     return path
 
 def normalize_stream(stream_name, stream):
diff --git a/sdk/python/tests/test_collections.py b/sdk/python/tests/test_collections.py
index 91d1797d0..66f062c16 100644
--- a/sdk/python/tests/test_collections.py
+++ b/sdk/python/tests/test_collections.py
@@ -960,6 +960,7 @@ class NewCollectionTestCase(unittest.TestCase, CollectionTestMixin):
 
     def test_other_special_chars_on_file_token(self):
         cases = [
+            ('\\000', '\0'),
             ('\\011', '\t'),
             ('\\012', '\n'),
             ('\\072', ':'),

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list