

If the archive comes in multiple files one among them will have a. Output = subprocess.Developed by a Russian software developer Eugene Roshal RAR stands for “Roshal Archive”, and represents a proprietary archive file format with support for data compression, error recovery and file spanning (archiving a single file within multiple packages). So I went back to the original subprocess solution and tried using patool instead of unrar import subprocess This one threw the following: PatoolError: could not find an executable program to extract format rar candidates are (rar,unrar,7z)ĭespite this message when I run patool directly from the command line the file is unrar'd with no problems. Patoolib.extract_archive(file,outdir=".") This threw a "no such file or directory" error. Next I went with pyunpack: from pyunpack import Archive Secondly I tried using libarchive, but despite a lack of build errors, I couldn't get the library to import. Using unrar from the command line works without any problem. Raise CalledProcessError(retcode, cmd, output=output)ĬalledProcessError: Command '' returned non-zero exit status 10 This code returns the following: Traceback (most recent call last):įile "/Users/Overlord/Documents/python/Unpacker.py", line 25, in įile "/Library/Frameworks/amework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output


My first attempt, I just figured I'd do a simple python script that would just call unrar directly: import osĬallstring = The basic problem is that I have some 1300+ rar files that I'd like to extract and keep somewhat organized, and to make things more fun a number of the rar files contain more rar files (which is why I'm disinclined to just do this by hand). This is driving me nuts, I've looked at & tried a number of the answers here for solving this problem but nothing is working out so far.
