ros-infrastructure/bloom — pull request #210 by wjwwood (2014-01-08 00:38:13+00:00)
Title: Blooms crashes when Changelog contains wrong character encoding

I used catkin_generate_changelog to generate a changelog for my repo. One of the contributers had the character 'ö' in its name. A subsequent call to bloom_release crashed with the below trace. Changing 'ö' into 'oe' in the Changelog made everything go nice again.

Here comes the traceback:

```
Traceback (most recent call last):
File "/usr/bin/git-bloom-generate", line 9, in
load_entry_point('bloom==0.4.4', 'console_scripts', 'git-bloom-generate')()
File "/usr/lib/pymodules/python2.7/bloom/commands/git/generate.py", line 247, in main
run_generator(generator, args)
File "/usr/lib/pymodules/python2.7/bloom/commands/git/generate.py", line 162, in run_generator
gen.post_rebase, destination)
File "/usr/lib/pymodules/python2.7/bloom/commands/git/generate.py", line 101, in try_execute
retcode = func(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/bloom/generators/debian/generator.py", line 502, in post_rebase
data = self.generate_debian(package, distro)
File "/usr/lib/pymodules/python2.7/bloom/generators/debian/generator.py", line 622, in generate_debian
subs = self.get_subs(package, debian_distro, releaser_history)
File "/usr/lib/pymodules/python2.7/bloom/generators/rosdebian.py", line 84, in get_subs
fallback_resolver=fallback_resolver
File "/usr/lib/pymodules/python2.7/bloom/generators/debian/generator.py", line 282, in generate_substitutions_from_package
changelogs = get_changelogs(package, releaser_history)
File "/usr/lib/pymodules/python2.7/bloom/generators/debian/generator.py", line 208, in get_changelogs
changes_str.extend([' ' + i for i in str(item).splitlines()])
File "/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py", line 320, in __str__
return unicode(self).encode('utf-8')
File "/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py", line 323, in __unicode__
return self.as_txt()
File "/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py", line 335, in as_txt
lines = [i + b.next() + str(l).replace('\n', n) for l in self]
File "/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py", line 470, in __str__
return unicode(self).encode('utf-8')
File "/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py", line 473, in __unicode__
return unicode(self.to_txt())
File "/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py", line 483, in to_txt
lines.append(str(t))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 50: ordinal not in range(128)

<== Error running command '['/usr/bin/git-bloom-generate', '-y', 'rosdebian', '--prefix', 'release/groovy', 'groovy', '-i', '0']'
Release failed, exiting.
```