【问题标题】:dnspython 1.11.1 EmptyLabel exception in python 2.7.6python 2.7.6 中的 dnspython 1.11.1 EmptyLabel 异常
【发布时间】:2014-05-31 00:09:40
【问题描述】:

我刚刚使用“pip install dnspython”安装了 dnspython。然后我打开了一个 python shell 并尝试了以下代码:

import dns.resolver
answers = dns.resolver.query('dnspython.org', 'MX')

我立即得到以下信息:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dns/resolver.py", line 973, in query
    return get_default_resolver().query(qname, rdtype, rdclass, tcp, source,
  File "dns/resolver.py", line 961, in get_default_resolver
    default_resolver = Resolver()
  File "dns/resolver.py", line 489, in __init__
    self.read_resolv_conf(filename)
  File "dns/resolver.py", line 540, in read_resolv_conf
    self.search.append(dns.name.from_text(suffix))
  File "dns/name.py", line 638, in from_text
    raise EmptyLabel
dns.name.EmptyLabel

我在 OSX Mavericks 上使用 python 2.7.6、pip 版本 1.5.4 和 dnspython 版本 1.11.1

【问题讨论】:

  • 你有什么问题?

标签: python python-2.7 dnspython


【解决方案1】:

您似乎在本地遇到了一些 DNS 问题或权限问题。您能否确保您的网络 DNS 页面设置正确。

【讨论】:

  • 感谢您为我指明正确的方向!原来我的 VPN 在设置中有一个不正确的域
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2010-10-27
  • 1970-01-01
  • 2014-03-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多