diff --git a/git/config.py b/git/config.py index 209f2ffef..d5256e0d6 100644 --- a/git/config.py +++ b/git/config.py @@ -218,7 +218,7 @@ def _read(self, fp, fpname): continue else: # is it a section header? - mo = self.SECTCRE.match(line) + mo = self.SECTCRE.match(line.strip()) # strip the line to remove leading spaces if mo: sectname = mo.group('header') if sectname in self._sections: