[pp:metadata] ignore non-string tag values (#4764)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user