[arvados] updated: 2.6.0-35-g08fe9bab4

git repository hosting git at public.arvados.org
Wed Apr 19 21:59:35 UTC 2023


Summary of changes:
 sdk/python/arvados/http_import.py | 3 +++
 sdk/python/tests/test_http.py     | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

       via  08fe9bab402a591674993e6cd472570967e92dec (commit)
      from  59ffa1048ea27cfc18dfb510868edd994c0af5b2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 08fe9bab402a591674993e6cd472570967e92dec
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Apr 19 17:59:18 2023 -0400

    20257: Fix test
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/http_import.py b/sdk/python/arvados/http_import.py
index 91185d974..fef6d6719 100644
--- a/sdk/python/arvados/http_import.py
+++ b/sdk/python/arvados/http_import.py
@@ -173,6 +173,9 @@ class CurlDownloader(PyCurlHelper):
         else:
             self.name = self.parsedurl.path.split("/")[-1]
 
+        # Can't call curl.getinfo(pycurl.RESPONSE_CODE) until
+        # perform() is done but we need to know the status before that
+        # so we have to parse the status line ourselves.
         mt = re.match(r'^HTTP\/(\d(\.\d)?) ([1-5]\d\d) ([^\r\n\x00-\x08\x0b\x0c\x0e-\x1f\x7f]*)\r\n$', self._headers["x-status-line"])
         code = int(mt.group(3))
 
diff --git a/sdk/python/tests/test_http.py b/sdk/python/tests/test_http.py
index fa61e9ed8..296c1c654 100644
--- a/sdk/python/tests/test_http.py
+++ b/sdk/python/tests/test_http.py
@@ -60,9 +60,9 @@ class CurlMock:
         self.perform_was_called = True
 
         if self.head:
-            self.headerfn("HTTP/1.1 {} Status".format(self.head_response))
+            self.headerfn("HTTP/1.1 {} Status\r\n".format(self.head_response))
         else:
-            self.headerfn("HTTP/1.1 {} Status".format(self.get_response))
+            self.headerfn("HTTP/1.1 {} Status\r\n".format(self.get_response))
 
         for k,v in self.headers.items():
             self.headerfn("%s: %s" % (k,v))

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list