leosongwei / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

Decode Error in asf.py on Open #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by jukow...@gmail.com on 26 Oct 2012 at 10:01

GoogleCodeExporter commented 9 years ago
Please send me a file.

Original comment by reiter.christoph@gmail.com on 26 Oct 2012 at 10:12

GoogleCodeExporter commented 9 years ago
Sent by eMail. Thank you for looking into this!

Original comment by jukow...@gmail.com on 26 Oct 2012 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by reiter.christoph@gmail.com on 26 Oct 2012 at 10:42

GoogleCodeExporter commented 9 years ago
One UTF-16 value is null terminated in the middle of the value.

Possible offender: "Flip4Mac"

Original comment by reiter.christoph@gmail.com on 27 Oct 2012 at 9:00

GoogleCodeExporter commented 9 years ago
correction: not null terminated, just garbage

Original comment by reiter.christoph@gmail.com on 27 Oct 2012 at 9:14

GoogleCodeExporter commented 9 years ago
mutagen has moved to Bitbucket: https://bitbucket.org/lazka/mutagen/issue/127

Original comment by reiter.christoph@gmail.com on 4 Jul 2014 at 3:37