Author tim.golden
Recipients brian.curtin, dabrahams, davide.rizzo, dlenski, eric.araujo, eric.smith, jaraco, ncoghlan, pitrou, r.david.murray, sbt, tim.golden
Date 2012-07-02.08:53:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <4FF1618F.900@timgolden.me.uk>
In-reply-to <1341035137.77.0.664208977189.issue14243@psf.upfronthosting.co.za>
Content
On 30/06/2012 06:45, Daniel Lenski wrote:
> My preferred solution would be to replace the binary delete argument of the current NamedTemporaryFile implementation with finer-grained options:
>    delete=False         # don't delete
>    delete=True          # delete after file closed, current behavior
>    delete=AFTER_CLOSE   # delete after file closed
>    delete=AFTER_CM_EXIT # delete after context manager exits
>    delete=AFTER_CM_EXIT_NO_EXCEPTION # delete after CM exit, unless this is due to an exception

I'm aware that Richard & others are fleshing out alternatives. But my
having asked you to propose something I wanted to come back on this
particular suggestion. I think it's just too complex an API. Not least
because, on Windows, we're making use of a filesystem feature which will
delete on closure regardless (so the implementation on Windows skips the
context-based delete).

I'm not sure what we'll end up with but I'm more inclined towards the
sort of method-based closer/reopener which is more explicit.
History
Date User Action Args
2012-07-02 08:53:39tim.goldensetrecipients: + tim.golden, jaraco, ncoghlan, pitrou, eric.smith, eric.araujo, r.david.murray, brian.curtin, dabrahams, davide.rizzo, sbt, dlenski
2012-07-02 08:53:38tim.goldenlinkissue14243 messages
2012-07-02 08:53:37tim.goldencreate