[issue10521] str methods don't accept non-BMP fillchar on a narrow Unicode build

Alexander Belopolsky report at bugs.python.org
Wed Nov 24 22:23:59 CET 2010

Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

On Wed, Nov 24, 2010 at 3:37 PM, Marc-Andre Lemburg
<report at bugs.python.org> wrote:
> I don't think we should change that for the formatting methods.

That's a reasonable position.  What about

>>> '\N{OLD ITALIC LETTER A}'.isalpha()

the str.isalpha() method is underspecified in the reference manual,
but a comment in unicodectype.c describes Py_UNICODE_ISALPHA as

/* Returns 1 for Unicode characters having the category 'Ll', 'Lu',
   'Lo' or 'Lm',  0 otherwise. */

I don't have a wide build handy, but I am fairly sure  '\N{OLD ITALIC
LETTER A}'.isalpha() would produce True there.  The result above is
simply consequence of surrogates considered to be non-letters:

[False, False]


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list