export: Let mkdtemp pick its favorite directory.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2019-01-14 18:02:06 -08:00 committed by Tim Abbott
parent 79d888223f
commit b37ed12df2
4 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ class Command(BaseCommand):
def handle(self, *args: Any, **options: Any) -> None:
output_dir = options["output_dir"]
if output_dir is None:
output_dir = tempfile.mkdtemp(prefix="/tmp/converted-gitter-data-")
output_dir = tempfile.mkdtemp(prefix="converted-gitter-data-")
else:
output_dir = os.path.realpath(output_dir)

View File

@ -36,7 +36,7 @@ class Command(BaseCommand):
def handle(self, *args: Any, **options: Any) -> None:
output_dir = options["output_dir"]
if output_dir is None:
output_dir = tempfile.mkdtemp(prefix="/tmp/converted-slack-data-")
output_dir = tempfile.mkdtemp(prefix="converted-slack-data-")
else:
output_dir = os.path.realpath(output_dir)

View File

@ -108,7 +108,7 @@ class Command(ZulipBaseCommand):
output_dir = options["output_dir"]
if output_dir is None:
output_dir = tempfile.mkdtemp(prefix="/tmp/zulip-export-")
output_dir = tempfile.mkdtemp(prefix="zulip-export-")
else:
output_dir = os.path.realpath(os.path.expanduser(output_dir))
if os.path.exists(output_dir):

View File

@ -34,7 +34,7 @@ class Command(ZulipBaseCommand):
output_dir = options["output_dir"]
if output_dir is None:
output_dir = tempfile.mkdtemp(prefix="/tmp/zulip-export-")
output_dir = tempfile.mkdtemp(prefix="zulip-export-")
if os.path.exists(output_dir):
shutil.rmtree(output_dir)
os.makedirs(output_dir)