From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.57]) by gnuweeb.org (Postfix) with ESMTPSA id E6C427E7BE; Tue, 19 Jul 2022 00:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1658189888; bh=CC5Aple0iigfBihYkG8AqmmzITC+mTetnhsJCfK0J2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kxvCMG1k522DnzZ8LssHflevX2pvFyVIx/okkul0T3rX8IyAfO3l1Jf2rrUKRxjOI JFIxpBHUrKWpPWLBxi33Y4YsRtUWT1TWvReAnl0tlobR4TKKn35hPQzsF7Ti8RFGVK 5EWEv3b9q2wtGGKgk0CMmWbEnfsBmi2NBlmu+BHEO9Qo/cZNwJQEQGHhkAWDCpPBuE JNrS6sOh7Zd3N0TcL2pl4HhE1X3RiJbViW3UBwsEzJCib72bN0nLLBG3igMImpc4o2 Joo6exQQzWV3lagx/ILpp1gcDSx3fYxvaMe2dNt4lU9MMMzyoc9vh78KlCtOkr0xFj aVNBG3wNtktyA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List Subject: [PATCH v2 03/18] Add default temporary directory Date: Tue, 19 Jul 2022 07:17:29 +0700 Message-Id: <20220719001744.1950-4-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220719001744.1950-1-kiizuha@gnuweeb.org> References: <20220719001744.1950-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: From: Muhammad Rizki We want to avoid error when "STORAGE_DIR" env is not defined, so you put a default value here. Signed-off-by: Muhammad Rizki --- daemon/scraper/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/scraper/utils.py b/daemon/scraper/utils.py index 9334b82..10fe956 100644 --- a/daemon/scraper/utils.py +++ b/daemon/scraper/utils.py @@ -110,7 +110,7 @@ def consruct_to_n_cc(to: list, cc: list): def gen_temp(name: str): md5 = hashlib.md5(name.encode()).hexdigest() - ret = os.getenv("STORAGE_DIR") + "/" + md5 + ret = os.getenv("STORAGE_DIR", "storage") + "/" + md5 try: os.mkdir(ret) except FileExistsError: -- Muhammad Rizki