mp3-tagger
mp3-tagger copied to clipboard
AttributeError: 'NoneType' object has no attribute 'group'
When using get_tags
on this mp3 file.
GB89-128 Voodoo Ray - A Guy Called Gerald.zip
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\mp3_tagger\id3.py", line 178, in _unpack_bytes
val = int(val)
ValueError: invalid literal for int() with base 10: ''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "sorter.py", line 41, in <module>
mp3s[file] = mp3.get_tags()
File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\mp3_tagger\mp3.py", line 141, in get_tags
tmp_dict[tag.title] = tag.value
File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\mp3_tagger\id3.py", line 40, in value
val = self._unpack_bytes()
File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\mp3_tagger\id3.py", line 183, in _unpack_bytes
val = int(re.search(r'\d+', val).group(0))
AttributeError: 'NoneType' object has no attribute 'group'
i have pretty much the same issue on ubuntu. thanfully i can still edit tags, it's just get_tags
that doesn't work
Change line 176 in id3.py from
if self.title == 'genre':
to
if self.title == 'genre' and len(val):
It's crashing when val is empty.
Added a pull here: https://github.com/artcom-net/mp3-tagger/pull/13
Change line 176 in id3.py from
if self.title == 'genre':
to
if self.title == 'genre' and len(val):
It's crashing when val is empty.
This will handle only if genre is empty.. what about if it is having string instead of integer?
I am having many mp3 files, where genre is with some other strings.
Already issue is fixed and committed: fix diff
please release it on https://pypi.org/project/mp3-tagger/