Comment 1 for bug 1785641

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

So, looking at the Changelog for Python3.7:

"The configparser.ConfigParser constructor now uses read_dict() to process the default values, making its behavior consistent with the rest of the parser. Non-string keys and values in the defaults dictionary are now being implicitly converted to strings. (Contributed by James Tocknell in bpo-23835.)"

So, this *should* work.

Now, looking at msg320899 of https://bugs.python.org/issue23835 :

$ python3.6 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})'
$ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})'
...
TypeError: option values must be strings

This seems to be a regression in Python, reported a few days ago.