From 517428a308fcff91c68c54a226ad95ec63ac81fd Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 28 Oct 2018 11:27:08 +0100 Subject: [PATCH 1/2] Fix typing error in NetworkedPrinterOutputDevice.post Strictly speaking the QNetworkManager.post() method takes a QByteArray instead of Python bytes, but according to the PyQt documentation, PyQt handles that conversion transparently: http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#python-strings-qt-strings-and-unicode --- cura/PrinterOutput/NetworkedPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index f7c7f5d233..35d2ce014a 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/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) From f12efb7aa1f6305d4d1fea6a757a17d10a080e43 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 7 Nov 2018 16:07:45 +0100 Subject: [PATCH 2/2] Fix LegacyUM3OutputDevice post() call --- plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py index e786840803..fb79b26b64 100644 --- a/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py @@ -499,8 +499,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)