diff --git a/craft_application/errors.py b/craft_application/errors.py index 37060e59..7a637a9e 100644 --- a/craft_application/errors.py +++ b/craft_application/errors.py @@ -101,7 +101,9 @@ def from_parts_error(cls, err: craft_parts.PartsError) -> Self: @classmethod def from_os_error(cls, err: OSError) -> Self: """Create a PartsLifecycleError from an OSError.""" - message = f"{err.filename}: {err.strerror}" if err.filename else err.strerror + message = ( + f"{err.filename}: {err.strerror}" if err.filename else str(err.strerror) + ) details = err.__class__.__name__ if err.filename: details += f": filename: {err.filename!r}" diff --git a/pyproject.toml b/pyproject.toml index 124ecf5f..064e39a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,15 +51,15 @@ remote = [ "pyxdg>=0.27", ] lint = [ - "black~=24.0", - "codespell[toml]==2.3.0", - "yamllint==1.35.1" + "codespell[toml]~=2.3", + "yamllint~=1.35" ] types = [ - "mypy[reports]==1.12.0", - "pyright==1.1.385", + "mypy[reports]~=1.12", + "pyright==1.1.390", "types-requests", "types-urllib3", + "types-pyyaml" ] docs = [ "canonical-sphinx~=0.2.0",