Skip to content
New issue

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

yaml 'module' has no attribute 'Dumper' #7745

Closed
mgwilliams opened this issue Oct 11, 2013 · 7 comments

Comments

@mgwilliams
Copy link
Contributor

commented Oct 11, 2013

On latest develop, I'm getting the following backtrace when installing (python setup.py install):

  File "/xxxxxxxxx/salt/salt/utils/jinja.py", line 35, in <module>
    class OrderedDictDumper(yaml.Dumper):
AttributeError: 'module' object has no attribute 'Dumper'

This patch fixes it, but I'm not sure it's the correct solution:
https://github.com/mgwilliams/salt/compare/yaml-dumper

Oddly, I can run this from a bash prompt just fine:

echo "import yaml; yaml.Dumper(None, None)" | python
@mgwilliams

This comment has been minimized.

Copy link
Contributor Author

commented Oct 11, 2013

The issue was a relic in my salt checkout: a yaml.pyc from Feb 27 in the salt/utils directory.

@mgwilliams mgwilliams closed this Oct 11, 2013
@UtahDave

This comment has been minimized.

Copy link
Member

commented Oct 12, 2013

I just ran into this same issue.

@techhat

This comment has been minimized.

Copy link
Member

commented Oct 12, 2013

Same here. Mine was from Apr 9.

@basepi

This comment has been minimized.

Copy link
Collaborator

commented Oct 15, 2013

Hrm, wonder why your pyc files are not being cleaned up properly.

@mgwilliams

This comment has been minimized.

Copy link
Contributor Author

commented Oct 15, 2013

It's too late to do any forensics, but I suspect I wound up with a pyc in my source tree (due to development work), which was then getting installed. To fix the issue, I removed the pyc from the source and then installed again.

@thatch45

This comment has been minimized.

Copy link
Member

commented Oct 15, 2013

Please keep in mind that we do have a clean routine in setup.py
python setup.py clean
that will clear out the pyc/pyo files

@edlane

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2014

I just hit this same problem...
The fix required me to remove a residual yaml.py left over from a previous build in the
./build/lib.linux-x86_64-2.7/salt/utils/ build directory.
python setup.py build should probably delete everything in the target directories before generating their contents over again in order that cruft files are removed.
python setup.py clean does not seem to remove old cruft *.py files either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.