Message254196
I think that this is a reasonable request, and probably applies to the whole shlex module, although less strongly.
You could use the surrogateescape hack to work around the problem:
shlex.quote(mydata.encode('ascii', 'surrogateescape')).decode('ascii', 'surrogateescape)
That might be the only practical way to handle bytes input to the shlex parser, if we do also want to tackle that.
Note that it is already the case that os module functions that retrn filenames and stdin/stdout use surrogateescape, so a naive program may actually work with binary filenames (which is why the handler is used in those contexts). |
|
Date |
User |
Action |
Args |
2015-11-06 13:58:12 | r.david.murray | set | recipients:
+ r.david.murray, The Compiler, Jonas Thiem |
2015-11-06 13:58:12 | r.david.murray | set | messageid: <1446818292.72.0.196327303662.issue25567@psf.upfronthosting.co.za> |
2015-11-06 13:58:12 | r.david.murray | link | issue25567 messages |
2015-11-06 13:58:12 | r.david.murray | create | |
|