galindale/cpe — pull request #1 by TauPan (2013-12-09 12:00:42+00:00)
Title: Fix bdist_rpm by setting default encoding in setup.py

I've tried to create a rpm via setup.py bdist_rpm and stumbled accross the following error:
```
running bdist_rpm
running egg_info
writing cpe.egg-info/PKG-INFO
writing top-level names to cpe.egg-info/top_level.txt
writing dependency_links to cpe.egg-info/dependency_links.txt
reading manifest file 'cpe.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'cpe/tests'
writing manifest file 'cpe.egg-info/SOURCES.txt'
writing 'build/bdist.linux-x86_64/rpm/SPECS/cpe.spec'
Traceback (most recent call last):
File "setup.py", line 31, in
zip_safe=False,
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/home/taupan/.virtualenvs/airshield-cve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/bdist_rpm.py", line 28, in run
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/command/bdist_rpm.py", line 293, in run
"writing '%s'" % spec_path)
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/cmd.py", line 358, in execute
util.execute(func, args, msg, dry_run=self.dry_run)
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/util.py", line 373, in execute
apply(func, args)
File "/home/taupan/.pythonbrew/pythons/Python-2.6/lib/python2.6/distutils/file_util.py", line 252, in write_file
f.write(line + "\n")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 30: ordinal not in range(128)
```

I fixed it by setting the default encoding in setup.py, see http://stackoverflow.com/a/1178429

I'm not sure if this is a good fix.