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 vstinner
Recipients Adrian Wielgosik, BTaskaya, dheiberg, hongweipeng, lukasz.langa, serhiy.storchaka, terry.reedy, vstinner
Date 2019-10-28.16:04:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572278667.74.0.298450691583.issue35448@roundup.psfhosted.org>
In-reply-to
Content
> I would expect that this basic usage is very popular. If the file doesn't exist, the normal usage pattern fails in a confusing way: (...)

Well, the configparser is well defined. As you wrote: "If a file named in filenames cannot be opened, that file will be ignored."

You can check if the file exists or not by checking read() result:

"read(): (...) returning a list of filenames which were successfully parsed."
https://docs.python.org/dev/library/configparser.html#configparser.ConfigParser.read

I suggest to close this issue as "not a bug".

--

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.
History
Date User Action Args
2019-10-28 16:04:27vstinnersetrecipients: + vstinner, terry.reedy, lukasz.langa, serhiy.storchaka, Adrian Wielgosik, hongweipeng, dheiberg, BTaskaya
2019-10-28 16:04:27vstinnersetmessageid: <1572278667.74.0.298450691583.issue35448@roundup.psfhosted.org>
2019-10-28 16:04:27vstinnerlinkissue35448 messages
2019-10-28 16:04:27vstinnercreate