Message337282
It seems twice call of `optionxform` is not avoidable when read-and-write workflow.
I'm not against about fixing readdict.
But I don't think configparser supports non-idempotent optionxform.
>>> import configparser
>>> cfg = configparser.ConfigParser()
>>> cfg.optionxform = lambda s: "#"+s
>>> cfg.add_section("sec")
>>> cfg.set("sec", "foo", "1")
>>> cfg["sec2"] = cfg["sec"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/inada-n/work/python/cpython/Lib/configparser.py", line 974, in __setitem__
self.read_dict({key: value})
File "/Users/inada-n/work/python/cpython/Lib/configparser.py", line 747, in read_dict
for key, value in keys.items():
File "/Users/inada-n/work/python/cpython/Lib/_collections_abc.py", line 744, in __iter__
yield (key, self._mapping[key])
File "/Users/inada-n/work/python/cpython/Lib/configparser.py", line 1254, in __getitem__
raise KeyError(key)
KeyError: '#foo' |
|
Date |
User |
Action |
Args |
2019-03-06 06:30:12 | methane | set | recipients:
+ methane, lukasz.langa, xtreak, Phil Kang |
2019-03-06 06:30:12 | methane | set | messageid: <1551853812.79.0.569895217478.issue35838@roundup.psfhosted.org> |
2019-03-06 06:30:12 | methane | link | issue35838 messages |
2019-03-06 06:30:12 | methane | create | |
|