rtoml
rtoml copied to clipboard
TomlParsingError when reading a TOML file
I'm trying to read a poetry toml file (which I'd think should not matter since it's a regular toml file) like this:
import rtoml
obj = rtoml.load("pyproject.toml")
print(obj)
and I'm getting
_rtoml.TomlParsingError: expected an equals, found eof at line 1 column 15
Here are few first lines from that file
[tool.poetry]
name = "datascience"
version = "0.1.0"
So it looks like it can't read the section [tool.poetry]
line?
But in the example it seems to read it without problems?
According to the source. It seems that rtoml.load
will pass the arg directly to rtoml.loads
if you give it a str
.
https://github.com/samuelcolvin/rtoml/blob/d79d03faad6d473f2482319365445a50c0df4e18/rtoml/init.py#L16-L26