[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 #29132: Merged fix from 3.6.
https://hg.python.org/cpython/rev/c163a76163f7

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: http://bugs.python.org/file46174/shlex-posix-quote2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: http://bugs.python.org/file46112/shlex-posix-quote.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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"']
>>> list(shlex('>"a"', posix=True, punctuation_chars=True))
['>a']  # should be ['>', 'a']

--
components: Library (Lib)
messages: 284480
nosy: evan_, r.david.murray, vinay.sajip
priority: normal
severity: normal
status: open
title: shlex.shlex with punctuation_chars and posix doesn't handle punctuation 
next to quotes
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com