Skip to content

Cannot use periods/dots in key names #24

Description

@mattymo
>>> print(libconf.dumps({'source.name': 'test'}))
source.name = "test";

>>> print(libconf.dumps({'rules': {'source.name': 'test'}}))
rules =
{
    source.name = "test";
};

>>> l = libconf.loads((libconf.dumps({'rules': {'source.name': 'test'}})))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mmosesohn/venv/lib/python3.8/site-packages/libconf.py", line 515, in loads
    return load(f, filename=filename, includedir=includedir)
  File "/home/mmosesohn/venv/lib/python3.8/site-packages/libconf.py", line 489, in load
    tokenstream = TokenStream.from_file(f,
  File "/home/mmosesohn/venv/lib/python3.8/site-packages/libconf.py", line 272, in from_file
    tokens.extend(tokenizer.tokenize(''.join(lines)))
  File "/home/mmosesohn/venv/lib/python3.8/site-packages/libconf.py", line 197, in tokenize
    yield cls(type, m.group(0),
  File "/home/mmosesohn/venv/lib/python3.8/site-packages/libconf.py", line 102, in __init__
    self.value = float(self.text)
ValueError: could not convert string to float: '.'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions