diff --git a/moto/s3/responses.py b/moto/s3/responses.py index d9dc5ad77..cf1044953 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -1923,7 +1923,7 @@ class S3Response(BaseResponse): tags = {} for tag in parsed_xml["Tagging"]["TagSet"]["Tag"]: - tags[tag["Key"]] = tag["Value"] + tags[tag["Key"]] = tag["Value"] or "" return tags diff --git a/tests/test_s3/test_s3_tagging.py b/tests/test_s3/test_s3_tagging.py index f6e6236bd..dc85e41b1 100644 --- a/tests/test_s3/test_s3_tagging.py +++ b/tests/test_s3/test_s3_tagging.py @@ -69,6 +69,7 @@ def test_put_bucket_tagging(): "TagSet": [ {"Key": "TagOne", "Value": "ValueOne"}, {"Key": "TagTwo", "Value": "ValueTwo"}, + {"Key": "TagThree", "Value": ""}, ] }, ) @@ -222,6 +223,7 @@ def test_put_object_tagging(): "TagSet": [ {"Key": "item1", "Value": "foo"}, {"Key": "item2", "Value": "bar"}, + {"Key": "item3", "Value": ""}, ] }, )