mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
repr(b"\0") should return b"\x00", not the (unusual) b"\0".
This commit is contained in:
parent
e5e80b8c56
commit
57b93ad56d
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue