Commit 11d078a9 by Ned Batchelder

Merge pull request #3192 from edx/ned/fix-encode-error-when-hashing-resources

Fix hash_resource to avoid encode errors.
parents f275f542 732bf3f3
......@@ -55,11 +55,10 @@ xmodule.x_module.descriptor_global_local_resource_url = local_resource_url
def hash_resource(resource):
"""
Hash a :class:`xblock.fragment.FragmentResource
Hash a :class:`xblock.fragment.FragmentResource`.
"""
md5 = hashlib.md5()
for data in resource:
md5.update(data)
md5.update(repr(resource))
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