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

'utf-8' codec can't decode byte 0xff in position 0: invalid start byte #554

Open
Mte90 opened this issue Sep 16, 2021 · 3 comments
Open

Comments

@Mte90
Copy link

Mte90 commented Sep 16, 2021

Ticket migrated from nicfit/MishMash#810 that is of this library

ERROR:mishmash:'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/mishmash/__main__.py", line 55, in main
    retval = args.command_func(args) or 0
  File "/usr/local/lib/python3.9/dist-packages/mishmash/core.py", line 37, in run
    retval = super().run(args)
  File "/usr/local/lib/python3.9/dist-packages/nicfit/command.py", line 93, in run
    return self._run()
  File "/usr/local/lib/python3.9/dist-packages/mishmash/commands/sync/sync.py", line 504, in _run
    result = _syncLib(lib)
  File "/usr/local/lib/python3.9/dist-packages/mishmash/commands/sync/sync.py", line 497, in _syncLib
    return eyed3_main(args, None)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/main.py", line 41, in main
    eyed3.utils.walk(args.plugin, p, excludes=args.excludes, fs_encoding=args.fs_encoding,
  File "/usr/local/lib/python3.9/dist-packages/eyed3/utils/__init__.py", line 88, in walk
    handler.handleFile(f)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/plugins/__init__.py", line 172, in handleFile
    self.audio_file = core.load(f, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/core.py", line 442, in load
    return mp3.Mp3AudioFile(path, tag_version)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/mp3/__init__.py", line 145, in __init__
    super().__init__(path)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/core.py", line 231, in __init__
    self._read()
  File "/usr/local/lib/python3.9/dist-packages/eyed3/mp3/__init__.py", line 151, in _read
    tag_found = self._tag.parse(file_obj, self._tag_version)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/tag.py", line 99, in parse
    tag_found, padding = self._loadV2Tag(fileobj)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/tag.py", line 131, in _loadV2Tag
    padding = self.frame_set.parse(fp, self.header,
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 1788, in parse
    frame = createFrame(tag_header, frame_header, data)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 1888, in createFrame
    frame.parse(data, frame_header)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 611, in parse
    self.description = decodeUnicode(desc, encoding)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 1904, in decodeUnicode
    return str(bites, codec).rstrip("\x00")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
General error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/mishmash/__main__.py", line 55, in main
    retval = args.command_func(args) or 0
  File "/usr/local/lib/python3.9/dist-packages/mishmash/core.py", line 37, in run
    retval = super().run(args)
  File "/usr/local/lib/python3.9/dist-packages/nicfit/command.py", line 93, in run
    return self._run()
  File "/usr/local/lib/python3.9/dist-packages/mishmash/commands/sync/sync.py", line 504, in _run
    result = _syncLib(lib)
  File "/usr/local/lib/python3.9/dist-packages/mishmash/commands/sync/sync.py", line 497, in _syncLib
    return eyed3_main(args, None)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/main.py", line 41, in main
    eyed3.utils.walk(args.plugin, p, excludes=args.excludes, fs_encoding=args.fs_encoding,
  File "/usr/local/lib/python3.9/dist-packages/eyed3/utils/__init__.py", line 88, in walk
    handler.handleFile(f)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/plugins/__init__.py", line 172, in handleFile
    self.audio_file = core.load(f, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/core.py", line 442, in load
    return mp3.Mp3AudioFile(path, tag_version)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/mp3/__init__.py", line 145, in __init__
    super().__init__(path)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/core.py", line 231, in __init__
    self._read()
  File "/usr/local/lib/python3.9/dist-packages/eyed3/mp3/__init__.py", line 151, in _read
    tag_found = self._tag.parse(file_obj, self._tag_version)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/tag.py", line 99, in parse
    tag_found, padding = self._loadV2Tag(fileobj)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/tag.py", line 131, in _loadV2Tag
    padding = self.frame_set.parse(fp, self.header,
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 1788, in parse
    frame = createFrame(tag_header, frame_header, data)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 1888, in createFrame
    frame.parse(data, frame_header)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 611, in parse
    self.description = decodeUnicode(desc, encoding)
  File "/usr/local/lib/python3.9/dist-packages/eyed3/id3/frames.py", line 1904, in decodeUnicode
    return str(bites, codec).rstrip("\x00")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
@coofercat
Copy link

I have no idea if this is you problem or not, but this looks like the file wasn't opened in binary mode (ie. it was opened with "r" instead of "rb").

@Mte90
Copy link
Author

Mte90 commented Apr 4, 2022

I was facing this issue (I am not using this tool since months) so I have no idea...

@hardfau1t
Copy link

I faced same problem, it seems like it is specific to some Files, converted the file to wav and converted back to mp3 resolved this issue

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

3 participants