mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2026-01-02 01:40:42 +00:00
Removed premature decoding of iXML bytes
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
import io
|
||||||
|
|
||||||
class WavIXMLFormat:
|
class WavIXMLFormat:
|
||||||
"""
|
"""
|
||||||
@@ -6,7 +7,8 @@ class WavIXMLFormat:
|
|||||||
"""
|
"""
|
||||||
def __init__(self, xml):
|
def __init__(self, xml):
|
||||||
self.source = xml
|
self.source = xml
|
||||||
self.parsed = ET.fromstring(xml)
|
xmlBytes = io.BytesIO(xml)
|
||||||
|
self.parsed = ET.parse(xmlBytes)
|
||||||
|
|
||||||
def _get_text_value(self, xpath):
|
def _get_text_value(self, xpath):
|
||||||
e = self.parsed.find("./" + xpath)
|
e = self.parsed.find("./" + xpath)
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class WavInfoReader():
|
|||||||
if ixml_data is None:
|
if ixml_data is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
ixml_string = ixml_data.decode('utf-8')
|
ixml_string = ixml_data
|
||||||
return WavIXMLFormat(ixml_string)
|
return WavIXMLFormat(ixml_string)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user