about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/boto/bug-953970_python3.8-compat.patch
blob: ac56210423753752e0c4cc6c8154fd1b0cba0c68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Index: python-boto/tests/unit/utils/test_utils.py
===================================================================
--- python-boto.orig/tests/unit/utils/test_utils.py
+++ python-boto/tests/unit/utils/test_utils.py
@@ -85,7 +85,7 @@ class TestPassword(unittest.TestCase):
         def hmac_hashfunc(cls, msg):
             if not isinstance(msg, bytes):
                 msg = msg.encode('utf-8')
-            return hmac.new(b'mysecretkey', msg)
+            return hmac.new(b'mysecretkey', msg, digestmod='sha256')

         class HMACPassword(Password):
             hashfunc = hmac_hashfunc
@@ -95,15 +95,15 @@ class TestPassword(unittest.TestCase):
         password.set('foo')

         self.assertEquals(str(password),
-                          hmac.new(b'mysecretkey', b'foo').hexdigest())
+                          hmac.new(b'mysecretkey', b'foo', digestmod='sha256').hexdigest())

     def test_constructor(self):
-        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)
+        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg, digestmod='sha256')

         password = Password(hashfunc=hmac_hashfunc)
         password.set('foo')
         self.assertEquals(password.str,
-                          hmac.new(b'mysecretkey', b'foo').hexdigest())
+                          hmac.new(b'mysecretkey', b'foo', digestmod='sha256').hexdigest())


 class TestPythonizeName(unittest.TestCase):
Index: python-boto/boto/ecs/item.py
===================================================================
--- python-boto.orig/boto/ecs/item.py
+++ python-boto/boto/ecs/item.py
@@ -22,6 +22,7 @@

 import xml.sax
 import cgi
+from html import escape
 from boto.compat import six, StringIO

 class ResponseGroup(xml.sax.ContentHandler):
@@ -67,7 +68,7 @@ class ResponseGroup(xml.sax.ContentHandl
         return None

     def endElement(self, name, value, connection):
-        self._xml.write("%s</%s>" % (cgi.escape(value).replace("&amp;amp;", "&amp;"), name))
+        self._xml.write("%s</%s>" % (escape(value).replace("&amp;amp;", "&amp;"), name))
         if len(self._nodepath) == 0:
             return
         obj = None