Skip to content

Comment on Bug #915: Please helpparent

Comments

I suppose adding f.close() right after the flush might help.

The file is in a with block - it should be automatically closed at the end of the block.

Yes, but if it fixes the issue then there's something off with NamedTemporaryFile and its __exit__. You mentioned the file descriptor was being closed by a GC run, right?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.