Skip to content

Commit 1d44964

Browse files
committed
fix(bom show): bom show and bom validate read SBOMs in UTF-8 encodi…
1 parent a61d397 commit 1d44964

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

capycli/common/capycli_bom_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ class CaPyCliBom():
490490
@classmethod
491491
def read_sbom(cls, inputfile: str) -> Bom:
492492
LOG.debug(f"Reading from file {inputfile}")
493-
with open(inputfile) as fin:
493+
with open(inputfile, encoding="utf-8") as fin:
494494
try:
495495
json_data = json.load(fin)
496496
except Exception as exp:
@@ -568,7 +568,7 @@ def _string_to_schema_version(cls, spec_version: str) -> SchemaVersion:
568568
def validate_sbom(cls, inputfile: str, spec_version: str, show_success: bool = True) -> bool:
569569
"""Validate the given SBOM file against the given CycloneDX spec. version."""
570570
LOG.debug(f"Validating SBOM from file {inputfile}")
571-
with open(inputfile) as fin:
571+
with open(inputfile, encoding="utf-8") as fin:
572572
try:
573573
json_string = fin.read()
574574
except Exception as exp:

0 commit comments

Comments
 (0)