To avoid byte/character mixture, getarg('c') must only accept a byte string of 1 byte and getarg('C') only an unicode string of 1 character. Impacted methods: - datetime.datetime.isoformat(sep), array.array(type, data): don't accept byte anymore - msvcrt.putch(char), msvcrt.ungetch(char), .write_byte(char): don't accept unicode anymore I tried runtests.sh: only the 3 bytes.{center,ljust,rjust} tests have to be changed, all other tests are ok. Related issues: #3446, #5391.
unicode methods center(), ljust(), rjust() use a callback (convert_uc) to get an unicode character (unicode string of 1 character). If 'C' is fixed, convert_uc() callback can be removed.
Ooops, I read converterr("a unicode character", ...), but it should be converterr("an unicode character", ...) ;-) Thanks benjamin.peterson, it will help other issues like #5391 and #5410.
History
Date
User
Action
Args
2022-04-11 14:56:46
admin
set
github: 49749
2009-04-02 08:23:07
vstinner
set
messages: +
2009-04-02 00:34:27
benjamin.peterson
set
status: open -> closednosy: + benjamin.petersonmessages: + resolution: accepted