8000 test fix python > 3.7 · progressify/wp-api-python@47c27f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47c27f0

Browse files
committed
test fix python > 3.7
1 parent b75420c commit 47c27f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

wordpress/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import unicode_literals
88

99
# from requests import request
10+
import json
1011
import logging
1112

1213
from six import text_type
@@ -214,7 +215,7 @@ def __request(self, method, endpoint, data, **kwargs):
214215
content_type = value.lower()
215216

216217
if data is not None and content_type.startswith('application/json'):
217-
data = StrUtils.jsonencode(data, ensure_ascii=False)
218+
data = StrUtils.jsonencode(json.dumps(data.decode("utf-8")), ensure_ascii=False)
218219

219220
# enforce utf-8 encoded binary
220221
data = StrUtils.to_binary(data)

0 commit comments

Comments
 (0)
0