"print" strange with Sybase module

Carsten Gaebler cg at schlund.de
Fri Jan 26 04:05:44 EST 2001


"Erwin S. Andreasen" wrote:

> >./sqltest.py | tee /tmp/test.txt
> >
> >there is no output and test.txt is empty. What's going wrong? It's
> >Sybase module 0.10 with Python 2.0.
> 
> Does your Python interpreter exit before the very end with some fatal error?
> (do echo $? after you run the script without piping it to see the exit error
> code, is it 0?).

Everything's fine, return code is 0.

> I can't see a reason to why it would exit that way quietly, but unflushed
> buffers are the first thing that comes to mind when seeing those symptoms.

If I give Python the "-u" option the following happens:

[cg at cg test]$ ./sqltest.py | tee /tmp/test.txt
Traceback (most recent call last):
  File "./sqltest.py", line 12, in ?
    print row
IOError: [Errno 32] Broken pipe


Broken pipe?? BTW it's the same with "|less", "|more", "|gzip" etc. I'm
confused.
cg.



More information about the Python-list mailing list