-
Notifications
You must be signed in to change notification settings - Fork 95
Using os.path.join() is not good for zipfile paths #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found this statement to back up my findings:
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
So using os.path is the wrong thing for zip files |
The path separator in a zip file MUST always be '/'. From the spec (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT): 4.4.17 file name: (Variable) 4.4.17.1 The name of the file, with optional relative path. The path stored MUST NOT contain a drive or device letter, or a leading slash. All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' for compatibility with Amiga and UNIX file systems etc. If input came from standard input, there is no file name field. #247 Signed-off-by: Tatiana Leon <[email protected]>
Thanks for reporting, @DavePlater. This issue is fixed in master (see commit f2d9225) and will be included in the next release. In the meantime, you can download the source code from the master branch and install the library from there (see instructions at https://github.com/digidotcom/python-xbee/blob/master/README.rst#install-from-source). Sorry for the inconvenience. Best regards. |
The path separator in a zip file MUST always be '/'. From the spec (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT): 4.4.17 file name: (Variable) 4.4.17.1 The name of the file, with optional relative path. The path stored MUST NOT contain a drive or device letter, or a leading slash. All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' for compatibility with Amiga and UNIX file systems etc. If input came from standard input, there is no file name field. Related to commit f2d9225 While on it, fix the 'ReadXBeeProfileSample' sample. #247 #256 Signed-off-by: Tatiana Leon <[email protected]>
xbee-python/digi/xbee/profile.py
Line 893 in 2016bfb
(Trying to use the library on windows)
Using os.join() results in funky paths like
'radio_fw\\\\XB3-24A/XB3-24A_2003-th.xml'
which cannot be found and throw exceptions.For looking at zipfile contents, i think you need to force the slash type
I changed to
self._fw_xml_file = _FW_DIR_NAME + "/" + self._fw_xml_filename
and the code executed fineThe text was updated successfully, but these errors were encountered: