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 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:20skrahsetrecipients: + skrah, pitrou, stutzbach
2010-02-05 21:28:20skrahsetmessageid: <1265405300.06.0.973184216127.issue7862@psf.upfronthosting.co.za>
2010-02-05 21:28:18skrahlinkissue7862 messages
2010-02-05 21:28:18skrahcreate