{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/pyzmq/issues/684","labels_url":"https://api.github.com/repos/zeromq/pyzmq/issues/684/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/pyzmq/issues/684/comments","events_url":"https://api.github.com/repos/zeromq/pyzmq/issues/684/events","html_url":"https://github.com/zeromq/pyzmq/issues/684","id":85708916,"number":684,"title":"zmq.tests.test_cffi_backend.TestCFFIBackend tests incorrectly skipped and failing with Python 3","user":{"login":"Arfrever","id":656294,"avatar_url":"https://avatars.githubusercontent.com/u/656294?v=3","gravatar_id":"","url":"https://api.github.com/users/Arfrever","html_url":"https://github.com/Arfrever","followers_url":"https://api.github.com/users/Arfrever/followers","following_url":"https://api.github.com/users/Arfrever/following{/other_user}","gists_url":"https://api.github.com/users/Arfrever/gists{/gist_id}","starred_url":"https://api.github.com/users/Arfrever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arfrever/subscriptions","organizations_url":"https://api.github.com/users/Arfrever/orgs","repos_url":"https://api.github.com/users/Arfrever/repos","events_url":"https://api.github.com/users/Arfrever/events{/privacy}","received_events_url":"https://api.github.com/users/Arfrever/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-06T06:22:26Z","updated_at":"2015-06-08T04:01:28Z","closed_at":null,"body":"`zmq.tests.test_cffi_backend.TestCFFIBackend` tests should not be skipped with CPython when CFFI is installed for CPython.\r\nAfter unskipping of these tests, they pass with CPython 2.\r\nAfter unskipping of these tests, some of them pass with CPython 3, but others cause errors with CPython 3 and most likely also with Python 3 version of PyPy.\r\nI use ZeroMQ 4.1.1.\r\n\r\nResult of test suite of PyZMQ git trunk with CPython 3.4 after unskipping of these tests:\r\n```\r\n$ PYTHONPATH=\"build/lib.linux-x86_64-3.4\" nosetests-3.4 -s -v -w build/lib.linux-x86_64-3.4/zmq/tests\r\n...\r\ntest_zmq_bind (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_bind_connect (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_ctx_new_destroy (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\ntest_zmq_getsockopt (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_msg_data (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_msg_init_close (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\ntest_zmq_msg_init_data (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_msg_init_size (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\ntest_zmq_poll (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_recv (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_send (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_setsockopt (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ERROR\r\ntest_zmq_sleep (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\ntest_zmq_socket_open_close (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\ntest_zmq_stopwatch_functions (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\ntest_zmq_version_info (zmq.tests.test_cffi_backend.TestCFFIBackend) ... ok\r\n...\r\n======================================================================\r\nERROR: test_zmq_bind (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 89, in test_zmq_bind\r\n    assert 0 == C.zmq_bind(socket, 'tcp://*:4444')\r\nTypeError: initializer for ctype 'char *' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_bind_connect (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 101, in test_zmq_bind_connect\r\n    assert 0 == C.zmq_bind(socket1, 'tcp://*:4444')\r\nTypeError: initializer for ctype 'char *' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_getsockopt (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 65, in test_zmq_getsockopt\r\n    identity = ffi.new('char[]', 'zmq')\r\n  File \"/usr/lib64/python3.4/site-packages/cffi/api.py\", line 237, in new\r\n    return self._backend.newp(cdecl, init)\r\nTypeError: initializer for ctype 'char[]' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_msg_data (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 139, in test_zmq_msg_data\r\n    message = ffi.new('char[]', 'Hello')\r\n  File \"/usr/lib64/python3.4/site-packages/cffi/api.py\", line 237, in new\r\n    return self._backend.newp(cdecl, init)\r\nTypeError: initializer for ctype 'char[]' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_msg_init_data (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 126, in test_zmq_msg_init_data\r\n    message = ffi.new('char[5]', 'Hello')\r\n  File \"/usr/lib64/python3.4/site-packages/cffi/api.py\", line 237, in new\r\n    return self._backend.newp(cdecl, init)\r\nTypeError: initializer for ctype 'char[5]' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_poll (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 217, in test_zmq_poll\r\n    r1 = C.zmq_bind(receiver, 'tcp://*:3333')\r\nTypeError: initializer for ctype 'char *' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_recv (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 185, in test_zmq_recv\r\n    assert 0 == C.zmq_bind(receiver, 'tcp://*:2222')\r\nTypeError: initializer for ctype 'char *' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_send (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 159, in test_zmq_send\r\n    assert 0 == C.zmq_bind(receiver, 'tcp://*:7777')\r\nTypeError: initializer for ctype 'char *' must be a bytes or list or tuple, not str\r\n\r\n======================================================================\r\nERROR: test_zmq_setsockopt (zmq.tests.test_cffi_backend.TestCFFIBackend)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/tmp/pyzmq/build/lib.linux-x86_64-3.4/zmq/tests/test_cffi_backend.py\", line 52, in test_zmq_setsockopt\r\n    identity = ffi.new('char[3]', 'zmq')\r\n  File \"/usr/lib64/python3.4/site-packages/cffi/api.py\", line 237, in new\r\n    return self._backend.newp(cdecl, init)\r\nTypeError: initializer for ctype 'char[3]' must be a bytes or list or tuple, not str\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/zeromq/pyzmq/issues/comments/109854421","html_url":"https://github.com/zeromq/pyzmq/issues/684#issuecomment-109854421","issue_url":"https://api.github.com/repos/zeromq/pyzmq/issues/684","id":109854421,"user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T04:01:28Z","updated_at":"2015-06-08T04:01:28Z","body":"@Arfrever would you like to make a pull request with your patch? I can apply it myself, if not, in which case would you like to give a name and email so I can give proper attribution?"}}