pyzmq fails on sending bytearray on pypy3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pyzmq fails on sending bytearray on pypy3

Michal Moiseev
Hello,
our projects runs on python 3.4, and when trying to run them with pypy3
we run into this problem:
when trying to send bytearray with send()
like:
clientSocket.send(bytearray(some_bytes))
it fails on:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/pypy3-v5.8.0-src/site-packages/zmq/backend/cffi/socket.py", line 209, in send
    c_message = ffi.new('char[]', message)
  File "/opt/pypy3-v5.8.0-src/lib_pypy/cffi/api.py", line 250, in new
    return self._backend.newp(cdecl, init)
TypeError: 'bytearray' object cannot be interpreted as an integer
it behaves differently when running with python3.4 (Cpython) - which works
i'm not sure if the problem is with the the pyzmq library or the cffi 
thank you in advance

--


_______________________________________________
pypy-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/pypy-dev
Reply | Threaded
Open this post in threaded view
|

Re: pyzmq fails on sending bytearray on pypy3

Michal Moiseev
do you know what could be the problem?

On Wed, Aug 2, 2017 at 1:02 PM, Michal Moiseev <[hidden email]> wrote:
Hello,
our projects runs on python 3.4, and when trying to run them with pypy3
we run into this problem:
when trying to send bytearray with send()
like:
clientSocket.send(bytearray(some_bytes))
it fails on:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/pypy3-v5.8.0-src/site-packages/zmq/backend/cffi/socket.py", line 209, in send
    c_message = ffi.new('char[]', message)
  File "/opt/pypy3-v5.8.0-src/lib_pypy/cffi/api.py", line 250, in new
    return self._backend.newp(cdecl, init)
TypeError: 'bytearray' object cannot be interpreted as an integer
it behaves differently when running with python3.4 (Cpython) - which works
i'm not sure if the problem is with the the pyzmq library or the cffi 
thank you in advance

--




--


_______________________________________________
pypy-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/pypy-dev
Reply | Threaded
Open this post in threaded view
|

Re: pyzmq fails on sending bytearray on pypy3

Carl Friedrich Bolz-Tereick
In reply to this post by Michal Moiseev
Hello Michal,

sorry, this is not enough information for us to debug the problem. We
would need detailed instructions how to reproduce it, not just a traceback:

http://doc.pypy.org/en/latest/faq.html#how-should-i-report-a-bug


As a guess: It sounds a bit like the socket.send method in zmq with the
cython backend (which is used by CPython) accepts a bytearray as the
message, while the cffi backend (used by PyPy) does not. In this case,
it would be a zmq bug and you should report it with them.

Cheers,

Carl Friedrich

On 02/08/17 12:02, Michal Moiseev wrote:

> Hello,
> our projects runs on python 3.4, and when trying to run them with pypy3
> we run into this problem:
> when trying to send bytearray with send()
> like:
> clientSocket.send(bytearray(some_bytes))
> it fails on:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/opt/pypy3-v5.8.0-src/site-packages/zmq/backend/cffi/socket.py",
> line 209, in send
>     c_message = ffi.new('char[]', message)
>   File "/opt/pypy3-v5.8.0-src/lib_pypy/cffi/api.py", line 250, in new
>     return self._backend.newp(cdecl, init)
> TypeError: 'bytearray' object cannot be interpreted as an integer
> it behaves differently when running with python3.4 (Cpython) - which works
> i'm not sure if the problem is with the the pyzmq library or the cffi
> thank you in advance
>
> --
>
>
>
> _______________________________________________
> pypy-dev mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/pypy-dev
>

_______________________________________________
pypy-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/pypy-dev