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 2.0 compatibility #3117

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions docker/transport/unixconn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import requests.adapters
import socket
import http.client as httplib

from docker.transport.basehttpadapter import BaseHTTPAdapter
from .. import constants
Expand All @@ -14,7 +13,7 @@
RecentlyUsedContainer = urllib3._collections.RecentlyUsedContainer


class UnixHTTPConnection(httplib.HTTPConnection):
class UnixHTTPConnection(urllib3.connection.HTTPConnection):

def __init__(self, base_url, unix_socket, timeout=60):
super().__init__(
Expand All @@ -30,12 +29,6 @@ def connect(self):
sock.connect(self.unix_socket)
self.sock = sock

def putheader(self, header, *values):
super().putheader(header, *values)

def response_class(self, sock, *args, **kwargs):
return httplib.HTTPResponse(sock, *args, **kwargs)


class UnixHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
def __init__(self, base_url, socket_path, timeout=60, maxsize=10):
Expand Down