From 9253a1a47a8ee48182b7b44916c5efc5c7079237 Mon Sep 17 00:00:00 2001 From: James Denton Date: Thu, 17 Aug 2017 14:54:09 +0000 Subject: [PATCH] Switch from BytesIO to StringIO for Python 3 compatibility (test only) --- action/_v2_config_template.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action/_v2_config_template.py b/action/_v2_config_template.py index 3209d3a..8ff946d 100644 --- a/action/_v2_config_template.py +++ b/action/_v2_config_template.py @@ -301,7 +301,7 @@ def return_config_overrides_ini(self, except Exception: config = ConfigTemplateParser(dict_type=MultiKeyDict) - config_object = io.BytesIO(str(resultant)) + config_object = io.StringIO(resultant) config.readfp(config_object) for section, items in config_overrides.items(): # If the items value is not a dictionary it is assumed that the @@ -336,12 +336,12 @@ def return_config_overrides_ini(self, else: config_object.close() - resultant_bytesio = io.BytesIO() + resultant_stringio = io.StringIO() try: - config.write(resultant_bytesio) - return resultant_bytesio.getvalue() + config.write(resultant_stringio) + return resultant_stringio.getvalue() finally: - resultant_bytesio.close() + resultant_stringio.close() @staticmethod def _option_write(config, section, key, value):