Author r.david.murray
Recipients Arfrever, a.badger, abadger1999, benjamin.peterson, ezio.melotti, lemburg, ncoghlan, pitrou, r.david.murray, serhiy.storchaka, vstinner
Date 2013-08-22.15:40:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377186038.8.0.16299145899.issue18713@psf.upfronthosting.co.za>
In-reply-to
Content
If you pipe the ls (eg: ls >temp) the bytes are preserved.  Since setting the escape handler via PYTHONIOENCODING sets it for both stdin in and stdout, it sounds like that solves the sysadmin use case.  The sysadmin can just put that environment variable setting in their default profile, and python will once again work like the other unix shell tools.  (I double checked, and this does indeed work...doing the equivalent of ls >temp via python preserves the bytes with that PYTHONIOENCODING setting.  I don't quite understand, however, why I get the � chars if I don't redirect the output.). 

I'd be inclined to consider the above as reason enough to close this issue.  As usual with Python, explicit is better than implicit.
History
Date User Action Args
2013-08-22 15:40:38r.david.murraysetrecipients: + r.david.murray, lemburg, ncoghlan, pitrou, vstinner, abadger1999, benjamin.peterson, ezio.melotti, a.badger, Arfrever, serhiy.storchaka
2013-08-22 15:40:38r.david.murraysetmessageid: <1377186038.8.0.16299145899.issue18713@psf.upfronthosting.co.za>
2013-08-22 15:40:38r.david.murraylinkissue18713 messages
2013-08-22 15:40:38r.david.murraycreate