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

Issue #17 new
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 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

Or, alternatively, to work around this specific issue, these lines could be added to

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

Comments (3)

  1. 亚琪 张

    hello Jonathan, recently I have this problem too.Could you tell me how did you solved this problem two years age? Thank you very much.

    something available: [helen@yingyun python]$ rpm -qa | grep yaml libyaml-0.1.4-11.el7_0.x86_64 [helen@yingyun python]$ rpm -qa | grep -i pyyaml PyYAML-3.10-11.el7.x86_64

  2. Log in to comment