mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
#16518: Bring error messages in harmony with docs ("bytes-like object")
Some time ago we changed the docs to consistently use the term 'bytes-like object' in all the contexts where bytes, bytearray, memoryview, etc are used. This patch (by Ezio Melotti) completes that work by changing the error messages that previously reported that certain types did "not support the buffer interface" to instead say that a bytes-like object is required. (The glossary entry for bytes-like object references the discussion of the buffer protocol in the docs.)
This commit is contained in:
parent
d577cea8ab
commit
861470c836
11 changed files with 30 additions and 22 deletions
|
@ -241,7 +241,7 @@ PyDoc_STRVAR(compare_digest__doc__,
|
|||
"Return 'a == b'. This function uses an approach designed to prevent\n"
|
||||
"timing analysis, making it appropriate for cryptography.\n"
|
||||
"a and b must both be of the same type: either str (ASCII only),\n"
|
||||
"or any type that supports the buffer protocol (e.g. bytes).\n"
|
||||
"or any bytes-like object.\n"
|
||||
"\n"
|
||||
"Note: If a and b are of different lengths, or if an error occurs,\n"
|
||||
"a timing attack could theoretically reveal information about the\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue