Message350331
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)] |
|
Date |
User |
Action |
Args |
2019-08-23 20:58:17 | Sean Robertson | set | recipients:
+ Sean Robertson |
2019-08-23 20:58:17 | Sean Robertson | set | messageid: <1566593897.26.0.561388114417.issue37932@roundup.psfhosted.org> |
2019-08-23 20:58:17 | Sean Robertson | link | issue37932 messages |
2019-08-23 20:58:16 | Sean Robertson | create | |
|