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 barry, ezio.melotti, flox, lemburg, ncoghlan, vstinner
Date 2013-11-05.14:16:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383661015.85.0.761977763134.issue17828@psf.upfronthosting.co.za>
In-reply-to
Content
Checking the other binary<->binary and str<->str codecs with input type and value restrictions:

- they all throw TypeError and get wrapped appropriately when asked to encode str input (rot_13 throws the output type error)

- rot_13 throws an appropriately wrapped AttributeError when asked to decode bytes or bytearray object

For bad value input, "uu_codec" is the only one that throws a normal ValueError, I couldn't figure out a way to get "quopri_codec" to complain about the input value and the others throw a module specific error:

    binascii (base64_codec, hex_codec) throws binascii.Error (a custom ValueError subclass)
    zlib (zlib_codec) throws zlib.error (inherits directly from Exception)

As with the OSError that escapes from bz2_codec, I think the simplest and most conservative option is to not worry about those at this point.
History
Date User Action Args
2013-11-05 14:16:55ncoghlansetrecipients: + ncoghlan, lemburg, barry, vstinner, ezio.melotti, flox
2013-11-05 14:16:55ncoghlansetmessageid: <1383661015.85.0.761977763134.issue17828@psf.upfronthosting.co.za>
2013-11-05 14:16:55ncoghlanlinkissue17828 messages
2013-11-05 14:16:55ncoghlancreate