Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / boto / bug-953970_python3.8-compat.patch
blobac56210423753752e0c4cc6c8154fd1b0cba0c68
1 Index: python-boto/tests/unit/utils/test_utils.py
2 ===================================================================
3 --- python-boto.orig/tests/unit/utils/test_utils.py
4 +++ python-boto/tests/unit/utils/test_utils.py
5 @@ -85,7 +85,7 @@ class TestPassword(unittest.TestCase):
6 def hmac_hashfunc(cls, msg):
7 if not isinstance(msg, bytes):
8 msg = msg.encode('utf-8')
9 - return hmac.new(b'mysecretkey', msg)
10 + return hmac.new(b'mysecretkey', msg, digestmod='sha256')
12 class HMACPassword(Password):
13 hashfunc = hmac_hashfunc
14 @@ -95,15 +95,15 @@ class TestPassword(unittest.TestCase):
15 password.set('foo')
17 self.assertEquals(str(password),
18 - hmac.new(b'mysecretkey', b'foo').hexdigest())
19 + hmac.new(b'mysecretkey', b'foo', digestmod='sha256').hexdigest())
21 def test_constructor(self):
22 - hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)
23 + hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg, digestmod='sha256')
25 password = Password(hashfunc=hmac_hashfunc)
26 password.set('foo')
27 self.assertEquals(password.str,
28 - hmac.new(b'mysecretkey', b'foo').hexdigest())
29 + hmac.new(b'mysecretkey', b'foo', digestmod='sha256').hexdigest())
32 class TestPythonizeName(unittest.TestCase):
33 Index: python-boto/boto/ecs/item.py
34 ===================================================================
35 --- python-boto.orig/boto/ecs/item.py
36 +++ python-boto/boto/ecs/item.py
37 @@ -22,6 +22,7 @@
39 import xml.sax
40 import cgi
41 +from html import escape
42 from boto.compat import six, StringIO
44 class ResponseGroup(xml.sax.ContentHandler):
45 @@ -67,7 +68,7 @@ class ResponseGroup(xml.sax.ContentHandl
46 return None
48 def endElement(self, name, value, connection):
49 - self._xml.write("%s</%s>" % (cgi.escape(value).replace("&amp;amp;", "&amp;"), name))
50 + self._xml.write("%s</%s>" % (escape(value).replace("&amp;amp;", "&amp;"), name))
51 if len(self._nodepath) == 0:
52 return
53 obj = None