Issue7862
Created on 2010-02-05 21:28 by skrah, last changed 2010-08-13 15:19 by pitrou.
|
msg98909 - (view) |
Author: Stefan Krah (skrah) |
Date: 2010-02-05 21:28 |
|
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
|
|
msg113784 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2010-08-13 15:19 |
|
All of them should probably raise io.UnsupportedOperation instead (which inherits from both IOError and ValueError).
|
|
| Date |
User |
Action |
Args |
| 2010-08-13 15:19:28 | pitrou | set | messages:
+ msg113784 |
| 2010-08-02 19:17:50 | georg.brandl | set | assignee: pitrou |
| 2010-02-05 22:35:01 | pitrou | set | nosy:
+ amaury.forgeotdarc
|
| 2010-02-05 21:28:18 | skrah | create | |
|