Tries to read included configs twice
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
configglue |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
STR:
1. Create a local.cfg:
{{{
[__main__]
includes = config/foo.cfg
}}}
2. and an arbitrary config/foo.cfg:
{{{
[django]
debug = true
}}}
3. parse the config
ER: should be parsed without warnings
AR: parser parses config/foo.cfg correctly but then tries to parse config/
WARNING:root:File /home/michael/
The reason is that in configglue.
1) Reads local.cfg with the correct basedir, then checks if the config has an includes option (self.has_
2) Sets self._basedir to point (in this case) to django_project correctly,
3) Calls self.read() with config/foo.cfg which calls _read() recursively,
4) It reads config/foo.cfg correctly, and then checks if the config has an includes option, and *incorrectly* decides that it does (as self is really the configparser for local.cfg), so it
5) updates self._basedir to point to django_
Without looking deeply, it *looks* like a SchemaConfigParser (which inherits from SafeConfigParser) is meant to represent a single config file (in step 4, self.has_
Changed in configglue: | |
status: | New → Confirmed |