"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, 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})' ConfigParser( defaults= {"a": None})'
$ python3.7 -c 'import configparser; configparser.
...
TypeError: option values must be strings
This seems to be a regression in Python, reported a few days ago.