Merge pull request #112 from guardicore/nadler/unicode

fix unicode bug
This commit is contained in:
Daniel Goldberg 2018-04-02 14:18:56 +03:00 committed by GitHub
commit 5a8b7e98c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ def _cast_by_example(value, example):
"""
example_type = type(example)
if example_type is str:
return str(os.path.expandvars(value))
return os.path.expandvars(value).encode("utf8")
elif example_type is tuple and len(example) != 0:
if value is None or value == tuple(None):
return tuple()