第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

<type 'exceptions.AttributeError'>這到底是哪里錯了

<type 'exceptions.AttributeError'>這到底是哪里錯了

守候你守候我 2019-02-26 10:05:33
python 報錯 Exception in thread Thread-1 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner File "/usr/lib/python2.6/threading.py", line 484, in run File "dxcad.py", line 243, in threadget File "dxcad.py", line 181, in gethtml File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen File "/usr/lib/python2.6/urllib2.py", line 391, in open File "/usr/lib/python2.6/urllib2.py", line 409, in _open File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain File "/usr/lib/python2.6/urllib2.py", line 1190, in http_open File "/usr/lib/python2.6/urllib2.py", line 1164, in do_open <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error' 代碼 def gethtml(url): encoding_support = ContentEncodingProcessor prodom=proxylist[random.randint(0,proxn)] proxy_support = urllib2.ProxyHandler({'http':prodom}) opener = urllib2.build_opener(proxy_support,encoding_support,urllib2.HTTPHandler) urllib2.install_opener(opener) try: bpanhtml = urllib2.urlopen(url,timeout = 2).read() except Exception,e: print e return gethtml(url) return bpanhtml 求教
查看完整描述

1 回答

?
慕哥6287543

TA貢獻(xiàn)1831條經(jīng)驗 獲得超10個贊

不要在線程中 install_opener

urllib2.install_opener(opener)
Install an OpenerDirector instance as the default global opener. Installing an opener is only necessary if you want urlopen to use that opener; otherwise, simply call OpenerDirector.open() instead of urlopen(). The code does not check for a real OpenerDirector, and any class with the appropriate interface will work.

查看完整回答
反對 回復(fù) 2019-03-01
  • 1 回答
  • 0 關(guān)注
  • 627 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號