Skip to content

GitConfigParser().get_values() does not load sections properly. #1534

@kf-novi

Description

@kf-novi

To replicate this bug, first do the following in your CLI

git config --global --add safe.directory /some/directory/here

Then run this python script

from git import GitConfigParser
from git.config import get_config_path

config = GitConfigParser(get_config_path("global"), read_only=False)
config.get_values("safe", "directory") # This throws a KeyError

There is a workaround:

config.get_value("safe", "directory")
config.get_values("safe", "directory") # This works

I will be taking a look at the code to see if I can submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy