1- import io
21import json
32import logging
43import os
@@ -1057,8 +1056,7 @@ def _get_secret(self, namespace, name):
10571056 secrets ['data' ][key ] = base64 .b64decode (value ).decode (encoding = 'UTF-8' )
10581057
10591058 # tell python-requests it actually hasn't consumed the data
1060- response ._content_consumed = False
1061- response .raw = io .StringIO (json .dumps (secrets ))
1059+ response ._content = bytes (json .dumps (secrets ), 'UTF-8' )
10621060
10631061 return response
10641062
@@ -1079,7 +1077,7 @@ def _create_secret(self, namespace, name, data):
10791077
10801078 for key , value in data .items ():
10811079 value = value if isinstance (value , bytes ) else bytes (value , 'UTF-8' )
1082- item = base64 .b64encode (value ).decode ()
1080+ item = base64 .b64encode (value ).decode (encoding = 'UTF-8' )
10831081 template ["data" ].update ({key : item })
10841082
10851083 url = self ._api ("/namespaces/{}/secrets" , namespace )
@@ -1098,7 +1096,7 @@ def _update_secret(self, namespace, name, data):
10981096
10991097 for key , value in data .items ():
11001098 value = value if isinstance (value , bytes ) else bytes (value , 'UTF-8' )
1101- item = base64 .b64encode (value ).decode ()
1099+ item = base64 .b64encode (value ).decode (encoding = 'UTF-8' )
11021100 template ["data" ].update ({key : item })
11031101
11041102 url = self ._api ("/namespaces/{}/secrets/{}" , namespace , name )
0 commit comments