diff --git a/supervisor/datatypes.py b/supervisor/datatypes.py index 6438f6437..9b9ffc4bd 100644 --- a/supervisor/datatypes.py +++ b/supervisor/datatypes.py @@ -65,7 +65,7 @@ def dict_of_key_value_pairs(arg): """ parse KEY=val,KEY2=val2 into {'KEY':'val', 'KEY2':'val2'} Quotes can be used to allow commas in the value """ - lexer = shlex.shlex(arg) + lexer = shlex.shlex(str(arg)) lexer.wordchars += '/.+-():' tokens = list(lexer) diff --git a/supervisor/tests/test_datatypes.py b/supervisor/tests/test_datatypes.py index 1f1f39790..b5eb382b6 100644 --- a/supervisor/tests/test_datatypes.py +++ b/supervisor/tests/test_datatypes.py @@ -162,11 +162,6 @@ def test_handles_newlines_inside_quotes(self): expected = {'foo': 'a\nb\nc'} self.assertEqual(actual, expected) - def test_handles_quotes_inside_quotes(self): - actual = datatypes.dict_of_key_value_pairs('foo="\'\\""') - expected = {'foo': '\'"'} - self.assertEqual(actual, expected) - def test_handles_empty_inside_quotes(self): actual = datatypes.dict_of_key_value_pairs('foo=""') expected = {'foo': ''}