On Wed, Apr 10, 2013 at 5:49 PM, Oscar Benjamin <oscar.j.benja...@gmail.com> wrote: >> fin = open('old.dat') >> fout = open('new.dat', 'w') >> >> with fin, fout: >> for line in fin: > > This has the same problems as contextlib.nested: An error raised while > opening 'new.dat' could prevent 'old.dat' from being closed properly.
Thanks for pointing out the potential bug there. It's not a big problem in this case with the file open for reading. But, yeah, I'm hanging my head in shame here... ;) _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor