Git Product home page Git Product logo

Comments (7)

oschwald avatar oschwald commented on June 12, 2024 2

Thanks! The new version seems to work well.

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024 1

I'll have a look at it. Thanks for reporting the issue.

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024 1

Perfect, I was asking to try it out just because I was not able to run the whole pipeline. I'll try to tackle all the other problems that appear and release a new version ASAP.

from python-mocket.

s-t-e-v-e-n-k avatar s-t-e-v-e-n-k commented on June 12, 2024

urllib3 never actually exported wrap_socket, it was imported from ssl, that is what mocket is pulling in. That import was removed for 2.0.

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024

@oschwald could you please test out the code from the above PR?
Don't worry if tests are failing, they rely A LOT on httpbin.org and it's returning some BAD GATEWAY errors here and there. I have a plan to replace it with a Docker container, but it was not an easy change and I had no time to complete it.

from python-mocket.

oschwald avatar oschwald commented on June 12, 2024

Thanks for making the PR! Unfortunately, I am getting errors like this one with it when using urllib3 2.0.2:

======================================================================
ERROR: test_weird_body_error (tests.webservice_test.TestClient)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/mocket/mocket.py", line 701, in wrapper
    return test(*args, **kwargs)
  File "/home/greg/MaxMind/GeoIP2-python/tests/webservice_test.py", line 177, in test_weird_body_error
    self.run_client(self.client.country("1.2.3.8"))
  File "/home/greg/MaxMind/GeoIP2-python/geoip2/webservice.py", line 462, in country
    Country, self._response_for("country", geoip2.models.Country, ip_address)
  File "/home/greg/MaxMind/GeoIP2-python/geoip2/webservice.py", line 489, in _response_for
    response = self._session.get(uri, proxies=self._proxies, timeout=self._timeout)
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/urllib3/connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn
    conn.connect()
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/urllib3/connection.py", line 635, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/urllib3/connection.py", line 728, in _ssl_wrap_socket_and_match_hostname
    context = create_urllib3_context(
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 282, in create_urllib3_context
    context.minimum_version = TLSVersion.TLSv1_2
  File "/home/greg/.pyenv/versions/3.10.0/lib/python3.10/ssl.py", line 603, in minimum_version
    super(SSLContext, SSLContext).minimum_version.__set__(self, value)
AttributeError: 'super' object has no attribute 'minimum_version'

urllib3 1.26.4 works fine with the changes in the PR.

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024

Enjoy the new version of Mocket: https://pypi.org/project/mocket/3.11.1/

from python-mocket.

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.