diff --git a/gramps/gen/utils/place.py b/gramps/gen/utils/place.py index 2ca30bef5..956f3f56f 100644 --- a/gramps/gen/utils/place.py +++ b/gramps/gen/utils/place.py @@ -116,9 +116,12 @@ def __convert_using_colon_repr(stringValue): # if no characters before ':' nothing useful is input! if len(l[0]) == 0: return None - if l[0][0] == '-': - sign = '-' - l[0]=l[0][1:] + if l[0][0] in ['+', '-']: + sign = l[0][0] + l[0]=l[0][1:].strip() + # regard a second sign as an error + if l[0][0] in ['+', '-']: + return None else: sign = '+' try: diff --git a/gramps/gen/utils/test/place_test.py b/gramps/gen/utils/test/place_test.py index 80fa0fe5b..dbaa6163a 100644 --- a/gramps/gen/utils/test/place_test.py +++ b/gramps/gen/utils/test/place_test.py @@ -202,7 +202,7 @@ class PlaceTest(unittest.TestCase): self._test_formats_fail(lat, lon) lat, lon = '-50:10:1', '-+2:1:2' - self._test_formats_success(lat, lon) + self._test_formats_fail(lat, lon) def test_missing_minute(self): lat, lon = '-50::1', '-2:1:2'