Skip to content

Ignore MissingSectionHeaderError #180

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion databricks/sdk/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,12 @@ def _known_file_config_loader(self):
logger.debug("%s does not exist", config_path)
return
ini_file = configparser.ConfigParser()
ini_file.read(config_path)
try:
ini_file.read(config_path)
except configparser.MissingSectionHeaderError:
# Ignore config profile loading on corrupted configs
# See https://github.com/databricks/databricks-sdk-py/issues/174
return
profile = self.profile
has_explicit_profile = self.profile is not None
# In Go SDK, we skip merging the profile with DEFAULT section, though Python's ConfigParser.items()
Expand Down