Nick Coghlan added the comment: Oops, my review comments don't actually make sense because I looked at the patch in isolation, rather than checking the full context in the module. Sorry about that.
We have 2 different cases to deal with, only one of which currently has a helper function. I suggest renaming _bytes_from_decode_data to "_bytes_for_decoding" and adding "_bytes_for_encoding". The difference between them is the implicit encoding of pure ASCII strings to bytes in the decoding case and the details of the error message thrown. The encoding and decoding functions should then use the appropriate coercion helper for both the input data and for altchars. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17839> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com