Python/Django “BadStatusLine” error

前端 未结 3 523
暗喜
暗喜 2020-12-15 20:35

I\'m getting a weird error that I can\'t seem to find a solution for.

This error does not occur every time I hit this segment of code, and neither does it happen for

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 21:18

    This doesn't have anything to do with Django, it's an exception thrown by urllib2 which couldn't parse the response after fetching your url. It may be a network issue, a malformed response… Some servers / applications throw this kind of error randomly. If you don't control what this URL returns you're left with catching the exception, debugging which URLs are causing problems and trying to identify a pattern.

提交回复
热议问题