Skip to content

Commit fd2553e

Browse files
committed
profile: ignore leading slashes in <description_file> field
Some versions of XBee Studio create .xpro files where the `<description_file>` field has a leading slash (such as `/XB3-24Z/XB3-24Z_1013-th.xml`). Python's `zipfile` library does not normalize paths like `radio_fw//XB3-24Z/XB3-24Z_1013-th.xml`, and so any such .xpro file is treated as unparseable. https://onedigi.atlassian.net/browse/XBPL-432
1 parent cb577cf commit fd2553e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

digi/xbee/profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ def _parse_xml_profile_file(self, zip_file):
894894
if fw_xml_file_element is None:
895895
self._throw_read_exception(_ERROR_PROFILE_XML_INVALID
896896
% "missing firmware file element")
897-
self._fw_xml_filename = fw_xml_file_element.text
897+
self._fw_xml_filename = fw_xml_file_element.text.lstrip("/")
898898
# Store XML firmware file name.
899899
self._fw_xml_file = _FW_DIR_NAME + "/" + self._fw_xml_filename
900900
_log.debug(" - XML firmware file: %s", self._fw_xml_file)

0 commit comments

Comments
 (0)