python.d.plugin: UrlService bytes decode, logger unicode encodi… (#7601)
* python.d UrlService: ignore decode errors during decoding bytes (py3) * python.d logger: ignore encoding errors in unicode
Ilya Mashchenko committed
Dec 23, 2019 at 15:18 UTC
977062b81232107e504dbb8f140165166509d80b
2 files changed
+2
-2
collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py
+1
-1
@@ -152,7 +152,7 @@ class UrlService(SimpleService):
152
)
153
if isinstance(response.data, str):
154
return response.status, response.data
155
- return response.status, response.data.decode()
155
+ return response.status, response.data.decode(errors='ignore')
156
157
def check(self):
158
"""
collectors/python.d.plugin/python_modules/bases/collection.py
+1
-1
@@ -95,6 +95,6 @@ def unicode_str(arg):
95
:return: <str>
96
"""
97
try:
98
- return unicode(arg)
98
+ return unicode(arg, errors='ignore')
99
except NameError:
100
return str(arg)