[issue17859] improve error message for saving ints to file
Ezio Melotti
report at bugs.python.org
Sun Apr 28 09:47:54 CEST 2013
Ezio Melotti added the comment:
Maybe the error could be replaced with something like:
TypeError: write() requires an object that supports the buffer interface, not '<type>'
But that's a bit long and also not entirely accurate, because the type accepted by write depends on the type of the file (binary or text). The first problem could be solved by using "requires a bytes-like object"[0], the second problem could be fixed by omitting the name of the function:
TypeError: a bytes-like object is required, not '<type>'
[0]: #16518 has a discussion about the best term to describe "objects that support the buffer protocol"
----------
nosy: +ezio.melotti
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17859>
_______________________________________
More information about the Python-bugs-list
mailing list