Sfoglia il codice sorgente

Fix "wrong" read method called

This is conceptually a bit wrong as it is since I guess it would break
on GZipped responses, though they would not occur here due to the Git
protocol.

In the `urllib3` case, however, it is more pressing since the
`resp.read` method is always empty at this stage due to the data already
having been consumed in `_http_request` (unless `preload_content=False`
is given).

Use the `read` method prepared and provided by `_http_request` instead.
Daniel Andersson 7 anni fa
parent
commit
1578223d19
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      dulwich/client.py

+ 1 - 1
dulwich/client.py

@@ -1380,7 +1380,7 @@ class HttpGitClient(GitClient):
         resp, read = self._smart_request("git-receive-pack", url,
                                          data=req_data.getvalue())
         try:
-            resp_proto = Protocol(resp.read, None)
+            resp_proto = Protocol(read, None)
             self._handle_receive_pack_tail(
                 resp_proto, negotiated_capabilities, progress)
             return new_refs