From a4e0ce50709b3821006149d2ade6471660c66223 Mon Sep 17 00:00:00 2001 From: Tobias Megies Date: Wed, 14 Oct 2015 10:27:27 +0200 Subject: [PATCH] try to get rid of unicode strings in `__str__(self)` of event types --- obspy/core/event.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obspy/core/event.py b/obspy/core/event.py index 8e071554497..7dffa20bacd 100644 --- a/obspy/core/event.py +++ b/obspy/core/event.py @@ -337,7 +337,10 @@ def __str__(self, force_one_line=False): return ret_str + "()" def get_value_repr(key): - repr_str = getattr(self, key).__repr__() + value = getattr(self, key) + if isinstance(value, (str, native_str)): + value = native_str(value) + repr_str = value.__repr__() # Print any associated errors. error_key = key + "_errors" if hasattr(self, error_key) and\