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 SilentGhost
Recipients SilentGhost, ezio.melotti, loewis, r.david.murray, spaceone, vstinner
Date 2015-12-17.16:26:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450369613.27.0.523050959488.issue25880@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-12-17 16:26:53SilentGhostsetrecipients: + SilentGhost, loewis, vstinner, ezio.melotti, r.david.murray, spaceone
2015-12-17 16:26:53SilentGhostsetmessageid: <1450369613.27.0.523050959488.issue25880@psf.upfronthosting.co.za>
2015-12-17 16:26:53SilentGhostlinkissue25880 messages
2015-12-17 16:26:53SilentGhostcreate