This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients cvrebert, eli.bendersky, ncoghlan, pitrou
Date 2012-02-12.04:51:57
SpamBayes Score 2.7644942e-11
Marked as misclassified No
Message-id <[email protected]>
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: <[email protected]>
2012-02-12 04:51:58ncoghlanlinkissue13997 messages
2012-02-12 04:51:57ncoghlancreate

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant