[issue1170] shlex have problems with parsing unicode

Fernando Perez report at bugs.python.org
Mon Jul 26 06:35:48 CEST 2010


Fernando Perez <fdo.perez at gmail.com> added the comment:

Here is an illustration of the problem with a simple test case (the value of the posix flag doesn't make any difference):

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import shlex
>>> list(shlex.shlex('ab'))
['ab']
>>> list(shlex.shlex(u'ab', posix=True))
['a', '\x00', '\x00', '\x00', 'b', '\x00', '\x00', '\x00']
>>> list(shlex.shlex(u'ab', posix=False))
['a', '\x00', '\x00', '\x00', 'b', '\x00', '\x00', '\x00']
>>>

----------
nosy: +fperez

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1170>
_______________________________________


More information about the Python-bugs-list mailing list