diff service/reasoning/httpputoutputs.py @ 1560:c3d699b5759c

more py3 fixes Ignore-this: f212b4a5edf8e599e9efd70bc65e7651 darcs-hash:d944ca9d7d7b36c2c02529dcf9225a99c0aa1831
author drewp <drewp@bigasterisk.com>
date Fri, 14 Feb 2020 00:33:31 -0800
parents d36d3b9ae516
children
line wrap: on
line diff
--- a/service/reasoning/httpputoutputs.py	Fri Feb 14 00:33:14 2020 -0800
+++ b/service/reasoning/httpputoutputs.py	Fri Feb 14 00:33:31 2020 -0800
@@ -63,7 +63,7 @@
         log.debug("PUT %s payload=%s agent=%s",
                   self.url, self.payload, self.foafAgent)
         if not self.mockOutput:
-            self.currentRequest = treq.put(self.url, data=self.payload,
+            self.currentRequest = treq.put(self.url, data=self.payload.encode('utf8'),
                                            headers=h, timeout=3)
             self.currentRequest.addCallback(self.onResponse).addErrback(
                 self.onError)
@@ -115,8 +115,7 @@
         self.mockOutput = mockOutput
         self.state = {} # url: HttpPutOutput
 
-    def put(self, url, payload, foafAgent, refreshSecs):
-        assert isinstance(url, str)
+    def put(self, url: str, payload: str, foafAgent: str, refreshSecs: float):
         if url not in self.state:
             self.state[url] = HttpPutOutput(url, mockOutput=self.mockOutput,
                                             refreshSecs=refreshSecs)