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

Decode Error in asf.py on Open #127

Closed
lazka opened this issue Jul 4, 2014 · 6 comments
Closed

Decode Error in asf.py on Open #127

lazka opened this issue Jul 4, 2014 · 6 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Jul 4, 2014

Originally reported by: Christoph Reiter (Bitbucket: lazka, GitHub: lazka)


From jukow...@gmail.com on October 27, 2012 00:01:48

Python: 2.7 x64
Platform: Windows 7 x64

Hi,

I have a small (but significant) number of WMA files that are failing to open in Mutagen.

Below is the exact error, as thrown. I use Mutagen to query file runtimes. I suspect there may be something in a Metadata tag somewhere, but I have 'cleared' all tags using Windows 7 built-in option.

I am happy to send a copy of an offending file, I just didn't want to attach it publicly.

Kind regards,

Geoff



Error is as follows:

>>> a = File(r"d:\test.wma", easy=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\mutagen\__init__.py", line 215, in File
    if score > 0: return Kind(filename)
  File "C:\Python27\lib\site-packages\mutagen\__init__.py", line 73, in __init__
    self.load(filename, *args, **kwargs)
  File "C:\Python27\lib\site-packages\mutagen\asf.py", line 591, in load
    self.__read_file(fileobj)
  File "C:\Python27\lib\site-packages\mutagen\asf.py", line 671, in __read_file
    self.__read_object(fileobj)
  File "C:\Python27\lib\site-packages\mutagen\asf.py", line 680, in __read_object
    obj.parse(self, data, fileobj, size)
  File "C:\Python27\lib\site-packages\mutagen\asf.py", line 442, in parse
    attr = _attribute_types[value_type](data=value)
  File "C:\Python27\lib\site-packages\mutagen\asf.py", line 114, in __init__
    self.value = self.parse(data, **kwargs)
  File "C:\Python27\lib\site-packages\mutagen\asf.py", line 159, in parse
    return data.decode("utf-16-le").strip("\x00")
  File "C:\Python27\lib\encodings\utf_16_le.py", line 16, in decode
    return codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 10-11: illegal encoding

Original issue: http://code.google.com/p/mutagen/issues/detail?id=127


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From jukow...@gmail.com on October 26, 2012 15:20:16

Sent by eMail. Thank you for looking into this!
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on October 26, 2012 15:12:27

Please send me a file.
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on October 27, 2012 14:00:37

One UTF-16 value is null terminated in the middle of the value.

Possible offender: "Flip4Mac"
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on October 26, 2012 15:42:44

Status: Accepted
Labels: -Type-Enhancement Type-Defect

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on October 27, 2012 14:14:09

correction: not null terminated, just garbage
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Sep 24, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


asf: raise a proper exception on invalid utf-16. (Fixes issue #127)

@lazka lazka added trivial bug labels Apr 7, 2016
@lazka lazka closed this Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.