shlex.split != shlex.shlex get_token til eof

p.lavarre at p.lavarre at
Wed Sep 27 00:30:26 CEST 2006

Kindly offline the answer is:

(a) Python installation usually includes source, and thus
(b) UTSL:

$ pwd
$ ...
$ pwd
$ grep -A 5 "def split"
def split(s, comments=False):
    lex = shlex(s, posix=True)
    lex.whitespace_split = True
    if not comments:
        lex.commenters = ''
    return list(lex)

Voila the THREE undocumented ways that shlex.split has been overriding
the shlex.shlex defaults: nothing in wordchars, yes something in
whitespace_split, but also stuff in commenters and in posix.  (Of
these, the posix override is documented.)

More information about the Python-list mailing list