Comment 5 for bug 707655

Revision history for this message
In , Bas-lijer (bas-lijer) wrote :

The following patch seems to fix the problem. Apparently some items can be None which causes an error

# diff -u /usr/share/hplip/base/device.py device.py
--- /usr/share/hplip/base/device.py 2011-01-25 14:51:16.000000000 +0100
+++ device.py 2011-01-25 14:50:18.000000000 +0100
@@ -2462,7 +2462,13 @@
             log.error("Unable To read the XML data from device")
             return ""
         xmlDict = utils.XMLToDictParser().parseXML(data)
- return str(xmlDict[attribute])
+
+ try:
+ rA = xmlDict[attribute]
+ except KeyError:
+ rA = ""
+
+ return str(rA)

     def downloadFirmware(self, usb_bus_id=None, usb_device_id=None): # Note: IDs not currently used
         ok = False