vstinner / hachoir

Hachoir is a Python library to view and edit a binary stream field by field
http://hachoir.readthedocs.io/
GNU General Public License v2.0
613 stars 70 forks source link

Parse FLAC file failed #57

Open mengyyy opened 4 years ago

mengyyy commented 4 years ago

Ubuntu 16.04 Python 3.8

Flac file: https://files.catbox.moe/gafg3k.flac file_hash: 138ae53711c6ec55ee88c9e8f54c846e469649c1bc16d5011786b1d70d143828

In [21]: with hachoir.parser.createParser("./gafg3k.flac") as parser:
    ...:      result = hachoir.metadata.extractMetadata(parser)
    ...:

[warn] [/metadata] Duplicate field name Key 'stream_info' already exists
...
...
...
[warn] [/metadata] Duplicate field name Key 'stream_info' already exists---------------------------------------------------------------------------
UniqKeyError                              Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/hachoir/field/generic_field_set.py in _addField(self, field)
    193         try:
--> 194             self._fields.append(field._name, field)
    195         except UniqKeyError as err:

/usr/local/lib/python3.8/dist-packages/hachoir/core/dict.py in append(self, key, value)
     66         if key in self._index:
---> 67             raise UniqKeyError("Key '%s' already exists" % key)
     68         self._index[key] = len(self._value_list)^C

UniqKeyError: Key 'stream_info' already exists

During handling of the above exception, another exception occurred:

KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-21-a7157485c236> in <module>
      1 with hachoir.parser.createParser("./gafg3k.flac") as parser:
----> 2      result = hachoir.metadata.extractMetadata

eyboardInterrupt