推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
bestehen
V2EX  ›  Python

Python 报错,我对这个错误处理,但是还是没有过,该如何修改呢?

  •  
  •   bestehen · Jun 23, 2018 · 1236 views
    This topic created in 3029 days ago, the information mentioned may be changed or developed.
    Traceback (most recent call last):
    File "qichacha.py", line 286, in <module>
    qichacha().read_data()
    File "qichacha.py", line 83, in read_data
    self.search_qichacha_index(name)
    File "qichacha.py", line 111, in search_qichacha_index
    if e.error !=errno.ECONNRESET:
    AttributeError: 'ConnectionError' object has no attribute 'error'



    try:
    response=self.s.post(self.search_index,headers=self.headers,data=Form_data,cookies=self.cookies,auth=self.auth,proxies=self.proxies,verify=False)
    except SocketError as e:
    if e.error !=errno.ECONNRESET:
    raise
    else:
    self.search_qichacha_index()
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   893 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.