Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Commit 260d257

Browse files
committed
Fix Issue-60: Replace encodestring and decodestring for standard_b64encode and standard_b64decode.
1 parent 7d1e449 commit 260d257

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config/kube_config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def as_file(self):
105105
else:
106106
content = self._data
107107
self._file = _create_temp_file_with_content(
108-
base64.decodestring(content))
108+
base64.standard_b64decode(content))
109109
else:
110110
self._file = _create_temp_file_with_content(self._data)
111111
if self._file and not os.path.isfile(self._file):
@@ -120,7 +120,7 @@ def as_data(self):
120120
with open(self._file) as f:
121121
if self._base64_file_content:
122122
self._data = bytes.decode(
123-
base64.encodestring(str.encode(f.read())))
123+
base64.standard_b64encode(str.encode(f.read())))
124124
else:
125125
self._data = f.read()
126126
return self._data

config/kube_config_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
def _base64(string):
43-
return base64.encodestring(string.encode()).decode()
43+
return base64.standard_b64encode(string.encode()).decode()
4444

4545

4646
def _format_expiry_datetime(dt):

0 commit comments

Comments
 (0)