◐ Shell
clean mode source ↗

Message 165307 - Python tracker

On 07/12/2012 04:13 AM, Serhiy Storchaka wrote:
> Serhiy Storchaka<storchaka@gmail.com>  added the comment:
>
>> sys.stdin.write returns the wrong error message when passed a non-string. Presently it returns io.UnsupportedOperation instead of TypeError: must be str, not ...
> It's not a bug. sys.stdin.write raises io.UnsupportedOperation in
> standard interpreter.

Here's what I get from the standard interpreter:

     Python 3.3.0b1 (default:4752fafb579d, Jul 11 2012, 22:05:03)
     [GCC 4.5.2] on linux
     Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys
 >>> sys.stdin.write(123)
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     TypeError: must be str, not int
 >>>

> ----------
>
> _______________________________________
> Python tracker<report@bugs.python.org>
> <http://bugs.python.org/issue15318>
> _______________________________________
>