Browse code

Fixes #967 - In addition with patch for #960, ensure that error logging with not crash

As in python3 errno can be "None" with system raised exceptions, ensure
that this case will not make s3cmd crash just for an error log output.

Florent Viard authored on 2018/06/04 09:02:48
Showing 1 changed files
... ...
@@ -1349,7 +1349,7 @@ def cmd_sync_remote2local(args):
1349 1349
                     error(u"Download of '%s' failed (Reason: No space left)" % file)
1350 1350
                     allow_partial = False
1351 1351
                 else:
1352
-                    error(u"Download of '%s' failed (Reason: Unknown OsError %d)" % (file, exc.errno))
1352
+                    error(u"Download of '%s' failed (Reason: Unknown OsError %d)" % (file, exc.errno or 0))
1353 1353
                     allow_partial = False
1354 1354
 
1355 1355
                 try: