PyYAML 4.1 changes "safe" in more ways than immediately obvious #187
Description
It's clear from the changelog that pyyaml 4.x now defaults to a style of safe_load for loading. This is probably good. However, it also appears that the definition of "safe" has changed somewhat.
In cdent/gabbi#252 the 'safe' related tests work differently depending on whether >4 or <4 is used. As currently written they pass with 4 and fail with 3. The difference seems to be that "safe" in 3 and 4 mean different things:
- in 4, safe will load custom tags that are defined in the same process, but not
python/object
, and unsafe will not load custom tags, but will loadpython/object
- in 3, custom tags only load in unsafe, and
python/object
, neither in safe
The branch on that pull request can demonstrate the problem with different PyYAML versions. And master in the same repo will as well.
However, I have no confidence that I'm parsing what's going on properly at all, so I need to come up with a minimal test case, which I'll try to do real soon, but I first wanted to get this written down in case there is something obviously wrong in either my code or in PyYAML.
I will followup to this with the MTC, ASAP. Sorry for dropping noise like this, but needed to dump state.