Author John Florian
Recipients BreamoreBoy, Carl Osterwisch, Gabi.Davar, John Florian, dabrahams, davide.rizzo, dlenski, eric.araujo, eric.smith, jaraco, martin.panter, ncoghlan, paul.moore, piotr.dobrogost, pitrou, r.david.murray, sbt, steve.dower, tim.golden, zach.ware
Date 2017-02-23.19:44:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487879086.93.0.981652111016.issue14243@psf.upfronthosting.co.za>
In-reply-to
Content
I just stumbled onto this though I'm not writing for Windows.  Instead, I'm on Fedora 25 with Python 3.5.2 and I went nearly crazy tracing down what seemed to be inconsistent behavior.  My use case has Python using NamedTemporaryFile(delete=True) in a CM to produce content fed into a subprocess.  The code had been reliably working and then it just didn't.  The only thing changing was the content being written, an rendered Jinja2 template.  I believe the fate is determined by the content length.  In debugging another problem, I'd been trivializing the template and once it got down to about 3k (rendered) the subprocess began seeing a file whose length was 0 bytes.  Make the template bigger and all works again.  Calling close() resolves the issue, but of course requires delete=False which removed much of the value of this object.  Preliminary testing looks like flush() may also resolve the issue.

Have I just been naive and getting lucky all along because this is expected or is there something else fishy here worth investigation?
History
Date User Action Args
2017-02-23 19:44:47John Floriansetrecipients: + John Florian, paul.moore, jaraco, ncoghlan, pitrou, eric.smith, tim.golden, eric.araujo, r.david.murray, dabrahams, BreamoreBoy, davide.rizzo, sbt, Gabi.Davar, martin.panter, piotr.dobrogost, zach.ware, dlenski, steve.dower, Carl Osterwisch
2017-02-23 19:44:46John Floriansetmessageid: <1487879086.93.0.981652111016.issue14243@psf.upfronthosting.co.za>
2017-02-23 19:44:46John Florianlinkissue14243 messages
2017-02-23 19:44:46John Floriancreate