Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not zip chinese filename #23

Open
chengshwu opened this issue May 22, 2018 · 11 comments
Open

can not zip chinese filename #23

chengshwu opened this issue May 22, 2018 · 11 comments

Comments

@chengshwu
Copy link

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
Copy link
Contributor

veon82 commented May 22, 2018

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
Copy link
Author

chengshwu commented May 24, 2018

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

@zzm88
Copy link

zzm88 commented Jan 31, 2019

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

@robo3945
Copy link

Also for me the same problem...

@chris9740
Copy link

Same with me, Ubuntu 18.04, version Python 3.7.5

@humygithub
Copy link

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
Copy link

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
Copy link

humygithub commented Jun 21, 2020

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
Copy link

TaZhao commented Aug 19, 2021

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
Copy link

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!

@VIZULR
Copy link

VIZULR commented Apr 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants