python-unrar icon indicating copy to clipboard operation
python-unrar copied to clipboard

Problems with RarFile read and open methods

Open cipriantrofin opened this issue 2 years ago • 1 comments
trafficstars

My environment: python 3.8.5, on Windows 10 x64, unrar module 0.4

The unrar64.dll is installed on "c:\Program Files (x86)\UnrarDLL\x64", the environment variable UNRAR_LIB_PATH is set to C:\Program Files (x86)\UnrarDLL\x64\UnRAR64.dll.

The extract method works fine. I was not able to make read and open methods to work.

The following code works:

from unrar import rarfile
import glob

myFile = rarfile.RarFile("my_rar.rar")
rarList = myFile.namelist()
print (rarList)
myFile.extract(rarList[0])

However, using .open or .read methods does not work - as in myFile.open(rarList[0]) or myFile.read(rarList[0]). The commands does not complete (I was not able to find another word). It suspect it might be related to unrar64.dll library (DLL version: 6.22.1.865, signed on 2023-05-14) but I have no experience to debug it.

cipriantrofin avatar May 15 '23 10:05 cipriantrofin

Same issue. Extract works fine, but open does not. I tried it with v6.24 and v5.90 of UnRAR64.dll and both fail. I recently upgraded to Windows 10 from Windows 7 where it worked fine. I did not update Python 3.8.1 in the meantime.
Not sure why this project here is dead when the owner has lots of activity on other repos.
In the meantime I tried https://github.com/markokr/rarfile which seems to be a good replacement. No real code changes needed - at least for my use cases.

ganego avatar Jan 01 '24 11:01 ganego