--- a/mercurial/url.py Wed Aug 21 22:15:05 2024 -0400
+++ b/mercurial/url.py Fri Jun 28 16:26:06 2024 +0200
@@ -499,6 +499,28 @@
return request
+class readlinehandler(urlreq.basehandler):
+ def http_response(self, request, response):
+ class readlineresponse(response.__class__):
+ def readlines(self, sizehint=0):
+ total = 0
+ list = []
+ while True:
+ line = self.readline()
+ if not line:
+ break
+ list.append(line)
+ total += len(line)
+ if sizehint and total >= sizehint:
+ break
+ return list
+
+ response.__class__ = readlineresponse
+ return response
+
+ https_response = http_response
+
+
handlerfuncs = []
@@ -564,6 +586,7 @@
)
handlers.extend([h(ui, passmgr) for h in handlerfuncs])
handlers.append(cookiehandler(ui))
+ handlers.append(readlinehandler())
opener = urlreq.buildopener(*handlers)
# keepalive.py's handlers will populate these attributes if they exist.