This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients ajaksu2, christian.heimes, georg.brandl, lebigot, loewis, ned.deily, ronaldoussoren
Date 2012-12-31.00:05:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1356912344.07.0.315536085531.issue1653416@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-12-31 00:05:44ned.deilysetrecipients: + ned.deily, loewis, georg.brandl, ronaldoussoren, lebigot, christian.heimes, ajaksu2
2012-12-31 00:05:44ned.deilysetmessageid: <1356912344.07.0.315536085531.issue1653416@psf.upfronthosting.co.za>
2012-12-31 00:05:44ned.deilylinkissue1653416 messages
2012-12-31 00:05:43ned.deilycreate