Merge branch '8784-dir-listings'
[arvados.git] / sdk / python / arvados / collection.py
index 5008450eded4c9414044115ebad7b42c619cbcdf..77312e4d4917a276f00b46e90e13ab13ba0d5ac4 100644 (file)
@@ -360,7 +360,7 @@ class CollectionWriter(CollectionBase):
 
     def portable_data_hash(self):
         stripped = self.stripped_manifest().encode()
-        return hashlib.md5(stripped).hexdigest() + '+' + str(len(stripped))
+        return '{}+{}'.format(hashlib.md5(stripped).hexdigest(), len(stripped))
 
     def manifest_text(self):
         self.finish_current_stream()
@@ -725,7 +725,7 @@ class RichCollectionBase(CollectionBase):
     @synchronized
     def keys(self):
         """Get a list of names of files and collections directly contained in this collection."""
-        return viewkeys(self._items)
+        return self._items.keys()
 
     @synchronized
     def values(self):
@@ -1085,7 +1085,7 @@ class RichCollectionBase(CollectionBase):
             return self._portable_data_hash
         else:
             stripped = self.portable_manifest_text().encode()
-            return hashlib.md5(stripped).hexdigest() + '+' + str(len(stripped))
+            return '{}+{}'.format(hashlib.md5(stripped).hexdigest(), len(stripped))
 
     @synchronized
     def subscribe(self, callback):