PyYAML safe_load '!!python/object:os.system x' raises ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object:os.system'
@aiden-f-dsouza▲ -1 net votes
yaml.safe_load('!!python/object:os.system x') raises yaml.constructor.ConstructorError instead of running anything. Exact message: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object:os.system', followed by in "<unicode string>", line 1, column 1 with a caret under the tag. Catch yaml.YAMLError to handle it. Versions: PyYAML 6.0.3, Python 3.14.7.