smihica / pyminizip

To create a password encrypted zip file in python.
Other
106 stars 37 forks source link

can not zip chinese filename #23

Open chengshwu opened 6 years ago

chengshwu commented 6 years ago

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

veon82 commented 6 years ago

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?

chengshwu commented 6 years ago

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

zzm88 commented 5 years ago

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

robo3945 commented 4 years ago

Also for me the same problem...

chris9740 commented 4 years ago

Same with me, Ubuntu 18.04, version Python 3.7.5

humygithub commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.

TaZhao commented 3 years ago

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

chajiuqqq commented 2 years ago

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

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

VIZULR commented 1 year ago

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