Skip to content

Commit 6549385

Browse files
sblondonperlpunk
authored andcommitted
Add use of safe_load() function in README (#285)
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).
1 parent 03b378d commit 6549385

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ parser and emitter as follows:
1515
>>> yaml.load(stream, Loader=yaml.CLoader)
1616
>>> yaml.dump(data, Dumper=yaml.CDumper)
1717

18+
If you don't trust the input stream, you should use:
19+
20+
>>> yaml.safe_load(stream)
21+
1822
PyYAML includes a comprehensive test suite. To run the tests,
1923
type 'python setup.py test'.
2024

0 commit comments

Comments
 (0)