Skip to content

Commit 90c632b

Browse files
committed
Fix: PendingDeprecationWarning: HMAC() without an explicit digestmod
argument is deprecated. Set md5 explicitly.
1 parent 0527a27 commit 90c632b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roundup/rest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
# else not supported
3030
dicttoxml = None
3131

32+
from hashlib import md5
33+
3234
from roundup import hyperdb
3335
from roundup import date
3436
from roundup import actions
@@ -144,7 +146,7 @@ def calculate_etag (node, key, classname="Missing", id="0",
144146

145147
items = node.items(protected=True) # include every item
146148
etag = hmac.new(bs2b(key),bs2b(repr_format +
147-
repr(sorted(items)))).hexdigest()
149+
repr(sorted(items))), md5).hexdigest()
148150
logger.debug("object=%s%s; tag=%s; repr=%s", classname, id,
149151
etag, repr(node.items(protected=True)))
150152
# Quotes are part of ETag spec, normal headers don't have quotes

0 commit comments

Comments
 (0)