Browse Source

Handle broken pipe on stdout

master
JustAnotherArchivist 4 years ago
parent
commit
5c907488e1
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      s3-bucket-list

+ 4
- 1
s3-bucket-list View File

@@ -96,7 +96,10 @@ while True:

size = int(fields['Size']) if 'Size' in fields else None

print(format.format(**fields, key = key, url = url, size = size))
try:
print(format.format(**fields, key = key, url = url, size = size))
except BrokenPipeError:
sys.exit(0)
lastKey = key

truncated = True if b'<IsTruncated>true</IsTruncated>' in body else (False if b'<IsTruncated>false</IsTruncated>' in body else None)


Loading…
Cancel
Save