https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1718129

Index: ui4/wifisetupdialog.py
--- ui4/wifisetupdialog.py.orig
+++ ui4/wifisetupdialog.py
@@ -329,7 +329,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
             try:
                 self.dev = device.Device(self.device_uri)
             except Error as e:
-                FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, QString(e[0])))
+                FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, QString(e.msg)))
 
                 if self.dev is not None:
                     self.dev.close()
@@ -933,7 +933,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
 
 
     def showIOError(self, e):
-        FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % QString(e[0])))
+        FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % QString(e.msg)))
 
         if self.dev is not None:
             self.dev.close()
