Paul Svensson wrote:
> On Fri, 18 Nov 2005, Walter Dörwald wrote:
>
>> BTW, isatty() has a similar problem:
>>
>> >>> import StringIO, cStringIO
>> >>> s = StringIO.StringIO()
>> >>> s.close()
>> >>> s.isatty()
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> File "/usr/local/lib/python2.4/StringIO.py", line 93, in isatty
>> _complain_ifclosed(self.closed)
>> File "/usr/local/lib/python2.4/StringIO.py", line 40, in
>> _complain_ifclosed
>> raise ValueError, "I/O operation on closed file"
>> ValueError: I/O operation on closed file
>> >>> s = cStringIO.StringIO()
>> >>> s.close()
>> >>> s.isatty()
>> False
>>
>> I guess cStringIO.StringIO.isatty() should raise an exception too.
>
>
> Why ? Is there any doubt that it's not a tty ?
No, but for real files a ValueError is raised too.
Bye,
Walter Dörwald
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com