推荐学习书目
› 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
ioven
V2EX  ›  Python

求教,gevent + urllib2 采集https://code.google.com抛出一堆错误 _ssl.c:504: EOF occurred in violation of protocol

  •  
  •   ioven · May 22, 2013 · 6171 views
    This topic created in 4879 days ago, the information mentioned may be changed or developed.
    7 replies  •  1970-01-01 08:00:00 +08:00
    ljbha007
        1
    ljbha007  
       May 22, 2013
    多半是被墙了
    ioven
        2
    ioven  
    OP
       May 22, 2013
    @ljbha007 木被墙,单用urllib2完全木问题
    feisuzhu
        3
    feisuzhu  
       May 23, 2013
    monkey_patch的时候有没有指定patch_ssl?
    ioven
        4
    ioven  
    OP
       May 24, 2013
    @feisuzhu __import__('gevent.monkey').monkey.patch_all(thread=False)
    feisuzhu
        5
    feisuzhu  
       May 24, 2013
    @ioven 抱歉我也没有过patch_ssl。monkey_patch尽量放到所有import的前面。还有就是,你可以试试gevent1.0,尽管还是beta,但是beta了好久了。
    ioven
        6
    ioven  
    OP
       May 24, 2013
    @feisuzhu gevent 1.0 官网,pypi找了一圈也没找到,求下载地址
    ioven
        7
    ioven  
    OP
       May 25, 2013
    找到原因了,采集的数据保存用的是mysql,MySQLdb无法被gevent path,所以线程阻塞导致urllib2出现错误

    偶是白痴。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1074 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    ♥ Do have faith in what you're doing.