From 526e02a0419f2035383e62dca7d1c257c896deb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Feb 2023 10:30:18 +0000 Subject: [PATCH] Fix an issue with using --file argument The following command did not work in the lang folder: python .\update-po.py --file ./po/Firmware_cs.po To resolve this we just extract the filename from the path and use the constant PO_DIR to make sure the path is always the same. --- lang/update-po.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/update-po.py b/lang/update-po.py index a1e07da55..042b8269b 100644 --- a/lang/update-po.py +++ b/lang/update-po.py @@ -37,7 +37,7 @@ def main(): for po_file in PO_FILE_LIST: # Start by creating a back-up of the .po file po_file_bak = po_file.with_suffix(".bak") - shutil.copy(PO_DIR / po_file, PO_DIR / po_file_bak) + shutil.copy(PO_DIR / po_file.name, PO_DIR / po_file_bak.name) po = polib.pofile(po_file) po.merge(POT_REFERENCE) po.save(po_file)