[Python-checkins] bpo-23835: [docs] configparser converts defaults to strings (#3176)

Łukasz Langa webhook-mailer at python.org
Mon Aug 21 19:23:41 EDT 2017


https://github.com/python/cpython/commit/ea57923e89aa4a1bde1d4fa1de7d6eacff603683
commit: ea57923e89aa4a1bde1d4fa1de7d6eacff603683
branch: master
author: Łukasz Langa <lukasz at langa.pl>
committer: GitHub <noreply at github.com>
date: 2017年08月21日T16:23:38-07:00
summary:
bpo-23835: [docs] configparser converts defaults to strings (#3176)
Title says all.
files:
A Misc/NEWS.d/next/Library/2017-08-21-16-06-19.bpo-23835.da_4Kz.rst
M Doc/library/configparser.rst
M Misc/ACKS
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index 61eab4e6a4b..c31a7e94651 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -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.
-
diff --git a/Misc/ACKS b/Misc/ACKS
index 21fc6bbbd3a..e3e02eb6a5f 100644
--- 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
index 00000000000..5e15ed9669e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-08-21-16-06-19.bpo-23835.da_4Kz.rst
@@ -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.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /