Author bpedman
Recipients bpedman
Date 2010-08-11.17:50:45
SpamBayes Score 4.69973e-07
Marked as misclassified No
Message-id <>
The cStringIO module in CPython says:

# Close object and discard memory buffer --
# .getvalue() will now raise an exception

I was expecting this to happen in a little script but it did not raise an exception (not relying on it, just testing some things out)

In Jython 2.5.1 I close the StringIO object and it will still return the string buffer

Looking at the source it looks like all close() does is set a flag. In reality it should clear out the buffer to free the memory and raise an exception if getvalue() is called after close
Date User Action Args
2010-08-11 17:50:47bpedmansetrecipients: + bpedman
2010-08-11 17:50:47bpedmansetmessageid: <>
2010-08-11 17:50:46bpedmanlinkissue1640 messages
2010-08-11 17:50:46bpedmancreate