File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 21
21
class UnixHTTPResponse (httplib .HTTPResponse , object ):
22
22
def __init__ (self , sock , * args , ** kwargs ):
23
23
disable_buffering = kwargs .pop ('disable_buffering' , False )
24
+ if six .PY2 :
25
+ # FIXME: We may need to disable buffering on Py3 as well,
26
+ # but there's no clear way to do it at the moment. See:
27
+ # https://github.com/docker/docker-py/issues/1799
28
+ kwargs ['buffering' ] = not disable_buffering
24
29
super (UnixHTTPResponse , self ).__init__ (sock , * args , ** kwargs )
25
- if disable_buffering is True :
26
- # We must first create a new pointer then close the old one
27
- # to avoid closing the underlying socket.
28
- new_fp = sock .makefile ('rb' , 0 )
29
- self .fp .close ()
30
- self .fp = new_fp
31
30
32
31
33
32
class UnixHTTPConnection (httplib .HTTPConnection , object ):
You can’t perform that action at this time.
0 commit comments