incorrect(?) shlex behaviour

bill bill.pursell at gmail.com
Sat May 14 16:30:03 EDT 2005


Consider:
>>> import shlex
>>> shlex.split('$(which sh)')
['$(which', 'sh)']

Is this behavior correct?  It seems that I should
either get one token, or the list
['$','(','which','sh',')'],
but certainly breaking it the way it does is
erroneous.  

Can anyone explain why the string is being split
that way?




More information about the Python-list mailing list