From 49626296cdf1016a2ba5611f389c660ebcf4bf7b Mon Sep 17 00:00:00 2001 From: sblondon Date: Fri, 22 Mar 2019 11:47:04 +0100 Subject: [PATCH] Add use of safe_load() function in README It helps people to use `safe_load` if they discover the library. It's more secure if `safe_load()` is used by default, and `load()` is used if it's necessary (and the developer knows what is does). --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index 361839a0..49c87e76 100644 --- a/README +++ b/README @@ -15,6 +15,10 @@ parser and emitter as follows: >>> yaml.load(stream, Loader=yaml.CLoader) >>> yaml.dump(data, Dumper=yaml.CDumper) +If you don't trust the input stream, you should use: + + >>> yaml.safe_load(stream) + PyYAML includes a comprehensive test suite. To run the tests, type 'python setup.py test'.