Message355557
> 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. |
|
Date |
User |
Action |
Args |
2019-10-28 16:04:27 | vstinner | set | recipients:
+ vstinner, terry.reedy, lukasz.langa, serhiy.storchaka, Adrian Wielgosik, hongweipeng, dheiberg, BTaskaya |
2019-10-28 16:04:27 | vstinner | set | messageid: <1572278667.74.0.298450691583.issue35448@roundup.psfhosted.org> |
2019-10-28 16:04:27 | vstinner | link | issue35448 messages |
2019-10-28 16:04:27 | vstinner | create | |
|