[pypy-issue] Issue #2787: pypy3 sockname error (pypy/pypy)

Guillaume Valadon issues-reply at bitbucket.org
Thu Apr 5 03:44:05 EDT 2018


New issue 2787: pypy3 sockname error
https://bitbucket.org/pypy/pypy/issues/2787/pypy3-sockname-error

Guillaume Valadon:

I found an error with socket.sockname() while using pypy3 with Scapy. 

Here is how to reproduce it:
```
#!shell

$ pypy3 --version
Python 3.5.3 (3f6eaa010fce78cc7973bdc1dfdb95970f08fed2, Feb 12 2018, 22:20:44)
[PyPy 5.10.1 with GCC 7.3.0]

$ cat test_pypy3.py 
import socket
ETH_P_ALL = 3
ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(ETH_P_ALL))
ins.bind(("eno1", ETH_P_ALL))
print(ins.getsockname())
ins.close()

$ sudo pypy3 test_pypy3.py
[sudo] password for guedou: 
Traceback (most recent call last):
  File "test_pypy3.py", line 5, in <module>
    print(ins.getsockname())
UnicodeDecodeError: 'utf8' codec can't decode byte 0xdc in position 0: invalid continuation byte
```
The same code works fine with Python 2.7, 3.6 and pypy.




More information about the pypy-issue mailing list