V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
crny520
V2EX  ›  Python

关于多线程采集的问题.

  •  
  •   crny520 · Nov 18, 2013 · 3938 views
    This topic created in 4556 days ago, the information mentioned may be changed or developed.
    BadStatusLine: ''
    raise BadStatusLine(line)
    File "/usr/lib/python2.7/httplib.py", line 371, in _read_status
    version, status, reason = self._read_status()
    File "/usr/lib/python2.7/httplib.py", line 407, in begin
    response.begin()
    File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse
    response = conn.getresponse()
    File "taskblog.py", line 62, in get_remote_data
    self.__target(*self.__args, **self.__kwargs)
    File "/usr/lib/python2.7/threading.py", line 504, in run
    self.run()
    File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    Traceback (most recent call last):
    Exception in thread Thread-1:

    我用到队列和多线程,用httplib类,try conn.getresponse() 取得数据,无论用try都会使该线程出错.有没有方法处理?
    1 replies    1970-01-01 08:00:00 +08:00
    likexian
        1
    likexian  
       Nov 18, 2013   ❤️ 1
    BadStatusLine 目测对方网站返回了非200

    话说你代码什么都没有,光有这个说个j8
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   906 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 592ms · UTC 19:33 · PVG 03:33 · LAX 12:33 · JFK 15:33
    ♥ Do have faith in what you're doing.