[Pythonmac-SIG] Is this a bug?
Bob Ippolito
bob@redivi.com
Mon, 17 Feb 2003 15:27:15 -0500
On Monday, Feb 17, 2003, at 13:00 America/New_York, Stefan Petrucha
wrote:
> MacPython 2.2.2:
>
> Documentation on module sys says that sys.stdout and/or sys.stderr can
> be any object having method write() taking one string argument. But
> test.regrtest.main() traces back executing sys.stdout.flush().
> (Background: Python is embedded into another application and sys.std*
> are redirected.)
>
> If I remember good MacPython 2.2.1 had no such problem.
>
> Can this be considered as a bug? When yes: is it a documentation or
> test.regrtest bug? Should I log it somewhere (of course by checking
> first nobody did it already)?
Not speaking specifically for MacPython, but in practice flush is
usually expected to be there for stdout (don't often see people flush
stderr).. it doesn't actually have to do anything if the meaning
doesn't make sense for your file-like object, but probably should be a
callable attribute (for example: "sys.stdout.flush = lambda *x:None").
-bob