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

Unable to parse nested values #1

Open
Rashaad1268 opened this issue Feb 7, 2022 · 2 comments
Open

Unable to parse nested values #1

Rashaad1268 opened this issue Feb 7, 2022 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Rashaad1268
Copy link
Owner

Rashaad1268 commented Feb 7, 2022

If values like nested_list=[[1, 2, 3], [1, 2, 3], [1, 2, 3]] are present in the .env file the parser won't be able to parse it because it removes the spaces and splits the string by comma's which results in a list like ['[1', '2', '3]', '[1', '2', '3]', '[1', '2', '3]']. Values like [[1 will result in an error by the parser

@Rashaad1268 Rashaad1268 added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Feb 7, 2022
@prabeshpathak
Copy link

What is an expected result for the nested array?

@Rashaad1268
Copy link
Owner Author

Rashaad1268 commented Feb 9, 2022

@prabeshpathak If a nested list is present in the .env file it is expected that the parser will parse that value and return a python list.
Example:
If list=[[1, 2, 3]] is present in the .env file the expected value for env["list"] to return is a python list [[1, 2, 3]]
but an error is raised instead ValueError: Invalid value. [1 the error is raised from this line https://github.com/Rashaad1268/PyEnv/blob/main/pyenv.py#L54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants