django-seo2 icon indicating copy to clipboard operation
django-seo2 copied to clipboard

Unicode and cache

Open eriktelepovsky opened this issue 8 years ago • 0 comments
trafficstars

Once I set use_cache to True, I got this exception:

Traceback (most recent call last):
  File "/Users/erik/src/django/giaroo/source/djangoseo/templatetags/seo.py", line 65, in render
    **kwargs)
  File "/Users/erik/src/django/giaroo/source/djangoseo/base.py", line 301, in get_metadata
    return metadata._get_formatted_data(path, context, site, language)
  File "/Users/erik/src/django/giaroo/source/djangoseo/base.py", line 253, in _get_formatted_data
    site, language)
  File "/Users/erik/src/django/giaroo/source/djangoseo/base.py", line 43, in __init__
    hexpath = hashlib.md5(iri_to_uri(path)).hexdigest()
TypeError: Unicode-objects must be encoded before hashing

eriktelepovsky avatar May 23 '17 21:05 eriktelepovsky