jeffreynghm / socksipy-branch

Automatically exported from code.google.com/p/socksipy-branch
Other
0 stars 0 forks source link

Does not work right with requests module #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Was trying to use wrapmodule with the "requests" module, got an interesting 
error.

Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socks
>>> import requests
>>> socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, 'localhost', 9050)
>>> socks.wrapmodule(requests)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "socks.py", line 107, in wrapmodule
    module.socket.socket = socksocket
AttributeError: 'module' object has no attribute 'socket'
>>>

Is there a fix for this? Not sure if it was a requests bug or a socks bug, so 
reported to both.

Original issue reported on code.google.com by the.info...@gmail.com on 27 Jan 2013 at 2:43