Coder Social home page Coder Social logo

Comments (2)

razzmatazz avatar razzmatazz commented on May 21, 2024

We are currently using this patch to make it work (i.e. to make the disable()/enable() properly restore socket.inet_aton)

Note that this patch does not fix the other underlying issue of socket.inet_aton() not working properly when socket is patched, which was mentioned by @dotpot. It just makes 'unpatching/disabling' to work properly.

--- a/venv/lib/python2.7/site-packages/httpretty/core.py    2013-05-29 16:01:51.000000000 +0300
+++ b/venv/lib/python2.7/site-packages/httpretty/core.py    2013-05-29 16:02:19.000000000 +0300
@@ -68,6 +69,7 @@
 old_gethostbyname = socket.gethostbyname
 old_gethostname = socket.gethostname
 old_getaddrinfo = socket.getaddrinfo
+old_inet_aton = socket.inet_aton
 old_socksocket = None
 old_ssl_wrap_socket = None
 old_sslwrap_simple = None
@@ -696,7 +708,7 @@
         socket.gethostname = old_gethostname
         socket.gethostbyname = old_gethostbyname
         socket.getaddrinfo = old_getaddrinfo
-        socket.inet_aton = old_gethostbyname
+        socket.inet_aton = old_inet_aton

         socket.__dict__['socket'] = old_socket
         socket.__dict__['_socketobject'] = old_socket
@@ -706,7 +718,7 @@
         socket.__dict__['gethostname'] = old_gethostname
         socket.__dict__['gethostbyname'] = old_gethostbyname
         socket.__dict__['getaddrinfo'] = old_getaddrinfo
-        socket.__dict__['inet_aton'] = old_gethostbyname
+        socket.__dict__['inet_aton'] = old_inet_aton

         if socks:
             socks.socksocket = old_socksocket

from httpretty.

CyrilRoelandteNovance avatar CyrilRoelandteNovance commented on May 21, 2024

I think this has been fixed by a2d6dfc . Closing.

from httpretty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.