Skip to content

Commit

Permalink
Use YAML safe loader instead of full loader (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Apr 30, 2023
1 parent f47d2fe commit 26f70be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ ignore = [
"RET504", # Unnecessary variable assignment before `return` statement
# Temporary disabled during adoption:
"A003", # Class attribute `exec` is shadowing a python builtin
"S506", # Probable use of unsafe loader `FullLoader`
"S607", # Starting a process with a partial executable path

]
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_compat/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def yaml_from_file(path: Path) -> Any: # noqa: ANN401
"""Return a loaded YAML file."""
with path.open(encoding="utf-8") as content:
return yaml.load(content, Loader=yaml.FullLoader)
return yaml.load(content, Loader=yaml.SafeLoader)


def colpath_from_path(path: Path) -> str | None:
Expand Down

0 comments on commit 26f70be

Please sign in to comment.