pyminizip icon indicating copy to clipboard operation
pyminizip copied to clipboard

can not zip chinese filename

Open chengshwu opened this issue 6 years ago • 11 comments

pyminizip.compress("D:\py\测试文件.txt", None, "D:\py\test.zip", "password", 5)

it will give the error : Exception "unhandled OSError" error in opening D:\py\测试文件.txt for reading

chengshwu avatar May 22 '18 13:05 chengshwu

I don't think that this is a issue related to the filename encoding but maybe I ignore some encoding problems on Windows.

On my Linux machine it works with python2.7:

image

Have you tried with other files?

veon82 avatar May 22 '18 20:05 veon82

the environment is windows7 32 bit , python3.6.4 .if I want use it ,how should I do?

chengshwu avatar May 24 '18 00:05 chengshwu

I also have this issue, with python 3.6 and Vscode in windows 10 64 bit.

zzm88 avatar Jan 31 '19 03:01 zzm88

Also for me the same problem...

robo3945 avatar Oct 23 '19 12:10 robo3945

Same with me, Ubuntu 18.04, version Python 3.7.5

chris9740 avatar Jan 15 '20 09:01 chris9740

Same with me, Windows 7 64bit + Python 3.65 64bit filepath=r"三国.txt" # error in opening 三国.txt for reading filepath=r"sanguo.txt" import pyminizip pyminizip.compress(filepath, None, "r.zip", "123456", 0)

humygithub avatar Jun 20 '20 07:06 humygithub

Windows 7 64bit + Python 3.65 64bit

from pyminizip import compress compress("a.txt", None, "a.zip", "123456", 0) compress("甲.txt", None, "jia.zip", "123456", 0)

result: Traceback (most recent call last): File "C:\Users\dyjxx\Desktop\新的文档 1.py", line 4, in compress("甲.txt", None, "jia.zip", "123456", 0) OSError: error in opening 甲.txt for reading

humygithub avatar Jun 20 '20 23:06 humygithub

compress_multiple alse has the same question: cannot process filename with Chinese chars

from pyminizip import compress_multiple compress_multiple(["a.txt","b.txt"], [], "ab.zip", "123456", 0) compress_multiple(["甲.txt","乙.txt"], [], "jiayi.zip", "123456", 0)

result: Traceback (most recent call last): File "C:\Users\dyjxx\Desktop\新的文档 1.py", line 17, in compress_multiple(["甲.txt","乙.txt"], [], "jiayi.zip", "123456", 0) OSError: error in opening 甲.txt for reading

I am expecting an solution for filename with Chinese chars in the new version.

humygithub avatar Jun 21 '20 00:06 humygithub

same problem on win10 64bit, python 3.7 if chinese in input file name, compress("副本.txt", None, "jia.zip", "123456", 0) then get error : OSError: error in opening 副本.txt for reading

TaZhao avatar Aug 19 '21 02:08 TaZhao

It actually has the problem in Windows platform when the src-path or dist-path contains any Chinese words .

  • When src-path contains Chinese words, it raises OSError: error in closing <dist file> (-102)
  • When you solve the previous problem, but dist-path contains Chinese words, you will get error in opening xxx(file needed zip)

However ,it works perfect in MacOS or other Linux platform. What a pity!

chajiuqqq avatar Mar 25 '22 10:03 chajiuqqq

Same problem on win10 64bit, python 3.7 but when the path name includes ö or any other extended characters
OSError: error in closing

VIZULR avatar Apr 17 '23 15:04 VIZULR