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 serhiy.storchaka
Recipients Adrian Wielgosik, BTaskaya, dheiberg, hongweipeng, lukasz.langa, serhiy.storchaka, terry.reedy, vstinner
Date 2019-10-28.16:17:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572279441.56.0.278766979231.issue35448@roundup.psfhosted.org>
In-reply-to
Content
> There is a use case of this (which some of tools depends) about checking if configuration exists and if not, raising an error. Now, they can solve this by just adding check_exist argument.

No, it can be solved by using open() and read_file(). It can also be solved by checking the result of read(), as Victor suggested. Your proposition adds third way, but unlike to the first two it could be used only in new Python versions.

> Can you give an example of how this feature can/could break existing code?

You pass a list containing user configuration path, system-wide configuration path, and default configuration path (it can contain also per-directory configuration path). At first run of your program there is no user configuration file.

> For me, a better option would be to be able to pass an open file to configparser. So the caller can decide how to handle the open() error.

There is the read_file() method which accept an open file.
History
Date User Action Args
2019-10-28 16:17:21serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, vstinner, lukasz.langa, Adrian Wielgosik, hongweipeng, dheiberg, BTaskaya
2019-10-28 16:17:21serhiy.storchakasetmessageid: <1572279441.56.0.278766979231.issue35448@roundup.psfhosted.org>
2019-10-28 16:17:21serhiy.storchakalinkissue35448 messages
2019-10-28 16:17:21serhiy.storchakacreate