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

Prefixfix #32

Open
wants to merge 3 commits into
base: missingfix
Choose a base branch
from
Open

Prefixfix #32

wants to merge 3 commits into from

Conversation

TWAC
Copy link

@TWAC TWAC commented Jun 26, 2017

Fix #31, also one additional Python 3 fix.

@@ -127,7 +128,7 @@ def hashFile(handle, want_hex=False, limit=None, chunk_size=CHUNK_SIZE):
for block in iter(lambda: handle.read(chunk_size), b''):
fhash.update(block)
read += chunk_size
if 0 < limit <= read:
if limit and limit <= read:
Copy link
Owner

Choose a reason for hiding this comment

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

Would you mind explaining why you made this no longer ensure that limit is positive?

@@ -0,0 +1,12 @@
#execute with pytest
Copy link
Owner

@ssokolow ssokolow Aug 20, 2017

Choose a reason for hiding this comment

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

It's a bit rude to just unilaterally decide that the tests will depend on pytest-specific features. (And, in fact, had you submitted this a year ago, I'd have asked you to rewrite it to be compatible with Nose.)

That said, the API presented is quite appealing and I was already considering a move to pytest so I'm not going to rewrite it to the "Python stdlib only" subset I often aim for.

file1 = files.join("file1")
file2 = files.join("file2")
file1.write("0"*1000000 + "1")
file2.write("0"*1000000 + "2")
Copy link
Owner

Choose a reason for hiding this comment

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

It'd probably be better to either assert or use max() to ensure that this test will always use a value greater than HEAD_SIZE.

@ssokolow
Copy link
Owner

Sorry for falling off the edge of the world. Now that things are back in order, I'm planning to write he tests that were holding up merging back into master A.S.A.P.

I'd like to get this and a bunch of others cleared out within the next week so, if you can address my code comments, I'll get this stuff merged promptly.

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