SilentGhost added the comment: I think what David was trying to say is that you could do
try: user_input.encode(encoding) except UnicodeError: do_my_error_handling() since UnicodeError is a super class of UnicodeDecodeError and UnicodeEncodeError. ---------- nosy: +SilentGhost _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25880> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com