This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients Wade.Tattersall, alexandre.vassalotti, belopolsky, brian.curtin, eric.snow, georg.brandl, orsenthil, ygale
Date 2012-11-28.05:42:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354081335.38.0.178244111133.issue1286@psf.upfronthosting.co.za>
In-reply-to
Content
Keep in mind that it's pretty easy to roll your own CM wrapper:

@contextlib.contextmanager
def closes(file):
    yield file
    file.close()

Then you can do this:

with closes(StringIO()) as test:
    test.write("hi!")
    return test.getvalue()

This works for 2.5 and up.
History
Date User Action Args
2012-11-28 05:42:15eric.snowsetrecipients: + eric.snow, georg.brandl, belopolsky, ygale, orsenthil, alexandre.vassalotti, brian.curtin, Wade.Tattersall
2012-11-28 05:42:15eric.snowsetmessageid: <1354081335.38.0.178244111133.issue1286@psf.upfronthosting.co.za>
2012-11-28 05:42:15eric.snowlinkissue1286 messages
2012-11-28 05:42:15eric.snowcreate