socket.gaierror: [Errno 11001] getaddrinfo failed

前端 未结 8 1903
北海茫月
北海茫月 2021-01-06 08:33

I have tried to attached a file to the mail using python. Code:

import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIME         


        
相关标签:
8条回答
  • 2021-01-06 09:22

    There seems to be a bug in urllib3 version 1.25.9 package. This produced "socket.gaierror: [Errno 11001] getaddrinfo failed" error for me (working from behind an authenticated proxy server). Downgrading to urllib3 version 1.25.8 solved the problem.

    0 讨论(0)
  • 2021-01-06 09:24

    The below answer may be quite irrelevant to the question. But,some users may have a different scenario.

    If a server can be reached only through VPN and if we try to reach it with VPN disconnected, this error : "gaierror: [Errno 11001] getaddrinfo failed" crops up.

    Connect to VPN and then executing the code should work good.

    0 讨论(0)
提交回复
热议问题