Skip to content

gitconfig parser fails to parse config keys without values #352

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

Closed
auscompgeek opened this issue Sep 18, 2015 · 1 comment
Closed

gitconfig parser fails to parse config keys without values #352

auscompgeek opened this issue Sep 18, 2015 · 1 comment

Comments

@auscompgeek
Copy link

Here is a snippet of my ~/.config/git/config:

[diff]
    mnemonicPrefix
[rebase]
    stat
[merge]
    summary
    tool = vimdiff

GitPython raises a configparser.ParsingError for the lines without values:

Traceback (most recent call last):
  ...
  File "/home/auscompgeek/.local/lib/python3.4/site-packages/git/refs/head.py", line 162, in tracking_branch
    if reader.has_option(self.k_config_remote) and reader.has_option(self.k_config_remote_ref):
  File "/home/auscompgeek/.local/lib/python3.4/site-packages/git/config.py", line 114, in <lambda>
    return lambda *args, **kwargs: self._call_config(attr, *args, **kwargs)
  File "/home/auscompgeek/.local/lib/python3.4/site-packages/git/config.py", line 120, in _call_config
    return getattr(self._config, method)(self._section_name, *args, **kwargs)
  File "/home/auscompgeek/.local/lib/python3.4/site-packages/git/config.py", line 70, in assure_data_present
    self.read()
  File "/home/auscompgeek/.local/lib/python3.4/site-packages/git/config.py", line 378, in read
    self._read(fp, fp.name)
  File "/home/auscompgeek/.local/lib/python3.4/site-packages/git/config.py", line 340, in _read
    raise e
configparser.ParsingError: Source contains parsing errors: '/home/auscompgeek/.config/git/config'
    [line 28]: '\tmnemonicPrefix\n'
    [line 30]: '\tstat\n'
    [line 32]: '\tsummary\n'
@auscompgeek
Copy link
Author

Gah, I just noticed #349. Figures.

@Byron Byron added this to the v1.0.2 - Fixes milestone Sep 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants