From: Kevin B. <ke...@ss...> - 2007-07-10 18:03:50
|
Hi, I am trying to write a large amount of binary data over a pipe with some Jython code. However, when the data is returned to the client, it crashes because it appears that part of the pipe is getting overwritten with subsequent data (some kind-of overflow going on) I am writing over sys.stdout. I have read in other places that it is buffered by default and can be made unbuffered somehow, but I can't seem to figure out how it can be done in the code. I have tried things like: os.environ['PYTHONUNBUFFERED']=1 and sys.stdout.flush in many locations, but still get this same problem. I was also wondering what this means when I type sys.stdout from the Jython prompt: <open file '<stdout>', mode 'w' 1> Am I able to change that "1" at the end there to "0" which I'm thinking might be a buffering argument?? And how would you change it? I know about the -u option for python, but I don't know how to use it in relation to Jython, especially since the code has been compiled with jythonc. Hope this makes a little sense! Thanks! Kevin |