From 6855df0abbcdb9f7224fdaabdb7a7862edd1ba2e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 16 Dec 2021 19:11:33 -0800 Subject: [PATCH] export_single_user: Fix usage with relative --output directory. Signed-off-by: Anders Kaseorg --- zerver/management/commands/export_single_user.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zerver/management/commands/export_single_user.py b/zerver/management/commands/export_single_user.py index 87851a0803..25fca88e3b 100644 --- a/zerver/management/commands/export_single_user.py +++ b/zerver/management/commands/export_single_user.py @@ -34,6 +34,7 @@ class Command(ZulipBaseCommand): if output_dir is None: output_dir = tempfile.mkdtemp(prefix="zulip-export-") else: + output_dir = os.path.abspath(output_dir) if os.path.exists(output_dir) and os.listdir(output_dir): raise CommandError( f"Refusing to overwrite nonempty directory: {output_dir}. Aborting...",