【问题标题】:Python3.8 socketpair failed (s.o. cygwin)Python3.8 socketpair 失败(s.o. cygwin)
【发布时间】:2021-01-31 17:02:00
【问题描述】:

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>)

我不知道去哪里找! :((

谢谢

【问题讨论】:

  • 不是你的错。这是 python/cygwin 包中的当前错误
  • 我在 socket.py 第 571 行稍作改动解决了这个问题:#if hasattr(_socket, "socketpair"):
  • 有趣的解决方法,它绕过系统调用并使用它自己的构建

标签: jupyter-notebook cygwin python-2.6 python-sockets


【解决方案1】:

新版本实现了与您的想法类似的解决方法

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

【讨论】:

  • 我的问题的主要原因是我在cygwin命令窗口下启动jupyter时出错。现在,python3.8 一切正常,我也使用 python osgeo/gdal。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-06-18
  • 2013-11-08
  • 1970-01-01
  • 2020-03-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多