Author ncoghlan
Recipients cvrebert, eli.bendersky, ncoghlan, pitrou
Date 2012-02-12.04:51:57
SpamBayes Score 2.76449e-11
Marked as misclassified No
Message-id <1329022319.4.0.394273362035.issue13997@psf.upfronthosting.co.za>
In-reply-to
Content
No point to adding a new keyword arg - if people are going to do something like that, they may as well learn to use "errors" and "encoding" properly.

Adding open_ascii() would be an acknowledgement that "basically ASCII, but maybe with a few other bytes that just need to round-trip correctly" is a common enough use case to special case (in particular, it's convenient to have algorithms than can operate on both utf-8 and all 8-bit extended ASCII variants, including latin-1).

The downside to using surrogateescape is that if you ever *do* feed it a file in a non-ASCII compatible encoding and then perform ASCII-based manipulations, you'll get mojibake instead of an early UnicodeDecodeError. (i.e. exactly the same problem this kind of thing can cause in Python 2)
History
Date User Action Args
2012-02-12 04:51:59ncoghlansetrecipients: + ncoghlan, pitrou, eli.bendersky, cvrebert
2012-02-12 04:51:59ncoghlansetmessageid: <1329022319.4.0.394273362035.issue13997@psf.upfronthosting.co.za>
2012-02-12 04:51:58ncoghlanlinkissue13997 messages
2012-02-12 04:51:57ncoghlancreate