Просмотр исходного кода

Merge pull request #4678 from fieldOfView/fix_networkprinter_post

Fix type error in NetworkedPrinterOutputDevice.post
Lipu Fei 6 лет назад
Родитель
Сommit
de6ab02422

+ 1 - 1
cura/PrinterOutput/NetworkedPrinterOutputDevice.py

@@ -213,7 +213,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
         request = self._createEmptyRequest(target)
         self._last_request_time = time()
         if self._manager is not None:
-            reply = self._manager.post(request, data)
+            reply = self._manager.post(request, data.encode())
             if on_progress is not None:
                 reply.uploadProgress.connect(on_progress)
             self._registerOnFinishedCallback(reply, on_finished)

+ 2 - 2
plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py

@@ -498,8 +498,8 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
         self._authentication_id = None
 
         self.post("auth/request",
-                  json.dumps({"application":  "Cura-" + CuraApplication.getInstance().getVersion(),
-                                               "user": self._getUserName()}).encode(),
+                  json.dumps({"application": "Cura-" + CuraApplication.getInstance().getVersion(),
+                              "user": self._getUserName()}),
                   on_finished=self._onRequestAuthenticationFinished)
 
         self.setAuthenticationState(AuthState.AuthenticationRequested)