Message202212
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. | |
| Date | User | Action | Args | | 2013-11-05 14:16:55 | ncoghlan | set | recipients: + ncoghlan, lemburg, barry, vstinner, ezio.melotti, flox | | 2013-11-05 14:16:55 | ncoghlan | set | messageid: <1383661015.85.0.761977763134.issue17828@psf.upfronthosting.co.za> | | 2013-11-05 14:16:55 | ncoghlan | link | issue17828 messages | | 2013-11-05 14:16:55 | ncoghlan | create | | |