From 7b40e6c7ed4c84e4c55ba3fe228bd19b057786f5 Mon Sep 17 00:00:00 2001 From: "Tobias Wellnitz, DH1TW" Date: Sun, 18 Dec 2022 14:40:20 +0100 Subject: [PATCH] callinfo: handle specific unicode strings --- pyhamtools/callinfo.py | 2 +- test/test_callinfo.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyhamtools/callinfo.py b/pyhamtools/callinfo.py index f20d1a2..27c19fd 100644 --- a/pyhamtools/callinfo.py +++ b/pyhamtools/callinfo.py @@ -215,7 +215,7 @@ class Callinfo(object): #make sure that the remaining part is actually a callsign (avoid: OZ/JO81) rest = re.search('/[A-Z0-9]+', entire_callsign) if rest is None: - self._logger.warning("non latin characters in callsign '{0}'".format(entire_callsign)) + self._logger.warning(u"non latin characters in callsign '{0}'".format(entire_callsign)) raise KeyError rest = re.sub('/', '', rest.group(0)) if re.match('^[\\d]{0,1}[A-Z]{1,2}\\d([A-Z]{1,4}|\\d{3,3}|\\d{1,3}[A-Z])[A-Z]{0,5}$', rest): diff --git a/test/test_callinfo.py b/test/test_callinfo.py index 024cfe9..c023fb8 100644 --- a/test/test_callinfo.py +++ b/test/test_callinfo.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from datetime import datetime import pytest