From 3cacdaaaab771107d3400320472fc0807543e028 Mon Sep 17 00:00:00 2001 From: Kris Gesling Date: Sat, 17 Aug 2019 08:36:00 +0930 Subject: [PATCH] Fix TypeError for number values in settings In some instances, the backend returns number setting values as an integer rather than a string. This has been seen in the wild but has been difficult to replicate. The circumstances under which it happens are still unclear. I was able to semi-consistently have a number returned as int from the [Severe Weather Skill](https://github.com/domcross/severe-weather-information-skill) when editing an unrelated setting. To test, remove the 3 character country code (`[A-Z]{3} - `) from the service options of this skill . This seems to be the quickest fix for it, but worth investigating further from the backend. --- mycroft/skills/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mycroft/skills/settings.py b/mycroft/skills/settings.py index ee1c7bc777..bbdeec4823 100644 --- a/mycroft/skills/settings.py +++ b/mycroft/skills/settings.py @@ -489,7 +489,7 @@ class SkillSettings(dict): value = field.get('value') if to_platform == 'core': - if "." in value: + if "." in str(value): sections[i]['fields'][j]['value'] = float(value) else: sections[i]['fields'][j]['value'] = int(value)