Message153171
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) |
|
Date |
User |
Action |
Args |
2012-02-12 04:51:59 | ncoghlan | set | recipients:
+ ncoghlan, pitrou, eli.bendersky, cvrebert |
2012-02-12 04:51:59 | ncoghlan | set | messageid: <1329022319.4.0.394273362035.issue13997@psf.upfronthosting.co.za> |
2012-02-12 04:51:58 | ncoghlan | link | issue13997 messages |
2012-02-12 04:51:57 | ncoghlan | create | |
|