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

BadRarFile: Failed the read enough data #10

Closed
chrisspen opened this issue Aug 6, 2014 · 4 comments
Closed

BadRarFile: Failed the read enough data #10

chrisspen opened this issue Aug 6, 2014 · 4 comments

Comments

@chrisspen
Copy link

I'm running into strange behavior on different servers with reading Rar files. On my Ubuntu 12.04 localhost, I have unrar-nonfree installed, and I can unrar a sample archive just fine, but on an Ubuntu 12.04 instance running on Amazon, which uses the unrar-free package instead, I get the error:

>>> import rarfile
>>> fn = '/tmp/sample.rar'
>>> rf = rarfile.RarFile(fn)
>>> fin = rf.open(rf.namelist()[0])
>>> total_lines = rf.open(rf.namelist()[0]).read().count('\n')
BadRarFile: Failed the read enough data

What does that error mean?

Using checksums, I've confirmed the rar files aren't getting corrupted and permissions are corrupt. That same code runs fine on my localhost.

The only difference seems to be which backend unrar package I'm using. However, the unrar-nonfree seems to have become obsolete and has been removed from the standard repos, so I can't install in on the Amazon server. How do I fix this?

@chrisspen
Copy link
Author

Nevermind. It seems this is a bug in unrar-free, and the only workaround is to enable the multiverse repo and install the non-free unrar package.

@pannal
Copy link

pannal commented Apr 6, 2018

This doesn't seem like an issue with the unrar tool itself, but with the rarfile implementation:

Diaoul/subliminal#709 (comment)

@Southwest16
Copy link

I had the same problem with Centos. Once I have rar installed, it's ok!
https://bitsanddragons.wordpress.com/2018/01/09/install-rar-unrar-on-centos-7/

@zhbzhbzhbz
Copy link

zhbzhbzhbz commented Aug 6, 2020

I have the same problem too on Windows 10 using rarfile. But it works well with Winrar.

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

4 participants