Author Adeokkuw
Recipients Adeokkuw
Date 2019-02-10.12:46:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549802769.11.0.931289725614.issue35954@roundup.psfhosted.org>
In-reply-to
Content
Btw: The name "read_dict" [1] as well as its docstring say exactly the opposite of what it does. It acts as a "save_dict". Maybe that can be fixed on the go ...

The docstring

""" [...]
All types held in the dictionary are converted to strings during
reading, including section names, option names and keys. [...]
"""

actually implies what is my proposal here: Convert arguments to str during lookup as well.

```
    def __getitem__(self, key):
        if key != self.default_section and not self.has_section(key):
            raise KeyError(key)
        return self._proxies[key]
```

to

```
    def __getitem__(self, key):

        try: key = str(key)
        except (WhateverError, IsRelevantHereError): raise KeyError(key)

        if key != self.default_section and not self.has_section(key):
            raise KeyError(key)
        return self._proxies[key]
```

[1] https://github.com/python/cpython/blob/3.7/Lib/configparser.py
History
Date User Action Args
2019-02-10 12:46:10Adeokkuwsetrecipients: + Adeokkuw
2019-02-10 12:46:09Adeokkuwsetmessageid: <1549802769.11.0.931289725614.issue35954@roundup.psfhosted.org>
2019-02-10 12:46:09Adeokkuwlinkissue35954 messages
2019-02-10 12:46:08Adeokkuwcreate