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

Ezio Melotti report at bugs.python.org
Sat Nov 27 09:16:14 CET 2010

Ezio Melotti <ezio.melotti at gmail.com> added the comment:

I agree that s.center(char, n).encode('utf-8') should be the same on both the builds -- even if their len() will be different -- for the following reasons:

1) the string will eventually be encoded, and if they the result is the same on both builds, it will look the same too;
2) trying to keep the same len() will generate different results and it won't work in case of odd width like 'foo'.center(surrogate_pair, 5) because you can't put half surrogate.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list