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

Fixes #10 - Make sure object header is an int #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unformatt
Copy link
Contributor

Also removes trailing whitespace

#10

def __getObjHeader(self, offset):
obj_header = self.data[offset]

if type(obj_header) == str:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we don't need that check because the BPlistReader() expects an str as input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So reading from string never worked or something changed in python2?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a tricky question to answer now, given I never wrote unit tests for this :-)

I'm pretty sure all codepaths used to work, but I went back to python 2.5 and it's still a problem there. This package is clearly not the most popular one so maybe it was a bug all these years.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, I feel like it's safer to leave the check in there

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.

None yet

2 participants