From 269509614a0137448d1b65ffc673606d5e81ec11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Kieffer?= Date: Wed, 28 Apr 2021 14:43:13 +0200 Subject: [PATCH] Fix nexus test --- fabio/nexus.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fabio/nexus.py b/fabio/nexus.py index 17462bf1c..4916bcbba 100644 --- a/fabio/nexus.py +++ b/fabio/nexus.py @@ -33,7 +33,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "23/04/2021" +__date__ = "28/04/2021" __status__ = "production" __docformat__ = 'restructuredtext' @@ -83,10 +83,10 @@ def from_isotime(text, use_tz=False): if len(text) == 1: # just in case someone sets as a list text = text[0] - try: - text = text.decode("ascii") - except (UnicodeError, AttributeError): - text = str(text) + if isinstance(text, bytes): + text = text.decode() + if len(text) > 3 and text.startswith("b") and text[1] == text[-1] and text[1] in ('"', "'"): + text = text[2:-1] if len(text) < 19: logger.warning("Not a iso-time string: %s", text) return