I try to use pypy 2.5.1 replace python 2.7:
I used mechanize 0.2.5 package for pypy:
The problem is on /mechanize/_ulib2_fork.py line 70
try:
socket._fileobject("fake socket", close=True)
except TypeError:
....
here I want to replace the "fake socket" string with some real fake socket. How to do it?
I want to do this because:
the _fileobject function will invoke init function and the init():
def __init__(self, sock, mode='rb', bufsize=1, close=False):
socket._resue() //there will be error
the _reuse() function only defined in socket object not string object
(Actually, for combine with mechanize and pypy, I get AttributeError replace NameEorror. The reason is the socket would be string 'str' replace the reality socket object here. I need a presudo socket object here)