Message5951

Author bpedman
Recipients bpedman
Date 2010-08-11.17:50:45
SpamBayes Score 4.6997312e-07
Marked as misclassified No
Message-id <1281549047.41.0.0170662342871.issue1640@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2010-08-11 17:50:47bpedmansetrecipients: + bpedman
2010-08-11 17:50:47bpedmansetmessageid: <1281549047.41.0.0170662342871.issue1640@psf.upfronthosting.co.za>
2010-08-11 17:50:46bpedmanlinkissue1640 messages
2010-08-11 17:50:46bpedmancreate