From cd754cc018c1e51690fbf7fc9141cea4cab9a272 Mon Sep 17 00:00:00 2001 From: Zimri Leisher Date: Tue, 7 Jan 2025 09:19:35 -0600 Subject: [PATCH 1/2] Add fix for xml entities not working --- Autocoders/Python/bin/tlm_packet_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autocoders/Python/bin/tlm_packet_gen.py b/Autocoders/Python/bin/tlm_packet_gen.py index 2502afe564..8b40b2bfae 100755 --- a/Autocoders/Python/bin/tlm_packet_gen.py +++ b/Autocoders/Python/bin/tlm_packet_gen.py @@ -260,7 +260,7 @@ def gen_packet_file(self, xml_filename): raise TlmPacketParseIOError("File %s does not exist!" % xml_filename) fd = open(xml_filename, "r") - xml_parser = etree.XMLParser(remove_comments=True) + xml_parser = etree.XMLParser(remove_comments=True, load_dtd=True, resolve_entities=True, no_network=True) element_tree = etree.parse(fd, parser=xml_parser) channel_size_dict = None From 03dbe5ad3e1dad10c03c1b69129d7882e1133168 Mon Sep 17 00:00:00 2001 From: M Starch Date: Tue, 7 Jan 2025 09:29:30 -0800 Subject: [PATCH 2/2] Fixing formatting --- Autocoders/Python/bin/tlm_packet_gen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Autocoders/Python/bin/tlm_packet_gen.py b/Autocoders/Python/bin/tlm_packet_gen.py index 8b40b2bfae..206d81d2c4 100755 --- a/Autocoders/Python/bin/tlm_packet_gen.py +++ b/Autocoders/Python/bin/tlm_packet_gen.py @@ -260,7 +260,9 @@ def gen_packet_file(self, xml_filename): raise TlmPacketParseIOError("File %s does not exist!" % xml_filename) fd = open(xml_filename, "r") - xml_parser = etree.XMLParser(remove_comments=True, load_dtd=True, resolve_entities=True, no_network=True) + xml_parser = etree.XMLParser( + remove_comments=True, load_dtd=True, resolve_entities=True, no_network=True + ) element_tree = etree.parse(fd, parser=xml_parser) channel_size_dict = None