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

Failed the read enough data #108

Open
hasnali456578 opened this issue Sep 5, 2024 · 0 comments
Open

Failed the read enough data #108

hasnali456578 opened this issue Sep 5, 2024 · 0 comments

Comments

@hasnali456578
Copy link

This is my code. It works fine without a password for rar, but gives an error when there is a password (the password is 100% correct). The problem is that when I create the rar myself and put a password, it works fine. However, it does not work with some rars that I downloaded from the internet with passwords.
Failed the read enough data: req=7661 got=0

`
import rarfile

rar_dosyasi_yolu = "testrar.rar"
rarfile.UNRAR_TOOL = "UnRAR.exe"
rf = rarfile.RarFile(rar_dosyasi_yolu)

for info in rf.infolist():
print(f"File: {info.filename}, Size: {info.file_size} bytes")
if info.file_size > 0:
try:
with rf.open(info, pwd=b'testrar') as dosya:
icerik = dosya.read()
print(icerik)
except rarfile.RarWrongPassword:
print("Yanlış şifre!")
except rarfile.RarCRCError:
print("CRC hatası! Dosya bozuk olabilir.")
except Exception as e:
print(f"Dosya açılırken hata oluştu: {e}") # Failed the read enough data: req=7661 got=0
else:
print("Dosya boyutu 0, bu dosya boş olabilir.")
`

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

1 participant