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 serhiy.storchaka
Recipients Marcus.Smith, Suzumizaki, dstufft, ncoghlan, paul.moore, serhiy.storchaka, tanbro-liu, vstinner, xtreak
Date 2018-12-22.08:35:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545467707.87.0.98272194251.issue24307@roundup.psfhosted.org>
In-reply-to
Content
Even if you encode the Unicode default for output, the user can not specify the same value, unless you use custom converter. For example, if you encode u"早上好" as string "\xe6\x97\xa9\xe4\xb8\x8a\xe5\xa5\xbd" (in UTF-8), the user can only specify the argument as a 8-bit string "\xe6\x97\xa9\xe4\xb8\x8a\xe5\xa5\xbd" which differs from a Unicode string u"早上好".

Even if you use a custom converter which decodes 8-bit strings to Unicode, it makes sense to specify the default value as encoded string, because it will be pass to the converter.

Non-ascii unicode values never supported as default values. This issue is rather a feature request than a bug report. It is too late to add new features in 2.7. The right solution is to upgrade to Python 3. Eventually, solving similar issues was one of purposes of creating Python 3.
History
Date User Action Args
2018-12-22 08:35:08serhiy.storchakasetrecipients: + serhiy.storchaka, paul.moore, ncoghlan, vstinner, Suzumizaki, dstufft, Marcus.Smith, tanbro-liu, xtreak
2018-12-22 08:35:07serhiy.storchakasetmessageid: <1545467707.87.0.98272194251.issue24307@roundup.psfhosted.org>
2018-12-22 08:35:07serhiy.storchakalinkissue24307 messages
2018-12-22 08:35:07serhiy.storchakacreate