Show More
@@ -287,13 +287,12 b' def arg_split(s,posix=False):' | |||
|
287 | 287 | function, but with a default of posix=False for splitting, so that quotes |
|
288 | 288 | in inputs are respected.""" |
|
289 | 289 | |
|
290 | # XXX - there may be unicode-related problems here!!! I'm not sure that | |
|
291 | # shlex is truly unicode-safe, so it might be necessary to do | |
|
292 | # | |
|
293 | # s = s.encode(sys.stdin.encoding) | |
|
294 | # | |
|
295 | # first, to ensure that shlex gets a normal string. Input from anyone who | |
|
296 | # knows more about unicode and shlex than I would be good to have here... | |
|
290 | # Unfortunately, python's shlex module is buggy with unicode input: | |
|
291 | # http://bugs.python.org/issue1170 | |
|
292 | # At least encoding the input when it's unicode seems to help, but there | |
|
293 | # may be more problems lurking. Apparently this is fixed in python3. | |
|
294 | if isinstance(s, unicode): | |
|
295 | s = s.encode(sys.stdin.encoding) | |
|
297 | 296 | lex = shlex.shlex(s, posix=posix) |
|
298 | 297 | lex.whitespace_split = True |
|
299 | 298 | return list(lex) |
General Comments 0
You need to be logged in to leave comments.
Login now