[pypy-issue] Issue #3051: socket.fromfd sets sockets to blocking on pypy3 (pypy/pypy)

Glyph issues-reply at bitbucket.org
Fri Aug 9 14:30:26 EDT 2019


New issue 3051: socket.fromfd sets sockets to blocking on pypy3
https://bitbucket.org/pypy/pypy/issues/3051/socketfromfd-sets-sockets-to-blocking-on

Glyph:

```
import os
import socket
import fcntl

def nonblock_check(fd):
    flags = fcntl.fcntl(fd, fcntl.F_GETFL)
    return bool(flags & os.O_NONBLOCK)

s = socket.socket()

s.setblocking(False)
print(nonblock_check(s.fileno()))
s2 = socket.fromfd(s.fileno(), socket.AF_INET, socket.SOCK_STREAM)
print(nonblock_check(s.fileno()))
```

‌

```
$ pypy pypyminimal.py
True
True
$ pypy3 pypyminimal.py
True
False
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G87
$ pypy --version
Python 2.7.13 (8cdda8b8cdb8ff29d9e620cccd6c5edd2f2a23ec, May 14 2019, 12:36:09)
[PyPy 7.1.1 with GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
$ pypy3 --version
Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, Jun 18 2019, 05:54:52)
[PyPy 7.1.1-beta0 with GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
$
```




More information about the pypy-issue mailing list