This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients r.david.murray, thbach, vinay.sajip
Date 2012-10-04.22:50:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349391042.73.0.224003498489.issue16110@psf.upfronthosting.co.za>
In-reply-to
Content
I could consider relaxing the parameters on fileConfig such that instead of accepting just a string or a file-like object, it additionally accepts a ConfigParser instance. More specifically:

def fileConfig(file_or_fname_or_cp, defaults=None):
    if isinstance(file_or_fname_or_cp, RawConfigParser):
        cp = file_or_filename_or_cp
    else:
        cp = ConfigParser.ConfigParser(defaults)
        if hasattr(cp, 'readfp') and\
            hasattr(file_or_fname_or_cp, 'readline'):
            cp.readfp(file_or_fname_or_cp)
        else:
            cp.read(file_or_fname_or_cp)

    formatters = _create_formatters(cp)

This will only require (in addition to the above) small tweaks to docs
and tests. It would appear to fit the bill for your use case. Do you agree?
History
Date User Action Args
2012-10-04 22:50:42vinay.sajipsetrecipients: + vinay.sajip, r.david.murray, thbach
2012-10-04 22:50:42vinay.sajipsetmessageid: <1349391042.73.0.224003498489.issue16110@psf.upfronthosting.co.za>
2012-10-04 22:50:42vinay.sajiplinkissue16110 messages
2012-10-04 22:50:42vinay.sajipcreate