Message278351
See also 28391: Multiple occurances of: Closing quotes separate words
The issue 28391 is accepted, as it is defined:
Quotes *within* words are ignored, only a leading quoted string will result in a separate word. (That's recursive: try '"Do""This""Separate).
So I implement for compatibility mode your proposal.
But the example does not seem to work as expected, so seems to hint to a bug. Thus openning a seperate issue:
snip-->
import shlex
sopts = """-a "Do""This""Separate" """
resx = ["-a", '"Do"', 'ThisSeparate', ]
res=shlex.split(sopts,posix=False)
print "sopts ="+str(sopts)
print "resx ="+str(resx)
print "res ="+str(res)
assert res == resx
"""
Results in:
sopts =-a "Do""This""Separate"
resx =['-a', '"Do"', 'ThisSeparate']
res =['-a', '"Do"', '"This"', '"Separate"']
Traceback (most recent call last):
File "shlex_demo.py", line 52, in <module>
assert res == resx
AssertionError
"""
<--snip
I also checked the variant with a trailing quoted word for completeness, which is not enclosed. Does not split at all:
sopts =-a Do"SeparateThis"
resx =['-a', 'Do', '"SeparateThis"']
res =['-a', 'Do"SeparateThis"'] |
|
Date |
User |
Action |
Args |
2016-10-09 08:02:45 | acue | set | recipients:
+ acue, vinay.sajip, eric.smith, robodan, ezio.melotti, eric.araujo, r.david.murray, cvrebert, python-dev, Andrey.Kislyuk |
2016-10-09 08:02:45 | acue | set | messageid: <1476000165.64.0.597524292198.issue28392@psf.upfronthosting.co.za> |
2016-10-09 08:02:45 | acue | link | issue28392 messages |
2016-10-09 08:02:45 | acue | create | |
|