Skip to content

Failure to parse environment with quoted empty strings. (Issue #328) #873

@mostrows2

Description

@mostrows2

commit aa7d40e is incorrect...

The problem is that the test in the above commit tests the value 'foo=""' -- that works.
However, 'foo="",bar=a' will fail. This seems to be related to the use of "posix=True" with shlex.

#>>> supervisor.datatypes.dict_of_key_value_pairs('foo="",c=d')
Traceback (most recent call last):
File "", line 1, in
File "/home/mostrows/workspace/cmf.build/agents/cmf/ext-py/supervisor-4.0.0.dev0/supervisor/datatypes.py", line 96, in dict_of_key_value_pairs
"Unexpected end of key/value pairs in value '%s'" % arg)
ValueError: Unexpected end of key/value pairs in value 'foo="",c=d'
#>>> supervisor.datatypes.dict_of_key_value_pairs("foo='',c=d")
Traceback (most recent call last):
File "", line 1, in
File "/home/mostrows/workspace/cmf.build/agents/cmf/ext-py/supervisor-4.0.0.dev0/supervisor/datatypes.py", line 96, in dict_of_key_value_pairs
"Unexpected end of key/value pairs in value '%s'" % arg)
ValueError: Unexpected end of key/value pairs in value 'foo='',c=d'
#>>> supervisor.datatypes.dict_of_key_value_pairs("foo=''")
{'foo': ''}
#>>> supervisor.datatypes.dict_of_key_value_pairs('foo=""')
{'foo': ''}
#>>>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions