django-pattern-library icon indicating copy to clipboard operation
django-pattern-library copied to clipboard

Can't use Python object YAML tags

Open bcdickinson opened this issue 3 years ago • 0 comments

Issue Summary

Use of pyyaml's !!python/object tags to create arbitrary Python objects isn't working. I'm raising this as a bug because it should work, but I'm not sure it's necessarily something we want to support.

Steps to Reproduce

Add a context item like !!python/object:django.forms.fields.CharField, and you get an error like this:

Exception Type: ConstructorError at /pattern-library/pattern/patterns/organisms/form/feedback-form.html
Exception Value: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object:django.forms.fields.CharField'
  in "<unicode string>", line 3, column 5:
        !!python/object:django.forms.fie ... 
        ^

This seems to be related to the use of yaml.FullLoader and our version of pyyaml somehow (ref https://github.com/yaml/pyyaml/issues/266)

bcdickinson avatar Sep 17 '21 17:09 bcdickinson