Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'group' #12

Open
wodim opened this issue Jun 18, 2020 · 5 comments
Open

AttributeError: 'NoneType' object has no attribute 'group' #12

wodim opened this issue Jun 18, 2020 · 5 comments

Comments

@wodim
Copy link

wodim commented Jun 18, 2020

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'
@ohnekopf
Copy link

i have pretty much the same issue on ubuntu. thanfully i can still edit tags, it's just get_tags that doesn't work

@TheBengineer
Copy link

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.

@TheBengineer
Copy link

Added a pull here:
#13

@kk-hiraskar
Copy link

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.

@kk-hiraskar
Copy link

Already issue is fixed and committed: fix diff

please release it on https://pypi.org/project/mp3-tagger/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants