Using umlauts in various output-related strings causes UnicodeDecodeErrors.
For example, using a ScalarContext like this:
nagiosplugin.ScalarContext(
'cert_expiration_days',
fmt_metric="Zeritifikat läuft in {value} Tagen ab."
)
results in
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Python27\lib\site-packages\nagiosplugin\runtime.py", line 108, in run
self.output.add(check)
File "C:\Python27\lib\site-packages\nagiosplugin\output.py", line 27, in add
self.status = self.format_status(check)
File "C:\Python27\lib\site-packages\nagiosplugin\output.py", line 41, in format_status
summary_str = check.summary_str.strip()
File "C:\Python27\lib\site-packages\nagiosplugin\check.py", line 143, in summary_str
return self.summary.problem(self.results) or ''
File "C:\Python27\lib\site-packages\nagiosplugin\summary.py", line 51, in problem
return str(results.first_significant)
File "C:\Python27\lib\site-packages\nagiosplugin\result.py", line 57, in __str__
return '{0} ({1})'.format(desc, self.hint)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 13: ordinal not in range(128)
Original report by Christian Kauhaus (Bitbucket: ckauhaus, GitHub: ckauhaus).
Using umlauts in various output-related strings causes UnicodeDecodeErrors.
For example, using a ScalarContext like this:
results in
Same problem on Linux machines.