Le Tuesday 17 March 2009 13:52:16 Victor Stinner, vous avez écrit : > I realised with the issue #3446 that getarg('c') (get a byte) accepts not > only a byte string of 1 byte, but also an unicode string of 1 character (if > the character code is in [0; 255]). I don't think that it's a good idea to > accept unicode here. Example: b"x".center(5, "\xe9") should be a TypeError. > > The "C" format (get a character) has the opposite problem: it accepts both > byte and unicode, whereas byte should be rejected. Example: > mmap.write_byte('é') should be a TypeError.
I opened an issue (with a patch) for my request: http://bugs.python.org/issue5499 Note: except of the bytes.{center,ljust,rjust} tests, all other tests are ok. It should not break the standard library, but maybe 3rd party library. -- Victor Stinner aka haypo http://www.haypocalc.com/blog/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com