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 vstinner
Recipients belopolsky, benjamin.peterson, cben, eric.araujo, flox, georg.brandl, gvanrossum, lemburg, loewis, ncoghlan, ssbarnea, vstinner
Date 2011-10-19.22:34:48
SpamBayes Score 0.0059288824
Marked as misclassified No
Message-id <1319063688.95.0.0614650932312.issue7475@psf.upfronthosting.co.za>
In-reply-to
Content
> *.encode('rot_13') ==> CodecLookupError

I like the idea of raising a lookup error on .encode/.decode if the codec is not a classic text codec (like ASCII or UTF-8).

> *.transform('ascii') ==> CodecLookupError

Same comment.

> str.transform('bz2') ==> CodecLookupError

A lookup error is surprising here. It may be a TypeError instead. The bz2 can be used with .transform, but not on str. So:

 - Lookup error if the codec cannot be used with encode/decode or transform/untransform
 - Type error if the value type is invalid

(CodecLookupError doesn't exist, you propose to define a new exception who inherits from LookupError?)
History
Date User Action Args
2011-10-19 22:34:49vstinnersetrecipients: + vstinner, lemburg, gvanrossum, loewis, georg.brandl, cben, ncoghlan, belopolsky, benjamin.peterson, eric.araujo, ssbarnea, flox
2011-10-19 22:34:48vstinnersetmessageid: <1319063688.95.0.0614650932312.issue7475@psf.upfronthosting.co.za>
2011-10-19 22:34:48vstinnerlinkissue7475 messages
2011-10-19 22:34:48vstinnercreate