Browse code

Small cleanup of _build_attr_header

Florent Viard authored on 2020/04/17 03:30:42
Showing 1 changed files
... ...
@@ -1633,13 +1633,14 @@ def _build_attr_header(local_list, src):
1633 1633
             pass
1634 1634
 
1635 1635
     if attrs:
1636
-        result = ""
1636
+        attr_str_list = []
1637 1637
         for k in sorted(attrs.keys()):
1638
-            result += "%s:%s/" % (k, attrs[k])
1639
-        return {'x-amz-meta-s3cmd-attrs' : result[:-1]}
1638
+            attr_str_list.append(u"%s:%s" % (k, attrs[k]))
1639
+        attr_header = {'x-amz-meta-s3cmd-attrs': u'/'.join(attr_str_list)}
1640 1640
     else:
1641
-        return {}
1641
+        attr_header = {}
1642 1642
 
1643
+    return attr_header
1643 1644
 
1644 1645
 def cmd_sync_local2remote(args):
1645 1646
     cfg = Config()