This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Carl Osterwisch, Gabi.Davar, John Florian, dabrahams, davide.rizzo, dlenski, eric.araujo, eric.smith, jaraco, jwilk, martin.panter, ncoghlan, paul.moore, piotr.dobrogost, pitrou, r.david.murray, sbt, steve.dower, tim.golden, zach.ware
Date 2017-02-24.07:04:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
John, your problem sounds different - if you're opening the files in binary mode, then you'll be getting a default buffer that's probably 4k or 8k in size, so if you're writing less content than that, the subprocess won't see anything until you explicitly flush() the buffer to disk (and even if you're writing more than that, the subprocess may see a truncated version without an explicit flush()). 

By contrast, the issue here relates to the fact that on Windows it's currently necessary to do the following in order to get multiple handles to a NamedTemporaryFile:

1. Open the file in the current process
2. Write content to the file
3*. Close the file in the current process
4. Open the file by name in another process (or the current process)
5. Read content from the file
6. Close the second file handle
7*. Delete the file

*On POSIX systems, you can just skip step 3 and leave closing the original file handle until step 7, and that's the design that the current NamedTemporaryFile is built around. Most of the discussion above is about figuring out how to make that same approach "just work" on Windows (perhaps with some additional flags used in step 4), rather than  providing a third option beyond the current delete-on-close and delete-manually.
Date User Action Args
2017-02-24 07:04:09ncoghlansetrecipients: + ncoghlan, paul.moore, jaraco, pitrou, eric.smith, tim.golden, jwilk, eric.araujo, r.david.murray, dabrahams, davide.rizzo, sbt, Gabi.Davar, martin.panter, piotr.dobrogost, zach.ware, dlenski, steve.dower, Carl Osterwisch, John Florian
2017-02-24 07:04:09ncoghlansetmessageid: <>
2017-02-24 07:04:09ncoghlanlinkissue14243 messages
2017-02-24 07:04:08ncoghlancreate