NotImplementError while using zip file | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

NotImplementError while using zip file

I am trying to extract the password protected zip file but I am getting this error NotImplementedError: That compression method is not supported how to solve this? zip is compressed using es file explorer! my attempt : https://code.sololearn.com/cDBTlS9iFRHo/?ref=app

25th Jun 2021, 4:46 PM
Ratnapal Shende
Ratnapal Shende - avatar
4 Answers
0
I have tested your code and it looks fine. The problem should consist on the .zip file, rather on the code. My try : # i work on android mobile import zipfile as zf obj = zf.ZipFile('/storage/emulated/0/Download/song.zip') obj.setpassword(b'1234') obj.extractall(path='/storage/emulated/0',pwd=b'1234') Link to be referred : https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.extract
25th Jun 2021, 9:10 PM
Ervis Meta
Ervis Meta - avatar
0
Ervis Meta why it's not working for me? I created zip using es file explorer.. it means es file explorer uses any protection which is stopping us from extracting files ?
26th Jun 2021, 6:27 AM
Ratnapal Shende
Ratnapal Shende - avatar
0
I have tried it with es file explorer but nothing bad happend. Maybe the glitch is at file compression (in that case you should extract all your files and re-compress the archive) but you should also check the pwd attribute at your code, make it as mine and try again : the 'b' in front of pwd value
26th Jun 2021, 6:45 AM
Ervis Meta
Ervis Meta - avatar
0
Ervis Meta yes I tried recompressing file with es file explorer and used your code still I am getting same error... but then as u said problem is with zip file then I created the zip using 7zip and now i can extract it.. but when I create zip using es file explorer I am getting error...
26th Jun 2021, 7:57 AM
Ratnapal Shende
Ratnapal Shende - avatar