Fix Python – How to correct TypeError: Unicode-objects must be encoded before hashing?

I have this error:
Traceback (most recent call last):
File “python_md5_cracker.py”, line 27, in
m.update(line)
TypeError: Unicode-objects must be encoded before hashing

when I try to execute this code in Python 3.2.2:
import hashlib, sys
m = hashlib.md5()
hash = “”
hash_file = input(“What is the file name in which the hash resides? ….