簡體   English   中英

Python3.8 socketpair 失敗(所以 cygwin)

[英]Python3.8 socketpair failed (s.o. cygwin)

在 cygwin 控制台下:

$ python3.8

Python 3.8.7 (default, Jan 26 2021, 07:37:32)

[GCC 10.2.0] on cygwin

Type "help", "copyright", "credits" or "license" for more information.

```>>> import socket as s```

```>>> s.socketpair()```
 
 File "\<stdin\>", line 1, in <module>
  File "/usr/lib/python3.8/socket.py", line 571, in socketpair

    ```a, b = _socket.socketpair(family, type, proto)```

SystemError: <built-in function socketpair> returned NULL without setting an error

但...

$ python2.7

Python 2.7.18 (default, Jan  2 2021, 09:22:32)

[GCC 10.2.0] on cygwin

Type "help", "copyright", "credits" or "license" for more information.

```>>> import socket as s```

```>>> s.socketpair()```

(<socket object, fd=3, family=1, type=1, protocol=0>, <socket object, fd=4, family=1, type=1, 
protocol=0>)

我不知道在哪里看:((

謝謝

新版本實現了類似於您的想法的解決方法

https://sourceware.org/pipermail/cygwin/2021-February/247684.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM