[issue17859] improve error message for saving ints to file

Éric Araujo report at bugs.python.org
Sun Apr 28 18:12:42 CEST 2013


Éric Araujo added the comment:

I don’t understand that the first message says.

If one wants to call the write method of a file object opened in binary mode, one needs to pass bytes, as the doc surely explains.  The same error that is seen here with ints would be seen with any other objects.  A more practical way is to use print (with its file, sep and end parameters) which will do the conversion for you.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17859>
_______________________________________


More information about the Python-bugs-list mailing list