jjlee / mechanize

Stateful programmatic web browsing in Python, after Andy Lester's Perl module WWW::Mechanize .
http://wwwsearch.sourceforge.net/mechanize/
618 stars 123 forks source link

Fake socket is not compatible with PyPy #98

Open dellis23 opened 10 years ago

dellis23 commented 10 years ago

The _urllib2_fork digs into the internals of sockets, causing breakage when used with PyPy. There's a number of libraries that have had this issue, but here's a link to the patch where it was fixed in PyPy proper:

https://mail.python.org/pipermail/pypy-commit/2013-August/076574.html

The fix is to add _reuse and _drop methods to the object that is being passed to socket._fileobject.