Skip to content

Commit 9d7c598

Browse files
authored
yaml.load() to yaml.safe_load()
Details: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation PyYAML's load function has been unsafe since the first release in May 2006. It has always been documented that way in bold type: PyYAMLDocumentation. PyYAML has always provided a safe_load function that can load a subset of YAML without exploit.
1 parent c145396 commit 9d7c598

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

searchtweets/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _load_yaml_credentials(filename=None, yaml_key=None):
3131
"""
3232
try:
3333
with open(os.path.expanduser(filename)) as f:
34-
search_creds = yaml.load(f)[yaml_key]
34+
search_creds = yaml.safe_load(f)[yaml_key]
3535
except FileNotFoundError:
3636
logger.error("cannot read file {}".format(filename))
3737
search_creds = {}

0 commit comments

Comments
 (0)