You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fortigate supports non utf-8 characters, suggestion to replace these when formatting response:
def formatresponse(self, res, vdom=None):
LOG.debug("formating response")
self.logging(res)
# Generic way to format the return from FortiAPI
# If vdom is global the resp is a dict of resp (even 1)
# 1 per vdom we check only the first one here (might need a more
# complex check)
if vdom == "global":
resp = json.loads(res.content.decode('utf-8', errors='replace'))[0]
resp['vdom'] = "global"
else:
LOG.debug("content res: %s", res.content)
resp = json.loads(res.content.decode('utf-8', errors='replace'))
return resp
The text was updated successfully, but these errors were encountered:
I've moved on from this project. I believe a workaround for the issue I
faced was to re-add the object. There is a firmware fix that may have
resolved this. We were using 5.2.3
On 20 Dec 2018 11:06, "Nicolas Thomas" <[email protected]> wrote:
Will a configuration parameter for utf-8 solve your issue ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG7kY22C3yLiFDLn7f7SHLPDU4j1DaFSks5u629BgaJpZM4VXvPx>
.
I have run into this issue on two different units running 5.6.7. I've created a few dozen objects using this library and now get the UTF-8 decoding errors when getting them back. I don't believe I've used any characters outside of Unicode. Adding errors='replace' to the UTF-8 decode does resolve the issue.
The fortigate supports non utf-8 characters, suggestion to replace these when formatting response:
The text was updated successfully, but these errors were encountered: