Commit 732bf3f3 by Ned Batchelder

Fix hash_resource to avoid encode errors.

parent af486423
...@@ -55,11 +55,10 @@ xmodule.x_module.descriptor_global_local_resource_url = local_resource_url ...@@ -55,11 +55,10 @@ xmodule.x_module.descriptor_global_local_resource_url = local_resource_url
def hash_resource(resource): def hash_resource(resource):
""" """
Hash a :class:`xblock.fragment.FragmentResource Hash a :class:`xblock.fragment.FragmentResource`.
""" """
md5 = hashlib.md5() md5 = hashlib.md5()
for data in resource: md5.update(repr(resource))
md5.update(data)
return md5.hexdigest() return md5.hexdigest()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment