Problem flushing stderr in embedded python

Donn Cave donn at drizzle.com
Thu Nov 11 01:54:20 EST 2004


Quoth "Farshid Lashkari" <lashkariNO at SPAMworldviz.com>:
...
| I've tried calling fflush on stderr, but that doesn't work either.

OK, this would seem to mean that your sys.stderr has been replaced
with something else.  I guess I don't know for sure what you can
count on in Windows, but I would have to expect that fflush on stderr
really does work - that is, it flushes stderr's buffer.

| I've encountered another weird problem also. If my python code causes an
| error and I don't flush stderr, then I get a runtime error when my app
| exits. It also prints out:
|
| Exception exceptions.NameError: "global name 'y' is not defined" in 'garbage
| collection' ignored
| Fatal Python error: unexpected exception during garbage collection.
|
| Does this give anybody a clue as to what's happening?

Doesn't do anything for me, but you may find out what that is when you
locate the code for the faux stderr you're (not) flushing.  I would be
more worried about this 'y' thing in principle, though, because it sounds
like a problem in the C (or whatever) to Python interface that could have
other unpleasant consequences.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list