commit | 57b93ad56d570c27bd3de3820b996352121c18e2 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Tue May 08 19:09:34 2007 +0000 |
committer | Guido van Rossum <guido@python.org> | Tue May 08 19:09:34 2007 +0000 |
tree | dbdce68ef3995086ec14d57493573029a9037ab6 | |
parent | e5e80b8c561de3a13154fa45eafcb32b8695eea7 [diff] |
repr(b"\0") should return b"\x00", not the (unusual) b"\0".
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index cb830e3..3a707ac 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c
@@ -849,7 +849,7 @@ else if (c == '\r') *p++ = '\\', *p++ = 'r'; else if (c == 0) - *p++ = '\\', *p++ = '0'; + *p++ = '\\', *p++ = 'x', *p++ = '0', *p++ = '0'; else if (c < ' ' || c >= 0x7f) { /* For performance, we don't want to call PyOS_snprintf here (extra layers of