简体   繁体   中英

Python ZipFile path separators

如果我要使用Python ZipFile库解压缩一个Zip文件,该文件是在Windows上创建的,而我的代码却在类Unix上运行,那么路径分隔符是否始终是Unix风格的?

Internally, ZipFile stores forward slashes as required by the zip file specification .

Externally, they get translated using os.sep so it will match what is normally expected on a given platform.

Code references:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM