Skip to content

Commit c4ca84c

Browse files
committed
Python 3 compatibility encode repr when caclulating etag.
1 parent 7a4ed5d commit c4ca84c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

roundup/rest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from roundup import hyperdb
2828
from roundup import date
2929
from roundup import actions
30+
from roundup.anypy.strings import bs2b
3031
from roundup.exceptions import *
3132
from roundup.cgi.exceptions import *
3233

@@ -125,7 +126,7 @@ def calculate_etag (node, classname="Missing", id="0"):
125126
'''
126127

127128
items = node.items(protected=True) # include every item
128-
etag = md5(repr(items)).hexdigest()
129+
etag = md5(bs2b(repr(items))).hexdigest()
129130
logger.debug("object=%s%s; tag=%s; repr=%s", classname, id,
130131
etag, repr(node.items(protected=True)))
131132
return etag

0 commit comments

Comments
 (0)