hash problem?

The Pyweek site is currently rejecting my final submission due to the hash not matching, eek! I'm not sure what I did wrong to create the hash, but I can get the same results each time. I'm running the following on WindowsXP with Python2.5:

IDLE 1.2.1 >>> import hashlib >>> m = hashlib.md5() >>> m.update(file('C:\\python\\robottoast\\robot_toast_really_final.zip').read()) >>> print m.hexdigest() bc3a0a2f85b4d10225838ff80d3b9e74

A copy of our game is currently available at http://rapidshare.com/files/105191310/robot_toast_really_final.zip.html

Can anyone give some insight?

(log in to comment)

Comments

Binary files should be opened as 'binary' under windows, otherwise their content's is screwed up. You had to file(path, "rb") to get the hash right.

Yeah, the help page of this site doesn't say that and I was seriously sleep deprived yesterday when I made the hash :(
The help page seems to have been mysteriously "fixed"... I also had the same problem with it invalidating my hash.
Same here.
The MD5 hashlib isn't broken. If you hashed your zip, and it doesn't match its because you changed your zip.
Yes, hashlib isn't broken, the helpfile was. Look at this Google cache of the help page. Search for "md5" and read the instructions provided there. Notice the difference.
I didn't say hashlib was broken - it is just it returned a bad result for me - because of the way I used it - which was to just copy the script off of the help-page ;)
nihilocrat, there's nothing mysterious about it. It was pointed out that I didn't have the 'rb' on the page and I fixed it.

Why the accusation?

I didn't mean to accuse at all. Due to the way the forum system works I can't really easily find if you had posted about it or not (particularly if you posted as a reply in a thread, and then that was replied to by someone else) and I appreciate that you did go ahead and change the help file.

I guess by posting the Google cache link I was just trying to point out that I was not being crazy and that the help file originally was in the wrong. I'm sorry if any of my language suggested I was trying to accuse you of any intentional wrongdoing. I'm sorry for the misunderstanding, and thanks for putting in the time to accommodate for all of these last-minute issues.