This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sean Robertson
Recipients Sean Robertson
Date 2019-08-23.20:58:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566593897.26.0.561388114417.issue37932@roundup.psfhosted.org>
In-reply-to
Content
Hello and thanks for reading.

I've also experienced this in Python 3.7, and I believe it to be around since 3.2.

The allow_no_value option of ConfigParser allows None values when (de)serializing configuration files. Yet calling the "items(section)" method of a ConfigParser returns empty strings for values instead of None. See below for an MRE.

Thanks,
Sean

Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from configparser import ConfigParser
>>> a = ConfigParser(allow_no_value=True)
>>> a.add_section('foo')
>>> a.set('foo', 'bar')
>>> a.items('foo')
[('bar', '')]
>>> a.items('foo', raw=True)
[('bar', None)]
>>> a.get('foo', 'bar')
>>> list(a['foo'].items())
[('bar', None)]
History
Date User Action Args
2019-08-23 20:58:17Sean Robertsonsetrecipients: + Sean Robertson
2019-08-23 20:58:17Sean Robertsonsetmessageid: <1566593897.26.0.561388114417.issue37932@roundup.psfhosted.org>
2019-08-23 20:58:17Sean Robertsonlinkissue37932 messages
2019-08-23 20:58:16Sean Robertsoncreate