Richard Xia added the comment: Thanks for the discussion. I ended up doing something similar to the code snippet Christian posted, except I also had a second try/except FileNotFoundError within the original finally block to catch the case that David pointed out.
In retrospect, I probably should have used TemporaryDirectory since I am using Python 3.5 and because the file I was creating with NamedTemporaryFile was only being used as an output file, not an input file, to the subprocess command. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29573> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com