Issue #17 new

AttributeError: 'CLoader' object has no attribute 'dispose'

Jonathan Ultis
created an issue

I use pyyaml 3.10 for several utility scripts. We've noticed an interesting conflict when we ship a nicely sandboxed utility. When I ship a pure python pyyaml 3.10 without C optimized bindings, but the distribution has already installed pyyaml 3.09 with C optimized bindings, the python side of pyyaml 3.10 will accidentally load the c optimized _yaml.so from the distribution packaging.

That fails eventually because pyyaml 3.10 added a "dispose" method to the CLoader that does not exist in the C optimized 3.09 library.

I have a workaround. But, it'd be really nice if pyyaml verified that the c optimized library version matches the python yaml library version when attempting to load _yaml in cyaml.py.

Or, alternatively, to work around this specific issue, these lines could be added to cyaml.py:

if 'dispose' not in dir(CParser): throw ImportError()

Comments (0)

  1. Log in to comment