This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dexen
Recipients dexen
Date 2007-09-17.16:20:38
SpamBayes Score 0.012659959
Marked as misclassified No
Message-id <>
A quick paste to illustrate: the exception is raised only when unicode 
object is passed to shlex. Warning: the cStringIO module is unsuitable 
for use there, only the StringIO. cStringIO does not output unicode.

dexen!muraena!~$ python
Python 2.5.1 (r251:54863, May  4 2007, 16:52:23)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from StringIO import StringIO
>>> import shlex
>>> lx = shlex.shlex( StringIO( unicode( "abc" ) ) )
>>> lx.get_token()
>>> lx = shlex.shlex( StringIO( unicode( "abc" ) ), None, True )
>>> lx.get_token()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib/python2.5/", line 150, in read_token
    elif nextchar in self.wordchars:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 
63: ordinal not in range(128)
Date User Action Args
2007-09-17 16:20:39dexensetspambayes_score: 0.01266 -> 0.012659959
recipients: + dexen
2007-09-17 16:20:38dexensetspambayes_score: 0.01266 -> 0.01266
messageid: <>
2007-09-17 16:20:38dexenlinkissue1170 messages
2007-09-17 16:20:38dexencreate