kube-shell icon indicating copy to clipboard operation
kube-shell copied to clipboard

fix: use yaml.SafeLoader for yaml.load

Open thehackercat opened this issue 4 years ago • 0 comments

Fix this warning:

/venv/lib/python2.7/site-packages/kubeshell/kubeshell.py:43: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

Ref https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation#how-to-disable-the-warning

Since 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. In this case, we use yaml.SafeLoader instead.

thehackercat avatar May 11 '20 03:05 thehackercat