Skip to content
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

Failure to read default config file silently ignored #53

Open
arcresu opened this issue Jun 1, 2019 · 1 comment
Open

Failure to read default config file silently ignored #53

arcresu opened this issue Jun 1, 2019 · 1 comment

Comments

@arcresu
Copy link
Member

arcresu commented Jun 1, 2019

In beets we noticed (see beetbox/beets#3264) that when confuse can't read the default config file it silently ignores the problem:

confuse/confuse.py

Lines 935 to 939 in 04fd862

if self.modname:
if self._package_path:
filename = os.path.join(self._package_path, DEFAULT_FILENAME)
if os.path.isfile(filename):
self.add(ConfigSource(load_yaml(filename), filename, True))

Since beets was assuming that the file existed and was readable so that default config values were set, it led to some very obscure error messages about missing config fields.

This would have been a lot easier to debug if confuse threw an exception or something to indicate that the file was missing. Maybe some users of confuse don't need a default config file, but for those that do it seems that they would always expect it to be present.

@maddenfederico
Copy link

I'd like to bump this. Add on to that the fact that the optional parameter that sets this behavior isn't easily changeable by the user. There should be a distinction between default config files that don't exist (ignored) and those that fail to parse (should raise an exception).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants