Message98909
| Author |
skrah |
| Recipients |
pitrou, skrah, stutzbach |
| Date |
2010年02月05日.21:28:18 |
| SpamBayes Score |
6.508171e-08 |
| Marked as misclassified |
No |
| Message-id |
<1265405300.06.0.973184216127.issue7862@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think that certain FileIO methods should raise IOError instead of
ValueError when a file operation is attempted with the wrong mode.
The methods of IOBase are documented to raise IOError in these situations.
>>> import io
>>> f = io.open("testfile", "w")
>>> f.read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: not readable
>>>
>>> f = io.FileIO("testfile", "w")
>>> f.read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: File not open for reading |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年02月05日 21:28:20 | skrah | set | recipients:
+ skrah, pitrou, stutzbach |
| 2010年02月05日 21:28:20 | skrah | set | messageid: <1265405300.06.0.973184216127.issue7862@psf.upfronthosting.co.za> |
| 2010年02月05日 21:28:18 | skrah | link | issue7862 messages |
| 2010年02月05日 21:28:18 | skrah | create |
|