title: NoSuchBucket error sometimes occurs when looping through all S3 buckets
body: <p>I have written some code meant to loop through all S3 buckets and print each bucket's account, name, and versioning status. This code worked when I ran it yesterday with no errors. Today, it gave me a BucketNotFound error when it reached some bucket. I hadn't changed the code at all except to make the .csv file it outputs to appended instead of overwritten.</p>
  
  <pre><code>def main(access_key, access_secret):
      session = boto3.Session(
          aws_access_key_id=access_key,
          aws_secret_access_key=access_secret,
          )
      s3resource = session.resource('s3')
      account = session.client('iam').list_account_aliases()['AccountAliases'][0]
      with open('Buckets with Versioning Enabled.csv', 'a') as output:
          writer = csv.writer(output)
          writer.writerow(['Account', 'Bucket', 'Versioning'])
          for bucket in s3resource.buckets.all():
              response = s3resource.BucketVersioning(bucket.name).status
              if response is None:
                  versioning = "Disabled"
              else:
                  versioning = response
              print("Account: " + account + " | Bucket: " + bucket.name + " | Versioning: " + versioning)
              writer.writerow([account, bucket.name, versioning])
  </code></pre>
  
  <p>Can anyone advise me about why this code might selectively throw such an error? This code needs to work reliably. It takes a long time to run this code due to the number of buckets it must check, and it would be frustrating to have to run it multiple times until this error doesn't occur. Here is the exception:</p>
  
  <pre><code>botocore.errorfactory.NoSuchBucket: An error occurred (NoSuchBucket) when calling the GetBucketVersioning operation: The specified bucket does not exist
  </code></pre>