Skip to content

Commit

Permalink
Read YML file with encoding for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
huard committed Dec 14, 2023
1 parent 8b1885a commit ad70965
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xclim/core/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,9 @@ def build_indicator_module_from_yaml( # noqa: C901
schema = yamale.make_schema(Path(__file__).parent.parent / "data" / "schema.yml")

# Validate - a YamaleError will be raised if the module does not comply with the schema.
yamale.validate(schema, yamale.make_data(ymlpath))
yamale.validate(
schema, yamale.make_data(content=ymlpath.read_text(encoding=encoding))
)

# Load values from top-level in yml.
# Priority of arguments differ.
Expand Down

0 comments on commit ad70965

Please sign in to comment.