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

Csv(None) hangs #149

Closed
iurisilvio opened this issue Jan 5, 2023 · 0 comments
Closed

Csv(None) hangs #149

iurisilvio opened this issue Jan 5, 2023 · 0 comments

Comments

@iurisilvio
Copy link
Contributor

iurisilvio commented Jan 5, 2023

The shlex splitter hangs with None as input, so config("FOO", default=None, cast=Csv()) hangs the application.

I expected it to return an empty list. I think Csv()(None) should return [] because if it was a required config, it would fail before.

from decouple import Csv
Csv()(None)  # it hangs

To understand what was hanging, I tried it:

from shlex import shlex
splitter = shlex(None, posix=True)
list(splitter)  # it hangs

Based on docs:

Since the split() function instantiates a shlex instance, passing None for s will read the string to split from standard input.)

iurisilvio added a commit that referenced this issue Jan 9, 2023
Fixed #149 Csv with None should return an empty list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant