Due to shlex.py's use of cStringIO, it behaves badly when fed unicode strings. The attached patch fixes that by always using StringIO instead of cStringIO.
Logged In: YES user_id=92689 Ugh, I take that back: it doesn't fix it, there's a gross snippet in shlex.py that makes it barf: if self.posix: self.wordchars += ('??·???ÂÊÁËÈÍÎÏÌÓÔ?ÒÚÛÙ??¯???¸???' '¿¡¬????«»? ÀÃÕ????????÷ÿ??????') Help. I'd love to fix this, but I'm not sure what would be correct (my intuition says to just yank the above snippet, but I'm sure that'll make _someone_ unhappy...).
Logged In: YES user_id=21627 To test whether a letter is a wordchar, you should check whether it .isalnum() or equals '_'. Then you can do away with self.wordchars, and it works the same for byte strings and Unicode strings. Non-ASCII characters in byte strings then work if locale.setlocale had been invoked.