Author aroberge
Recipients aroberge
Date 2008-01-09.12:52:27
SpamBayes Score 0.0182826
Marked as misclassified No
Message-id <>
According to the docs, and consistent with the Python 2.x behavior,
filehandle.write() should return None.  However, under 3.0a2 (and
3.0a1), it returns the number of characters written.

Either the documentation
is wrong, or it is a bug.  I would *much* prefer if the behavior would
stay the same as before.

Below is a sample session illustrating the behavior.  Note that I also
get an error message when exiting the session using exit() - this is an
unrelated problem.

Python 3.0a2 (r30a2:59382, Dec 27 2007, 15:48:14) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> handle = open('test_file.txt.', 'w')
>>> handle.write('spam')
>>> r = handle.write('more spam')
>>> print(r)
>>> exit()
/usr/local/py3k/lib/python3.0/ RuntimeWarning: Trying to
close unclosable fd!
Date User Action Args
2008-01-09 12:52:29arobergesetspambayes_score: 0.0182826 -> 0.0182826
recipients: + aroberge
2008-01-09 12:52:29arobergesetspambayes_score: 0.0182826 -> 0.0182826
messageid: <>
2008-01-09 12:52:28arobergelinkissue1775 messages
2008-01-09 12:52:27arobergecreate