Browse code

fix put - s3:// (upload from stdin, #270)

https://github.com/s3tools/s3cmd/issues/270

Matt Domsch authored on 2014/01/21 04:26:13
Showing 2 changed files
... ...
@@ -190,6 +190,10 @@ def fetch_local_list(args, is_src = False, recursive = None):
190 190
                 'full_name' : '-',
191 191
                 'size' : -1,
192 192
                 'mtime' : -1,
193
+                'uid' : os.geteuid(),
194
+                'gid' : os.getegid(),
195
+                'dev' : 0,
196
+                'inode': 0,
193 197
             }
194 198
             return loc_list, True
195 199
         if local_uri.isdir():
... ...
@@ -1048,8 +1048,12 @@ def _build_attr_header(local_list, src):
1048 1048
             except IOError:
1049 1049
                 val = None
1050 1050
         else:
1051
-            val = getattr(local_list[src]['sr'], 'st_' + attr)
1052
-        attrs[attr] = val
1051
+            try:
1052
+                val = getattr(local_list[src]['sr'], 'st_' + attr)
1053
+            except:
1054
+                val = None
1055
+        if val is not None:
1056
+            attrs[attr] = val
1053 1057
 
1054 1058
     if 'md5' in attrs and attrs['md5'] is None:
1055 1059
         del attrs['md5']