Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keys are not trimmed #21

Closed
lbrack opened this issue Mar 26, 2019 · 2 comments · Fixed by #25
Closed

keys are not trimmed #21

lbrack opened this issue Mar 26, 2019 · 2 comments · Fixed by #25
Labels
bug Bugs and problems with poyo help wanted Tasks to be picked up by contributors

Comments

@lbrack
Copy link

lbrack commented Mar 26, 2019

Version: 0.4.2
OS: OSX (but irrelevant)

I came across this issue when attempting to render a cookiecutter template from a user config
where there was a space between a key and the colon.

While this is very trivial, it is hard to root cause because the error message is something like
Error message: 'dict object' has no attribute 'python_3_6' and only careful examination of the dumped structure shows the problem

"interpreter_versions": {
            "python_2_7": "no",
            "python_3_5": "no",
            "python_3_6 ": "yes",
            "python_3_7": "yes"
        },

How to reproduce

If you take this (valid) YAML example and parse it through poyo

python_3_6 : yes

you get (note the space after the python_3_6 key

>>> from poyo import parse_string
>>> config = parse_string("python_3_6 : yes")
>>> config
{'python_3_6 ': 'yes'}

whereas it should have been {'python_3_6': 'yes'}

@hackebrot
Copy link
Owner

Hi @lbrack! 👋

Thank you for raising this bug!

@hackebrot hackebrot added bug Bugs and problems with poyo help wanted Tasks to be picked up by contributors labels Jul 16, 2019
@hackebrot
Copy link
Owner

Thanks again @lbrack! This should be fixed on master now. 🐓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and problems with poyo help wanted Tasks to be picked up by contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants