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 eric.araujo
Recipients amaury.forgeotdarc, eric.araujo, jkloth, r.david.murray, serhiy.storchaka, techtonik
Date 2012-12-13.16:45:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355417116.83.0.622257255041.issue16656@psf.upfronthosting.co.za>
In-reply-to
Content
Anatoly
> b'Русское имя' is not a valid syntax construct in Python 3 even though I have
> correct 'coding: utf-8' header and expect characters to be utf-8 bytes.

David
> The byte string vs the coding cookie is an interesting observation, but is a separate
> issue and should probably be raised on python-ideas, since I'm guessing it the
> current behavior was a conscious design choice.

Yes, it works as designed: the coding cookie is used to decode bytes to characters in unicode literals (e.g. if I have u'Éric' in my source file, not a \u escape); bytes literals are independent of the coding cookie and should always contain only bytes, not characters (including \u escapes), e.g. '\xc3\x89ric' for UTF-8 bytes.
History
Date User Action Args
2012-12-13 16:45:16eric.araujosetrecipients: + eric.araujo, amaury.forgeotdarc, techtonik, jkloth, r.david.murray, serhiy.storchaka
2012-12-13 16:45:16eric.araujosetmessageid: <1355417116.83.0.622257255041.issue16656@psf.upfronthosting.co.za>
2012-12-13 16:45:16eric.araujolinkissue16656 messages
2012-12-13 16:45:16eric.araujocreate