mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
parent
9f7b0dfc30
commit
225fa5d092
84 changed files with 652 additions and 963 deletions
|
@ -85,7 +85,8 @@ class UnsafeProxy(object):
|
|||
class AnsibleJSONUnsafeEncoder(json.JSONEncoder):
|
||||
def encode(self, obj):
|
||||
if isinstance(obj, AnsibleUnsafe):
|
||||
return super(AnsibleJSONUnsafeEncoder, self).encode(dict(__ansible_unsafe=True, value=unicode(obj)))
|
||||
return super(AnsibleJSONUnsafeEncoder, self).encode(dict(__ansible_unsafe=True,
|
||||
value=to_text(obj, errors='surrogate_or_strict', nonstring='strict')))
|
||||
else:
|
||||
return super(AnsibleJSONUnsafeEncoder, self).encode(obj)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue