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 lemburg
Recipients SilentGhost, ezio.melotti, lemburg, loewis, r.david.murray, serhiy.storchaka, spaceone, vstinner
Date 2015-12-18.19:45:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <5674624C.1060505@egenix.com>
In-reply-to <1450466711.68.0.954133179302.issue25880@psf.upfronthosting.co.za>
Content
On 18.12.2015 20:25, R. David Murray wrote:
> I wonder if we originally only had UnicodeError and it got split later but these codecs were never updated.  The codecs date back to the start of unicode support in python2, I think.

UnicodeDecodeError and UnicodeEncodeError were added in Python 2.3
as part of the more flexible error handlers.

> Adding MAL, he's likely to have an opinion on this ;)
> 
> Oh, right.  The more likely possibility is that there was (in python2) no way to know if the operation was (from the user's POV) encoding or decoding when the codec was called.  In python3 we do know, when the codec is called via encode/decode, but the codecs are still generic in principle.  So yeah, we need MAL's opinion.  (Or, I could be completely confused, since I always found encode/decode confusing in python2 :)

There's a clear direction with codecs:
- encode: transform to the encoded data
- decode: transform back from the encoded data

Take e.g. the hex codec. It encodes data into hex format and
decodes from hex format back into the original data.

The IDNA codecs transforms Unicode domains into the IDNA format
(.encode()) and back to Unicode again (.decode()).

It was added in Python 2.3 as well, so I guess it was just
an overlap/oversight that it was not adapted to the new error
classes.
History
Date User Action Args
2015-12-18 19:45:26lemburgsetrecipients: + lemburg, loewis, vstinner, ezio.melotti, r.david.murray, SilentGhost, serhiy.storchaka, spaceone
2015-12-18 19:45:26lemburglinkissue25880 messages
2015-12-18 19:45:26lemburgcreate