There was a problem hiding this comment.
Instead of this, reading defaults should be done by callingself.read_dict(), then it will behave consistently with doing:
cp['DEFAULT'] = {1: 2.4}|
Yeah, that seems more sensible (I originally wrote the patch against 2.7, which is why I didn't use read_dict). Do you want the new version in a new PR, or just replace the current PR with the new code? Also, where should I add a test, I couldn't find where I should add it last time I looked. |
|
Replacing the current PR is totally fine. There are tests for configparser in Lib/test/test_configparser.py. |
|
Done. |
|
Ping? |
Add assert statements to the new test.
|
I'll add a NEWS.d entry in a separate PR. |
|
Thanks! ✨ 🍰 ✨ |
* Enforce that configparser defaults are strings * Update test_configparser.py
This is the patch attached to https://bugs.python.org/issue23835, updated to master.
https://bugs.python.org/issue23835