GitPython uses ConfigParser to parse git config files and it seems to be unable to parse some valid git config files. I ran into this while using fedpkg-fixbranches.py:
Checking status of upstream branch conversion
Traceback (most recent call last):
File "/usr/bin/fedpkg-fixbranches.py", line 294, in <module>
File "/usr/bin/fedpkg-fixbranches.py", line 56, in convert
File "/usr/lib/python2.6/site-packages/git/remote.py", line 442, in __getattr__
File "/usr/lib/python2.6/site-packages/git/remote.py", line 32, in <lambda>
return lambda *args, **kwargs: self._call_config(attr, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/git/remote.py", line 38, in _call_config
return getattr(self._config, method)(self._section_name, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/git/config.py", line 53, in assure_data_present
File "/usr/lib/python2.6/site-packages/git/config.py", line 281, in read
File "/usr/lib/python2.6/site-packages/git/config.py", line 246, in _read
ConfigParser.ParsingError: File contains parsing errors: /home/tmz/.gitconfig
[line 21]: '\t# This affects decoration collors in git log output\n'
The git config section in question looks like this:
plain = white
meta = bold green
frag = bold yellow
old = bold red
new = bold cyan
# This affects decoration colors in git log output
#commit = bold black yellow
whitespace = reverse red
It would be nice if GitPython didn't choke on config files that git has no issues with.
Created attachment 500524 [details]
[PATCH] Handle indented comments in git config files
I've filed a bug upstream and submitted a similar patch there. See https://github.com/gitpython-developers/GitPython/issues/17
GitPython-0.2.0-0.6.beta1.fc15 has been submitted as an update for Fedora 15.
GitPython-0.2.0-0.6.beta1.fc14 has been submitted as an update for Fedora 14.
GitPython-0.2.0-0.6.beta1.el6 has been submitted as an update for Fedora EPEL 6.
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing GitPython-0.2.0-0.6.beta1.el6'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '13'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 13's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 13 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Just for completeness, this was fixed upstream a little differently. It was merged together with fixes for a few other potential config parse errors:
GitPython-0.2.0-0.6.beta1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
GitPython-0.2.0-0.6.beta1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
GitPython-0.2.0-0.6.beta1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.