2011-03-12 1 views
4

나는 Windows XP에서 gevent와 패치 urllib2가 포함 된 URL을 열려고 해요 :Windows에서 "NotImplementedError"urllib2/gevent 오류를 해결하는 방법은 무엇입니까?

from gevent import monkey 
monkey.patch_all() 
import urllib2 

opener = urllib2.build_opener() 
request = urllib2.Request("http://www.google.com") 
response = opener.open(request) 

그리고 나는 opener.open 통화 중이 예외 얻을 다음 gevent의 socket.py 보면

File "C:\Python26\lib\site-packages\gevent\socket.py", line 768, in getaddrinfo 
    sockaddr = (inet_ntop(AF_INET6, res), port, 0, 0) 
File "C:\Python26\lib\site-packages\gevent\socket.py", line 133, in inet_ntop 
    raise NotImplementedError('inet_ntop() is not available on this platform') 
NotImplementedError: inet_ntop() is not available on this platform 
<SERPScrapper at 0xbc0f60> failed with NotImplementedError 

을 소스 코드 윈도우에서 IPV6과 관련이있는 것 같습니다 ...

이 문제를 해결하기위한 아이디어 나 제안은 있습니까?

편집 : 다른 URL에는 문제가 없습니다 (예 : http://www.bing.com). 그것은 구글이 IPV6을 사용하는 것 같습니다. IPV4 응답을 강제하는 방법이 있습니까?

답변

2

대신 http://ipv4.google.com/으로 요청하십시오.