{"action":"created","issue":{"url":"https://api.github.com/repos/dzhoshkun/ndicapi/issues/11","repository_url":"https://api.github.com/repos/dzhoshkun/ndicapi","labels_url":"https://api.github.com/repos/dzhoshkun/ndicapi/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/dzhoshkun/ndicapi/issues/11/comments","events_url":"https://api.github.com/repos/dzhoshkun/ndicapi/issues/11/events","html_url":"https://github.com/dzhoshkun/ndicapi/issues/11","id":299923640,"number":11,"title":"Python 3 support for the extension module","user":{"login":"dzhoshkun","id":9197424,"avatar_url":"https://avatars2.githubusercontent.com/u/9197424?v=4","gravatar_id":"","url":"https://api.github.com/users/dzhoshkun","html_url":"https://github.com/dzhoshkun","followers_url":"https://api.github.com/users/dzhoshkun/followers","following_url":"https://api.github.com/users/dzhoshkun/following{/other_user}","gists_url":"https://api.github.com/users/dzhoshkun/gists{/gist_id}","starred_url":"https://api.github.com/users/dzhoshkun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzhoshkun/subscriptions","organizations_url":"https://api.github.com/users/dzhoshkun/orgs","repos_url":"https://api.github.com/users/dzhoshkun/repos","events_url":"https://api.github.com/users/dzhoshkun/events{/privacy}","received_events_url":"https://api.github.com/users/dzhoshkun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-02-24T08:25:02Z","updated_at":"2018-02-25T12:13:47Z","closed_at":null,"author_association":"OWNER","body":"[This guideline](https://docs.python.org/3/howto/cporting.html) in conj. with [this more detailed one](http://python3porting.com/cextensions.html) shows how to port extension modules to Python 3.\r\nIn particular when trying to compile against Python 3, the following errors are encountered:\r\n\r\n```\r\ndzhoshkun@joshuah ‹ master ●● › : ~/workspace/ndicapi\r\n[0] % python3 setup.py build\r\nrunning build\r\nrunning build_ext\r\nbuilding 'pyndicapi' extension\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ndicapi.cxx -o build/temp.linux-x86_64-3.5/ndicapi.o\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nndicapi.cxx: In function ‘char* ndiErrorString(int)’:\r\n\r\n[...]\r\n\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ndicapi_math.cxx -o build/temp.linux-x86_64-3.5/ndicapi_math.o\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nndicapi_math.cxx:96:1: warning: multi-line comment [-Wcomment]\r\n //                               /  m_11 m_12 m_11 m_12 \\\r\n ^\r\nndicapi_math.cxx:243:1: warning: multi-line comment [-Wcomment]\r\n // / 1    0       0       \\ / cos(pch) 0 -sin(pch) \\ /  cos(rol) sin(rol)  0 \\\r\n ^\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ndicapi_serial.cxx -o build/temp.linux-x86_64-3.5/ndicapi_serial.o\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nIn file included from ndicapi_serial.cxx:55:0:\r\nndicapi_serial_unix.cxx: In function ‘int ndiSerialRead(int, char*, int, bool, int*)’:\r\nndicapi_serial_unix.cxx:436:19: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]\r\n     if (!isBinary && reply[totalNumberOfBytesRead - 1] == '\\r'       /* done when carriage return received (ASCII) or when ERROR... re\r\n                   ^\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ndicapi_thread.cxx -o build/temp.linux-x86_64-3.5/ndicapi_thread.o\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nx86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ndicapimodule.cxx -o build/temp.linux-x86_64-3.5/ndicapimodule.o\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nndicapimodule.cxx: In function ‘PyObject* PyNdicapi_PyString(PyObject*)’:\r\nndicapimodule.cxx:53:35: error: ‘PyString_FromString’ was not declared in this scope\r\n   return PyString_FromString(space);\r\n                                   ^\r\nndicapimodule.cxx: In function ‘PyObject* PyNdicapi_PyRepr(PyObject*)’:\r\nndicapimodule.cxx:61:35: error: ‘PyString_FromString’ was not declared in this scope\r\n   return PyString_FromString(space);\r\n                                   ^\r\nndicapimodule.cxx: At global scope:\r\nndicapimodule.cxx:84:4: error: ‘cmpfunc’ was not declared in this scope\r\n   (cmpfunc)0,                                                 /* tp_compare */\r\n    ^\r\nndicapimodule.cxx:84:12: error: expected ‘}’ before numeric constant\r\n   (cmpfunc)0,                                                 /* tp_compare */\r\n            ^\r\nndicapimodule.cxx:84:12: error: expected ‘,’ or ‘;’ before numeric constant\r\nndicapimodule.cxx:97:1: error: expected declaration before ‘}’ token\r\n };\r\n ^\r\nndicapimodule.cxx:48:18: warning: ‘PyObject* PyNdicapi_PyString(PyObject*)’ defined but not used [-Wunused-function]\r\n static PyObject* PyNdicapi_PyString(PyObject* self)\r\n                  ^\r\nndicapimodule.cxx:56:18: warning: ‘PyObject* PyNdicapi_PyRepr(PyObject*)’ defined but not used [-Wunused-function]\r\n static PyObject* PyNdicapi_PyRepr(PyObject* self)\r\n                  ^\r\nndicapimodule.cxx:73:21: warning: ‘PyNdicapiType’ defined but not used [-Wunused-variable]\r\n static PyTypeObject PyNdicapiType =\r\n                     ^\r\nerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dzhoshkun/ndicapi/issues/comments/368304439","html_url":"https://github.com/dzhoshkun/ndicapi/issues/11#issuecomment-368304439","issue_url":"https://api.github.com/repos/dzhoshkun/ndicapi/issues/11","id":368304439,"user":{"login":"dzhoshkun","id":9197424,"avatar_url":"https://avatars2.githubusercontent.com/u/9197424?v=4","gravatar_id":"","url":"https://api.github.com/users/dzhoshkun","html_url":"https://github.com/dzhoshkun","followers_url":"https://api.github.com/users/dzhoshkun/followers","following_url":"https://api.github.com/users/dzhoshkun/following{/other_user}","gists_url":"https://api.github.com/users/dzhoshkun/gists{/gist_id}","starred_url":"https://api.github.com/users/dzhoshkun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzhoshkun/subscriptions","organizations_url":"https://api.github.com/users/dzhoshkun/orgs","repos_url":"https://api.github.com/users/dzhoshkun/repos","events_url":"https://api.github.com/users/dzhoshkun/events{/privacy}","received_events_url":"https://api.github.com/users/dzhoshkun/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T12:13:47Z","updated_at":"2018-02-25T12:13:47Z","author_association":"OWNER","body":"* [ ] more elegant way to group `#if PY_MAJOR_VERSION` conditions?"}}
{"actor":{"display_login":"dzhoshkun"}}