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 <rep...@bugs.python.org>
<http://bugs.python.org/issue17859>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to