Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import eventlet still patches everything #240

Open
Glueon opened this issue Jul 31, 2015 · 5 comments
Open

import eventlet still patches everything #240

Glueon opened this issue Jul 31, 2015 · 5 comments

Comments

@Glueon
Copy link

Glueon commented Jul 31, 2015

In the docs you write:

We’ve in the past considered doing this automatically upon importing Eventlet, but have decided against that course of action because it is un-Pythonic to change the behavior of module A simply by importing module B.

I was working on a project which uses eventlet in some parts of the system and thus imports eventlet. Also I use HTTPretty to test some functionallity. Just a simple import eventlet "greens" some standard libraries thefore breaking the httpretty functionallity. It does not always break. For example if I mock an 'http' request it works fine and breaks only on 'https'.

Here is an open issue on httpretty gabrielfalcao/HTTPretty#254

I think that it's HTTPretty fault it breaks when eventlet greens the world but that auto-monkeypatching upon simple import seems to be quite unpredictable.

@temoto
Copy link
Member

temoto commented Aug 1, 2015

Hello. Thanks for reproduction code, I've used it to bisect breaker commit.

I couldn't get FakeSSLSocket error since Eventlet v0.15, but OSError Socket is not connected is showing up since b2e5146

@Glueon
Copy link
Author

Glueon commented Aug 2, 2015

@temoto I used the the latest eventlet version. My concrete example was invoked via pytest but as far as I remember repl gives the same result.

What is interesting that this all works fine with the responses library.

@davidszotten
Copy link
Contributor

also hitting this. i was surprised to find eventlet applying monkey-patches at import time (simply import eventlet triggers the monkey-patch at the bottom of eventlet/green/ssl.py)

is this a "bug"?

@temoto
Copy link
Member

temoto commented Dec 17, 2015

It is a bug.

davidszotten added a commit to davidszotten/eventlet that referenced this issue Dec 18, 2015
davidszotten added a commit to davidszotten/eventlet that referenced this issue Dec 18, 2015
davidszotten added a commit to davidszotten/eventlet that referenced this issue Dec 21, 2015
davidszotten added a commit to davidszotten/eventlet that referenced this issue Dec 21, 2015
davidszotten added a commit to davidszotten/eventlet that referenced this issue Dec 21, 2015
davidszotten added a commit to davidszotten/eventlet that referenced this issue Dec 21, 2015
openstack-gerrit pushed a commit to openstack-archive/deb-python-eventlet that referenced this issue Sep 2, 2016
@temoto temoto self-assigned this Mar 21, 2017
@temoto temoto removed their assignment Jul 13, 2019
@temoto
Copy link
Member

temoto commented Jul 13, 2019

Sorry for leaving this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants