On 17/07/07, Christian Heimes <[EMAIL PROTECTED]> wrote:
> def write(self, s: str):
> if self.closed:
> raise ValueError("write to closed file")
> if not hasattr(s, 'encode')
> raise TypeError("str expected, got %r" % s)
> ...
>
> ? It explains what is going wrong.
Surely the error should say that the object passed needs an encode
method, rather than that it should be a str?
Paul.
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com