]> granicus.if.org Git - python/commitdiff
bpo-23835: [docs] configparser converts defaults to strings (#3176)
authorŁukasz Langa <lukasz@langa.pl>
Mon, 21 Aug 2017 23:23:38 +0000 (16:23 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Aug 2017 23:23:38 +0000 (16:23 -0700)
Title says all.

Doc/library/configparser.rst
Misc/ACKS
Misc/NEWS.d/next/Library/2017-08-21-16-06-19.bpo-23835.da_4Kz.rst [new file with mode: 0644]

index 61eab4e6a4bc6574b0ee3a1fbc961acda938e6f6..c31a7e94651898d10975146f33af1e41b93dfeb2 100644 (file)
@@ -944,6 +944,11 @@ ConfigParser Objects
    .. versionchanged:: 3.5
       The *converters* argument was added.
 
+   .. versionchanged:: 3.7
+      The *defaults* argument is read with :meth:`read_dict()`,
+      providing consistent behavior across the parser: non-string
+      keys and values are implicitly converted to strings.
+
 
    .. method:: defaults()
 
@@ -1325,4 +1330,3 @@ Exceptions
 .. [1] Config parsers allow for heavy customization.  If you are interested in
        changing the behaviour outlined by the footnote reference, consult the
        `Customizing Parser Behaviour`_ section.
-
index 21fc6bbbd3ad233c1bad63599bbb524e2cfe32ea..e3e02eb6a5f5042c56f61f626d1a044c9bea1a85 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1578,6 +1578,7 @@ Jason Tishler
 Christian Tismer
 Jim Tittsler
 Frank J. Tobin
+James Tocknell
 Bennett Todd
 R Lindsay Todd
 Eugene Toder
diff --git a/Misc/NEWS.d/next/Library/2017-08-21-16-06-19.bpo-23835.da_4Kz.rst b/Misc/NEWS.d/next/Library/2017-08-21-16-06-19.bpo-23835.da_4Kz.rst
new file mode 100644 (file)
index 0000000..5e15ed9
--- /dev/null
@@ -0,0 +1,4 @@
+configparser: reading defaults in the ``ConfigParser()`` constructor is now
+using ``read_dict()``, 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.  Patch by James Tocknell.