<font color="#000000"><br></font><br><div class="gmail_quote">On Mon, Oct 24, 2011 at 3:03 AM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, Oct 24, 2011 at 4:18 PM, Jason Swails <<a href="mailto:jason.swails@gmail.com">jason.swails@gmail.com</a>> wrote:<br>
> my_csv = csv.writer(open('temp.1.csv', 'wb'))<br>
><br>
<br>
</div>Have you confirmed, or can you confirm, whether or not the file gets<br>
closed automatically when the writer gets destructed? If so, all you<br>
need to do is:<br>
<br>
my_csv = something_else<br>
# or:<br>
del my_csv<br></blockquote><div><br></div><div>I'm not sure why I decided against this approach in the first place. This does work (at least with my test), so it's what I'll do. I probably wasn't confident that it would clean itself up properly, but that's probably rather un-pythonic and would not have made it into the stdlib if that was the case.</div>
<div><br></div><div>Thanks!</div><div>Jason</div><div><br></div></div>