Windows上的imapclient错误 [英] imapclient error on Windows

查看:118
本文介绍了Windows上的imapclient错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题的环境:Windows10上的Python 2.7.11(已更新).通过msi安装Python.我已经检查了设置中的PATH设置,并将其设置为c:\ Python27.

Environment that I'm having trouble on: Python 2.7.11 on Windows10 (patched up to date). Python installed via a msi. I've checked PATH settings in settings, and it's set to c:\Python27.

这在Mac上适用:

from imapclient import IMAPClient

IMAPClient("imap-mail.outlook.com", use_uid=True, ssl=(True))

但是在Windows上,如果barfs像这样:

But on Windows, if barfs like so:

Traceback (most recent call last):
  File "test_outlook_imap.py", line 3, in <module>
    IMAPClient("imap-mail.outlook.com", use_uid=True, ssl=(True))
  File "C:\Python27\lib\site-packages\imapclient\imapclient.py", line 152, in     __init__
    self._imap = self._create_IMAP4()
  File "C:\Python27\lib\site-packages\imapclient\imapclient.py", line 164, in _create_IMAP4
    self._timeout)
  File "C:\Python27\lib\site-packages\imapclient\tls.py", line 153, in __init__
    imaplib.IMAP4.__init__(self, host, port)
  File "C:\Python27\lib\imaplib.py", line 173, in __init__
    self.open(host, port)
  File "C:\Python27\lib\site-packages\imapclient\tls.py", line 159, in open
    self.sock = wrap_socket(sock, self.ssl_context, host)
  File "C:\Python27\lib\site-packages\imapclient\tls.py", line 126, in wrap_socket
    ssl_context = create_default_context()
  File "C:\Python27\lib\site-packages\imapclient\tls.py", line 109, in     create_default_context
    context.load_verify_locations(cadata=certs)
  File "C:\Python27\lib\site-packages\backports\ssl\core.py", line 654, in     load_verify_locations
    self._ctx.load_verify_locations(cafile, capath)
  File "C:\Python27\lib\site-packages\OpenSSL\SSL.py", line 528, in load_verify_locations
    _raise_current_error()
  File "C:\Python27\lib\site-packages\OpenSSL\_util.py", line 48, in     exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: []

这与Window对证书链的处理有关吗?

Is this to do with Window's handling of certificate chains?

顺便说一句,它在Outlook域中对imap.gmail.com的作用相同.

Incidentally, it does the same for imap.gmail.com in the place of the Outlook domain.

推荐答案

这不是最终答案,但是我发现的解决方法是卸载imapclient并安装旧版本.版本0.13(和0.11)对我有用,但是升级到1.0.1后,我收到了与您发布的相同的错误消息.

This is not a final answer, but the work around that I've found is to uninstall imapclient and install an older version. Version 0.13 (and 0.11) worked for me, however after upgrading to 1.0.1 I got the same error message that you posted.

要使用pip卸载imapclient,请运行:

To uninstall imapclient with pip, run:

pip uninstall imapclient

要使用pip安装旧版0.13,请运行:

To install the older 0.13 version with pip, run:

pip install imapclient==0.13

要从交互式外壳程序中验证imapclient的版本,请执行以下操作:

To verify the version of imapclient, from the interactive shell run:

>>> import imapclient >>> imapclient.__version__

这篇关于Windows上的imapclient错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆