[New-bugs-announce] [issue1775] filehandle.write() does not return None (Python 3.0a2)
report at bugs.python.org
Wed Jan 9 13:52:29 CET 2008
New submission from Andre Roberge:
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
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')
>>> r = handle.write('more spam')
/usr/local/py3k/lib/python3.0/io.py:1210: RuntimeWarning: Trying to
close unclosable fd!
components: Interpreter Core
title: filehandle.write() does not return None (Python 3.0a2)
versions: Python 3.0
Tracker <report at bugs.python.org>
More information about the New-bugs-announce