Message164509
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. |
|
Date |
User |
Action |
Args |
2012-07-02 08:53:39 | tim.golden | set | recipients:
+ tim.golden, jaraco, ncoghlan, pitrou, eric.smith, eric.araujo, r.david.murray, brian.curtin, dabrahams, davide.rizzo, sbt, dlenski |
2012-07-02 08:53:38 | tim.golden | link | issue14243 messages |
2012-07-02 08:53:37 | tim.golden | create | |
|