Message178630
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. |
|
Date |
User |
Action |
Args |
2012-12-31 00:05:44 | ned.deily | set | recipients:
+ ned.deily, loewis, georg.brandl, ronaldoussoren, lebigot, christian.heimes, ajaksu2 |
2012-12-31 00:05:44 | ned.deily | set | messageid: <1356912344.07.0.315536085531.issue1653416@psf.upfronthosting.co.za> |
2012-12-31 00:05:44 | ned.deily | link | issue1653416 messages |
2012-12-31 00:05:43 | ned.deily | create | |
|