diff Objects/bytesobject.c @ 41648:bc6ad63cd5f1

repr(b"\0") should return b"\x00", not the (unusual) b"\0".
author Guido van Rossum <guido@python.org>
date Tue, 08 May 2007 19:09:34 +0000
parents ca448c607b14
children a363cea32b9b
line wrap: on
line diff
--- a/Objects/bytesobject.c	Tue May 08 18:51:25 2007 +0000
+++ b/Objects/bytesobject.c	Tue May 08 19:09:34 2007 +0000
@@ -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