STINNER Victor <vstin...@python.org> added the comment:

> 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.

----------
nosy: +vstinner

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35448>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to