1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

fixed non-ascii characters inside petition title wheh running inside Munin

This commit is contained in:
Raphaël Droz 2017-01-05 03:11:29 -03:00
parent 4804aea0ec
commit 97d4922ba7

View file

@ -28,6 +28,8 @@ GPLv3
'''
from sys import argv, exit
import sys
import codecs
from os import environ, path, umask
import re
import urllib.request
@ -73,7 +75,9 @@ if environ.get('MUNIN_PLUGSTATE') and write_cache:
umask(0o077)
with open(petition_cache_names, 'w') as outfile:
json.dump(petition_titles, outfile)
# equivalent of passing PYTHONIOENCODING=utf-8 to munin
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
if len(argv) > 1 and argv[1] == 'config':
print('''graph_title change.org signature count