Skip to content

Commit

Permalink
Merge pull request #624 from mahtin/issue617-NoneType-object-has-no-a…
Browse files Browse the repository at this point in the history
…ttribute-proto

unicode support added to correct issue617
  • Loading branch information
KimiNewt authored Apr 26, 2023
2 parents ec6e38e + 9d8dc42 commit a32e361
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pyshark/tshark/output_parser/tshark_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def packet_from_xml_packet(xml_pkt, psml_structure=None):
:return: Packet object.
"""
if not isinstance(xml_pkt, lxml.objectify.ObjectifiedElement):
parser = lxml.objectify.makeparser(huge_tree=True, recover=True)
parser = lxml.objectify.makeparser(huge_tree=True, recover=True, encoding='utf-8')
xml_pkt = xml_pkt.decode(errors='ignore').translate(DEL_BAD_XML_CHARS)
xml_pkt = lxml.objectify.fromstring(xml_pkt, parser)
xml_pkt = lxml.objectify.fromstring(xml_pkt.encode('utf-8'), parser)
if psml_structure:
return _packet_from_psml_packet(xml_pkt, psml_structure)
return _packet_from_pdml_packet(xml_pkt)
Expand Down

0 comments on commit a32e361

Please sign in to comment.