Skip to content

Commit

Permalink
Consider space a wordchar, not s whitespace in the lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Mar 18, 2019
1 parent 4b5fe77 commit 17f5fb0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/parsec/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,12 @@ def strip_and_unquote_list(cls, keys, value):
Processed value as a list.
"""
if value.startswith('"') or value.startswith("'"):
lexer = shlex.shlex(value, posix=True)
values = [t for t in lexer if t != ","]
lexer = shlex.shlex(value, posix=True, punctuation_chars=",")
lexer.commenters = '#'
lexer.whitespace_split = False
lexer.whitespace = "\t\n\r"
lexer.wordchars += " "
values = [t.strip() for t in lexer if t != ","]
else:
# unquoted values (may contain internal quoted strings with list
# delimiters inside 'em!)
Expand Down

0 comments on commit 17f5fb0

Please sign in to comment.