Skip to content

Csv(None) hangs #149

Closed
Closed
@iurisilvio

Description

@iurisilvio

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions