Python hash code returns wrong result? For a school project, I'm trying to demonstrate a hash collision using Python.
This is the little piece of code that I'm trying to use (based on this answer):

from hashlib import md5
from binascii import hexlify

s1 = b'd131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70'

h1 = md5(hexlify(s1))
print(h1.hexdigest())


This, however returns a completely wrong md5 hash of 9fe9cb63decce991b7783d9b783ee73f (expected: 79054025255fb1a26e4bc422aef54eb4).

My question is, what causes this error and how can I solve this?
It was (like @mikeazo) said an encoding issue.
See the answer linked in the OP for an updated answer from @mikeazo.  

This is what the code became:

from hashlib import md5

s1 = 'd131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70'

h1 = md5(bytes.fromhex(s1))
print(h1.hexdigest())