path - does Python zipfile always use posixpath filenames regardless of operating system? -


it won't matter current utility, coding practice, i'd know if files in zip file, using zipfile module, can accessed using posix-style pathname such subdir/file.ext regardless of on operating system made, or on system python script running. or if, in case of windows, file stored or accessed subdir\file.ext. read pydoc module, , did searches here , on google, couldn't see relevant question. thanks.

yes.

you can see these lines zipfile module:

# used ensure paths in generated zip files use # forward slashes directory separator, required # zip format specification. if os.sep != "/" , os.sep in filename:     filename = filename.replace(os.sep, "/") 

and in zip specification:

file name: (variable)

the name of file, optional relative path. path stored should not contain drive or device letter, or leading slash. slashes should forward slashes '/' opposed backwards slashes '\' compatibility amiga , unix file systems etc.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -