diff --git a/ncdu_s3/s3_directory_generator.py b/ncdu_s3/s3_directory_generator.py index 1a3a04c..ac19cc3 100644 --- a/ncdu_s3/s3_directory_generator.py +++ b/ncdu_s3/s3_directory_generator.py @@ -16,6 +16,10 @@ def __init__(self, s3_url): try: client = boto3.client('s3') region = client.get_bucket_location(Bucket=self.bucket_name)['LocationConstraint'] + if region == 'EU': + # for the eu-west-1 region, location constraint may either be 'EU' or 'eu-west-1' + # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + region = 'eu-west-1' except: region=None