可能是因为使用了不同的编码方式导致乱码,可以尝试在命令行中添加"-encoding"参数指定编码方式,如:

subprocess.run(['pigz', '-c', file_path, '-encoding', 'utf-8'], stdout=open(output_file, 'wb'))

打包后压缩包内的文件变成乱码import osimport subprocessfrom alive_progress import alive_bar config_handlerdef pack_filessource_dir output_dir # 检查源目录和输出目录是否存在 if not ospathexistssource_dir or not ospathisdirso

原文地址: https://www.cveoy.top/t/topic/deQO 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录