Message288473
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? |
|
Date |
User |
Action |
Args |
2017-02-23 19:44:47 | John Florian | set | recipients:
+ 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:46 | John Florian | set | messageid: <1487879086.93.0.981652111016.issue14243@psf.upfronthosting.co.za> |
2017-02-23 19:44:46 | John Florian | link | issue14243 messages |
2017-02-23 19:44:46 | John Florian | create | |
|