2017-04-22 4 views
4

표준 json 모듈에 대한 더 나은 대안을 찾고 있는데 cjson 모듈 (https://github.com/AGProjects/python-cjson/)이 가장 빠른 인코더/디코더라고합니다. 그러나 pip3 (Python 3.5)으로 설치하면 다음과 같은 오류가 발생합니다 (그리고 너무 바보로 알아낼 수 없습니다).왜 Python 3.x에서 python-cjson을 사용할 수 없습니까?

  object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL); 
        ^~~~~~~~~~~~~~~~~~~~~ cjson.c:167:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL); 
       ^ cjson.c:169:18: warning: implicit declaration of function ‘PyString_FromStringAndSize’ [-Wimplicit-function-declaration] 
      object = PyString_FromStringAndSize(jsondata->ptr+1, len); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:169:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      object = PyString_FromStringAndSize(jsondata->ptr+1, len); 
       ^ cjson.c:185:39: warning: implicit declaration of function ‘PyString_AsString’ [-Wimplicit-function-declaration] 
           reason ? PyString_AsString(reason) : "bad format"); 
             ^~~~~~~~~~~~~~~~~ cjson.c:185:65: warning: pointer/integer type mismatch in conditional expression 
           reason ? PyString_AsString(reason) : "bad format"); 
                   ^ cjson.c: In function ‘decode_number’: cjson.c:295:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     str = PyString_FromStringAndSize(jsondata->ptr, ptr - jsondata->ptr); 
     ^ cjson.c:300:18: error: too many arguments to function ‘PyFloat_FromString’ 
      object = PyFloat_FromString(str, NULL); 
        ^~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.5m/Python.h:81:0, 
        from cjson.c:5: /usr/include/python3.5m/floatobject.h:42:24: note: declared here PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*); 
          ^~~~~~~~~~~~~~~~~~ cjson.c:302:18: warning: implicit declaration of function ‘PyInt_FromString’ [-Wimplicit-function-declaration] 
      object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10); 
        ^~~~~~~~~~~~~~~~ cjson.c:302:35: warning: implicit declaration of function ‘PyString_AS_STRING’ [-Wimplicit-function-declaration] 
      object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10); 
            ^~~~~~~~~~~~~~~~~~ cjson.c:302:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10); 
       ^ cjson.c: In function ‘encode_string’: cjson.c:593:14: error: unknown type name ‘PyStringObject’ 
     register PyStringObject* op = (PyStringObject*) string; 
       ^~~~~~~~~~~~~~ cjson.c:593:36: error: ‘PyStringObject’ undeclared (first use in this function) 
     register PyStringObject* op = (PyStringObject*) string; 
             ^~~~~~~~~~~~~~ cjson.c:593:36: note: each undeclared identifier is reported only once for each function it appears in cjson.c:593:51: error: expected expression before ‘)’ token 
     register PyStringObject* op = (PyStringObject*) string; 
                ^ cjson.c:594:32: error: request for member ‘ob_size’ in something not a structure or union 
     size_t newsize = 2 + 6 * op->ob_size; 
            ^~ cjson.c:597:11: error: request for member ‘ob_size’ in something not a structure or union 
     if (op->ob_size > (PY_SSIZE_T_MAX-2)/6) { 
      ^~ cjson.c:602:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     v = PyString_FromStringAndSize((char *)NULL, newsize); 
     ^ cjson.c:614:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      p = PyString_AS_STRING(v); 
      ^ cjson.c:616:27: error: request for member ‘ob_size’ in something not a structure or union 
      for (i = 0; i < op->ob_size; i++) { 
          ^~ cjson.c:620:19: error: request for member ‘ob_sval’ in something not a structure or union 
       c = op->ob_sval[i]; 
        ^~ cjson.c:646:9: warning: implicit declaration of function ‘_PyString_Resize’ [-Wimplicit-function-declaration] 
      _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v))); 
      ^~~~~~~~~~~~~~~~ cjson.c:646:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 
      _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v))); 
           ^ cjson.c: In function ‘encode_unicode’: cjson.c:697:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     repr = PyString_FromStringAndSize(NULL, 2 + expandsize*size + 1); 
      ^ cjson.c:701:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     p = PyString_AS_STRING(repr); 
     ^ cjson.c:709:57: error: subscripted value is neither array nor pointer nor vector 
      if ((ch == (Py_UNICODE) PyString_AS_STRING(repr)[0] || ch == '\\')) { 
                 ^ cjson.c:804:36: error: subscripted value is neither array nor pointer nor vector 
     *p++ = PyString_AS_STRING(repr)[0]; 
            ^ cjson.c: In function ‘encode_tuple’: cjson.c:828:10: error: ‘PyTupleObject {aka struct <anonymous>}’ has no member named ‘ob_size’; did you mean ‘ob_base’? 
     n = v->ob_size; 
      ^~ cjson.c:830:16: warning: implicit declaration of function ‘PyString_FromString’ [-Wimplicit-function-declaration] 
      return PyString_FromString("[]"); 
        ^~~~~~~~~~~~~~~~~~~ cjson.c:830:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("[]"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:846:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("["); 
     ^ cjson.c:850:5: warning: implicit declaration of function ‘PyString_ConcatAndDel’ [-Wimplicit-function-declaration] 
     PyString_ConcatAndDel(&s, temp); 
     ^~~~~~~~~~~~~~~~~~~~~ cjson.c:855:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("]"); 
     ^ cjson.c:865:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString(", "); 
     ^ cjson.c:868:14: warning: implicit declaration of function ‘_PyString_Join’ [-Wimplicit-function-declaration] 
     result = _PyString_Join(s, pieces); 
       ^~~~~~~~~~~~~~ cjson.c:868:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     result = _PyString_Join(s, pieces); 
      ^ cjson.c: In function ‘encode_list’: cjson.c:902:10: error: ‘PyListObject {aka struct <anonymous>}’ has no member named ‘ob_size’; did you mean ‘ob_base’? 
     if (v->ob_size == 0) { 
      ^~ cjson.c:903:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      result = PyString_FromString("[]"); 
       ^ cjson.c:913:22: error: ‘PyListObject {aka struct <anonymous>}’ has no member named ‘ob_size’; did you mean ‘ob_base’? 
     for (i = 0; i < v->ob_size; ++i) { 
         ^~ cjson.c:926:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("["); 
     ^ cjson.c:935:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("]"); 
     ^ cjson.c:945:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString(", "); 
     ^ cjson.c:948:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     result = _PyString_Join(s, pieces); 
      ^ cjson.c: In function ‘encode_dict’: cjson.c:987:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      result = PyString_FromString("{}"); 
       ^ cjson.c:995:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     colon = PyString_FromString(": "); 
      ^ cjson.c:1005:14: warning: implicit declaration of function ‘PyString_Check’ [-Wimplicit-function-declaration] 
      if (!PyString_Check(key) && !PyUnicode_Check(key)) { 
       ^~~~~~~~~~~~~~ cjson.c:1014:9: warning: implicit declaration of function ‘PyString_Concat’ [-Wimplicit-function-declaration] 
      PyString_Concat(&s, colon); 
      ^~~~~~~~~~~~~~~ cjson.c:1027:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("{"); 
     ^ cjson.c:1036:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("}"); 
     ^ cjson.c:1046:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString(", "); 
     ^ cjson.c:1049:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     result = _PyString_Join(s, pieces); 
      ^ cjson.c: In function ‘encode_object’: cjson.c:1064:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("true"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1066:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("false"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1068:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("null"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1076:20: warning: return makes pointer from integer without a cast [-Wint-conversion] 
       return PyString_FromString("NaN"); 
         ^~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1079:24: warning: return makes pointer from integer without a cast [-Wint-conversion] 
        return PyString_FromString("Infinity"); 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1081:24: warning: return makes pointer from integer without a cast [-Wint-conversion] 
        return PyString_FromString("-Infinity"); 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1086:16: warning: implicit declaration of function ‘PyInt_Check’ [-Wimplicit-function-declaration] 
     } else if (PyInt_Check(object) || PyLong_Check(object)) { 
        ^~~~~~~~~~~ cjson.c: In function ‘JSON_decode’: cjson.c:1149:9: warning: implicit declaration of function ‘PyString_AsStringAndSize’ [-Wimplicit-function-declaration] 
     if (PyString_AsStringAndSize(str, &(jsondata.str), NULL) == -1) { 
      ^~~~~~~~~~~~~~~~~~~~~~~~ cjson.c:1155:35: warning: implicit declaration of function ‘PyString_GET_SIZE’ [-Wimplicit-function-declaration] 
     jsondata.end = jsondata.str + PyString_GET_SIZE(str); 
            ^~~~~~~~~~~~~~~~~ cjson.c: In function ‘initcjson’: cjson.c:1206:9: warning: implicit declaration of function ‘Py_InitModule3’ [-Wimplicit-function-declaration] 
     m = Py_InitModule3("cjson", cjson_methods, module_doc); 
      ^~~~~~~~~~~~~~ cjson.c:1206:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     m = Py_InitModule3("cjson", cjson_methods, module_doc); 
     ^ cjson.c:1209:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ cjson.c:1202:1: note: declared here initcjson(void) ^~~~~~~~~ cjson.c:1213:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ cjson.c:1202:1: note: declared here initcjson(void) ^~~~~~~~~ cjson.c:1219:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ cjson.c:1202:1: note: declared here initcjson(void) ^~~~~~~~~ cjson.c:1225:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ cjson.c:1202:1: note: declared here initcjson(void) ^~~~~~~~~ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 
    ---------------------------------------- Failed building wheel for python-cjson Running setup.py clean for python-cjson Failed to build python-cjson Installing collected packages: python-cjson Running setup.py install for python-cjson ... error 
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3pu8hloy/python-cjson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install 
--record /tmp/pip-zp1kxfa_-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: 
    running install 
    running build 
    running build_ext 
    building 'cjson' extension 
    creating build 
    creating build/temp.linux-x86_64-3.5 
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-7CCmgg/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DMODULE_VERSION=1.2.1 -I/usr/include/python3.5m -c cjson.c -o build/temp.linux-x86_64-3.5/cjson.o 
    cjson.c: In function ‘decode_string’: 
    cjson.c:167:18: warning: implicit declaration of function ‘PyString_DecodeEscape’ [-Wimplicit-function-declaration] 
      object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL); 
         ^~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:167:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL); 
        ^
    cjson.c:169:18: warning: implicit declaration of function ‘PyString_FromStringAndSize’ [-Wimplicit-function-declaration] 
      object = PyString_FromStringAndSize(jsondata->ptr+1, len); 
         ^~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:169:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      object = PyString_FromStringAndSize(jsondata->ptr+1, len); 
        ^
    cjson.c:185:39: warning: implicit declaration of function ‘PyString_AsString’ [-Wimplicit-function-declaration] 
            reason ? PyString_AsString(reason) : "bad format"); 
              ^~~~~~~~~~~~~~~~~ 
    cjson.c:185:65: warning: pointer/integer type mismatch in conditional expression 
            reason ? PyString_AsString(reason) : "bad format"); 
                    ^
    cjson.c: In function ‘decode_number’: 
    cjson.c:295:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     str = PyString_FromStringAndSize(jsondata->ptr, ptr - jsondata->ptr); 
      ^
    cjson.c:300:18: error: too many arguments to function ‘PyFloat_FromString’ 
      object = PyFloat_FromString(str, NULL); 
         ^~~~~~~~~~~~~~~~~~ 
    In file included from /usr/include/python3.5m/Python.h:81:0, 
        from cjson.c:5: 
    /usr/include/python3.5m/floatobject.h:42:24: note: declared here 
    PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*); 
          ^~~~~~~~~~~~~~~~~~ 
    cjson.c:302:18: warning: implicit declaration of function ‘PyInt_FromString’ [-Wimplicit-function-declaration] 
      object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10); 
         ^~~~~~~~~~~~~~~~ 
    cjson.c:302:35: warning: implicit declaration of function ‘PyString_AS_STRING’ [-Wimplicit-function-declaration] 
      object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10); 
             ^~~~~~~~~~~~~~~~~~ 
    cjson.c:302:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10); 
        ^
    cjson.c: In function ‘encode_string’: 
    cjson.c:593:14: error: unknown type name ‘PyStringObject’ 
     register PyStringObject* op = (PyStringObject*) string; 
        ^~~~~~~~~~~~~~ 
    cjson.c:593:36: error: ‘PyStringObject’ undeclared (first use in this function) 
     register PyStringObject* op = (PyStringObject*) string; 
             ^~~~~~~~~~~~~~ 
    cjson.c:593:36: note: each undeclared identifier is reported only once for each function it appears in 
    cjson.c:593:51: error: expected expression before ‘)’ token 
     register PyStringObject* op = (PyStringObject*) string; 
                ^
    cjson.c:594:32: error: request for member ‘ob_size’ in something not a structure or union 
     size_t newsize = 2 + 6 * op->ob_size; 
            ^~ 
    cjson.c:597:11: error: request for member ‘ob_size’ in something not a structure or union 
     if (op->ob_size > (PY_SSIZE_T_MAX-2)/6) { 
       ^~ 
    cjson.c:602:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     v = PyString_FromStringAndSize((char *)NULL, newsize); 
     ^
    cjson.c:614:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      p = PyString_AS_STRING(v); 
      ^
    cjson.c:616:27: error: request for member ‘ob_size’ in something not a structure or union 
      for (i = 0; i < op->ob_size; i++) { 
           ^~ 
    cjson.c:620:19: error: request for member ‘ob_sval’ in something not a structure or union 
       c = op->ob_sval[i]; 
         ^~ 
    cjson.c:646:9: warning: implicit declaration of function ‘_PyString_Resize’ [-Wimplicit-function-declaration] 
      _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v))); 
      ^~~~~~~~~~~~~~~~ 
    cjson.c:646:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 
      _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v))); 
           ^
    cjson.c: In function ‘encode_unicode’: 
    cjson.c:697:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     repr = PyString_FromStringAndSize(NULL, 2 + expandsize*size + 1); 
      ^
    cjson.c:701:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     p = PyString_AS_STRING(repr); 
     ^
    cjson.c:709:57: error: subscripted value is neither array nor pointer nor vector 
      if ((ch == (Py_UNICODE) PyString_AS_STRING(repr)[0] || ch == '\\')) { 
                  ^
    cjson.c:804:36: error: subscripted value is neither array nor pointer nor vector 
     *p++ = PyString_AS_STRING(repr)[0]; 
             ^
    cjson.c: In function ‘encode_tuple’: 
    cjson.c:828:10: error: ‘PyTupleObject {aka struct <anonymous>}’ has no member named ‘ob_size’; did you mean ‘ob_base’? 
     n = v->ob_size; 
       ^~ 
    cjson.c:830:16: warning: implicit declaration of function ‘PyString_FromString’ [-Wimplicit-function-declaration] 
      return PyString_FromString("[]"); 
        ^~~~~~~~~~~~~~~~~~~ 
    cjson.c:830:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("[]"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:846:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("["); 
     ^
    cjson.c:850:5: warning: implicit declaration of function ‘PyString_ConcatAndDel’ [-Wimplicit-function-declaration] 
     PyString_ConcatAndDel(&s, temp); 
     ^~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:855:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("]"); 
     ^
    cjson.c:865:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString(", "); 
     ^
    cjson.c:868:14: warning: implicit declaration of function ‘_PyString_Join’ [-Wimplicit-function-declaration] 
     result = _PyString_Join(s, pieces); 
        ^~~~~~~~~~~~~~ 
    cjson.c:868:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     result = _PyString_Join(s, pieces); 
       ^
    cjson.c: In function ‘encode_list’: 
    cjson.c:902:10: error: ‘PyListObject {aka struct <anonymous>}’ has no member named ‘ob_size’; did you mean ‘ob_base’? 
     if (v->ob_size == 0) { 
       ^~ 
    cjson.c:903:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      result = PyString_FromString("[]"); 
        ^
    cjson.c:913:22: error: ‘PyListObject {aka struct <anonymous>}’ has no member named ‘ob_size’; did you mean ‘ob_base’? 
     for (i = 0; i < v->ob_size; ++i) { 
          ^~ 
    cjson.c:926:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("["); 
     ^
    cjson.c:935:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("]"); 
     ^
    cjson.c:945:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString(", "); 
     ^
    cjson.c:948:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     result = _PyString_Join(s, pieces); 
       ^
    cjson.c: In function ‘encode_dict’: 
    cjson.c:987:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
      result = PyString_FromString("{}"); 
        ^
    cjson.c:995:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     colon = PyString_FromString(": "); 
      ^
    cjson.c:1005:14: warning: implicit declaration of function ‘PyString_Check’ [-Wimplicit-function-declaration] 
      if (!PyString_Check(key) && !PyUnicode_Check(key)) { 
        ^~~~~~~~~~~~~~ 
    cjson.c:1014:9: warning: implicit declaration of function ‘PyString_Concat’ [-Wimplicit-function-declaration] 
      PyString_Concat(&s, colon); 
      ^~~~~~~~~~~~~~~ 
    cjson.c:1027:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("{"); 
     ^
    cjson.c:1036:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString("}"); 
     ^
    cjson.c:1046:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     s = PyString_FromString(", "); 
     ^
    cjson.c:1049:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     result = _PyString_Join(s, pieces); 
       ^
    cjson.c: In function ‘encode_object’: 
    cjson.c:1064:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("true"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1066:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("false"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1068:16: warning: return makes pointer from integer without a cast [-Wint-conversion] 
      return PyString_FromString("null"); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1076:20: warning: return makes pointer from integer without a cast [-Wint-conversion] 
       return PyString_FromString("NaN"); 
         ^~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1079:24: warning: return makes pointer from integer without a cast [-Wint-conversion] 
        return PyString_FromString("Infinity"); 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1081:24: warning: return makes pointer from integer without a cast [-Wint-conversion] 
        return PyString_FromString("-Infinity"); 
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1086:16: warning: implicit declaration of function ‘PyInt_Check’ [-Wimplicit-function-declaration] 
     } else if (PyInt_Check(object) || PyLong_Check(object)) { 
        ^~~~~~~~~~~ 
    cjson.c: In function ‘JSON_decode’: 
    cjson.c:1149:9: warning: implicit declaration of function ‘PyString_AsStringAndSize’ [-Wimplicit-function-declaration] 
     if (PyString_AsStringAndSize(str, &(jsondata.str), NULL) == -1) { 
      ^~~~~~~~~~~~~~~~~~~~~~~~ 
    cjson.c:1155:35: warning: implicit declaration of function ‘PyString_GET_SIZE’ [-Wimplicit-function-declaration] 
     jsondata.end = jsondata.str + PyString_GET_SIZE(str); 
             ^~~~~~~~~~~~~~~~~ 
    cjson.c: In function ‘initcjson’: 
    cjson.c:1206:9: warning: implicit declaration of function ‘Py_InitModule3’ [-Wimplicit-function-declaration] 
     m = Py_InitModule3("cjson", cjson_methods, module_doc); 
      ^~~~~~~~~~~~~~ 
    cjson.c:1206:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] 
     m = Py_InitModule3("cjson", cjson_methods, module_doc); 
     ^
    cjson.c:1209:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ 
    cjson.c:1202:1: note: declared here 
    initcjson(void) 
    ^~~~~~~~~ 
    cjson.c:1213:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ 
    cjson.c:1202:1: note: declared here 
    initcjson(void) 
    ^~~~~~~~~ 
    cjson.c:1219:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ 
    cjson.c:1202:1: note: declared here 
    initcjson(void) 
    ^~~~~~~~~ 
    cjson.c:1225:9: warning: ‘return’ with no value, in function returning non-void 
      return; 
      ^~~~~~ 
    cjson.c:1202:1: note: declared here 
    initcjson(void) 
    ^~~~~~~~~ 
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

    ---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3pu8hloy/python-cjson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install 
--record /tmp/pip-zp1kxfa_-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-3pu8hloy/python-cjson/ 

감사합니다.

답변

5

py3readiness.org에 따르면 python-cjson에 대한 Python3 지원은 현재 없습니다.

아마도 ujson (benchmark)을보고 싶을 것입니다.

+0

@Alexandre이 정보가 도움이 되었으면 질문에 대한 대답으로 표시하는 것이 좋습니다. – mab

+2

감사합니다. ujson은 실제로 그 일을 해냈고 25 % 향상된 성능으로 동일한 결과를 얻었습니다. – Alexandre

관련 문제