[issue1653416] OS X print >> f, "Hello" produces no error on read-only f: normal?
Ned Deily
report at bugs.python.org
Mon Dec 31 01:05:44 CET 2012
Ned Deily added the comment:
An update: the problem with OS X behavior appears to have been fixed between OS X 10.6 and 10.7. As of 10.7, print to a read-only file also fails as on linux:
>>> print >> f, "Hi"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 9] Bad file descriptor
Also, f.write() as of 2.7.3 produces a more meaningful message.
>>> f.write("bha")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: File not open for writing
Since the original example now produces an exception, plus, as noted, this is not an issue for 3.x and it's not likely that further work will be done on 2.x in this area, I'm closing this as out-of-date.
----------
nosy: -BreamoreBoy
resolution: -> out of date
stage: test needed -> committed/rejected
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1653416>
_______________________________________
More information about the Python-bugs-list
mailing list