Skip to content

Commit 60e1b9d

Browse files
committed
bugfix: corrected XML parsing error
1 parent 7b3d62d commit 60e1b9d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

werobot/parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3+
import re
34
import xmltodict
45
from werobot.messages.messages import MessageMetaClass, UnknownMessage
56
from werobot.messages.events import EventMetaClass, UnknownEvent
@@ -11,7 +12,8 @@ def parse_user_msg(xml):
1112

1213

1314
def parse_xml(text):
14-
xml_dict = xmltodict.parse(text)["xml"]
15+
text_clean = re.sub(b'[\x00-\x1F]', b'', text)
16+
xml_dict = xmltodict.parse(text_clean)["xml"]
1517
xml_dict["raw"] = text
1618
return xml_dict
1719

0 commit comments

Comments
 (0)