mirror of
https://github.com/fergalmoran/picard.git
synced 2026-05-20 01:46:07 +00:00
vorbis: empty string is not a valid Vorbis comment key
This commit is contained in:
@@ -72,7 +72,7 @@ def is_valid_key(key):
|
||||
Valid characters for Vorbis comment field names are
|
||||
ASCII 0x20 through 0x7D, 0x3D ('=') excluded.
|
||||
"""
|
||||
return INVALID_CHARS.search(key) is None
|
||||
return key and INVALID_CHARS.search(key) is None
|
||||
|
||||
|
||||
def flac_sort_pics_after_tags(metadata_blocks):
|
||||
|
||||
@@ -67,6 +67,7 @@ VALID_KEYS = [
|
||||
]
|
||||
|
||||
INVALID_KEYS = [
|
||||
'',
|
||||
'invalid=key',
|
||||
'invalid\x19key',
|
||||
'invalid~key',
|
||||
@@ -91,7 +92,7 @@ class CommonVorbisTests:
|
||||
supports_tag = self.format.supports_tag
|
||||
for key in VALID_KEYS + list(TAGS.keys()):
|
||||
self.assertTrue(supports_tag(key), '%r should be supported' % key)
|
||||
for key in INVALID_KEYS + ['']:
|
||||
for key in INVALID_KEYS:
|
||||
self.assertFalse(supports_tag(key), '%r should be unsupported' % key)
|
||||
|
||||
@skipUnlessTestfile
|
||||
|
||||
Reference in New Issue
Block a user