[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2433: dead code: NamedTemporaryDirectory

Tahoe-LAFS trac at tahoe-lafs.org
Wed May 27 00:18:14 UTC 2015


#2433: dead code: NamedTemporaryDirectory
------------------------+-------------------------------
     Reporter:  zooko   |      Owner:  daira
         Type:  defect  |     Status:  closed
     Priority:  minor   |  Milestone:  1.10.1
    Component:  code    |    Version:  1.10.0
   Resolution:  fixed   |   Keywords:  cleanup dead-code
Launchpad Bug:          |
------------------------+-------------------------------

Comment (by daira):

 I looked at the implementation of `NamedTemporaryFile` in pyutil, and I
 think it may not work correctly for asynchronous tests. The problem is
 that the `NamedTemporaryFile` object may go out of scope and have its
 `__del__` method called before any callback/errback chains associated with
 the test have finished (it's possible that the closures of those
 callbacks/errbacks might hold on to the object for long enough, but that
 seems error-prone and complicated to reason about).

 If we were going to add automatic cleanup, I would want it to only be
 triggered in the test's cleanup phase. Even that is potentially a problem
 for diagnosing what happened by looking at the files under `_trial_temp`
 in case of a test failure.

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2433#comment:7>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list