You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I'm still getting the KeyError: 'safe' in version 3.1.43 (using Python 3.12.4), but only if the safe section is not already present in the git config. The above workaround with calling .get_value() first still works, though. @Byron #1555
To replicate this bug, first do the following in your CLI
Then run this python script
There is a workaround:
I will be taking a look at the code to see if I can submit a PR for this.
The text was updated successfully, but these errors were encountered: