From 62013d90ee1287a40c0d859a2cabb8eb598171a7 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 15 Feb 2023 21:21:22 -0500 Subject: [PATCH] Fix `TypeError` in outfile warning message. These attributes are strings, not paths. It is safe to format with a path -- paths are implicitly convertible to strings by formatters. We use a `PurePath` because we only care about getting the string name and not actually performing any path manipulation. --- korman/exporter/outfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korman/exporter/outfile.py b/korman/exporter/outfile.py index d3ee7e6..e955e7c 100644 --- a/korman/exporter/outfile.py +++ b/korman/exporter/outfile.py @@ -20,7 +20,7 @@ import json from .. import korlib import locale import os -from pathlib import Path, PureWindowsPath +from pathlib import Path, PurePath, PureWindowsPath from ..plasma_magic import plasma_python_glue from PyHSPlasma import * import shutil @@ -392,7 +392,7 @@ class OutputFiles: shutil.copy2(i.file_path, dst_path) else: report.warn("No data found for dependency file '{}'. It will not be copied into the export directory.", - str(i.dirname / i.filename), indent=1) + PurePath(i.dirname, i.filename), indent=1) def _write_gather_build(self): report = self._exporter().report