summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-08 19:09:34 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-08 19:09:34 (GMT)
commit57b93ad56d570c27bd3de3820b996352121c18e2 (patch)
treedbdce68ef3995086ec14d57493573029a9037ab6 /Objects
parente5e80b8c561de3a13154fa45eafcb32b8695eea7 (diff)
downloadcpython-57b93ad56d570c27bd3de3820b996352121c18e2.zip
cpython-57b93ad56d570c27bd3de3820b996352121c18e2.tar.gz
cpython-57b93ad56d570c27bd3de3820b996352121c18e2.tar.bz2
repr(b"\0") should return b"\x00", not the (unusual) b"\0".
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c2
1 files changed, 1 insertions, 1 deletions
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 @@ bytes_repr(PyBytesObject *self)
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