Skip to content

Commit

Permalink
add fix to split to handle an equal sign in the filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWheelerMT committed Dec 11, 2024
1 parent 87b87bf commit 70512f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mhs/common/mhs_common/messages/ebxml_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def parse_external_attachments(xml_tree: Element) -> Dict[str, str]:

filename = None
print(variables)
description_variables = dict(pair.split("=") for pair in variables)
description_variables = dict(pair.split("=", 1) for pair in variables)
if "Filename" in description_variables:
filename = description_variables["Filename"].replace('\\', '')

Expand Down
4 changes: 1 addition & 3 deletions mhs/common/mhs_common/messages/tests/test_ebxml_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@ def test_filename_contains_equals_sign(self):
)
xml_tree = ElementTree.fromstring(message)

external_attachments = ebxml_envelope.EbxmlEnvelope.parse_external_attachments(xml_tree)
print("MartinTest")
print(external_attachments.keys())
external_attachments = ebxml_envelope.EbxmlEnvelope.parse_external_attachments(xml_tree)["external_attachments"]
self.assertEqual(external_attachments, {})

0 comments on commit 70512f1

Please sign in to comment.