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

Ensure the strerror() function returns None when there are no failures. #20

Merged
merged 1 commit into from
Apr 8, 2016

Conversation

gmazzola
Copy link

@gmazzola gmazzola commented Apr 8, 2016

Calling the strerror() function on an uncorrupted RAR file throws a traceback:

>>> rarfp = rarfile.RarFile('foo.rar')
>>> rarfp.strerror()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/rarfile.py", line 725, in strerror
    return self._parse_error
AttributeError: 'RarFile' object has no attribute '_parse_error'
>>>

This is because the self._parse_error variable is not defined in the RarFile constructor. The fix is simple: initialize that variable to None.

@markokr markokr merged commit 27f3b59 into markokr:master Apr 8, 2016
@markokr
Copy link
Owner

markokr commented Apr 8, 2016

Good catch.

Thanks.

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

Successfully merging this pull request may close these issues.

2 participants