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

Fix urllib3 Recursion Regression #410

Merged
merged 4 commits into from Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -48,7 +48,7 @@
)
from ctypes.util import find_library

from urllib3.packages.six import raise_from
from ...packages.six import raise_from

if platform.system() != "Darwin":
raise ImportError("Only macOS is supported")
Expand Down
4 changes: 2 additions & 2 deletions newrelic/packages/urllib3/util/ssltransport.py
Expand Up @@ -2,8 +2,8 @@
import socket
import ssl

from urllib3.exceptions import ProxySchemeUnsupported
from urllib3.packages import six
from ..exceptions import ProxySchemeUnsupported
from ..packages import six

SSL_BLOCKSIZE = 16384

Expand Down
Expand Up @@ -12,8 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import gevent.monkey


def test_patch_thread():
import gevent.monkey

gevent.monkey.patch_thread()


def test_patch_ssl_recursion():
import gevent.monkey

gevent.monkey.patch_all()

# Delay imports and test creation of contexts from both bundled and installed urllib3
import urllib3.util.ssl_

import newrelic.packages.urllib3.util.ssl_

context1 = urllib3.util.ssl_.create_urllib3_context()
context2 = newrelic.packages.urllib3.util.ssl_.create_urllib3_context()