[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

2017-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7e40c940df14 by Vinay Sajip in branch '3.6': Fixed #29132: Updated shlex to work better with punctuation chars in POSIX mode. https://hg.python.org/cpython/rev/7e40c940df14 New changeset c163a76163f7 by Vinay Sajip in branch 'default': Closes

[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

2017-01-06 Thread Evan
Evan added the comment: I've just submitted the form. I'm attaching a second patch which also addresses another similar bug demonstrated in the test case. The fix is to check for the 'c' state before checking for quotes or escape characters. -- Added file:

[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

2017-01-05 Thread Vinay Sajip
Vinay Sajip added the comment: Evan, thanks for looking at this. Would you like to submit a completed contributor form? https://www.python.org/psf/contrib/contrib-form/ -- ___ Python tracker

[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

2017-01-02 Thread Evan
Evan added the comment: I've attached a simplistic patch which fixes the problem. I suspect a better fix might be to shuffle the elif branches around so the extra condition isn't necessary. Vinay, what are your thoughts? -- keywords: +patch Added file:

[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

2017-01-02 Thread Evan
New submission from Evan: When both punctuation_chars and posix are used, any punctuation directly next to quoted characters is interpreted as a single token. >>> from shlex import shlex >>> list(shlex('>"a"', posix=True)) ['>', 'a'] >>> list(shlex('>"a"', punctuation_chars=True)) ['>', '"a"']