From 684d2f6ceaa3c98dc786e3cb4b5b8639d5593c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Bouliane?= Date: Mon, 1 Apr 2019 17:01:19 -0400 Subject: [PATCH] Remove yaml unsafe deprecation warning hides warning such has below in the projects using config-probe. This will make sure that config-probe uses the safe yaml load version. I don't see a valid reason to have injected code in your configuration ifile. This is a possibly breaking change. YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. --- config_probe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_probe/__init__.py b/config_probe/__init__.py index 210ccb9..a05f901 100644 --- a/config_probe/__init__.py +++ b/config_probe/__init__.py @@ -37,7 +37,7 @@ def fake_probe(content): _parsers = { - ".yaml": lambda f: yaml.load(f) or {}, + ".yaml": lambda f: yaml.safe_load(f) or {}, ".json": lambda f: json.load(f), }