We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have some yaml files which contains local tags. I got ConstructorError exceptions when i wanted to validate them.
The solution can be to handle all local tags by an "unknown" contructor:
def _pyyaml(f): import yaml def unknown(loader, suffix, node): if isinstance(node, yaml.ScalarNode): constructor = loader.__class__.construct_scalar elif isinstance(node, yaml.SequenceNode): constructor = loader.__class__.construct_sequence elif isinstance(node, yaml.MappingNode): constructor = loader.__class__.construct_mapping data = constructor(loader, node) return data try: Loader = yaml.CSafeLoader except AttributeError: # System does not have libyaml Loader = yaml.SafeLoader yaml.add_multi_constructor('!', unknown, Loader=Loader) return list(yaml.load_all(f, Loader=Loader))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have some yaml files which contains local tags. I got ConstructorError exceptions when i wanted to validate them.
The solution can be to handle all local tags by an "unknown" contructor:
The text was updated successfully, but these errors were encountered: