简体   繁体   English

socket.gaierror:[Errno 11003] getaddrinfo失败

[英]socket.gaierror: [Errno 11003] getaddrinfo failed

 if data.find('!scan') != -1:
 nick = data.split('!')[ 0 ].replace(':','')
 targetip = socket.gethostbyname(str(arg))
 sck.send('PRIVMSG ' + chan + " :" ' scanning host' + targetip + '\r\n')
 for i in range(20, 1025):
     s = socket(AF_INET, SOCK_STREAM)
     result = s.connect_ex((targetip, i))
     if (result == 0) :
          s.send('PRIVMSG ' + chan + " :" 'port %d: OPEN' % (i,) + '\r\n')
     s.close()

I get this error: 我收到此错误:

    targetip = socket.gethostbyname(str(arg))
socket.gaierror: [Errno 11003] getaddrinfo failed

On Windows, socket.gethostbyname() invokes the getaddrinfo() Winsock API call, and errno 11003 - WSANO_RECOVERY may be caused by the SYSTEMROOT environment variable not being set. 在Windows上, socket.gethostbyname()调用getaddrinfo() Winsock API调用,并且错误11003- WSANO_RECOVERY可能是由于未设置SYSTEMROOT环境变量引起的。

Check if os.environ contains SYSTEMROOT before calling socket.gethostbyname, ex: 在调用socket.gethostbyname之前检查os.environ是否包含SYSTEMROOT,例如:

import os
assert 'SYSTEMROOT' in os.environ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取错误 socket.gaierror: [Errno 11003] getaddrinfo failed when using Django Channels - Getting the error socket.gaierror: [Errno 11003] getaddrinfo failed when using Django Channels socket.gaierror:[Errno 11001] getaddrinfo 失败 - socket.gaierror: [Errno 11001] getaddrinfo failed 服务器连接问题:“socket.gaierror: [Errno 11004] getaddrinfo failed” - Server connection issue: “socket.gaierror: [Errno 11004] getaddrinfo failed” 如何解决:socket.gaierror: [Errno 11001] getaddrinfo failed - How to solve: socket.gaierror: [Errno 11001] getaddrinfo failed socket.gaierror: [Errno 11001] getaddrinfo 在 django 中失败 - socket.gaierror: [Errno 11001] getaddrinfo failed in django (Python)socket.gaierror:[Errno 11001] getaddrinfo失败 - (Python) socket.gaierror: [Errno 11001] getaddrinfo failed Scapy导入错误'socket.gaierror:[Errno 11001] getaddrinfo失败' - Scapy import error 'socket.gaierror: [Errno 11001] getaddrinfo failed' 错误:- socket.gaierror:[Errno 11001] getaddrinfo 在获取请求中失败 - Error :- socket.gaierror: [Errno 11001] getaddrinfo failed in get request gaierror socket.gaierror: [Errno 11001] getaddrinfo 失败 mail.send(msg) - gaierror socket.gaierror: [Errno 11001] getaddrinfo failed mail.send(msg) socket.connect() 给出 socket.gaierror: [Errno 11004] getaddrinfo failed - socket.connect() gives socket.gaierror: [Errno 11004] getaddrinfo failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM