From 6d137ac257da5feae1928e3fe59fadd1d6e5c39c Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 18 Nov 2020 15:51:08 -0500 Subject: [PATCH] Get rid of the tempfile.tempdir hackery --- src/allmydata/node.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 9e7143fd4..8eb199ef3 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -740,8 +740,6 @@ class Node(service.MultiService): self._i2p_provider = i2p_provider self._tor_provider = tor_provider - self.init_tempdir() - self.create_log_tub() self.logSource = "Node" self.setup_logging() @@ -768,25 +766,6 @@ class Node(service.MultiService): """ return len(self.tub.getListeners()) > 0 - def init_tempdir(self): - """ - Initialize/create a directory for temporary files. - """ - tempdir_config = self.config.get_config("node", "tempdir", "tmp") - if isinstance(tempdir_config, bytes): - tempdir_config = tempdir_config.decode('utf-8') - tempdir = self.config.get_config_path(tempdir_config) - if not os.path.exists(tempdir): - fileutil.make_dirs(tempdir) - tempfile.tempdir = tempdir - # this should cause twisted.web.http (which uses - # tempfile.TemporaryFile) to put large request bodies in the given - # directory. Without this, the default temp dir is usually /tmp/, - # which is frequently too small. - temp_fd, test_name = tempfile.mkstemp() - _assert(os.path.dirname(test_name) == tempdir, test_name, tempdir) - os.close(temp_fd) # avoid leak of unneeded fd - # pull this outside of Node's __init__ too, see: # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2948 def create_log_tub(self):