[pp:metadata] ignore non-string tag values (#4764)

pull/4022/merge
Mike Fährmann 11 months ago
parent 61d6558322
commit 6402f2950f
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -189,7 +189,7 @@ class MetadataPP(PostProcessor):
tags = []
extend = tags.extend
for tagdict in taglists:
extend([x for x in tagdict.values() if x is not None])
extend([x for x in tagdict.values() if isinstance(x, str)])
tags.sort()
fp.write("\n".join(tags) + "\n")

@ -365,8 +365,8 @@ class MetadataTest(BasePostprocessorTest):
self._create(
{"mode": "tags"},
{"tags": [
{"g": "foobar1", "m": "foobar2"},
{"g": None, "m": "foobarbaz"}
{"g": "foobar1", "m": "foobar2", "u": True},
{"g": None, "m": "foobarbaz", "u": [3, 4]},
]},
)
with patch("builtins.open", mock_open()) as m:

Loading…
Cancel
Save