Hello, I have been recently working with TOML and I notice dumps produce an invalid output (not according to the v1.0.0 standard). loads is also not able to parse the produced output.
The steps to reproduce this issue are:
>>> import tomlkit
>>> tomlkit.dumps({"": "src"})
' = "src"\n'
>>> tomlkit.loads(tomlkit.dumps({"": "src"}))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".venv/lib/python3.8/site-packages/tomlkit/api.py", line 34, in loads
return parse(string)
File ".venv/lib/python3.8/site-packages/tomlkit/api.py", line 51, in parse
return Parser(string).parse()
File ".venv/lib/python3.8/site-packages/tomlkit/parser.py", line 146, in parse
item = self._parse_item()
File ".venv/lib/python3.8/site-packages/tomlkit/parser.py", line 306, in _parse_item
return self._parse_key_value(True)
File ".venv/lib/python3.8/site-packages/tomlkit/parser.py", line 378, in _parse_key_value
key = self._parse_key()
File ".venv/lib/python3.8/site-packages/tomlkit/parser.py", line 422, in _parse_key
return self._parse_bare_key()
File ".venv/lib/python3.8/site-packages/tomlkit/parser.py", line 474, in _parse_bare_key
raise self.parse_error(ParseError, "Empty key found")
tomlkit.exceptions.ParseError: Empty key found at line 1 col 1
Empty key found at line 1 col 1
Please notice the standard explicit allows the usage of empty keys, and I believe the expected behaviour should be dumps({"": "src"}) #=> "" = "src".
I am using Python 3.8.0 and tomlkit 0.7.2 on Ubuntu 18.04.5 LTS
Please let me know if any other information is needed.
Hello, I have been recently working with TOML and I notice
dumpsproduce an invalid output (not according to the v1.0.0 standard).loadsis also not able to parse the produced output.The steps to reproduce this issue are:
Please notice the standard explicit allows the usage of empty keys, and I believe the expected behaviour should be
dumps({"": "src"}) #=> "" = "src".I am using Python 3.8.0 and tomlkit 0.7.2 on Ubuntu 18.04.5 LTS
Please let me know if any other information is needed.