diff --git a/lslopt/lslbasefuncs.py b/lslopt/lslbasefuncs.py index f32f3fa..8519287 100644 --- a/lslopt/lslbasefuncs.py +++ b/lslopt/lslbasefuncs.py @@ -475,6 +475,8 @@ def InternalUTF8toString(s): # NOTE: Without the above line, the following one hits a bug in # python-coverage. It IS executed but not detected. continue + if LSO: + raise ELSONotSupported("Byte strings not supported") ret += u'?' * len(partialchar) partialchar = b'' # fall through to process current character @@ -482,11 +484,15 @@ def InternalUTF8toString(s): partialchar = c pending = 1 if o < 0xE0 else 2 if o < 0xF0 else 3 elif o >= 0x80: + if LSO: + raise ELSONotSupported("Byte strings not supported") ret += u'?' else: ret += c.decode('utf8') if partialchar: + if LSO: + raise ELSONotSupported("Byte strings not supported") ret += u'?' * len(partialchar) return zstr(ret) diff --git a/lslopt/lslcommon.py b/lslopt/lslcommon.py index a4e351f..5bd285b 100644 --- a/lslopt/lslcommon.py +++ b/lslopt/lslcommon.py @@ -30,6 +30,9 @@ class Quaternion(tuple): def __repr__(self): return 'Quaternion(' + super(Quaternion, self).__repr__() + ')' +class ELSONotSupported(Exception): + pass + # Recognized: 3763, 6466, 6495 Bugs = set([6495])