• Guido Günther's avatar
    GitRepository: Use C locale when building error messages · 6a5675cb
    Guido Günther authored
    If we use stderr to build the error message we need to use the C locale
    when invoking git commands since otherwise we might end up with non
    ascii characters. Leading to errors like:
    
     gbp:debug: ['git', 'describe', '--match', 'upstream/*', '--abbrev=0',
     u'99b4406e2c43ed1e011239e07f2f809dad4803c0']
     Traceback (most recent call last):
       File "/usr/bin/gbp", line 9, in <module>
         load_entry_point('gbp==0.6.31', 'console_scripts', 'gbp')()
       File "/usr/lib/python2.7/dist-packages/gbp/scripts/supercommand.py",
       line 136, in supercommand
         return module.main(args)
       File "/usr/lib/python2.7/dist-packages/gbp/scripts/dch.py", line
       480, in main
         options.upstream_branch, cp)
       File "/usr/lib/python2.7/dist-packages/gbp/scripts/dch.py", line 48,
       in guess_version_from_upstream
         epoch=cp.epoch)
       File "/usr/lib/python2.7/dist-packages/gbp/deb/git.py", line 83, in
       debian_version_from_upstream
         tag = self.find_branch_tag(commit, upstream_branch,
         pattern=pattern)
       File "/usr/lib/python2.7/dist-packages/gbp/git/repository.py", line
       729, in find_branch_tag
         return self.describe(base_commit, pattern, abbrev=0)
       File "/usr/lib/python2.7/dist-packages/gbp/git/repository.py", line
       700, in describe
         (commitish, err.strip()))
     UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
     19: ordinal not in range(128)
    6a5675cb
repository.py 66.1 KB