Configs are always unicode now.

This commit is contained in:
Itamar Turner-Trauring 2020-10-29 10:20:06 -04:00
parent 9a4df38db9
commit fa0dbcfd0e

View File

@ -277,13 +277,8 @@ class _Config(object):
self._basedir = abspath_expanduser_unicode(unicode(basedir))
self._config_fname = config_fname
self.config = configparser
nickname_utf8 = self.get_config("node", "nickname", "<unspecified>")
if isinstance(nickname_utf8, bytes): # Python 2
self.nickname = nickname_utf8.decode("utf-8")
else:
self.nickname = nickname_utf8
assert type(self.nickname) is unicode
self.nickname = self.get_config("node", "nickname", u"<unspecified>")
assert isinstance(self.nickname, unicode)
def validate(self, valid_config_sections):
configutil.validate_config(self._config_fname, self.config, valid_config_sections)