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:
parent
4804aea0ec
commit
97d4922ba7
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue