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 doerwalter
Recipients benjamin.peterson, doerwalter, eamanu, ezio.melotti, lemburg, pitrou, serhiy.storchaka, thatiparthy, vstinner
Date 2020-06-25.15:11:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593097914.59.0.615892632075.issue41115@roundup.psfhosted.org>
In-reply-to
Content
UnicodeEncodeError and UnicodeDecodeError are used to report un(en|de)codedable ranges in the source object, so it wouldn't make sense to use them for errors that have nothing to do with problems in the source object. Their constructor requires 5 arguments (encoding, object, start, end, reason), not just a simple message: e.g. UnicodeEncodeError("utf-8", "foo", 17, 23, "bad string").

But for reporting e.g. missing BOMs at the start it would be useful to use (0,  0) as the offending range.
History
Date User Action Args
2020-06-25 15:11:54doerwaltersetrecipients: + doerwalter, lemburg, pitrou, vstinner, benjamin.peterson, ezio.melotti, serhiy.storchaka, thatiparthy, eamanu
2020-06-25 15:11:54doerwaltersetmessageid: <1593097914.59.0.615892632075.issue41115@roundup.psfhosted.org>
2020-06-25 15:11:54doerwalterlinkissue41115 messages
2020-06-25 15:11:54doerwaltercreate