pyyaml
pyyaml copied to clipboard
Is there a way to stop/remove constructors?
For an application, I would need an extra safe version of the yaml.safe_load()
that can't return datetime objects or bytes. Is there any way to stop this without sanitizing input?
This is for python 3.8
you could use the BaseLoader. That loads everything as a string. Would that work for you?
yaml.load(..., Loader=yaml.BaseLoader)
That would not exactly be what I need since access to dicts, lists, sets and other base python types is needed.