-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Description
Feature or enhancement
Proposal:
I understand the idea that when providing an iterable of files to ConfigParser.read(...)
it should not fail just because one file failed, as described in the docstring:
[...] Files that cannot be opened are silently ignored; this is
designed so that you can specify an iterable of potential
configuration file locations (e.g. current directory, user's
home directory, systemwide directory), and all existing
configuration files in the iterable will be read [...]
However, I would argue that this behaviour should be changed for providing specifically one file, as if I accidentally gave a non existent path or a directory, I'd rather my script fail than silently ignore the issue and not populate the data I expect.
In this case, the method should propagate any os-file-related errors up so that it is clearly established that the one-and-only specific file you've given as an argument is non-existent or not a file. Specifically when the path provided is relative and it worked previously but something changed in the file structure during development and suddenly I receive KeyError
of non existent config keys instead of direct info that the file does not exist under a/b/c
path.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response