[Python-3000] Odd output from test -- buffering bug?
Guido van Rossum
guido at python.org
Mon Oct 29 18:48:05 CET 2007
Thinking about this some more, the io module isn't thread-safe. It
probably should be (the old file objects were more-or-less
thread-safe, although I believe there might've been corner cases if
one thread were to close a file).
--Guido
2007/10/27, Bill Janssen <janssen at parc.com>:
> No, not unless the test harness uses it. But there are two threads.
>
> > Hard to say. Never seen this before. Are you using fork() *anywhere*
> > in your tests (not necessarily the affected test)?
> >
> > 2007/10/27, Bill Janssen <janssen at parc.com>:
> > > I'm seeing a sort of odd thing going on when running one of my tests.
> > > I'm seeing two lines of output, from two different threads, being
> > > duplicated when I run with "regrtest -u all -v test_ssl". This is
> > > with the latest 3K sources on PPC OS X 10.4.10.
> > >
> > > testSTARTTLS (test.test_ssl.ThreadedTests) ...
> > > client: sending b'msg 1'...
> > > ^@client: sending b'msg 1'...
> > > server: new connection from ('127.0.0.1', 52371)
> > > server: new connection from ('127.0.0.1', 52371)
> > >
> > > This is output to an Emacs shell buffer, so it shows control
> > > characters in the output, and I'm seeing a NUL character being output
> > > there at the beginning of the third line. Both of the duplicated lines
> > > are being output with code like this:
> > >
> > > if test_support.verbose:
> > > sys.stdout.write(
> > > " client: sending %s...\n" % repr(msg))
> > >
> > > This looks like some kind of buffering bug. Is it in the test
> > > harness, or the standard I/O library?
> > >
> > > Bill
> > >
> > > _______________________________________________
> > > Python-3000 mailing list
> > > Python-3000 at python.org
> > > http://mail.python.org/mailman/listinfo/python-3000
> > > Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
> > >
> >
> >
> > --
> > --Guido van Rossum (home page: http://www.python.org/~guido/)
>
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list