[issue4039] Add __enter__ and __exit__ methods to StringIO/cStringIO classes

2008-10-04 Thread peppergrower
New submission from peppergrower [EMAIL PROTECTED]: Currently, StringIO objects do not have __enter__ and __exit__ methods associated with them. As a result, the 'with' statement won't work properly on StringIO objects in a construction like the following, though they can otherwise

Using the 'with' statement with cStringIO objects

2008-09-27 Thread peppergrower
can't use the 'with' statement with cStringIO objects? Is this a bug, or do I need to use the 'with' statement differently to get this to work? Thanks, peppergrower -- http://mail.python.org/mailman/listinfo/python-list

Re: Using the 'with' statement with cStringIO objects

2008-09-27 Thread peppergrower
Thanks for the help. I'm fairly new to programming (which you probably could have guessed...). When I realized that you could use a StringIO instance as if it were a file, I wanted to try some of the same techniques on it as I would with a file. In this case, I wanted to use a for line in