-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: missingfix
Are you sure you want to change the base?
Prefixfix #32
Conversation
@@ -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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
.
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 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. |
Fix #31, also one additional Python 3 fix.